DCL 4.0
Loading...
Searching...
No Matches
PgModuleMain.cpp File Reference
#include <dcl/Config.h>
#include <locale.h>
#include <dcl/_stdlib.h>
#include <dcl/Object.h>
#include <dcl/SQLCore.h>
#include "PgConnection.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 51 of file PgModuleMain.cpp.

52{
53 return new PgConnection(_serverTitle);
54}

◆ ModuleCleanup()

bool ModuleCleanup ( )

Definition at line 73 of file PgModuleMain.cpp.

74{
75#if defined(__DCL_DEBUG) && defined(_DEBUG) && defined(_WINDOWS)
76 if (__hMSVCRT_DLL)
77 {
78 ::FreeLibrary(__hMSVCRT_DLL);
79 __hMSVCRT_DLL = NULL;
80 }
81#endif
82 return true;
83}
#define NULL
Definition Config.h:340

◆ ModuleInitialize()

bool ModuleInitialize ( )

Definition at line 56 of file PgModuleMain.cpp.

57{
58 const char* envUTF8 = "en_US.UTF-8";
59 char* lang = getenv("LANG");
60 if (!lang) {
61 lang = setlocale(LC_ALL, "");
62 }
63 if (lang) {
64 ByteString s = ByteString(lang).toLowerCase();
65 if (s.contains("ko") || s.contains("kr")) {
66 envUTF8 = "ko_KR.UTF-8";
67 }
68 }
69
70 return setenv("_LANG", envUTF8, true) == 0;;
71}

Variable Documentation

◆ DCL_DSO_ENTRY_POINT

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT
Initial value:
=
{
__T("DCL SQL Driver for PostgreSQL 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 88 of file PgModuleMain.cpp.

89{
90 // DCL common members
91 sizeof(SQL::DRIVER_MODULE), // structure size
95 DCL_SQL_DRIVER_MODULE, // module type
96 __T("DCL SQL Driver for PostgreSQL Database Server"),
97
98 // private members
100 _serverTitle,
101 __T("4.0.0.0"),
105};