00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00189
00190
00191
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