00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 #ifndef _STMTBASE_H_
00034 #define _STMTBASE_H_
00035 #include "stmt/statement.h"
00036 #include <stdio.h>
00037
00038 typedef int ( *StmtBaseFilter ) ( void *obj, void *data );
00039 typedef void ( *StmtUpdateCallback) (Statement *stmt, void *obj, void *data);
00040
00041 typedef struct _StmtBaseHandle StmtBaseHandle;
00042
00043 void stmtbase_set_filter(StmtBaseHandle *h, StmtBaseFilter func);
00044 void stmtbase_set_update_cb(StmtBaseHandle *h, StmtUpdateCallback cb);
00045
00050 int stmtbase_init();
00071 int stmtbase_get(StmtBaseHandle *h, const Statement *mask, Statement **result);
00072
00073 int stmtbase_get_ex(StmtBaseHandle *h, const Statement *mask, Statement **result,
00074 void *data, int flags);
00075
00076 int stmtbase_save(StmtBaseHandle *h, FILE *f);
00077
00078 int stmtbase_load(StmtBaseHandle *h, FILE *f);
00079
00080
00091 int stmtbase_set(StmtBaseHandle *h, Statement *stmt);
00092 int stmtbase_set_ex(StmtBaseHandle *h, Statement *stmt, int flags);
00093
00094
00096 void stmtbase_destoy();
00097
00098
00106 int stmtbase_open(char *opts, StmtBaseHandle **h);
00107
00108
00109
00111 int stmtbase_close(StmtBaseHandle *h);
00112
00113 #endif
00114
00115 #ifdef DMALLOC
00116 #include<dmalloc.h>
00117 #endif