Browse code

db_con internals changed a little bit

Jan Janak authored on 12/08/2002 11:23:17
Showing 8 changed files
... ...
@@ -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;
... ...
@@ -128,4 +128,4 @@ extern db_func_t dbf;
128 128
 int bind_dbmod(void);
129 129
  
130 130
 
131
-#endif
131
+#endif /* DB_H */
... ...
@@ -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 */
... ...
@@ -12,4 +12,4 @@
12 12
 typedef const char* db_key_t;
13 13
 
14 14
 
15
-#endif
15
+#endif /* DB_KEY_H */
... ...
@@ -50,4 +50,4 @@ int convert_result(db_con_t* _h, db_res_t* _r);
50 50
 int free_result(db_res_t* _r);
51 51
 
52 52
 
53
-#endif
53
+#endif /* DB_RES_H */
... ...
@@ -29,4 +29,4 @@ int convert_row(db_con_t* _h, struct db_res* _res, db_row_t* _r);
29 29
 int free_row(db_row_t* _r);
30 30
 
31 31
 
32
-#endif
32
+#endif /* DB_ROW_H */
... ...
@@ -65,4 +65,4 @@ int str2val(db_type_t _t, db_val_t* _v, const char* _s, int _l);
65 65
 int val2str(db_val_t* _v, char* _s, int* _len);
66 66
 
67 67
 
68
-#endif
68
+#endif /* DB_VAL_H */
... ...
@@ -1,6 +1,6 @@
1 1
 $Id$
2 2
 
3
-This is very simple example module that shows, how to
3
+This is very simple example module that shows how to
4 4
 use database interface.
5 5
 
6 6
 If you want to compile this module, move it to modules