Better error reporting when git-get-modules fails.
[versaplex.git] / vxodbc / dlg_specific.h
blob91467350e2c9958214bf5931514c7b8b1445a7c3
1 /* File: dlg_specific.h
3 * Description: See "dlg_specific.c"
5 * Comments: See "notice.txt" for copyright and license information.
7 */
9 #ifndef __DLG_SPECIFIC_H__
10 #define __DLG_SPECIFIC_H__
12 #include "psqlodbc.h"
13 #include "connection.h"
15 #ifdef WIN32
16 #include <windowsx.h>
17 #include "resource.h"
18 #endif
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 /* Unknown data type sizes */
24 #define UNKNOWNS_AS_MAX 0
25 #define UNKNOWNS_AS_DONTKNOW 1
26 #define UNKNOWNS_AS_LONGEST 2
28 /* ODBC initialization files */
29 #ifndef WIN32
30 #define ODBC_INI ".odbc.ini"
31 #define ODBCINST_INI "odbcinst.ini"
32 #else
33 #define ODBC_INI "ODBC.INI"
34 #define ODBCINST_INI "ODBCINST.INI"
35 #endif
37 #define ODBC_DATASOURCES "ODBC Data Sources"
39 #define INI_DSN "VxDSN"
41 //#define INI_KDESC "Description" /* Data source
42 // * description */
43 #define INI_SERVER "Servername" /* Name of Server
44 * running the Postgres
45 * service */
46 #define SPEC_SERVER "server"
47 #define INI_PORT "Port" /* Port on which the
48 * Postmaster is listening */
49 #define INI_DATABASE "Database" /* Database Name */
50 #define INI_UID "UID" /* Default User Name */
51 #define INI_USER "Username" /* Default User Name */
52 #define INI_PASSWORD "Password" /* Default Password */
53 // Which DBus connection to use. Defaults to "dbus:session".
54 #define INI_DBUS "DBus"
56 #define INI_READONLY "ReadOnly" /* Database is read only */
57 #if 0
58 #define INI_ABBREVIATE "CX"
59 #define INI_DEBUG "Debug" /* Debug flag */
60 #define ABBR_DEBUG "B2"
61 #define INI_FETCH "Fetch" /* Fetch Max Count */
62 #define ABBR_FETCH "A7"
63 #define INI_SOCKET "Socket" /* Socket buffer size */
64 #define ABBR_SOCKET "A8"
65 #define ABBR_READONLY "A0"
66 #define INI_COMMLOG "CommLog" /* Communication to
67 * backend logging */
68 #define ABBR_COMMLOG "B3"
69 #define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
70 #define ABBR_PROTOCOL "A1"
71 #define INI_OPTIMIZER "Optimizer" /* Use backend genetic
72 * optimizer */
73 #define ABBR_OPTIMIZER "B4"
74 #define INI_KSQO "Ksqo" /* Keyset query
75 * optimization */
76 #define ABBR_KSQO "B5"
77 #define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
78 * backend on successful
79 * connection */
80 #define ABBR_CONNSETTINGS "A6"
81 #define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique
82 * indexes */
83 #define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
84 * result set sizes */
85 #define ABBR_UNKNOWNSIZES "A9"
87 #define INI_CANCELASFREESTMT "CancelAsFreeStmt"
88 #define ABBR_CANCELASFREESTMT "C1"
89 #define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch
90 * cursors */
91 #define ABBR_USEDECLAREFETCH "B6"
93 /* More ini stuff */
94 #define INI_TEXTASLONGVARCHAR "TextAsLongVarchar"
95 #define ABBR_TEXTASLONGVARCHAR "B7"
96 #define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar"
97 #define ABBR_UNKNOWNSASLONGVARCHAR "B8"
98 #define INI_BOOLSASCHAR "BoolsAsChar"
99 #define ABBR_BOOLSASCHAR "B9"
100 #define INI_MAXVARCHARSIZE "MaxVarcharSize"
101 #define ABBR_MAXVARCHARSIZE "B0"
102 #define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize"
103 #define ABBR_MAXLONGVARCHARSIZE "B1"
105 #define INI_FAKEOIDINDEX "FakeOidIndex"
106 #define ABBR_FAKEOIDINDEX "A2"
107 #define INI_SHOWOIDCOLUMN "ShowOidColumn"
108 #define ABBR_SHOWOIDCOLUMN "A3"
109 #define INI_ROWVERSIONING "RowVersioning"
110 #define ABBR_ROWVERSIONING "A4"
111 #define INI_SHOWSYSTEMTABLES "ShowSystemTables"
112 #define ABBR_SHOWSYSTEMTABLES "A5"
113 #define INI_LIE "Lie"
114 #define INI_PARSE "Parse"
115 #define ABBR_PARSE "C0"
116 #define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes"
117 #define ABBR_EXTRASYSTABLEPREFIXES "C2"
119 #define INI_TRANSLATIONNAME "TranslationName"
120 #define INI_TRANSLATIONDLL "TranslationDLL"
121 #define INI_TRANSLATIONOPTION "TranslationOption"
122 #define INI_DISALLOWPREMATURE "DisallowPremature"
123 #define ABBR_DISALLOWPREMATURE "C3"
124 #define INI_UPDATABLECURSORS "UpdatableCursors"
125 #define ABBR_UPDATABLECURSORS "C4"
126 #define INI_LFCONVERSION "LFConversion"
127 #define ABBR_LFCONVERSION "C5"
128 #define INI_TRUEISMINUS1 "TrueIsMinus1"
129 #define ABBR_TRUEISMINUS1 "C6"
130 #define INI_INT8AS "BI"
131 #define INI_BYTEAASLONGVARBINARY "ByteaAsLongVarBinary"
132 #define ABBR_BYTEAASLONGVARBINARY "C7"
133 #define INI_USESERVERSIDEPREPARE "UseServerSidePrepare"
134 #define ABBR_USESERVERSIDEPREPARE "C8"
135 #define INI_LOWERCASEIDENTIFIER "LowerCaseIdentifier"
136 #define ABBR_LOWERCASEIDENTIFIER "C9"
137 #define INI_SSLMODE "SSLmode"
138 #define ABBR_SSLMODE "CA"
139 #define INI_EXTRAOPTIONS "AB"
141 #define SSLMODE_DISABLE "disable"
142 #define SSLMODE_ALLOW "allow"
143 #define SSLMODE_PREFER "prefer"
144 #define SSLMODE_REQUIRE "require"
146 /* Bit representaion for abbreviated connection strings */
147 #define BIT_LFCONVERSION (1L)
148 #define BIT_UPDATABLECURSORS (1L<<1)
149 #define BIT_DISALLOWPREMATURE (1L<<2)
150 #define BIT_UNIQUEINDEX (1L<<3)
151 #define BIT_PROTOCOL_63 (1L<<4)
152 #define BIT_PROTOCOL_64 (1L<<5)
153 #define BIT_UNKNOWN_DONTKNOW (1L<<6)
154 #define BIT_UNKNOWN_ASMAX (1L<<7)
155 #define BIT_OPTIMIZER (1L<<8)
156 #define BIT_KSQO (1L<<9)
157 #define BIT_COMMLOG (1L<<10)
158 #define BIT_DEBUG (1L<<11)
159 #define BIT_PARSE (1L<<12)
160 #define BIT_CANCELASFREESTMT (1L<<13)
161 #define BIT_USEDECLAREFETCH (1L<<14)
162 #define BIT_READONLY (1L<<15)
163 #define BIT_TEXTASLONGVARCHAR (1L<<16)
164 #define BIT_UNKNOWNSASLONGVARCHAR (1L<<17)
165 #define BIT_BOOLSASCHAR (1L<<18)
166 #define BIT_ROWVERSIONING (1L<<19)
167 #define BIT_SHOWSYSTEMTABLES (1L<<20)
168 #define BIT_SHOWOIDCOLUMN (1L<<21)
169 #define BIT_FAKEOIDINDEX (1L<<22)
170 #define BIT_TRUEISMINUS1 (1L<<23)
171 #define BIT_BYTEAASLONGVARBINARY (1L<<24)
172 #define BIT_USESERVERSIDEPREPARE (1L<<25)
173 #define BIT_LOWERCASEIDENTIFIER (1L<<26)
175 #define EFFECTIVE_BIT_COUNT 27
177 /* Mask for extra options */
178 #define BIT_FORCEABBREVCONNSTR 1L
179 #define BIT_FAKE_MSS (1L << 1)
180 #define BIT_BDE_ENVIRONMENT (1L << 2)
181 #define BIT_CVT_NULL_DATE (1L << 3)
182 #endif
184 /* Connection Defaults */
185 #define DEFAULT_PORT "5432"
186 #define DEFAULT_READONLY 0
188 #if 1
189 #define DEFAULT_PROTOCOL "7.4" /* the latest protocol is
190 * the default */
191 #define DEFAULT_USEDECLAREFETCH 0
192 #define DEFAULT_TEXTASLONGVARCHAR 1
193 #define DEFAULT_UNKNOWNSASLONGVARCHAR 0
194 #define DEFAULT_BOOLSASCHAR 1
195 #define DEFAULT_OPTIMIZER 1 /* disable */
196 #define DEFAULT_KSQO 1 /* on */
197 #define DEFAULT_UNIQUEINDEX 1 /* dont recognize */
198 #define DEFAULT_COMMLOG 0 /* dont log */
199 #define DEFAULT_DEBUG 0
200 #define DEFAULT_UNKNOWNSIZES UNKNOWNS_AS_MAX
203 #define DEFAULT_FAKEOIDINDEX 0
204 #define DEFAULT_SHOWOIDCOLUMN 0
205 #define DEFAULT_ROWVERSIONING 0
206 #define DEFAULT_SHOWSYSTEMTABLES 0 /* dont show system tables */
207 #define DEFAULT_LIE 0
208 #define DEFAULT_PARSE 0
210 #define DEFAULT_CANCELASFREESTMT 0
212 #define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;"
214 #define DEFAULT_DISALLOWPREMATURE 0
215 #define DEFAULT_TRUEISMINUS1 0
216 #define DEFAULT_UPDATABLECURSORS 1
217 #ifdef WIN32
218 #define DEFAULT_LFCONVERSION 1
219 #else
220 #define DEFAULT_LFCONVERSION 0
221 #endif /* WIN32 */
222 #define DEFAULT_INT8AS 0
223 #define DEFAULT_BYTEAASLONGVARBINARY 0
224 #define DEFAULT_USESERVERSIDEPREPARE 0
225 #define DEFAULT_LOWERCASEIDENTIFIER 0
226 #define DEFAULT_SSLMODE "disable"
228 #endif
230 /* prototypes */
231 void getCommonDefaults(const char *section, const char *filename, ConnInfo *ci);
233 #ifdef WIN32
234 void SetDlgStuff(HWND hdlg, const ConnInfo *ci);
235 void GetDlgStuff(HWND hdlg, ConnInfo *ci);
237 LRESULT CALLBACK driver_optionsProc(HWND hdlg,
238 UINT wMsg,
239 WPARAM wParam,
240 LPARAM lParam);
241 LRESULT CALLBACK global_optionsProc(HWND hdlg,
242 UINT wMsg,
243 WPARAM wParam,
244 LPARAM lParam);
245 LRESULT CALLBACK ds_options1Proc(HWND hdlg,
246 UINT wMsg,
247 WPARAM wParam,
248 LPARAM lParam);
249 LRESULT CALLBACK ds_options2Proc(HWND hdlg,
250 UINT wMsg,
251 WPARAM wParam,
252 LPARAM lParam);
253 LRESULT CALLBACK manage_dsnProc(HWND hdlg,
254 UINT wMsg,
255 WPARAM wParam,
256 LPARAM lParam);
257 #endif /* WIN32 */
259 void updateGlobals(void);
260 int writeDriverCommoninfo(const char *fileName, const char *sectionName,
261 const GLOBAL_VALUES *);
262 void writeDSNinfo(const ConnInfo *ci);
263 void getDSNdefaults(ConnInfo *ci);
264 void getDSNinfo(ConnInfo *ci, char overwrite);
265 void makeConnectString(char *connect_string, const ConnInfo *ci, UWORD);
266 BOOL copyAttributes(ConnInfo *ci, const char *attribute, const char *value);
267 BOOL copyCommonAttributes(ConnInfo *ci, const char *attribute, const char *value);
268 int getDriverNameFromDSN(const char *dsn, char *driver_name, int namelen);
269 int changeDriverNameOfaDSN(const char *dsn, const char *driver_name, DWORD *errcode);
271 #ifdef __cplusplus
273 #endif /* __cplusplus */
274 #endif /* __DLG_SPECIFIC_H__ */