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

pgsqlhandler.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_PGSQL__
00023 #define __AWHANDLER_PGSQL__
00024 
00025 #include <stdio.h>
00026 
00027 #include "awdb.h"
00028 
00029 #include "libpq-fe.h"
00030 
00031 #include "regexmatch.h"
00032 
00033 #include "awpgsql.h"
00034 
00035 #include "monitor.h"
00036 
00037 #include "wire.h"
00038 
00187 /* 
00188 Changes:
00189 
00190 11-17-02 Russell Leighton
00191 Connection pools added.
00192 
00193 */
00194 
00198 typedef struct {
00199 
00200   aw_handler_t
00201    handler_header;
00202 
00203   aw_pgsql_state_t 
00204    state;
00205 
00206   aw_pgsql_cinfo_t
00207    cinfo;
00208 
00209   byte_t
00210    *sql;
00211 
00212   byte_t
00213    *desc;
00214 
00215   aw_db_cevents_t
00216    cevents;
00217 
00218   u_int32_t
00219    nwatchers;
00220 
00221   aw_db_rwatcher_t
00222    *watchers;
00223 
00224   u_int32_t
00225    ncounters;
00226 
00227   aw_db_counter_t
00228    *counters;
00229 
00230 } aw_pgsqlhandler_t;
00231 
00248 aw_pgsqlhandler_t *aw_create_pgsqlhandler(const aw_pgsql_cinfo_t *cinfo,
00249                                           const byte_t *sql,
00250                                           const byte_t *desc,
00251                                           const aw_db_cevents_t *cevents,
00252                                           u_int32_t nregexs,
00253                                           const aw_db_regex_t *regexs,  
00254                                           u_int32_t ncounters,
00255                                           const aw_db_counter_t *counters,
00256                                           int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00257                                           int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00258                                           const aw_alarm_sched_t *sched,
00259                                           aw_logger_t *elogger);
00260 
00261 
00266 void aw_free_pgsqlhandler(aw_pgsqlhandler_t *h);
00267 
00268 
00272 aw_handler_t *aw_wire_pgsqlhandler(aw_wire_mkhandler_args_t *args);
00273 
00274 
00275 #endif
00276 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)