DCL 3.7.4
Loading...
Searching...
No Matches
PqModuleMain.cpp
Go to the documentation of this file.
1#include <dcl/Config.h>
2
3#ifdef _MSC_VER
4 #pragma comment(lib, "libpq.lib")
5#endif
6
7#include <string.h> // strchr
8#include <locale.h> // setlocale
9#include <dcl/_stdlib.h> // setenv
10
11#include <libpq-fe.h>
12
13#include <dcl/Object.h>
14#if __DCL_HAVE_ALLOC_DEBUG
15#undef __DCL_ALLOC_LEVEL
16#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
17#endif
18
19#include <dcl/SQLCore.h>
20#include "PqConnection.h"
21
22#define __TRACE_THIS 0
23#if __TRACE_THIS
24#define __DCL_TRACE0_N __DCL_TRACE0
25#define __DCL_TRACE1_N __DCL_TRACE1
26#define __DCL_TRACE2_N __DCL_TRACE2
27#define __DCL_TRACE3_N __DCL_TRACE3
28#define __DCL_TRACE4_N __DCL_TRACE4
29#else
30#define __DCL_TRACE0_N(fmt)
31#define __DCL_TRACE1_N(fmt, arg)
32#define __DCL_TRACE2_N(fmt, arg1, arg2)
33#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
34#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)
35#endif
36
37#if __DCL_HAVE_THIS_FILE__
38#undef __THIS_FILE__
39static const char_t __THIS_FILE__[] = __T("dcl/sql/PqModuleMain.cpp");
40#endif
41
42/*
43#ifdef _WINDOWS
44BOOL APIENTRY DllMain( HANDLE hModule,
45 DWORD ul_reason_for_call,
46 LPVOID lpReserved
47)
48{
49 switch (ul_reason_for_call) {
50 case DLL_PROCESS_ATTACH:
51 case DLL_PROCESS_DETACH:
52 return TRUE;
53 case DLL_THREAD_ATTACH:
54 case DLL_THREAD_DETACH:
55 break;
56 }
57 return FALSE;
58}
59#endif
60*/
61
62__DCL_BEGIN_NAMESPACE
63
64static const wchar_t* _serverTitle = __T("PostgreSQL");
65
67{
68 return new PqConnection(_serverTitle);
69}
70
72{
73 return true;
74}
75
77{
78 return true;
79}
80
81extern "C"
82{
85{
86 // DCL common members
87 sizeof(SQL::DRIVER_MODULE), // structure size
91 DCL_SQL_DRIVER_MODULE, // module type
92 __T("DCL SQL Adapter for PostgreSQL Database Server"),
93
94 // private members
96 _serverTitle,
101};
102
103}
104
105__DCL_END_NAMESPACE
106
107#ifdef __WINNT_NEW_DELETE_OVERRIDE
108#undef new
109__WINNT_NEW_DELETE_OVERRIDE
110#endif
#define __THIS_FILE__
Definition _trace.h:14
#define DCL_DSO_ENTRY_POINT
Definition Config.h:356
#define DCL_BUILD_FLAG
Definition Config.h:362
#define DCL_SQL_DRIVER_MODULE
Definition Config.h:353
wchar_t char_t
Definition Config.h:247
#define DCL_DSO_EXPORT
Definition Config.h:99
bool ModuleInitialize()
bool ModuleCleanup()
SQL::Connection * CreateConnectionInstance()
#define __T(str)
Definition Object.h:60
bool ModuleInitialize()
bool ModuleCleanup()
SQL::Connection * CreateConnectionInstance()
#define DCL_SQL_VERSION
#define __BUILD_TIMESTAMP__
#define DCL_VERSION
#define DCL_SQL_VERSION_STRING