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 #ifndef _PG_CMD_H
00028 #define _PG_CMD_H
00029
00030
00041 #include "pg_oid.h"
00042
00043 #include "../../lib/srdb2/db_drv.h"
00044 #include "../../lib/srdb2/db_cmd.h"
00045 #include "../../lib/srdb2/db_res.h"
00046 #include "../../str.h"
00047
00048 #include <stdarg.h>
00049 #include <libpq-fe.h>
00050
00051 struct pg_params {
00052 int n;
00053 const char** val;
00054 int* len;
00055 int* fmt;
00056 };
00057
00058
00063 struct pg_cmd {
00064 db_drv_t gen;
00065 char* name;
00066 str sql_cmd;
00068 struct pg_params params;
00069 PGresult* types;
00070 };
00071
00072
00080 int pg_cmd(db_cmd_t* cmd);
00081
00082
00096 int pg_cmd_exec(db_res_t* res, db_cmd_t* cmd);
00097
00098
00110 int pg_cmd_first(db_res_t* res);
00111
00112
00124 int pg_cmd_next(db_res_t* res);
00125
00126
00137 int pg_getopt(db_cmd_t* cmd, char* optname, va_list ap);
00138
00139
00150 int pg_setopt(db_cmd_t* cmd, char* optname, va_list ap);
00151
00152 #endif