Browse code

db_con renamed to db1_con in files originating from kamailio/db_mysql.

The structure db_con has been renamed in lib/srdb1 to db1_con, thus we
need to change the name of the structure in all files originating from
kamailio/modules/db_mysql (and using lib/srdb1).

Jan Janak authored on 16/02/2009 22:09:32
Showing 8 changed files
... ...
@@ -65,7 +65,7 @@
65 65
  * \param _s executed query
66 66
  * \return zero on success, negative value on failure
67 67
  */
68
-static int db_mysql_submit_query(const db_con_t* _h, const str* _s)
68
+static int db_mysql_submit_query(const db1_con_t* _h, const str* _s)
69 69
 {	
70 70
 	time_t t;
71 71
 	int i, code;
... ...
@@ -125,7 +125,7 @@ static int db_mysql_submit_query(const db_con_t* _h, const str* _s)
125 125
  * \param _url URL used for initialization
126 126
  * \return zero on success, negative value on failure
127 127
  */
128
-db_con_t* db_mysql_init(const str* _url)
128
+db1_con_t* db_mysql_init(const str* _url)
129 129
 {
130 130
 	return db_do_init(_url, (void *)db_mysql_new_connection);
131 131
 }
... ...
@@ -137,7 +137,7 @@ db_con_t* db_mysql_init(const str* _url)
137 137
  * \param _h handle to the closed connection
138 138
  * \return zero on success, negative value on failure
139 139
  */
140
-void db_mysql_close(db_con_t* _h)
140
+void db_mysql_close(db1_con_t* _h)
141 141
 {
142 142
 	db_do_close(_h, db_mysql_free_connection);
143 143
 }
... ...
@@ -149,7 +149,7 @@ void db_mysql_close(db_con_t* _h)
149 149
  * \param _r result set that should be retrieved
150 150
  * \return zero on success, negative value on failure
151 151
  */
152
-static int db_mysql_store_result(const db_con_t* _h, db_res_t** _r)
152
+static int db_mysql_store_result(const db1_con_t* _h, db_res_t** _r)
153 153
 {
154 154
 	if ((!_h) || (!_r)) {
155 155
 		LM_ERR("invalid parameter value\n");
... ...
@@ -213,7 +213,7 @@ done:
213 213
  * \param _r result set that should be freed
214 214
  * \return zero on success, negative value on failure
215 215
  */
216
-int db_mysql_free_result(db_con_t* _h, db_res_t* _r)
216
+int db_mysql_free_result(db1_con_t* _h, db_res_t* _r)
217 217
 {
218 218
      if ((!_h) || (!_r)) {
219 219
 	     LM_ERR("invalid parameter value\n");
... ...
@@ -243,7 +243,7 @@ int db_mysql_free_result(db_con_t* _h, db_res_t* _r)
243 243
  * \param _r pointer to a structure representing the result
244 244
  * \return zero on success, negative value on failure
245 245
  */
246
-int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
246
+int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
247 247
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
248 248
 	     const db_key_t _o, db_res_t** _r)
249 249
 {
... ...
@@ -266,7 +266,7 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
266 266
  * \param nrows number of fetched rows
267 267
  * \return zero on success, negative value on failure
268 268
  */
269
-int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows)
269
+int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows)
270 270
 {
271 271
 	int rows, i;
272 272
 
... ...
@@ -374,7 +374,7 @@ int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows)
374 374
  * \param _r result set for storage
375 375
  * \return zero on success, negative value on failure
376 376
  */
377
-int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r)
377
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r)
378 378
 {
379 379
 	return db_do_raw_query(_h, _s, _r, db_mysql_submit_query,
380 380
 	db_mysql_store_result);
... ...
@@ -389,7 +389,7 @@ int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r)
389 389
  * \param _n number of key=value pairs
390 390
  * \return zero on success, negative value on failure
391 391
  */
392
-int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
392
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
393 393
 {
394 394
 	return db_do_insert(_h, _k, _v, _n, db_mysql_val2str,
395 395
 	db_mysql_submit_query);
... ...
@@ -405,7 +405,7 @@ int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
405 405
  * \param _n number of key=value pairs
406 406
  * \return zero on success, negative value on failure
407 407
  */
408
-int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
408
+int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
409 409
 	const db_val_t* _v, const int _n)
410 410
 {
411 411
 	return db_do_delete(_h, _k, _o, _v, _n, db_mysql_val2str,
... ...
@@ -425,7 +425,7 @@ int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
425 425
  * \param _un number of columns to update
426 426
  * \return zero on success, negative value on failure
427 427
  */
428
-int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o, 
428
+int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o, 
429 429
 	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n, 
430 430
 	const int _un)
431 431
 {
... ...
@@ -442,7 +442,7 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
442 442
  * \param _n number of key=value pairs
443 443
  * \return zero on success, negative value on failure
444 444
  */
445
-int db_mysql_replace(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
445
+int db_mysql_replace(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
446 446
 {
447 447
 	return db_do_replace(_h, _k, _v, _n, db_mysql_val2str,
448 448
 	db_mysql_submit_query);
... ...
@@ -455,7 +455,7 @@ int db_mysql_replace(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
455 455
  * \return returns the ID as integer or returns 0 if the previous statement
456 456
  * does not use an AUTO_INCREMENT value.
457 457
  */
458
-int db_last_inserted_id(const db_con_t* _h)
458
+int db_last_inserted_id(const db1_con_t* _h)
459 459
 {
460 460
 	if (!_h) {
461 461
 		LM_ERR("invalid parameter value\n");
... ...
@@ -472,7 +472,7 @@ int db_last_inserted_id(const db_con_t* _h)
472 472
   * \param _v values of the keys
473 473
   * \param _n number of key=value pairs
474 474
  */
475
- int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
475
+ int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
476 476
 	const int _n)
477 477
  {
478 478
 	int off, ret;
... ...
@@ -530,7 +530,7 @@ error:
530 530
  * \param _t table name
531 531
  * \return zero on success, negative value on failure
532 532
  */
533
-int db_mysql_use_table(db_con_t* _h, const str* _t)
533
+int db_mysql_use_table(db1_con_t* _h, const str* _t)
534 534
 {
535 535
 	return db_use_table(_h, _t);
536 536
 }
... ...
@@ -45,25 +45,25 @@
45 45
 /*! \brief
46 46
  * Initialize database connection
47 47
  */
48
-db_con_t* db_mysql_init(const str* _sqlurl);
48
+db1_con_t* db_mysql_init(const str* _sqlurl);
49 49
 
50 50
 
51 51
 /*! \brief
52 52
  * Close a database connection
53 53
  */
54
-void db_mysql_close(db_con_t* _h);
54
+void db_mysql_close(db1_con_t* _h);
55 55
 
56 56
 
57 57
 /*! \brief
58 58
  * Free all memory allocated by get_result
59 59
  */
60
-int db_mysql_free_result(db_con_t* _h, db_res_t* _r);
60
+int db_mysql_free_result(db1_con_t* _h, db_res_t* _r);
61 61
 
62 62
 
63 63
 /*! \brief
64 64
  * Do a query
65 65
  */
66
-int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
66
+int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
67 67
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
68 68
 	     const db_key_t _o, db_res_t** _r);
69 69
 
... ...
@@ -71,32 +71,32 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
71 71
 /*! \brief
72 72
  * fetch rows from a result
73 73
  */
74
-int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows);
74
+int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows);
75 75
 
76 76
 
77 77
 /*! \brief
78 78
  * Raw SQL query
79 79
  */
80
-int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
80
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r);
81 81
 
82 82
 
83 83
 /*! \brief
84 84
  * Insert a row into table
85 85
  */
86
-int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
86
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
87 87
 
88 88
 
89 89
 /*! \brief
90 90
  * Delete a row from table
91 91
  */
92
-int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const 
92
+int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const 
93 93
 	db_op_t* _o, const db_val_t* _v, const int _n);
94 94
 
95 95
 
96 96
 /*! \brief
97 97
  * Update a row in table
98 98
  */
99
-int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
99
+int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
100 100
 	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
101 101
 	const int _un);
102 102
 
... ...
@@ -104,17 +104,17 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
104 104
 /*! \brief
105 105
  * Just like insert, but replace the row if it exists
106 106
  */
107
-int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
107
+int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
108 108
 
109 109
 /*! \brief
110 110
  * Returns the last inserted ID
111 111
  */
112
-int db_last_inserted_id(const db_con_t* _h);
112
+int db_last_inserted_id(const db1_con_t* _h);
113 113
 
114 114
 /*! \brief
115 115
  * Insert a row into table, update on duplicate key
116 116
  */
117
-int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
117
+int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
118 118
 	const int _n);
119 119
 
120 120
 
... ...
@@ -122,7 +122,7 @@ int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
122 122
  * Store name of table that will be used by
123 123
  * subsequent database functions
124 124
  */
125
-int db_mysql_use_table(db_con_t* _h, const str* _t);
125
+int db_mysql_use_table(db1_con_t* _h, const str* _t);
126 126
 
127 127
 
128 128
 #endif /* KM_DBASE_H */
... ...
@@ -50,7 +50,7 @@
50 50
  * \param _r database result set
51 51
  * \return 0 on success, negative on failure
52 52
  */
53
-int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r)
53
+int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r)
54 54
 {
55 55
 	int col;
56 56
 	MYSQL_FIELD* fields;
... ...
@@ -155,7 +155,7 @@ int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r)
155 155
  * \param _r database result set
