Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sqlitehandler.h

Go to the documentation of this file.
00001 
00002 /*
00003 ** Copyright (C) 2004 Russell Leighton
00004 **
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 **
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 
00021  
00022 #ifndef __AWHANDLER_SQLITE__
00023 #define __AWHANDLER_SQLITE__
00024 
00025 #include <stdio.h>
00026 
00027 #include "awdb.h"
00028 
00029 #include "sqlite3.h"
00030 
00031 #include "regexmatch.h"
00032 
00033 #include "monitor.h"
00034 
00035 #include "wire.h"
00036 
00037 #include "awsqlite.h"
00038 
00192 typedef struct {
00193 
00194   aw_handler_t
00195    handler_header;
00196 
00197   aw_sqlite_state_t 
00198    state;
00199 
00200   aw_sqlite_cinfo_t
00201    cinfo;
00202 
00203   byte_t
00204    *sql;
00205 
00206   byte_t
00207    *desc;
00208 
00209   aw_db_cevents_t
00210    cevents;
00211 
00212   u_int32_t
00213    nwatchers;
00214 
00215   aw_db_rwatcher_t
00216    *watchers;
00217 
00218   u_int32_t
00219    ncounters;
00220 
00221   aw_db_counter_t
00222    *counters;
00223 
00224 } aw_sqlitehandler_t;
00225 
00242 aw_sqlitehandler_t *aw_create_sqlitehandler(const aw_sqlite_cinfo_t *cinfo,
00243                                             const byte_t *sql,
00244                                             const byte_t *desc,
00245                                             aw_db_cevents_t *cevents,
00246                                             u_int32_t nregexs,
00247                                             const aw_db_regex_t *regexs,  
00248                                             u_int32_t ncounters,
00249                                             const aw_db_counter_t *counters,
00250                                             int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00251                                             int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00252                                             const aw_alarm_sched_t *sched,
00253                                             aw_logger_t *elogger);
00254 
00255 
00260 void aw_free_sqlitehandler(aw_sqlitehandler_t *h);
00261 
00262 
00266 aw_handler_t *aw_wire_sqlitehandler(aw_wire_mkhandler_args_t *args);
00267 
00268 
00269 #endif
00270 
00271 
00272 
00273 
00274 
00275 
00276 
00277 
00278 
00279 
00280 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)