db_postgres.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
00032
00033
00034
00035
00036 #include <stdio.h>
00037 #include "../../sr_module.h"
00038 #include "../../db/db_con.h"
00039 #include "../../db/db.h"
00040 #include "dbase.h"
00041
00042
00043 MODULE_VERSION
00044
00045 int db_postgres_bind_api(db_func_t *dbb);
00046
00047 static int mod_init(void);
00048
00049
00050
00051
00052
00053 static cmd_export_t cmds[]={
00054 {"db_bind_api", (cmd_function)db_postgres_bind_api, 0, 0, 0, 0},
00055 {0,0,0,0,0,0}
00056 };
00057
00058
00059
00060 struct module_exports exports = {
00061 "db_postgres",
00062 DEFAULT_DLFLAGS,
00063 cmds,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 mod_init,
00070 0,
00071 0,
00072 0
00073 };
00074
00075
00076 static int mod_init(void)
00077 {
00078 return 0;
00079 }
00080
00081 int db_postgres_bind_api(db_func_t *dbb)
00082 {
00083 if(dbb==NULL)
00084 return -1;
00085
00086 memset(dbb, 0, sizeof(db_func_t));
00087
00088 dbb->use_table = db_postgres_use_table;
00089 dbb->init = db_postgres_init;
00090 dbb->close = db_postgres_close;
00091 dbb->query = db_postgres_query;
00092 dbb->fetch_result = db_postgres_fetch_result;
00093 dbb->raw_query = db_postgres_raw_query;
00094 dbb->free_result = db_postgres_free_result;
00095 dbb->insert = db_postgres_insert;
00096 dbb->delete = db_postgres_delete;
00097 dbb->update = db_postgres_update;
00098
00099 return 0;
00100 }