1 /** 2 Copyright (C) 1995, 1996 by Ke Jin <kejin@visigenic.com> 3 Enhanced for unixODBC (1999) by Peter Harvey <pharvey@codebydesign.com> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 **/ 15 #ifndef _H_DRIVER 16 #define _H_DRIVER 17 18 #include "nnconfig.h" 19 #include "isql.h" 20 #include "isqlext.h" 21 #include "convert.h" 22 23 #include "yystmt.h" 24 #include "yyerr.h" 25 #include "yyenv.h" 26 27 #include "hstmt.h" 28 #include "herr.h" 29 30 typedef struct GSTMT { 31 void* hdbc; 32 void* hstmt; 33 struct GSTMT* 34 next; 35 } gstmt_t; 36 37 typedef struct DBC { 38 void* hcndes; 39 void* henv; 40 gstmt_t* 41 stmt; 42 void* herr; 43 44 struct DBC* 45 next; 46 } dbc_t; 47 48 typedef struct { 49 void* hdbc; 50 void* herr; 51 } env_t; 52 53 54 typedef struct { 55 int bind; 56 short type; 57 unsigned long 58 coldef; 59 short scale; 60 char* userbuf; 61 long userbufsize; 62 long* pdatalen; 63 64 int ctype; 65 int sqltype; 66 fptr_t cvt; /* c to sql type convert function */ 67 68 /* for SQLPutData() on SQL_CHAR, SQL_VARCHAR, SQL_LONGVARCHAR */ 69 char* putdtbuf; 70 int putdtlen; 71 int need; 72 } param_t; 73 74 typedef struct { 75 short ctype; 76 char* userbuf; 77 long userbufsize; 78 long* pdatalen; 79 80 long offset; /* getdata offset */ 81 } column_t; 82 83 typedef struct { 84 void* herr; 85 void* hdbc; 86 column_t* pcol; /* user bound columns */ 87 param_t* ppar; /* user bound parameters */ 88 int ndelay; /* number of delay parameters */ 89 void* yystmt; /* sql layer object handle */ 90 91 int refetch; /* need refetch */ 92 93 int putipar; 94 } stmt_t; 95 96 #include "connect.h" 97 98 #include "nnsql.h" 99 #include "nntp.h" 100 101 102 char* getkeyvalbydsn( 103 char* dsn, 104 int dsnlen, 105 char* keywd, 106 char* value, 107 int size ); 108 109 char* getkeyvalinstr( 110 char* cnstr, 111 int cnlen, 112 char* keywd, 113 char* value, 114 int size ); 115 116 #endif 117 118 119