]>
Commit | Line | Data |
---|---|---|
832ed81a AC |
1 | /* $Id: rsdb.h 26164 2008-10-26 19:52:43Z androsyn $ */ |
2 | #ifndef INCLUDED_rsdb_h | |
3 | #define INCLUDED_rsdb_h | |
4 | ||
5 | /* error handler callback */ | |
6 | typedef void rsdb_error_cb(const char *); | |
7 | ||
8 | typedef int (*rsdb_callback) (int, const char **); | |
9 | ||
10 | typedef enum rsdb_transtype | |
11 | { | |
12 | RSDB_TRANS_START, | |
13 | RSDB_TRANS_END | |
14 | } | |
15 | rsdb_transtype; | |
16 | ||
17 | struct rsdb_table | |
18 | { | |
19 | char ***row; | |
20 | int row_count; | |
21 | int col_count; | |
22 | void *arg; | |
23 | }; | |
24 | ||
25 | int rsdb_init(rsdb_error_cb *); | |
26 | void rsdb_shutdown(void); | |
27 | ||
28 | const char *rsdb_quote(const char *src); | |
29 | ||
30 | void rsdb_exec(rsdb_callback cb, const char *format, ...); | |
31 | ||
32 | void rsdb_exec_fetch(struct rsdb_table *data, const char *format, ...); | |
33 | void rsdb_exec_fetch_end(struct rsdb_table *data); | |
34 | ||
35 | void rsdb_transaction(rsdb_transtype type); | |
36 | /* rsdb_snprintf.c */ | |
37 | ||
38 | int rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args); | |
39 | int rs_snprintf(char *dest, const size_t bytes, const char *format, ...); | |
40 | ||
41 | ||
42 | #endif |