db_unixodbc.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "../../sr_module.h"
00032 #include "../../db/db.h"
00033 #include "dbase.h"
00034 #include "db_unixodbc.h"
00035
00036 int ping_interval = 5 * 60;
00037 int auto_reconnect = 1;
00038 int use_escape_common = 0;
00039
00040 MODULE_VERSION
00041
00042 int db_unixodbc_bind_api(db_func_t *dbb);
00043
00044
00045
00046
00047 static cmd_export_t cmds[] = {
00048 {"db_bind_api", (cmd_function)db_unixodbc_bind_api, 0, 0, 0, 0},
00049 {0, 0, 0, 0, 0, 0}
00050 };
00051
00052
00053
00054
00055
00056 static param_export_t params[] = {
00057 {"ping_interval", INT_PARAM, &ping_interval},
00058 {"auto_reconnect", INT_PARAM, &auto_reconnect},
00059 {"use_escape_common", INT_PARAM, &use_escape_common},
00060 {0, 0, 0}
00061 };
00062
00063
00064 struct module_exports exports = {
00065 "db_unixodbc",
00066 DEFAULT_DLFLAGS,
00067 cmds,
00068 params,
00069 0,
00070 0,
00071 0,
00072 0,
00073 0,
00074 0,
00075 0,
00076 0
00077 };
00078
00079 int db_unixodbc_bind_api(db_func_t *dbb)
00080 {
00081 if(dbb==NULL)
00082 return -1;
00083
00084 memset(dbb, 0, sizeof(db_func_t));
00085
00086 dbb->use_table = db_unixodbc_use_table;
00087 dbb->init = db_unixodbc_init;
00088 dbb->close = db_unixodbc_close;
00089 dbb->query = db_unixodbc_query;
00090 dbb->fetch_result = db_unixodbc_fetch_result;
00091 dbb->raw_query = db_unixodbc_raw_query;
00092 dbb->free_result = db_unixodbc_free_result;
00093 dbb->insert = db_unixodbc_insert;
00094 dbb->delete = db_unixodbc_delete;
00095 dbb->update = db_unixodbc_update;
00096 dbb->replace = db_unixodbc_replace;
00097
00098 return 0;
00099 }
00100