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__
39
static
const
char_t
__THIS_FILE__
[] =
__T
(
"dcl/sql/SqModuleMain.cpp"
);
40
#endif
41
42
/*
43
#ifdef _WINDOWS
44
BOOL 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
64
static
const
wchar_t
* _serverTitle =
65
#ifdef SQLITE_HAS_CODEC
66
__T
(
"SQLite3/SQLCipher"
)
67
#else
68
__T
(
"SQLite3"
)
69
#endif
70
;
71
72
SQL::Connection
*
CreateConnectionInstance
()
73
{
74
return
new
SqConnection
(_serverTitle);
75
}
76
77
bool
ModuleInitialize
()
78
{
79
return
true
;
80
}
81
82
bool
ModuleCleanup
()
83
{
84
return
true
;
85
}
86
87
extern
"C"
88
{
89
DCL_DSO_EXPORT
90
SQL::DRIVER_MODULE
DCL_DSO_ENTRY_POINT
=
91
{
92
// DCL common members
93
sizeof
(
SQL::DRIVER_MODULE
),
// structure size
94
DCL_VERSION
,
95
__T
(
__BUILD_TIMESTAMP__
),
96
DCL_BUILD_FLAG
,
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
106
DCL_SQL_VERSION
,
107
_serverTitle,
108
__T
(
DCL_SQL_VERSION_STRING
),
109
ModuleInitialize
,
110
ModuleCleanup
,
111
CreateConnectionInstance
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
_stdlib.h
__THIS_FILE__
#define __THIS_FILE__
Definition
_trace.h:14
Config.h
DCL_DSO_ENTRY_POINT
#define DCL_DSO_ENTRY_POINT
Definition
Config.h:356
DCL_BUILD_FLAG
#define DCL_BUILD_FLAG
Definition
Config.h:362
DCL_SQL_DRIVER_MODULE
#define DCL_SQL_DRIVER_MODULE
Definition
Config.h:353
char_t
wchar_t char_t
Definition
Config.h:247
DCL_DSO_EXPORT
#define DCL_DSO_EXPORT
Definition
Config.h:99
ModuleInitialize
bool ModuleInitialize()
Definition
IFXModuleMain.cpp:99
ModuleCleanup
bool ModuleCleanup()
Definition
IFXModuleMain.cpp:137
CreateConnectionInstance
SQL::Connection * CreateConnectionInstance()
Definition
IFXModuleMain.cpp:94
Object.h
__T
#define __T(str)
Definition
Object.h:60
SQLCore.h
SqConnection.h
ModuleInitialize
bool ModuleInitialize()
Definition
SqModuleMain.cpp:77
ModuleCleanup
bool ModuleCleanup()
Definition
SqModuleMain.cpp:82
CreateConnectionInstance
SQL::Connection * CreateConnectionInstance()
Definition
SqModuleMain.cpp:72
String.h
SQL::Connection
Definition
SQLCore.h:327
SqConnection
Definition
SqConnection.h:7
DCL_SQL_VERSION
#define DCL_SQL_VERSION
Definition
include/dcl/Version.h:26
__BUILD_TIMESTAMP__
#define __BUILD_TIMESTAMP__
Definition
include/dcl/Version.h:5
DCL_VERSION
#define DCL_VERSION
Definition
include/dcl/Version.h:14
DCL_SQL_VERSION_STRING
#define DCL_SQL_VERSION_STRING
Definition
include/dcl/Version.h:27
SQL::DRIVER_MODULE
Definition
SQLCore.h:460
src
SQLSQLite3
SqModuleMain.cpp
Generated by
1.14.0