00001
00004 #ifndef _DRIVER_H
00005 #define _DRIVER_H
00006
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010
00011 #include "bindvar.h"
00012
00016 typedef char * Tptr;
00017
00029 typedef struct driver_symbols {
00030
00031 const Mchar *version;
00032
00039 int (*count_rows)(Tptr);
00040
00047 int (*count_cols)(Tptr);
00048
00055 void (*setopt)(Tptr, int);
00056
00062 int (*getcdbopts)(void);
00063
00070 Tptr (*connect)(const Mchar*);
00071
00077 int (*status)(Tptr);
00078
00084 void (*disconnect)(Tptr);
00085
00092 const Mchar* (*error)(Tptr);
00093
00105 int (*read_date)(Tptr, int, int, int*, int*, int*);
00106
00118 int (*read_time)(Tptr, int, int, int*, int*, int*);
00119
00134 int (*read_datetime)(Tptr, int, int, int*, int*, int*, int*, int*, int*);
00135
00145 int (*read_long_integer)(Tptr, int, int, int64_t*);
00146
00156 int (*read_integer)(Tptr, int, int, int*);
00157
00167 int (*read_double)(Tptr, int, int, double*);
00168
00177 const Mchar* (*read_string)(Tptr, int, int);
00178
00187 int (*read_isnull)(Tptr, int, int);
00188
00199 int (*open_query)(Tptr, Tptr*, const Mchar*);
00200
00211 int (*exec_query)(Tptr, Tptr*, const Mchar*);
00212
00219 void (*close_query)(Tptr);
00220
00227 const Mchar* (*sqlerr)(Tptr);
00228
00236 int (*search_col)(Tptr, const Mchar*);
00237
00238 int (*bv_set_unfilled)(Tptr);
00239 int (*bv_get_count)(Tptr);
00240 char (*bv_get_filled)(Tptr, int);
00241 char (*bv_finished)(Tptr);
00242
00252 int (*bv_get_pos_by_name)(Tptr, const Mchar *, int *, int *);
00253
00263 int (*bv_bind_by_pos)(Tptr, int, tvartype, Tptr);
00264
00265 int (*process)(Tptr);
00266 } driver_symbols_t;
00267
00268 typedef struct cdb_datetime {
00269 int year, mon, day, hour, min, sec;
00270 } cdb_datetime_t;
00271
00275 typedef driver_symbols_t *(*driver_func_t)(void);
00276
00277
00278 #define OPT_SQL_TRACE 1
00279 #define OPT_BINDVAR_TRACE 2
00280 #define OPT_PTR_CHECK 4
00281 #define OPT_REEXECUTE 8
00282
00283 #ifdef __cplusplus
00284 }
00285 #endif
00286
00287 #endif
00288