Module: sip-router
Branch: janakj/postgres
Commit: 5a1f5e67c768500d930aeeadbc48b7d7030ea75c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a1f5e6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Mar 5 16:51:34 2008 +0000
- migrated to db_bind_api()
git-svn-id:
https://openser.svn.sourceforge.net/svnroot/openser/trunk@3854
689a6050-402a-0410-94f2-e92a70836424
---
modules/db_postgres/km_db_postgres.c | 35 ++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/modules/db_postgres/km_db_postgres.c b/modules/db_postgres/km_db_postgres.c
index 8cb196b..06766a7 100644
--- a/modules/db_postgres/km_db_postgres.c
+++ b/modules/db_postgres/km_db_postgres.c
@@ -31,10 +31,13 @@
#include <stdio.h>
#include "../../sr_module.h"
#include "../../db/db_con.h"
+#include "../../db/db.h"
#include "dbase.h"
MODULE_VERSION
+int db_postgres_bind_api(db_func_t *dbb);
+
static int mod_init(void);
/*
@@ -42,16 +45,7 @@ static int mod_init(void);
*/
static cmd_export_t cmds[]={
- {"db_use_table", (cmd_function)db_postgres_use_table, 2, 0, 0, 0},
- {"db_init", (cmd_function)db_postgres_init, 1, 0, 0, 0},
- {"db_close", (cmd_function)db_postgres_close, 2, 0, 0, 0},
- {"db_query", (cmd_function)db_postgres_query, 2, 0, 0, 0},
- {"db_fetch_result", (cmd_function)db_postgres_fetch_result, 2, 0, 0, 0},
- {"db_raw_query", (cmd_function)db_postgres_raw_query, 2, 0, 0, 0},
- {"db_free_result", (cmd_function)db_postgres_free_query, 2, 0, 0, 0},
- {"db_insert", (cmd_function)db_postgres_insert, 2, 0, 0, 0},
- {"db_delete", (cmd_function)db_postgres_delete, 2, 0, 0, 0},
- {"db_update", (cmd_function)db_postgres_update, 2, 0, 0, 0},
+ {"db_bind_api", (cmd_function)db_postgres_bind_api, 0, 0, 0, 0},
{0,0,0,0,0,0}
};
@@ -79,3 +73,24 @@ static int mod_init(void)
return 0;
}
+int db_postgres_bind_api(db_func_t *dbb)
+{
+ if(dbb==NULL)
+ return -1;
+
+ memset(dbb, 0, sizeof(db_func_t));
+
+ dbb->use_table = db_postgres_use_table;
+ dbb->init = db_postgres_init;
+ dbb->close = db_postgres_close;
+ dbb->query = db_postgres_query;
+ dbb->fetch_result = db_postgres_fetch_result;
+ dbb->raw_query = db_postgres_raw_query;
+ dbb->free_result = db_postgres_free_query;
+ dbb->insert = db_postgres_insert;
+ dbb->delete = db_postgres_delete;
+ dbb->update = db_postgres_update;
+
+ return 0;
+}
+