DCL 3.7.4
Loading...
Searching...
No Matches
IFXModuleMain.cpp File Reference
#include <dcl/Config.h>
#include <string.h>
#include <locale.h>
#include <dcl/_stdlib.h>
#include <dcl/Object.h>
#include <dcl/SQLCore.h>
#include "IFXConnection.h"
#include "IFXUtils.h"

Go to the source code of this file.

Macros

#define __TRACE_THIS   0
#define __DCL_TRACE0_N(fmt)
#define __DCL_TRACE1_N(fmt, arg)
#define __DCL_TRACE2_N(fmt, arg1, arg2)
#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)

Functions

SQL::ConnectionCreateConnectionInstance ()
bool ModuleInitialize ()
bool ModuleCleanup ()

Variables

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT

Macro Definition Documentation

◆ __DCL_TRACE0_N

#define __DCL_TRACE0_N ( fmt)

Definition at line 32 of file IFXModuleMain.cpp.

◆ __DCL_TRACE1_N

#define __DCL_TRACE1_N ( fmt,
arg )

Definition at line 33 of file IFXModuleMain.cpp.

◆ __DCL_TRACE2_N

#define __DCL_TRACE2_N ( fmt,
arg1,
arg2 )

Definition at line 34 of file IFXModuleMain.cpp.

◆ __DCL_TRACE3_N

#define __DCL_TRACE3_N ( fmt,
arg1,
arg2,
arg3 )

Definition at line 35 of file IFXModuleMain.cpp.

◆ __DCL_TRACE4_N

#define __DCL_TRACE4_N ( fmt,
arg1,
arg2,
arg3,
arg4 )

Definition at line 36 of file IFXModuleMain.cpp.

◆ __TRACE_THIS

#define __TRACE_THIS   0

Definition at line 24 of file IFXModuleMain.cpp.

Function Documentation

◆ CreateConnectionInstance()

SQL::Connection * CreateConnectionInstance ( )

Definition at line 94 of file IFXModuleMain.cpp.

95{
96 return new IFXConnection(_serverTitle);
97}

◆ ModuleCleanup()

bool ModuleCleanup ( )

Definition at line 137 of file IFXModuleMain.cpp.

138{
139#if defined(__DCL_DEBUG) && defined(_DEBUG) && defined(_WINDOWS)
140 if (__hMSVCRT_DLL) {
141 ::FreeLibrary(__hMSVCRT_DLL);
142 __hMSVCRT_DLL = NULL;
143 }
144#endif
145 return true;
146}
#define NULL
Definition Config.h:312

◆ ModuleInitialize()

bool ModuleInitialize ( )

Definition at line 99 of file IFXModuleMain.cpp.

100{
101 const char* langUTF8 = "en_US.UTF8";
102 char* lang = getenv("LANG");
103 if (!lang) {
104 // current locale
105 lang = setlocale(LC_CTYPE, NULL);
106 }
107 if (lang) {
108 ByteString lang_ = ByteString(lang);
109 ByteString lower = lang_.toLowerCase();
110 if (lower.contains("ko") || lower.contains("kr")) {
111 langUTF8 = "ko_KR.UTF8";
112 }
113 }
114 __DCL_TRACE1_N(L"setenv CLIENT_LOCALE=[%hs]\n", langUTF8);
115 if (setenv("CLIENT_LOCALE", langUTF8, 1)) {
116 return false;
117 }
118
119#if defined(__DCL_DEBUG) && defined(_DEBUG) && defined(_WINDOWS)
120 __hMSVCRT_DLL = ::LoadLibrary("MSVCRT.DLL");
121 if (!__hMSVCRT_DLL) {
122 return false;
123 }
124
125 __pfn_free = (__ndebug_free__)
126 ::GetProcAddress(__hMSVCRT_DLL, "free");
127 if (!__pfn_free) {
128 ::FreeLibrary(__hMSVCRT_DLL);
129 __hMSVCRT_DLL = NULL;
130 return false;
131 }
132#endif
133
134 return true;
135}
#define __DCL_TRACE1_N(fmt, arg)

Variable Documentation

◆ DCL_DSO_ENTRY_POINT

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT
Initial value:
=
{
__T("DCL SQL Adapter for IBM Informix Database Server"),
_serverTitle,
}
#define DCL_BUILD_FLAG
Definition Config.h:362
#define DCL_SQL_DRIVER_MODULE
Definition Config.h:353
bool ModuleInitialize()
bool ModuleCleanup()
SQL::Connection * CreateConnectionInstance()
#define __T(str)
Definition Object.h:60
#define DCL_SQL_VERSION
#define __BUILD_TIMESTAMP__
#define DCL_VERSION
#define DCL_SQL_VERSION_STRING

Definition at line 151 of file IFXModuleMain.cpp.

152{
153 // DCL common members
154 sizeof(SQL::DRIVER_MODULE), // structure size
158 DCL_SQL_DRIVER_MODULE, // module type
159 __T("DCL SQL Adapter for IBM Informix Database Server"),
160
161 // private members
163 _serverTitle,
168};