156 156
  * \return 0 on success, negative on failure
157 157
  */
158
-static inline int db_mysql_convert_rows(const db_con_t* _h, db_res_t* _r)
158
+static inline int db_mysql_convert_rows(const db1_con_t* _h, db_res_t* _r)
159 159
 {
160 160
 	int row;
161 161
 
... ...
@@ -201,7 +201,7 @@ static inline int db_mysql_convert_rows(const db_con_t* _h, db_res_t* _r)
201 201
  * \param _r database result
202 202
  * \return 0 on success, negative on failure
203 203
  */
204
-int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r)
204
+int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r)
205 205
 {
206 206
 	if ((!_h) || (!_r)) {
207 207
 		LM_ERR("invalid parameter\n");
... ...
@@ -44,7 +44,7 @@
44 44
  * \param _r database result
45 45
  * \return 0 on success, negative on failure
46 46
  */
47
-int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
47
+int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r);
48 48
 
49 49
 
50 50
 /*!
... ...
@@ -53,6 +53,6 @@ int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
53 53
  * \param _r database result set
54 54
  * \return 0 on success, negative on failure
55 55
  */
56
-int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r);
56
+int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r);
57 57
 
58 58
 #endif
... ...
@@ -44,7 +44,7 @@
44 44
  * \param _r database result row
