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

mysqlhandler.h

Go to the documentation of this file.
00001 
00002 /*
00003 ** Copyright (C) 2002 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_MYSQL__
00023 #define __AWHANDLER_MYSQL__
00024 
00025 #include <stdio.h>
00026 
00027 #include "awdb.h"
00028 
00029 #include "mysql.h"
00030 
00031 #include "regexmatch.h"
00032 
00033 #include "monitor.h"
00034 
00035 #include "wire.h"
00036 
00037 #include "awmysql.h"
00038 
00190 /* 
00191 Changes:
00192 
00193 10-29-02 Russell Leighton
00194 Added dbpool, change MYSQL conn to pointer.
00195 
00196 */
00197 
00198 
00202 typedef struct {
00203 
00204   aw_handler_t
00205    handler_header;
00206 
00207   aw_mysql_state_t 
00208    state;
00209 
00210   aw_mysql_cinfo_t
00211    cinfo;
00212 
00213   byte_t
00214    *sql;
00215 
00216   byte_t
00217    *desc;
00218 
00219   aw_db_cevents_t
00220    cevents;
00221 
00222   u_int32_t
00223    nwatchers;
00224 
00225   aw_db_rwatcher_t
00226    *watchers;
00227 
00228   u_int32_t
00229    ncounters;
00230 
00231   aw_db_counter_t
00232    *counters;
00233 
00234 } aw_mysqlhandler_t;
00235 
00252 aw_mysqlhandler_t *aw_create_mysqlhandler(const aw_mysql_cinfo_t *cinfo,
00253                                           const byte_t *sql,
00254                                           const byte_t *desc,
00255                                           const aw_db_cevents_t *cevents,
00256                                           u_int32_t nregexs,
00257                                           const aw_db_regex_t *regexs,  
00258                                           u_int32_t ncounters,
00259                                           const aw_db_counter_t *counters,
00260                                           int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00261                                           int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00262                                           const aw_alarm_sched_t *sched,
00263                                           aw_logger_t *elogger);
00264 
00265 
00270 void aw_free_mysqlhandler(aw_mysqlhandler_t *h);
00271 
00272 
00276 aw_handler_t *aw_wire_mysqlhandler(aw_wire_mkhandler_args_t *args);
00277 
00278 
00279 #endif
00280 
00281 
00282 
00283 
00284 
00285 
00286 
00287 
00288 
00289 
00290 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)