source: trunk/tools/database/db.h@ 3883

Last change on this file since 3883 was 3882, checked in by bird, 25 years ago

Corrections and handling of the updated field in function and file.

File size: 7.4 KB
Line 
1/* $Id: db.h,v 1.11 2000-07-21 21:09:45 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
14extern "C" {
15#endif
16
17
18/*******************************************************************************
19* Defined Constants *
20*******************************************************************************/
21#define NBR_PARAMETERS 30
22#define NBR_FUNCTIONS 20
23#define NBR_AUTHORS 20
24
25#define ALIAS_NULL -1
26#define ALIAS_DONTMIND -2
27
28/* type flags of function */
29#define FUNCTION_ODIN32_API 'A' /* for Odin32 APIs (ie. LoadLibrary) */
30#define FUNCTION_INTERNAL_ODIN32_API 'I' /* for Internal/Additional Odin32 APIs (ie. RegisterLxExe) */
31#define FUNCTION_OTHER 'O' /* for all other functions (ie. OSLibInitWSeBFileIO) */
32
33/* type flags of dll */
34#define DLL_ODIN32_API 'A' /* for Odin32 API dll (ie. kernel32) */
35#define DLL_INTERNAL 'I' /* for Internal Odin32 (API) dll (ie. odincrt) */
36#define DLL_SUPPORT 'S' /* for support stuff (ie. pe.exe and win32k.sys). */
37#define DLL_TOOLS 'T' /* for tools (executables and dlls) */
38
39
40/*******************************************************************************
41* Structures and Typedefs *
42*******************************************************************************/
43 typedef struct _FunctionDescription
44 {
45 /* buffers */
46 char szFnDclBuffer[2048];
47 char szFnHdrBuffer[10240];
48
49 /* function name and type */
50 char *pszName;
51 char *pszReturnType;
52 long cRefCodes;
53 long alRefCode[NBR_FUNCTIONS];
54 signed long lImpDll; /* -1 is SQL-NULL, -2 is do not mind, >= 0 ref to dll. */
55
56 /* parameters */
57 int cParams;
58 char *apszParamType[NBR_PARAMETERS];
59 char *apszParamName[NBR_PARAMETERS];
60 char *apszParamDesc[NBR_PARAMETERS];
61
62 /* authors */
63 int cAuthors;
64 char *apszAuthor[NBR_AUTHORS];
65 long alAuthorRefCode[NBR_AUTHORS];
66
67 /* other description fields */
68 char *pszDescription;
69 char *pszRemark;
70 char *pszReturnDesc;
71 char *pszSketch;
72 char *pszEquiv;
73 char *pszTime;
74
75 /* status */
76 char *pszStatus;
77 long lStatus;
78 } FNDESC, *PFNDESC;
79
80
81 typedef struct _FunctionFindBuffer
82 {
83 unsigned long cFns;
84 signed long alRefCode[NBR_FUNCTIONS];
85 signed long alDllRefCode[NBR_FUNCTIONS];
86 signed long alAliasFn[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */
87 signed long alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */
88 } FNFINDBUF, *PFNFINDBUF;
89
90 typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
91
92/*******************************************************************************
93* Exported Functions *
94*******************************************************************************/
95 char * _System dbGetLastErrorDesc(void);
96
97 BOOL _System dbConnect(const char *pszHost,
98 const char *pszUser,
99 const char *pszPassword,
100 const char *pszDatabase);
101 BOOL _System dbDisconnect();
102 signed long _System dbGetDll(const char *pszDllName);
103 signed long _System dbCountFunctionInDll(signed long ulDll,
104 BOOL fNotAliases);
105 signed long _System dbCheckInsertDll(const char *pszDll, char fchType);
106 unsigned short _System dbGet(const char *pszTable,
107 const char *pszGetColumn,
108 const char *pszMatch1,
109 const char *pszMatchValue1);
110 BOOL _System dbInsertUpdateFunction(signed long lDll,
111 const char *pszFunction,
112 const char *pszIntFunction,
113 unsigned long ulOrdinal,
114 BOOL fIgnoreOrdinal,
115 char fchType);
116 BOOL _System dbInsertUpdateFile(signed long lDll,
117 const char *pszFilename,
118 const char *pszDescription,
119 const char *pszLastDateTime,
120 signed long lLastAuthor,
121 const char *pszRevision);
122 BOOL _System dbFindFunction(const char *pszFunctionName,
123 PFNFINDBUF pFnFindBuf,
124 signed long lDll);
125 signed long _System dbFindFile(signed long lDll, const char *pszFilename);
126 signed long _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
127 signed long _System dbGetFunctionState(signed long lRefCode);
128 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc,
129 signed long lDll,
130 char *pszError);
131 BOOL _System dbRemoveDesignNotes(signed long lFile);
132 BOOL _System dbAddDesignNote(signed long lDll,
133 signed long lFile,
134 const char *pszTitle,
135 const char *pszText,
136 signed long lSeqNbr,
137 signed long lSeqNbrFile);
138 unsigned long _System dbCreateHistory(char *pszError);
139 unsigned long _System dbCheckIntegrity(char *pszError);
140
141 /* kHtml stuff */
142 void * _System dbExecuteQuery(const char *pszQuery);
143 signed long _System dbQueryResultRows(void *pres);
144 BOOL _System dbFreeResult(void *pres);
145 BOOL _System dbFetch(void *pres,
146 DBCALLBACKFETCH dbFetchCallBack,
147 void *pvUser);
148 signed long _System dbDateToDaysAfterChrist(const char *pszDate);
149 BOOL _System dbDaysAfterChristToDate(signed long ulDays,
150 char *pszDate);
151 /* StateUpd stuff */
152 BOOL _System dbGetNotUpdatedFunction(signed long lDll,
153 DBCALLBACKFETCH dbFetchCallBack);
154 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll);
155
156 /* APIImport stuff */
157 BOOL _System dbClearUpdateFlagFile(signed long lDll);
158 BOOL _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll);
159 BOOL _System dbDeleteNotUpdatedFiles(signed long lDll);
160 BOOL _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll);
161
162#ifdef __cplusplus
163}
164#endif
165
166#pragma pack()
167
168#endif
169
Note: See TracBrowser for help on using the repository browser.