DCL 4.0
Loading...
Searching...
No Matches
IFXModuleMain.cpp File Reference
#include <dcl/Config.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.

Functions

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

Variables

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT

Function Documentation

◆ CreateConnectionInstance()

SQL::Connection * CreateConnectionInstance ( )

Definition at line 79 of file IFXModuleMain.cpp.

80{
81 return new IFXConnection(_serverTitle);
82}

◆ ModuleCleanup()

bool ModuleCleanup ( )

Definition at line 120 of file IFXModuleMain.cpp.

121{
122#if defined(__DCL_DEBUG) && defined(_DEBUG) && defined(_WINDOWS)
123 if (__hMSVCRT_DLL) {
124 ::FreeLibrary(__hMSVCRT_DLL);
125 __hMSVCRT_DLL = NULL;
126 }
127#endif
128 return true;
129}
#define NULL
Definition Config.h:340

◆ ModuleInitialize()

bool ModuleInitialize ( )

Definition at line 84 of file IFXModuleMain.cpp.

85{
86 const char* envUTF8 = "en_US.UTF8";
87 char* lang = getenv("LANG");
88 if (!lang) {
89 lang = setlocale(LC_ALL, "");
90 }
91 if (lang) {
92 ByteString s = ByteString(lang).toLowerCase();
93 if (s.contains("ko") || s.contains("kr")) {
94 envUTF8 = "ko_KR.UTF8";
95 }
96 }
97
98 if (setenv("CLIENT_LOCALE", envUTF8, true)) {
99 return false;
100 }
101
102#if defined(__DCL_DEBUG) && defined(_DEBUG) && defined(_WINDOWS)
103 __hMSVCRT_DLL = ::LoadLibrary("MSVCRT.DLL");
104 if (!__hMSVCRT_DLL) {
105 return false;
106 }
107
108 __pfn_free = (__ndebug_free__)
109 ::GetProcAddress(__hMSVCRT_DLL, "free");
110 if (!__pfn_free) {
111 ::FreeLibrary(__hMSVCRT_DLL);
112 __hMSVCRT_DLL = NULL;
113 return false;
114 }
115#endif
116
117 return true;
118}

Variable Documentation

◆ DCL_DSO_ENTRY_POINT

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT
Initial value:
=
{
__T("DCL SQL Driver for IBM Informix Database Server"),
_serverTitle,
__T("4.0.0.0"),
}
#define __TIMESTAMP__
Definition Config.h:215
#define DCL_BUILD_FLAG
Definition Config.h:399
#define DCL_SQL_DRIVER_MODULE
Definition Config.h:390
#define DCL_SQL_VERSION
Definition Config.h:381
#define DCL_VERSION
Definition Config.h:376
bool ModuleInitialize()
bool ModuleCleanup()
SQL::Connection * CreateConnectionInstance()
#define __T(str)
Definition Object.h:44

Definition at line 134 of file IFXModuleMain.cpp.

135{
136 // DCL common members
137 sizeof(SQL::DRIVER_MODULE), // structure size
141 DCL_SQL_DRIVER_MODULE, // module type
142 __T("DCL SQL Driver for IBM Informix Database Server"),
143
144 // private members
146 _serverTitle,
147 __T("4.0.0.0"),
151};