... | ... |
@@ -10,27 +10,27 @@ db_func_t dbf; |
10 | 10 |
|
11 | 11 |
int bind_dbmod(void) |
12 | 12 |
{ |
13 |
- dbf.use_table = (db_use_table_f)find_export("db_use_table", 2); |
|
13 |
+ dbf.use_table = (db_use_table_f)find_export("~db_use_table", 2); |
|
14 | 14 |
|
15 |
- dbf.init = (db_init_f)find_export("db_init", 1); |
|
15 |
+ dbf.init = (db_init_f)find_export("~db_init", 1); |
|
16 | 16 |
if (!dbf.init) return -1; |
17 | 17 |
|
18 |
- dbf.close = (db_close_f)find_export("db_close", 2); |
|
18 |
+ dbf.close = (db_close_f)find_export("~db_close", 2); |
|
19 | 19 |
if (!dbf.close) return -1; |
20 | 20 |
|
21 |
- dbf.query = (db_query_f)find_export("db_query", 2); |
|
21 |
+ dbf.query = (db_query_f)find_export("~db_query", 2); |
|
22 | 22 |
if (!dbf.query) return -1; |
23 | 23 |
|
24 |
- dbf.free_query = (db_free_query_f)find_export("db_free_query", 2); |
|
24 |
+ dbf.free_query = (db_free_query_f)find_export("~db_free_query", 2); |
|
25 | 25 |
if (!dbf.free_query) return -1; |
26 | 26 |
|
27 |
- dbf.insert = (db_insert_f)find_export("db_insert", 2); |
|
27 |
+ dbf.insert = (db_insert_f)find_export("~db_insert", 2); |
|
28 | 28 |
if (!dbf.insert) return -1; |
29 | 29 |
|
30 |
- dbf.delete = (db_delete_f)find_export("db_delete", 2); |
|
30 |
+ dbf.delete = (db_delete_f)find_export("~db_delete", 2); |
|
31 | 31 |
if (!dbf.delete) return -1; |
32 | 32 |
|
33 |
- dbf.update = (db_update_f)find_export("db_update", 2); |
|
33 |
+ dbf.update = (db_update_f)find_export("~db_update", 2); |
|
34 | 34 |
if (!dbf.update) return -1; |
35 | 35 |
|
36 | 36 |
return 0; |
... | ... |
@@ -13,22 +13,19 @@ |
13 | 13 |
* handle |
14 | 14 |
*/ |
15 | 15 |
typedef struct { |
16 |
- char* table; /* Default table to use */ |
|
17 |
- void* con; /* Mysql Connection */ |
|
18 |
- void* res; /* Result of previous operation */ |
|
19 |
- void* row; /* Actual row in the result */ |
|
20 |
- int connected; |
|
16 |
+ char* table; /* Default table to use */ |
|
17 |
+ int connected; /* 1 if database is connected */ |
|
18 |
+ unsigned char tail[0]; /* Variable length tail |
|
19 |
+ * database module specific */ |
|
21 | 20 |
} db_con_t; |
22 | 21 |
|
23 | 22 |
|
24 | 23 |
#define CON_CONNECTED(cn) ((cn)->connected) |
25 | 24 |
#define CON_TABLE(cn) ((cn)->table) |
26 |
-#define CON_CONNECTION(cn) ((cn)->con) |
|
27 |
-#define CON_RESULT(cn) ((cn)->res) |
|
28 |
-#define CON_ROW(cn) ((cn)->row) |
|
25 |
+#define CON_TAIL(cn) ((cn)->tail) |
|
29 | 26 |
|
30 | 27 |
|
31 | 28 |
int use_table(db_con_t* _h, const char* _t); |
32 | 29 |
|
33 | 30 |
|
34 |
-#endif |
|
31 |
+#endif /* DB_CON_H */ |