1 | /* $Id: db.h,v 1.3 2000-02-11 18:35:54 bird Exp $ */
|
---|
2 | /*
|
---|
3 | * DB - contains all database routines
|
---|
4 | *
|
---|
5 | * Copyright (c) 1999 knut st. osmundsen
|
---|
6 | *
|
---|
7 | */
|
---|
8 | #ifndef _db_h_
|
---|
9 | #define _db_h_
|
---|
10 |
|
---|
11 | #pragma pack(4)
|
---|
12 |
|
---|
13 | #ifdef __cplusplus
|
---|
14 | extern "C" {
|
---|
15 | #endif
|
---|
16 |
|
---|
17 |
|
---|
18 | /*******************************************************************************
|
---|
19 | * Defined Constants *
|
---|
20 | *******************************************************************************/
|
---|
21 | #define NBR_FUNCTIONS 20
|
---|
22 | #define NBR_AUTHORS 20
|
---|
23 |
|
---|
24 | /*******************************************************************************
|
---|
25 | * Structures and Typedefs *
|
---|
26 | *******************************************************************************/
|
---|
27 | typedef struct _FunctionDescription
|
---|
28 | {
|
---|
29 | /* buffers */
|
---|
30 | char szFnDclBuffer[512];
|
---|
31 | char szFnHdrBuffer[1024];
|
---|
32 |
|
---|
33 | /* function name and type */
|
---|
34 | char *pszName;
|
---|
35 | char *pszReturnType;
|
---|
36 | long cRefCodes;
|
---|
37 | long alRefCode[NBR_FUNCTIONS];
|
---|
38 |
|
---|
39 | /* parameters */
|
---|
40 | int cParams;
|
---|
41 | char *apszParamType[30];
|
---|
42 | char *apszParamName[30];
|
---|
43 |
|
---|
44 | /* authors */
|
---|
45 | int cAuthors;
|
---|
46 | char *apszAuthor[NBR_AUTHORS];
|
---|
47 | long alAuthorRefCode[NBR_AUTHORS];
|
---|
48 |
|
---|
49 | /* status */
|
---|
50 | char *pszStatus;
|
---|
51 | long lStatus;
|
---|
52 | } FNDESC, *PFNDESC;
|
---|
53 |
|
---|
54 |
|
---|
55 | typedef struct _FunctionFindBuffer
|
---|
56 | {
|
---|
57 | unsigned long cFns;
|
---|
58 | signed long alRefCode[NBR_FUNCTIONS];
|
---|
59 | signed long alDllRefCode[NBR_FUNCTIONS];
|
---|
60 | } FNFINDBUF, *PFNFINDBUF;
|
---|
61 |
|
---|
62 | typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
|
---|
63 |
|
---|
64 | /*******************************************************************************
|
---|
65 | * Exported Functions *
|
---|
66 | *******************************************************************************/
|
---|
67 | char * _System dbGetLastErrorDesc(void);
|
---|
68 |
|
---|
69 | BOOL _System dbConnect(const char *pszHost,
|
---|
70 | const char *pszUser,
|
---|
71 | const char *pszPassword,
|
---|
72 | const char *pszDatabase);
|
---|
73 | BOOL _System dbDisconnect();
|
---|
74 | signed short _System dbGetDll(const char *pszDllName);
|
---|
75 | signed long _System dbCountFunctionInDll(signed long ulDll);
|
---|
76 |
|
---|
77 | signed short _System dbCheckInsertDll(const char *pszDll);
|
---|
78 | unsigned short _System dbGet(const char *pszTable,
|
---|
79 | const char *pszGetColumn,
|
---|
80 | const char *pszMatch1,
|
---|
81 | const char *pszMatchValue1);
|
---|
82 | BOOL _System dbInsertUpdateFunction(unsigned short usDll,
|
---|
83 | const char *pszFunction,
|
---|
84 | const char *pszIntFunction,
|
---|
85 | unsigned long ulOrdinal,
|
---|
86 | BOOL fIgnoreOrdinal);
|
---|
87 | BOOL _System dbFindFunction(const char *pszFunctionName,
|
---|
88 | PFNFINDBUF pFnFindBuf);
|
---|
89 | signed long _System dbFindAuthor(const char *pszAuthor);
|
---|
90 | signed long _System dbGetFunctionState(signed long lRefCode);
|
---|
91 | unsigned long _System dbUpdateFunction(PFNDESC pFnDesc,
|
---|
92 | char *pszError);
|
---|
93 | unsigned long _System dbCreateHistory(char *pszError);
|
---|
94 | unsigned long _System dbCheckIntegrity(char *pszError);
|
---|
95 |
|
---|
96 | /* kHtml stuff */
|
---|
97 | void * _System dbExecuteQuery(const char *pszQuery);
|
---|
98 | signed long _System dbQueryResultRows(void *pres);
|
---|
99 | BOOL _System dbFreeResult(void *pres);
|
---|
100 | BOOL _System dbFetch(void *pres,
|
---|
101 | DBCALLBACKFETCH dbFetchCallBack,
|
---|
102 | void *pvUser);
|
---|
103 | signed long _System dbDateToDaysAfterChrist(const char *pszDate);
|
---|
104 | BOOL _System dbDaysAfterChristToDate(signed long ulDays,
|
---|
105 | char *pszDate);
|
---|
106 | /* StateUpd stuff */
|
---|
107 | BOOL _System dbGetNotUpdatedFunction(signed long lDll,
|
---|
108 | DBCALLBACKFETCH dbFetchCallBack);
|
---|
109 |
|
---|
110 | #ifdef __cplusplus
|
---|
111 | }
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #pragma pack()
|
---|
115 |
|
---|
116 | #endif
|
---|
117 |
|
---|