Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

res_odbc.h

Go to the documentation of this file.
00001 /* 00002 * Asterisk -- A telephony toolkit for Linux. 00003 * 00004 * Copyright (C) 1999, Mark Spencer 00005 * 00006 * Mark Spencer <markster@linux-support.net> 00007 * 00008 * res_odbc.h <ODBC resource manager> 00009 * Copyright (C) 2004 Anthony Minessale II <anthmct@yahoo.com> 00010 */ 00011 00012 #ifndef _RES_ODBC_H 00013 #define _RES_ODBC_H 00014 00015 #include <sql.h> 00016 #include <sqlext.h> 00017 #include <sqltypes.h> 00018 00019 00020 00021 00022 typedef struct odbc_obj odbc_obj; 00023 00024 typedef enum { ODBC_SUCCESS=0,ODBC_FAIL=-1} odbc_status; 00025 00026 struct odbc_obj { 00027 char *name; 00028 char *dsn; 00029 char *username; 00030 char *password; 00031 SQLHENV env; /* ODBC Environment */ 00032 SQLHDBC con; /* ODBC Connection Handle */ 00033 SQLHSTMT stmt; /* ODBC Statement Handle */ 00034 ast_mutex_t lock; 00035 int up; 00036 00037 }; 00038 00039 00040 00041 00042 /* functions */ 00043 odbc_obj *new_odbc_obj(char *name,char *dsn,char *username, char *password); 00044 odbc_status odbc_obj_connect(odbc_obj *obj); 00045 odbc_status odbc_obj_disconnect(odbc_obj *obj); 00046 void destroy_obdc_obj(odbc_obj **obj); 00047 int register_odbc_obj(char *name,odbc_obj *obj); 00048 odbc_obj *fetch_odbc_obj(char *name); 00049 int odbc_dump_fd(int fd,odbc_obj *obj); 00050 00051 #endif

Generated on Fri Sep 24 21:03:48 2004 for Asterisk by doxygen 1.3.8