summaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/psqlodbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/odbc/psqlodbc.c')
-rw-r--r--src/interfaces/odbc/psqlodbc.c92
1 files changed, 16 insertions, 76 deletions
diff --git a/src/interfaces/odbc/psqlodbc.c b/src/interfaces/odbc/psqlodbc.c
index 08a22a249d2..e5d0d88b8e5 100644
--- a/src/interfaces/odbc/psqlodbc.c
+++ b/src/interfaces/odbc/psqlodbc.c
@@ -1,88 +1,28 @@
-
-/* Module: psqlodbc.c
- *
- * Description: This module contains the main entry point (DllMain) for the library.
- * It also contains functions to get and set global variables for the
- * driver in the registry.
- *
- * Classes: n/a
- *
- * API functions: none
- *
- * Comments: See "notice.txt" for copyright and license information.
- *
- */
+
+/* Module: psqlodbc.c
+ *
+ * Description: This module contains the main entry point (DllMain) for the library.
+ * It also contains functions to get and set global variables for the
+ * driver in the registry.
+ *
+ * Classes: n/a
+ *
+ * API functions: none
+ *
+ * Comments: See "notice.txt" for copyright and license information.
+ *
+ */
#include "psqlodbc.h"
+#include "dlg_specific.h"
#include <winsock.h>
#include <windows.h>
#include <sql.h>
#include <odbcinst.h>
HINSTANCE NEAR s_hModule; /* Saved module handle. */
-GLOBAL_VALUES globals;
-
+GLOBAL_VALUES globals;
-/* This function reads the ODBCINST.INI portion of
- the registry and gets any driver defaults.
-*/
-void getGlobalDefaults(void)
-{
-char temp[128];
-
-
- // Fetch Count is stored in driver section
- SQLGetPrivateProfileString(DBMS_NAME, INI_FETCH, "",
- temp, sizeof(temp), ODBCINST_INI);
- if ( temp[0] )
- globals.fetch_max = atoi(temp);
- else
- globals.fetch_max = FETCH_MAX;
-
-
- // Socket Buffersize is stored in driver section
- SQLGetPrivateProfileString(DBMS_NAME, INI_SOCKET, "",
- temp, sizeof(temp), ODBCINST_INI);
- if ( temp[0] )
- globals.socket_buffersize = atoi(temp);
- else
- globals.socket_buffersize = SOCK_BUFFER_SIZE;
-
-
- // Debug is stored in the driver section
- SQLGetPrivateProfileString(DBMS_NAME, INI_DEBUG, "0",
- temp, sizeof(temp), ODBCINST_INI);
- globals.debug = atoi(temp);
-
-
- // CommLog is stored in the driver section
- SQLGetPrivateProfileString(DBMS_NAME, INI_COMMLOG, "0",
- temp, sizeof(temp), ODBCINST_INI);
- globals.commlog = atoi(temp);
-
-
- // Optimizer is stored in the driver section only (OFF, ON, or ON=x)
- SQLGetPrivateProfileString(DBMS_NAME, INI_OPTIMIZER, "",
- globals.optimizer, sizeof(globals.optimizer), ODBCINST_INI);
-
-
- // ConnSettings is stored in the driver section and per datasource for override
- SQLGetPrivateProfileString(DBMS_NAME, INI_CONNSETTINGS, "",
- globals.conn_settings, sizeof(globals.conn_settings), ODBCINST_INI);
-}
-
-
-/* This function writes any global parameters (that can be manipulated)
- to the ODBCINST.INI portion of the registry
-*/
-void updateGlobals(void)
-{
-char tmp[128];
-
- sprintf(tmp, "%d", globals.commlog);
- SQLWritePrivateProfileString(DBMS_NAME,
- INI_COMMLOG, tmp, ODBCINST_INI);
-}
/* This is where the Driver Manager attaches to this Driver */
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)