1 | /* $Id: db.h,v 1.2 1999-12-06 18:11:50 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 | * Structures and Typedefs *
|
---|
19 | *******************************************************************************/
|
---|
20 | typedef struct _FunctionDescription
|
---|
21 | {
|
---|
22 | /* buffers */
|
---|
23 | char szFnDclBuffer[512];
|
---|
24 | char szFnHdrBuffer[1024];
|
---|
25 |
|
---|
26 | /* function name and type */
|
---|
27 | char *pszName;
|
---|
28 | char *pszReturnType;
|
---|
29 | long lRefCode;
|
---|
30 |
|
---|
31 | /* parameters */
|
---|
32 | int cParams;
|
---|
33 | char *apszParamType[30];
|
---|
34 | char *apszParamName[30];
|
---|
35 |
|
---|
36 | /* authors */
|
---|
37 | int cAuthors;
|
---|
38 | char *apszAuthor[20];
|
---|
39 | long alAuthorRefCode[20];
|
---|
40 |
|
---|
41 | /* status */
|
---|
42 | char *pszStatus;
|
---|
43 | long lStatus;
|
---|
44 | } FNDESC, *PFNDESC;
|
---|
45 |
|
---|
46 |
|
---|
47 | typedef struct _FunctionFindBuffer
|
---|
48 | {
|
---|
49 | unsigned long cFns;
|
---|
50 | signed long alRefCode[10];
|
---|
51 | signed long alDllRefCode[10];
|
---|
52 | } FNFINDBUF, *PFNFINDBUF;
|
---|
53 |
|
---|
54 | typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
|
---|
55 |
|
---|
56 | /*******************************************************************************
|
---|
57 | * Exported Functions *
|
---|
58 | *******************************************************************************/
|
---|
59 | char * _System dbGetLastErrorDesc(void);
|
---|
60 |
|
---|
61 | BOOL _System dbConnect(const char *pszHost, const char *pszUser, const char *pszPassword, const char *pszDatabase);
|
---|
62 | BOOL _System dbDisconnect();
|
---|
63 | signed short _System dbCheckInsertDll(const char *pszDll);
|
---|
64 | unsigned short _System dbGet(const char *pszTable, const char *pszGetColumn,
|
---|
65 | const char *pszMatch1, const char *pszMatchValue1);
|
---|
66 | BOOL _System dbInsertUpdateFunction(unsigned short usDll, const char *pszFunction,
|
---|
67 | unsigned long ulOrdinal, BOOL fIgnoreOrdinal);
|
---|
68 | BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf);
|
---|
69 | signed long _System dbFindAuthor(const char *pszAuthor);
|
---|
70 | signed long _System dbGetFunctionState(signed long lRefCode);
|
---|
71 | unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, char *pszError);
|
---|
72 | unsigned long _System dbCreateHistory(char *pszError);
|
---|
73 | unsigned long _System dbCheckIntegrity(char *pszError);
|
---|
74 |
|
---|
75 | /* kHtml stuff */
|
---|
76 | void * _System dbExecuteQuery(const char *pszQuery);
|
---|
77 | signed long _System dbQueryResultRows(void *pres);
|
---|
78 | BOOL _System dbFreeResult(void *pres);
|
---|
79 | BOOL _System dbFetch(void *pres, DBCALLBACKFETCH dbFetchCallBack, void *pvUser);
|
---|
80 | signed long _System dbDateToDaysAfterChrist(const char *pszDate);
|
---|
81 | BOOL _System dbDaysAfterChristToDate(signed long ulDays, char *pszDate);
|
---|
82 |
|
---|
83 | #ifdef __cplusplus
|
---|
84 | }
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | #pragma pack()
|
---|
88 |
|
---|
89 | #endif
|
---|
90 |
|
---|