[Kamailio-Devel] [PATCH 4/8] Various fixes to make the module compatible with libsrdb1

Jan Janak jan at iptel.org
Tue Mar 3 03:15:51 CET 2009


List of changes:
 * Rename db_res_t to db1_res_t
 * Rename db_con_t to db1_con_t
 * Rename db field type names DB_* to DB1_*
 * Update header paths to files in ../../lib/srdb1
---
 modules/carrierroute/cr_db.c           |   12 ++++++------
 modules/carrierroute/cr_db.h           |    2 +-
 modules/carrierroute/db_carrierroute.c |    2 +-
 modules/carrierroute/db_carrierroute.h |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/carrierroute/cr_db.c b/modules/carrierroute/cr_db.c
index bb4d646..3d967c2 100644
--- a/modules/carrierroute/cr_db.c
+++ b/modules/carrierroute/cr_db.c
@@ -78,7 +78,7 @@ str * failure_columns[FAILURE_COLUMN_NUM] = {
 
 
 static int load_carrier_map(struct route_data_t *rd) {
-	db_res_t * res = NULL;
+	db1_res_t * res = NULL;
 	int i, count;
 	if(!rd){
 		LM_ERR("invalid parameter\n");
@@ -134,7 +134,7 @@ static int load_carrier_map(struct route_data_t *rd) {
 
 
 static int load_domain_map(struct route_data_t *rd) {
-	db_res_t * res = NULL;
+	db1_res_t * res = NULL;
 	int i, count;
 	if(!rd){
 		LM_ERR("invalid parameter\n");
@@ -190,7 +190,7 @@ static int load_domain_map(struct route_data_t *rd) {
 
 
 int load_user_carrier(str * user, str * domain) {
-	db_res_t * res;
+	db1_res_t * res;
 	db_key_t cols[1];
 	db_key_t keys[2];
 	db_val_t vals[2];
@@ -205,13 +205,13 @@ int load_user_carrier(str * user, str * domain) {
 
 	keys[0] = subscriber_columns[SUBSCRIBER_USERNAME_COL];
 	op[0] = OP_EQ;
-	VAL_TYPE(vals) = DB_STR;
+	VAL_TYPE(vals) = DB1_STR;
 	VAL_NULL(vals) = 0;
 	VAL_STR(vals) = *user;
 
 	keys[1] = subscriber_columns[SUBSCRIBER_DOMAIN_COL];
 	op[1] = OP_EQ;
-	VAL_TYPE(vals+1) = DB_STR;
+	VAL_TYPE(vals+1) = DB1_STR;
 	VAL_NULL(vals+1) = 0;
 	VAL_STR(vals+1) = *domain;
 
@@ -254,7 +254,7 @@ int load_user_carrier(str * user, str * domain) {
  *
  */
 int load_route_data_db(struct route_data_t * rd) {
-	db_res_t * res = NULL;
+	db1_res_t * res = NULL;
 	db_row_t * row = NULL;
 	int i, ret;
 	struct carrier_data_t * tmp_carrier_data;
diff --git a/modules/carrierroute/cr_db.h b/modules/carrierroute/cr_db.h
index 709babc..097bed7 100644
--- a/modules/carrierroute/cr_db.h
+++ b/modules/carrierroute/cr_db.h
@@ -30,7 +30,7 @@
 #ifndef CR_DB_H
 #define CR_DB_H
 
-#include "../../db/db.h"
+#include "../../lib/srdb1/db.h"
 #include "db_carrierroute.h"
 #include "cr_data.h"
 
diff --git a/modules/carrierroute/db_carrierroute.c b/modules/carrierroute/db_carrierroute.c
index 4d19f35..cfe206f 100644
--- a/modules/carrierroute/db_carrierroute.c
+++ b/modules/carrierroute/db_carrierroute.c
@@ -23,7 +23,7 @@
 /* TODO assign read-write or read-only URI, introduce a parameter in XML */
 
 //extern str carrierroute_db_url;
-db_con_t * carrierroute_dbh = NULL;
+db1_con_t * carrierroute_dbh = NULL;
 db_func_t carrierroute_dbf;
 
 str carrierroute_table = str_init("carrierroute");
diff --git a/modules/carrierroute/db_carrierroute.h b/modules/carrierroute/db_carrierroute.h
index 3be17de..cebc30e 100644
--- a/modules/carrierroute/db_carrierroute.h
+++ b/modules/carrierroute/db_carrierroute.h
@@ -22,7 +22,7 @@
 
 
 /* necessary includes */
-#include "../../db/db.h"
+#include "../../lib/srdb1/db.h"
 #include "../../str.h"
 #include "../../ut.h"
 
@@ -32,7 +32,7 @@
 /* database variables */
 
 extern str carrierroute_db_url;
-extern db_con_t * carrierroute_dbh;
+extern db1_con_t * carrierroute_dbh;
 extern db_func_t carrierroute_dbf;
 
 #define carrierroute_DB_URL { "db_url", STR_PARAM, &carrierroute_db_url.s },
-- 
1.5.6.5




More information about the Devel mailing list