2
0
Эх сурвалжийг харах

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 16 жил өмнө
parent
commit
956802dcd6

+ 15 - 15
modules/db_mysql/km_dbase.c

@@ -65,7 +65,7 @@
  * \param _s executed query
  * \return zero on success, negative value on failure
  */
-static int db_mysql_submit_query(const db_con_t* _h, const str* _s)
+static int db_mysql_submit_query(const db1_con_t* _h, const str* _s)
 {	
 	time_t t;
 	int i, code;
@@ -125,7 +125,7 @@ static int db_mysql_submit_query(const db_con_t* _h, const str* _s)
  * \param _url URL used for initialization
  * \return zero on success, negative value on failure
  */
-db_con_t* db_mysql_init(const str* _url)
+db1_con_t* db_mysql_init(const str* _url)
 {
 	return db_do_init(_url, (void *)db_mysql_new_connection);
 }
@@ -137,7 +137,7 @@ db_con_t* db_mysql_init(const str* _url)
  * \param _h handle to the closed connection
  * \return zero on success, negative value on failure
  */
-void db_mysql_close(db_con_t* _h)
+void db_mysql_close(db1_con_t* _h)
 {
 	db_do_close(_h, db_mysql_free_connection);
 }
@@ -149,7 +149,7 @@ void db_mysql_close(db_con_t* _h)
  * \param _r result set that should be retrieved
  * \return zero on success, negative value on failure
  */
-static int db_mysql_store_result(const db_con_t* _h, db_res_t** _r)
+static int db_mysql_store_result(const db1_con_t* _h, db_res_t** _r)
 {
 	if ((!_h) || (!_r)) {
 		LM_ERR("invalid parameter value\n");
@@ -213,7 +213,7 @@ done:
  * \param _r result set that should be freed
  * \return zero on success, negative value on failure
  */
-int db_mysql_free_result(db_con_t* _h, db_res_t* _r)
+int db_mysql_free_result(db1_con_t* _h, db_res_t* _r)
 {
      if ((!_h) || (!_r)) {
 	     LM_ERR("invalid parameter value\n");
@@ -243,7 +243,7 @@ int db_mysql_free_result(db_con_t* _h, db_res_t* _r)
  * \param _r pointer to a structure representing the result
  * \return zero on success, negative value on failure
  */
-int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
+int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
 	     const db_key_t _o, db_res_t** _r)
 {
@@ -266,7 +266,7 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
  * \param nrows number of fetched rows
  * \return zero on success, negative value on failure
  */
-int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows)
+int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows)
 {
 	int rows, i;
 
@@ -374,7 +374,7 @@ int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows)
  * \param _r result set for storage
  * \return zero on success, negative value on failure
  */
-int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r)
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r)
 {
 	return db_do_raw_query(_h, _s, _r, db_mysql_submit_query,
 	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)
  * \param _n number of key=value pairs
  * \return zero on success, negative value on failure
  */
-int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
 {
 	return db_do_insert(_h, _k, _v, _n, db_mysql_val2str,
 	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,
  * \param _n number of key=value pairs
  * \return zero on success, negative value on failure
  */
-int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
+int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
 	const db_val_t* _v, const int _n)
 {
 	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,
  * \param _un number of columns to update
  * \return zero on success, negative value on failure
  */
-int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o, 
+int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o, 
 	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n, 
 	const int _un)
 {
@@ -442,7 +442,7 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
  * \param _n number of key=value pairs
  * \return zero on success, negative value on failure
  */
-int db_mysql_replace(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
+int db_mysql_replace(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
 {
 	return db_do_replace(_h, _k, _v, _n, db_mysql_val2str,
 	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,
  * \return returns the ID as integer or returns 0 if the previous statement
  * does not use an AUTO_INCREMENT value.
  */
-int db_last_inserted_id(const db_con_t* _h)
+int db_last_inserted_id(const db1_con_t* _h)
 {
 	if (!_h) {
 		LM_ERR("invalid parameter value\n");
@@ -472,7 +472,7 @@ int db_last_inserted_id(const db_con_t* _h)
   * \param _v values of the keys
   * \param _n number of key=value pairs
  */
- int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
+ int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
 	const int _n)
  {
 	int off, ret;
@@ -530,7 +530,7 @@ error:
  * \param _t table name
  * \return zero on success, negative value on failure
  */
-int db_mysql_use_table(db_con_t* _h, const str* _t)
+int db_mysql_use_table(db1_con_t* _h, const str* _t)
 {
 	return db_use_table(_h, _t);
 }

+ 13 - 13
modules/db_mysql/km_dbase.h

@@ -45,25 +45,25 @@
 /*! \brief
  * Initialize database connection
  */
-db_con_t* db_mysql_init(const str* _sqlurl);
+db1_con_t* db_mysql_init(const str* _sqlurl);
 
 
 /*! \brief
  * Close a database connection
  */
-void db_mysql_close(db_con_t* _h);
+void db_mysql_close(db1_con_t* _h);
 
 
 /*! \brief
  * Free all memory allocated by get_result
  */
-int db_mysql_free_result(db_con_t* _h, db_res_t* _r);
+int db_mysql_free_result(db1_con_t* _h, db_res_t* _r);
 
 
 /*! \brief
  * Do a query
  */
-int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
+int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
 	     const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
 	     const db_key_t _o, db_res_t** _r);
 
@@ -71,32 +71,32 @@ int db_mysql_query(const db_con_t* _h, const db_key_t* _k, const db_op_t* _op,
 /*! \brief
  * fetch rows from a result
  */
-int db_mysql_fetch_result(const db_con_t* _h, db_res_t** _r, const int nrows);
+int db_mysql_fetch_result(const db1_con_t* _h, db_res_t** _r, const int nrows);
 
 
 /*! \brief
  * Raw SQL query
  */
-int db_mysql_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r);
+int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db_res_t** _r);
 
 
 /*! \brief
  * Insert a row into table
  */
-int db_mysql_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
 
 
 /*! \brief
  * Delete a row from table
  */
-int db_mysql_delete(const db_con_t* _h, const db_key_t* _k, const 
+int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const 
 	db_op_t* _o, const db_val_t* _v, const int _n);
 
 
 /*! \brief
  * Update a row in table
  */
-int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
+int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
 	const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
 	const int _un);
 
@@ -104,17 +104,17 @@ int db_mysql_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
 /*! \brief
  * Just like insert, but replace the row if it exists
  */
-int db_mysql_replace(const db_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
+int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys, const db_val_t* vals, const int n);
 
 /*! \brief
  * Returns the last inserted ID
  */
-int db_last_inserted_id(const db_con_t* _h);
+int db_last_inserted_id(const db1_con_t* _h);
 
 /*! \brief
  * Insert a row into table, update on duplicate key
  */
-int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
+int db_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
 	const int _n);
 
 
@@ -122,7 +122,7 @@ int db_insert_update(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
  * Store name of table that will be used by
  * subsequent database functions
  */
-int db_mysql_use_table(db_con_t* _h, const str* _t);
+int db_mysql_use_table(db1_con_t* _h, const str* _t);
 
 
 #endif /* KM_DBASE_H */

+ 3 - 3
modules/db_mysql/km_res.c

@@ -50,7 +50,7 @@
  * \param _r database result set
  * \return 0 on success, negative on failure
  */
-int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r)
+int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r)
 {
 	int col;
 	MYSQL_FIELD* fields;
@@ -155,7 +155,7 @@ int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r)
  * \param _r database result set
  * \return 0 on success, negative on failure
  */
-static inline int db_mysql_convert_rows(const db_con_t* _h, db_res_t* _r)
+static inline int db_mysql_convert_rows(const db1_con_t* _h, db_res_t* _r)
 {
 	int row;
 
@@ -201,7 +201,7 @@ static inline int db_mysql_convert_rows(const db_con_t* _h, db_res_t* _r)
  * \param _r database result
  * \return 0 on success, negative on failure
  */
-int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r)
+int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r)
 {
 	if ((!_h) || (!_r)) {
 		LM_ERR("invalid parameter\n");

+ 2 - 2
modules/db_mysql/km_res.h

@@ -44,7 +44,7 @@
  * \param _r database result
  * \return 0 on success, negative on failure
  */
-int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
+int db_mysql_convert_result(const db1_con_t* _h, db_res_t* _r);
 
 
 /*!
@@ -53,6 +53,6 @@ int db_mysql_convert_result(const db_con_t* _h, db_res_t* _r);
  * \param _r database result set
  * \return 0 on success, negative on failure
  */
-int db_mysql_get_columns(const db_con_t* _h, db_res_t* _r);
+int db_mysql_get_columns(const db1_con_t* _h, db_res_t* _r);
 
 #endif

+ 1 - 1
modules/db_mysql/km_row.c

@@ -44,7 +44,7 @@
  * \param _r database result row
  * \return 0 on success, -1 on failure
  */
-int db_mysql_convert_row(const db_con_t* _h, db_res_t* _res, db_row_t* _r)
+int db_mysql_convert_row(const db1_con_t* _h, db_res_t* _res, db_row_t* _r)
 {
 	unsigned long* lengths;
 	int i;

+ 1 - 1
modules/db_mysql/km_row.h

@@ -46,6 +46,6 @@
  * \param _r database result row
  * \return 0 on success, -1 on failure
  */
-int db_mysql_convert_row(const db_con_t* _h, db_res_t* _res, db_row_t* _r);
+int db_mysql_convert_row(const db1_con_t* _h, db_res_t* _res, db_row_t* _r);
 
 #endif

+ 1 - 1
modules/db_mysql/km_val.c

@@ -43,7 +43,7 @@
  * \param _len target string length
  * \return 0 on success, negative on error
  */
-int db_mysql_val2str(const db_con_t* _c, const db_val_t* _v, char* _s, int* _len)
+int db_mysql_val2str(const db1_con_t* _c, const db_val_t* _v, char* _s, int* _len)
 {
 	int l, tmp;
 	char* old_s;

+ 1 - 1
modules/db_mysql/km_val.h

@@ -47,6 +47,6 @@
  * \param _len target string length
  * \return 0 on success, negative on error
  */
-int db_mysql_val2str(const db_con_t* _con, const db_val_t* _v, char* _s, int* _len);
+int db_mysql_val2str(const db1_con_t* _con, const db_val_t* _v, char* _s, int* _len);
 
 #endif