diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-11 00:12:35 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-11 00:12:35 +0000 |
commit | a5e941b56ea72044c4dadd9bdb8221cb919bea85 (patch) | |
tree | 938a7378ae06da558d7c6b35c4597db2a14162cf /include/asterisk/res_odbc.h | |
parent | 894fdbaf3ff8e922f2872750383d2f3b34914ba0 (diff) |
Merge res_odbc and res_config
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3186 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/res_odbc.h')
-rwxr-xr-x | include/asterisk/res_odbc.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/asterisk/res_odbc.h b/include/asterisk/res_odbc.h new file mode 100755 index 000000000..1a68acb98 --- /dev/null +++ b/include/asterisk/res_odbc.h @@ -0,0 +1,51 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Copyright (C) 1999, Mark Spencer + * + * Mark Spencer <markster@linux-support.net> + * + * res_odbc.h <ODBC resource manager> + * Copyright (C) 2004 Anthony Minessale II <anthmct@yahoo.com> + */ + +#ifndef _RES_ODBC_H +#define _RES_ODBC_H + +#include <sql.h> +#include <sqlext.h> +#include <sqltypes.h> + + + + +typedef struct odbc_obj odbc_obj; + +typedef enum { ODBC_SUCCESS=0,ODBC_FAIL=-1} odbc_status; + +struct odbc_obj { + char *name; + char *dsn; + char *username; + char *password; + SQLHENV env; /* ODBC Environment */ + SQLHDBC con; /* ODBC Connection Handle */ + SQLHSTMT stmt; /* ODBC Statement Handle */ + ast_mutex_t lock; + int up; + +}; + + + + +/* functions */ +odbc_obj *new_odbc_obj(char *name,char *dsn,char *username, char *password); +odbc_status odbc_obj_connect(odbc_obj *obj); +odbc_status odbc_obj_disconnect(odbc_obj *obj); +void destroy_obdc_obj(odbc_obj **obj); +int register_odbc_obj(char *name,odbc_obj *obj); +odbc_obj *fetch_odbc_obj(char *name); +int odbc_dump_fd(int fd,odbc_obj *obj); + +#endif |