DCL 3.7.4
Loading...
Searching...
No Matches
SqModuleMain.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 <sqlite3.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 "SqConnection.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/SqModuleMain.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 =
65#ifdef SQLITE_HAS_CODEC
66__T("SQLite3/SQLCipher")
67#else
68__T("SQLite3")
69#endif
70;
71
73{
74 return new SqConnection(_serverTitle);
75}
76
78{
79 return true;
80}
81
83{
84 return true;
85}
86
87extern "C"
88{
91{
92 // DCL common members
93 sizeof(SQL::DRIVER_MODULE), // structure size
97 DCL_SQL_DRIVER_MODULE, // module type
98#ifdef SQLITE_HAS_CODEC
99 __T("DCL SQL Adapter for SQLite3/SQLCipher")
100#else
101 __T("DCL SQL Adapter for SQLite3")
102#endif
103 ,
104
105 // private members
107 _serverTitle,
112};
113
114}
115
116__DCL_END_NAMESPACE
117
118#ifdef __WINNT_NEW_DELETE_OVERRIDE
119#undef new
120__WINNT_NEW_DELETE_OVERRIDE
121#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