diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-20 04:57:20 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-20 04:57:20 +0000 |
commit | 99788749f1a3ecbb960ee7d15be06650344d1382 (patch) | |
tree | 5d9cbe4009d3ba759a3e9a306a8b05f2b3320f4e /res/res_odbc.c | |
parent | 7b3a5c9a1aa3e56b5c8a210246e401d488eb01f8 (diff) |
move ODBC API into ast_ namespace
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43311 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_odbc.c')
-rw-r--r-- | res/res_odbc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c index 4ca7b0036..7b7b2cc12 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -75,7 +75,7 @@ static odbc_status odbc_obj_disconnect(struct odbc_obj *obj); static int odbc_register_class(struct odbc_class *class, int connect); -SQLHSTMT odbc_prepare_and_execute(struct odbc_obj *obj, SQLHSTMT (*prepare_cb)(struct odbc_obj *obj, void *data), void *data) +SQLHSTMT ast_odbc_prepare_and_execute(struct odbc_obj *obj, SQLHSTMT (*prepare_cb)(struct odbc_obj *obj, void *data), void *data) { int res = 0, i, attempt; SQLINTEGER nativeerror=0, numfields=0; @@ -130,7 +130,7 @@ SQLHSTMT odbc_prepare_and_execute(struct odbc_obj *obj, SQLHSTMT (*prepare_cb)(s return stmt; } -int odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) +int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) { int res = 0, i; SQLINTEGER nativeerror=0, numfields=0; @@ -172,7 +172,7 @@ int odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) } -int odbc_sanity_check(struct odbc_obj *obj) +int ast_odbc_sanity_check(struct odbc_obj *obj) { char *test_sql = "select 1"; SQLHSTMT stmt; @@ -319,12 +319,12 @@ static int odbc_show_command(int fd, int argc, char **argv) ast_cli(fd, "Pooled: yes\nLimit: %d\nConnections in use: %d\n", class->limit, class->count); AST_LIST_TRAVERSE(&(class->odbc_obj), current, list) { - ast_cli(fd, " Connection %d: %s", ++count, current->up && odbc_sanity_check(current) ? "connected" : "disconnected"); + ast_cli(fd, " Connection %d: %s", ++count, current->up && ast_odbc_sanity_check(current) ? "connected" : "disconnected"); } } else { /* Should only ever be one of these */ AST_LIST_TRAVERSE(&(class->odbc_obj), current, list) { - ast_cli(fd, "Pooled: no\nConnected: %s\n", current->up && odbc_sanity_check(current) ? "yes" : "no"); + ast_cli(fd, "Pooled: no\nConnected: %s\n", current->up && ast_odbc_sanity_check(current) ? "yes" : "no"); } } @@ -362,8 +362,8 @@ static int odbc_register_class(struct odbc_class *class, int connect) if (connect) { /* Request and release builds a connection */ - obj = odbc_request_obj(class->name, 0); - odbc_release_obj(obj); + obj = ast_odbc_request_obj(class->name, 0); + ast_odbc_release_obj(obj); } return 0; @@ -373,14 +373,14 @@ static int odbc_register_class(struct odbc_class *class, int connect) } } -void odbc_release_obj(struct odbc_obj *obj) +void ast_odbc_release_obj(struct odbc_obj *obj) { /* For pooled connections, this frees the connection to be * reused. For non-pooled connections, it does nothing. */ obj->used = 0; } -struct odbc_obj *odbc_request_obj(const char *name, int check) +struct odbc_obj *ast_odbc_request_obj(const char *name, int check) { struct odbc_obj *obj = NULL; struct odbc_class *class; @@ -445,7 +445,7 @@ struct odbc_obj *odbc_request_obj(const char *name, int check) AST_LIST_UNLOCK(&class->odbc_obj); if (obj && check) { - odbc_sanity_check(obj); + ast_odbc_sanity_check(obj); } return obj; } |