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
00036 #include <stdio.h>
00037 #include "../../sr_module.h"
00038 #include "../../lib/srdb1/db_con.h"
00039 #include "../../lib/srdb1/db.h"
00040 #include "../../lib/srdb1/db_query.h"
00041 #include "km_dbase.h"
00042 #include "km_db_postgres.h"
00043
00044
00045
00046
00047
00048
00049
00050
00051 static kam_cmd_export_t cmds[]={
00052 {"db_bind_api", (cmd_function)db_postgres_bind_api, 0, 0, 0, 0},
00053 {0,0,0,0,0,0}
00054 };
00055
00056
00057
00058 struct kam_module_exports kam_exports = {
00059 "db_postgres",
00060 DEFAULT_DLFLAGS,
00061 cmds,
00062 0,
00063 0,
00064 0,
00065 0,
00066 0,
00067 km_postgres_mod_init,
00068 0,
00069 0,
00070 0
00071 };
00072
00073
00074 int km_postgres_mod_init(void)
00075 {
00076 return 0;
00077 }
00078
00079 int db_postgres_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_postgres_use_table;
00087 dbb->init = db_postgres_init;
00088 dbb->init2 = db_postgres_init2;
00089 dbb->close = db_postgres_close;
00090 dbb->query = db_postgres_query;
00091 dbb->fetch_result = db_postgres_fetch_result;
00092 dbb->raw_query = db_postgres_raw_query;
00093 dbb->free_result = db_postgres_free_result;
00094 dbb->insert = db_postgres_insert;
00095 dbb->delete = db_postgres_delete;
00096 dbb->update = db_postgres_update;
00097 dbb->replace = db_postgres_replace;
00098 dbb->affected_rows = db_postgres_affected_rows;
00099 dbb->start_transaction= db_postgres_start_transaction;
00100 dbb->end_transaction = db_postgres_end_transaction;
00101 dbb->abort_transaction= db_postgres_abort_transaction;
00102
00103 return 0;
00104 }