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_FLD_H
00028 #define _PG_FLD_H
00029
00030
00040 #include "pg_oid.h"
00041 #include "pg_cmd.h"
00042 #include "../../ut.h"
00043 #include "../../lib/srdb2/db_gen.h"
00044 #include "../../lib/srdb2/db_fld.h"
00045 #include <libpq-fe.h>
00046
00047 struct pg_fld {
00048 db_drv_t gen;
00049
00055 union {
00056 int int4[2];
00057 short int2[4];
00058 float flt;
00059 double dbl;
00060 time_t time;
00061 unsigned int bitmap;
00062 long long int8;
00063 char byte[8];
00064 } v;
00065 char buf[INT2STR_MAX_LEN];
00066 Oid oid;
00067 };
00068
00069
00077 int pg_fld(db_fld_t* fld, char* table);
00078
00079 int pg_resolve_param_oids(db_fld_t* vals, db_fld_t* match,
00080 int n1, int n2, PGresult* res);
00081
00082 int pg_resolve_result_oids(db_fld_t* fld, int n, PGresult* res);
00083
00084
00100 int pg_fld2pg(struct pg_params* dst, int off, pg_type_t* types,
00101 db_fld_t* src, unsigned int flags);
00102
00103
00118 int pg_pg2fld(db_fld_t* dst, PGresult* src, int row, pg_type_t* types,
00119 unsigned int flags);
00120
00121
00131 int pg_check_fld2pg(db_fld_t* fld, pg_type_t* types);
00132
00142 int pg_check_pg2fld(db_fld_t* fld, pg_type_t* types);
00143
00144
00145 #endif