Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

sqlite3odbc.h

Go to the documentation of this file.
00001 #ifndef _SQLITE3ODBC_H
00002 #define _SQLITE3ODBC_H
00003 
00027 #if defined(_WIN32) || defined(_WIN64)
00028 #include <windows.h>
00029 #include <stdio.h>
00030 #include <io.h>
00031 #else
00032 #include <sys/time.h>
00033 #include <sys/types.h>
00034 #include <stdio.h>
00035 #include <unistd.h>
00036 #include <errno.h>
00037 #endif
00038 #include <stdlib.h>
00039 #if defined(HAVE_LOCALECONV) || defined(_WIN32) || defined(_WIN64)
00040 #include <locale.h>
00041 #endif
00042 #include <stdarg.h>
00043 #include <stddef.h>
00044 #include <string.h>
00045 #include <sql.h>
00046 #include <sqlext.h>
00047 #include <time.h>
00048 
00049 #include "sqlite3.h"
00050 #ifdef HAVE_IODBC
00051 #include <iodbcinst.h>
00052 #endif
00053 #if defined(HAVE_UNIXODBC) || defined(_WIN32) || defined(_WIN64)
00054 #include <odbcinst.h>
00055 #endif
00056 
00057 #ifndef SQL_API
00058 #define SQL_API
00059 #endif
00060 
00061 #ifndef HAVE_SQLLEN
00062 #define SQLLEN SQLINTEGER
00063 #endif
00064 
00065 #define SQLLEN_PTR SQLLEN *
00066 
00067 #ifndef HAVE_SQLULEN
00068 #define SQLULEN SQLUINTEGER
00069 #endif
00070 
00071 #ifndef HAVE_SQLROWCOUNT
00072 #define SQLROWCOUNT SQLUINTEGER
00073 #endif
00074 
00075 #ifndef HAVE_SQLSETPOSIROW
00076 #define SQLSETPOSIROW SQLUSMALLINT
00077 #endif
00078 
00079 #ifndef HAVE_SQLROWOFFSET
00080 #define SQLROWOFFSET SQLLEN
00081 #endif
00082 
00083 #ifndef HAVE_SQLROWSETSIZE
00084 #define SQLROWSETSIZE SQLULEN
00085 #endif
00086 
00087 struct dbc;
00088 struct stmt;
00089 
00096 typedef struct {
00097     int magic;                  
00098     int ov3;                    
00099     int pool;                   
00100 #if defined(_WIN32) || defined(_WIN64)
00101     CRITICAL_SECTION cs;        
00102 #endif
00103     struct dbc *dbcs;           
00104 } ENV;
00105 
00112 typedef struct dbc {
00113     int magic;                  
00114     ENV *env;                   
00115     struct dbc *next;           
00116     sqlite3 *sqlite;            
00117     int version;                
00118     char *dbname;               
00119     char *dsn;                  
00120     int timeout;                
00121     long t0;                    
00122     int busyint;                
00123     int *ov3;                   
00124     int ov3val;                 
00125     int autocommit;             
00126     int intrans;                
00127     struct stmt *stmt;          
00128     int naterr;                 
00129     char sqlstate[6];           
00130     SQLCHAR logmsg[1024];       
00131     int nowchar;                
00132     int dobigint;               
00133     int shortnames;             
00134     int longnames;              
00135     int nocreat;                
00136     int fksupport;              
00137     int curtype;                
00138     int step_enable;            
00139     int trans_disable;          
00140     int oemcp;                  
00141     int jdconv;                 
00142     struct stmt *cur_s3stmt;    
00143     int s3stmt_needmeta;        
00144     FILE *trace;                
00145     char *pwd;                  
00146     int pwdLen;                 
00147 #ifdef USE_DLOPEN_FOR_GPPS
00148     void *instlib;
00149     int (*gpps)();
00150 #endif
00151 #if defined(_WIN32) || defined(_WIN64)
00152     CRITICAL_SECTION cs;        
00153     DWORD owner;                
00154     int xcelqrx;
00155 #endif
00156 } DBC;
00157 
00164 typedef struct {
00165     char *db;                   
00166     char *table;                
00167     char *column;               
00168     int type;                   
00169     int size;                   
00170     int index;                  
00171     int nosign;                 
00172     int scale;                  
00173     int prec;                   
00174     int autoinc;                
00175     int notnull;                
00176     int ispk;                   
00177     int isrowid;                
00178     char *typename;             
00179     char *label;                
00180 } COL;
00181 
00188 typedef struct {
00189     SQLSMALLINT type;   
00190     SQLINTEGER max;     
00191     SQLLEN *lenp;       
00192     SQLPOINTER valp;    
00193     int index;          
00194     int offs;           
00195 } BINDCOL;
00196 
00203 typedef struct {
00204     int type, stype;    
00205     int coldef, scale;  
00206     SQLLEN max;         
00207     SQLLEN *lenp;       
00208     SQLLEN *lenp0;      
00209     void *param;        
00210     void *param0;       
00211     int inc;            
00212     int need;           
00213     int bound;          
00214     int offs, len;      
00215     void *parbuf;       
00216     char strbuf[64];    
00217     int s3type;         
00218     int s3size;         
00219     void *s3val;        
00220     int s3ival;         
00221     sqlite_int64 s3lival;       
00222     double s3dval;      
00223 } BINDPARM;
00224 
00231 typedef struct stmt {
00232     struct stmt *next;          
00233     HDBC dbc;                   
00234     SQLCHAR cursorname[32];     
00235     SQLCHAR *query;             
00236     int *ov3;                   
00237     int *oemcp;                 
00238     int *jdconv;                
00239     int isselect;               
00240     int ncols;                  
00241     COL *cols;                  
00242     COL *dyncols;               
00243     int dcols;                  
00244     int bkmrk;                  
00245     SQLINTEGER *bkmrkptr;       
00246     BINDCOL bkmrkcol;           
00247     BINDCOL *bindcols;          
00248     int nbindcols;              
00249     int nbindparms;             
00250     BINDPARM *bindparms;        
00251     int nparams;                
00252     int pdcount;                
00253     int nrows;                  
00254     int rowp;                   
00255     int rowprs;                 
00256     char **rows;                
00257     void (*rowfree)();          
00258     int naterr;                 
00259     char sqlstate[6];           
00260     SQLCHAR logmsg[1024];       
00261     int nowchar[2];             
00262     int dobigint;               
00263     int longnames;              
00264     SQLULEN retr_data;          
00265     SQLULEN rowset_size;        
00266     SQLUSMALLINT *row_status;   
00267     SQLUSMALLINT *row_status0;  
00268     SQLUSMALLINT row_status1;   
00269     SQLULEN *row_count;         
00270     SQLULEN row_count0;         
00271     SQLULEN paramset_size;      
00272     SQLULEN paramset_count;     
00273     SQLUINTEGER paramset_nrows; 
00274     SQLULEN max_rows;           
00275     SQLULEN bind_type;          
00276     SQLULEN *bind_offs;         
00277     /* Dummies to make ADO happy */
00278     SQLULEN *parm_bind_offs;    
00279     SQLUSMALLINT *parm_oper;    
00280     SQLUSMALLINT *parm_status;  
00281     SQLULEN *parm_proc;         
00282     SQLULEN parm_bind_type;     
00283     int curtype;                
00284     sqlite3_stmt *s3stmt;       
00285     int s3stmt_noreset;         
00286     int s3stmt_rownum;          
00287     char *bincell;              
00288     char *bincache;             
00289     int binlen;                 
00290     int guessed_types;          
00291     int one_tbl;                
00292     int has_pk;                 
00293     int has_rowid;              
00294 } STMT;
00295 
00296 #endif
00297 
00298 /*
00299  * Local Variables:
00300  * mode: c
00301  * c-basic-offset: 4
00302  * fill-column: 78
00303  * tab-width: 8
00304  * End:
00305  */

Generated on 24 Feb 2018 by doxygen.
Contact: chw@ch-werner.de