45 45
  * \return 0 on success, -1 on failure
46 46
  */
47
-int db_mysql_convert_row(const db_con_t* _h, db_res_t* _res, db_row_t* _r)
47
+int db_mysql_convert_row(const db1_con_t* _h, db_res_t* _res, db_row_t* _r)
48 48
 {
49 49
 	unsigned long* lengths;
50 50
 	int i;
... ...
@@ -46,6 +46,6 @@
46 46
  * \param _r database result row
47 47
  * \return 0 on success, -1 on failure
48 48
  */
49
-int db_mysql_convert_row(const db_con_t* _h, db_res_t* _res, db_row_t* _r);
49
+int db_mysql_convert_row(const db1_con_t* _h, db_res_t* _res, db_row_t* _r);
50 50
 
51 51
 #endif
... ...
@@ -43,7 +43,7 @@
43 43
  * \param _len target string length
44 44
  * \return 0 on success, negative on error
45 45
  */
46
-int db_mysql_val2str(const db_con_t* _c, const db_val_t* _v, char* _s, int* _len)
46
+int db_mysql_val2str(const db1_con_t* _c, const db_val_t* _v, char* _s, int* _len)
47 47
 {
48 48
 	int l, tmp;
49 49
 	char* old_s;
... ...
@@ -47,6 +47,6 @@
47 47
  * \param _len target string length
48 48
  * \return 0 on success, negative on error
49 49
  */
50
-int db_mysql_val2str(const db_con_t* _con, const db_val_t* _v, char* _s, int* _len);
50
+int db_mysql_val2str(const db1_con_t* _con, const db_val_t* _v, char* _s, int* _len);
51 51
 
52 52
 #endif