Module: sip-router
Branch: andrei/dbk_lib
Commit: 174881d2ffeb43a06566b57707a398ee8a1bcdf5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=174881d…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Nov 21 03:31:32 2008 +0100
libsr_dbk: added kamailio db interface as lib
- kamailio db interface tranformed into library
(Makefile added, include path changed)
---
lib/sr_dbk/Makefile | 14 ++++++++++++++
lib/sr_dbk/README | 14 +++++++++-----
lib/sr_dbk/db.c | 8 ++++----
lib/sr_dbk/db_con.h | 2 +-
lib/sr_dbk/db_id.c | 6 +++---
lib/sr_dbk/db_id.h | 2 +-
lib/sr_dbk/db_key.h | 2 +-
lib/sr_dbk/db_pool.c | 2 +-
lib/sr_dbk/db_query.c | 2 +-
lib/sr_dbk/db_res.c | 4 ++--
lib/sr_dbk/db_row.c | 4 ++--
lib/sr_dbk/db_ut.c | 4 ++--
lib/sr_dbk/db_val.h | 2 +-
13 files changed, 42 insertions(+), 24 deletions(-)
diff --git a/lib/sr_dbk/Makefile b/lib/sr_dbk/Makefile
new file mode 100644
index 0000000..2c21b96
--- /dev/null
+++ b/lib/sr_dbk/Makefile
@@ -0,0 +1,14 @@
+#
+# example library makefile
+#
+
+include ../../Makefile.defs
+auto_gen=
+NAME:=sr_dbk
+MAJOR_VER=1
+MINOR_VER=0
+BUGFIX_VER=0
+LIBS=
+
+include ../../Makefile.libs
+
diff --git a/lib/sr_dbk/README b/lib/sr_dbk/README
index bbdc03e..cd4fb44 100644
--- a/lib/sr_dbk/README
+++ b/lib/sr_dbk/README
@@ -1,7 +1,11 @@
$Id$
-This directory contains generic database support interface. The interface
-should be used by all modules willing to communicate with a database. Kamailio
-can then switch from one database to another simply by loading a different
-database support module. Directory example contains a very simple example
-how to use the interface. Directory doc contains the API documentation.
+This directory contains the Kamailio generic database support library.
+The library should be used by all modules willing to communicate with a
+database. Kamailio can then switch from one database to another simply by
+loading a different database support module. Directory example contains a
+very simple example how to use the interface. Directory doc contains the API
+documentation.
+
+Note that you can use sip-router with 2 different database interfaces:
+ ser and kamailio.
diff --git a/lib/sr_dbk/db.c b/lib/sr_dbk/db.c
index f24646a..772bb12 100644
--- a/lib/sr_dbk/db.c
+++ b/lib/sr_dbk/db.c
@@ -57,10 +57,10 @@
* - \ref db_unixodbc
*/
-#include "../dprint.h"
-#include "../sr_module.h"
-#include "../mem/mem.h"
-#include "../ut.h"
+#include "../../dprint.h"
+#include "../../sr_module.h"
+#include "../../mem/mem.h"
+#include "../../ut.h"
#include "db_cap.h"
#include "db_id.h"
#include "db_pool.h"
diff --git a/lib/sr_dbk/db_con.h b/lib/sr_dbk/db_con.h
index 08aa0f1..7804f07 100644
--- a/lib/sr_dbk/db_con.h
+++ b/lib/sr_dbk/db_con.h
@@ -30,7 +30,7 @@
#ifndef DB_CON_H
#define DB_CON_H
-#include "../str.h"
+#include "../../str.h"
/*! \brief
diff --git a/lib/sr_dbk/db_id.c b/lib/sr_dbk/db_id.c
index ad23881..3be3307 100644
--- a/lib/sr_dbk/db_id.c
+++ b/lib/sr_dbk/db_id.c
@@ -28,9 +28,9 @@
*/
#include "db_id.h"
-#include "../dprint.h"
-#include "../mem/mem.h"
-#include "../ut.h"
+#include "../../dprint.h"
+#include "../../mem/mem.h"
+#include "../../ut.h"
#include <stdlib.h>
#include <string.h>
diff --git a/lib/sr_dbk/db_id.h b/lib/sr_dbk/db_id.h
index 2650e6e..641417d 100644
--- a/lib/sr_dbk/db_id.h
+++ b/lib/sr_dbk/db_id.h
@@ -30,7 +30,7 @@
#ifndef _DB_ID_H
#define _DB_ID_H
-#include "../str.h"
+#include "../../str.h"
/** Structure representing a database ID */
struct db_id {
diff --git a/lib/sr_dbk/db_key.h b/lib/sr_dbk/db_key.h
index a03795a..50fd8aa 100644
--- a/lib/sr_dbk/db_key.h
+++ b/lib/sr_dbk/db_key.h
@@ -30,7 +30,7 @@
#ifndef DB_KEY_H
#define DB_KEY_H
-#include "../ut.h"
+#include "../../ut.h"
/**
diff --git a/lib/sr_dbk/db_pool.c b/lib/sr_dbk/db_pool.c
index a87f7c4..6a1a9fc 100644
--- a/lib/sr_dbk/db_pool.c
+++ b/lib/sr_dbk/db_pool.c
@@ -27,7 +27,7 @@
* \ingroup db
*/
-#include "../dprint.h"
+#include "../../dprint.h"
#include "db_pool.h"
diff --git a/lib/sr_dbk/db_query.c b/lib/sr_dbk/db_query.c
index eb7a798..609e935 100644
--- a/lib/sr_dbk/db_query.c
+++ b/lib/sr_dbk/db_query.c
@@ -33,7 +33,7 @@
*/
#include <stdio.h>
-#include "../dprint.h"
+#include "../../dprint.h"
#include "db_ut.h"
#include "db_query.h"
diff --git a/lib/sr_dbk/db_res.c b/lib/sr_dbk/db_res.c
index 27d162f..d82fae6 100644
--- a/lib/sr_dbk/db_res.c
+++ b/lib/sr_dbk/db_res.c
@@ -33,8 +33,8 @@
#include "db_res.h"
#include "db_row.h"
-#include "../dprint.h"
-#include "../mem/mem.h"
+#include "../../dprint.h"
+#include "../../mem/mem.h"
#include <string.h>
diff --git a/lib/sr_dbk/db_row.c b/lib/sr_dbk/db_row.c
index 090adb7..e690d5b 100644
--- a/lib/sr_dbk/db_row.c
+++ b/lib/sr_dbk/db_row.c
@@ -33,8 +33,8 @@
#include "db_row.h"
#include <string.h>
-#include "../dprint.h"
-#include "../mem/mem.h"
+#include "../../dprint.h"
+#include "../../mem/mem.h"
/*
* Release memory used by row
diff --git a/lib/sr_dbk/db_ut.c b/lib/sr_dbk/db_ut.c
index 2c86b17..cf7abf3 100644
--- a/lib/sr_dbk/db_ut.c
+++ b/lib/sr_dbk/db_ut.c
@@ -32,8 +32,8 @@
#include "db_ut.h"
-#include "../mem/mem.h"
-#include "../dprint.h"
+#include "../../mem/mem.h"
+#include "../../dprint.h"
#include <limits.h>
#include </usr/include/limits.h>
#include <errno.h>
diff --git a/lib/sr_dbk/db_val.h b/lib/sr_dbk/db_val.h
index ab9314b..fad0b24 100644
--- a/lib/sr_dbk/db_val.h
+++ b/lib/sr_dbk/db_val.h
@@ -37,7 +37,7 @@
#define DB_VAL_H
#include <time.h>
-#include "../str.h"
+#include "../../str.h"
/**