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

Last change on this file since 6543 was 3917, checked in by bird, 25 years ago

Added line numbers for function and designnote.
Corrected reading of SDS function headers.

File size: 7.9 KB
Line 
1/* $Id: db.h,v 1.13 2000-08-02 02:18:05 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
79 /* file */
80 long lFile; /* File refcode which this function is implemented in. */
81 /* -1 if not valid. */
82 /* line */
83 long lLine; /* Line number of the function start. */
84 } FNDESC, *PFNDESC;
85
86
87 typedef struct _FunctionFindBuffer
88 {
89 unsigned long cFns;
90 signed long alRefCode[NBR_FUNCTIONS];
91 signed long alDllRefCode[NBR_FUNCTIONS];
92 signed long alAliasFn[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */
93 signed long alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */
94 } FNFINDBUF, *PFNFINDBUF;
95
96 typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
97
98/*******************************************************************************
99* Exported Functions *
100*******************************************************************************/
101 char * _System dbGetLastErrorDesc(void);
102
103 BOOL _System dbConnect(const char *pszHost,
104 const char *pszUser,
105 const char *pszPassword,
106 const char *pszDatabase);
107 BOOL _System dbDisconnect();
108 signed long _System dbGetDll(const char *pszDllName);
109 signed long _System dbCountFunctionInDll(signed long ulDll,
110 BOOL fNotAliases);
111 signed long _System dbCheckInsertDll(const char *pszDll, char fchType);
112 unsigned short _System dbGet(const char *pszTable,
113 const char *pszGetColumn,
114 const char *pszMatch1,
115 const char *pszMatchValue1);
116 BOOL _System dbInsertUpdateFunction(signed long lDll,
117 const char *pszFunction,
118 const char *pszIntFunction,
119 unsigned long ulOrdinal,
120 BOOL fIgnoreOrdinal,
121 char fchType);
122 BOOL _System dbInsertUpdateFile(signed long lDll,
123 const char *pszFilename,
124 const char *pszDescription,
125 const char *pszLastDateTime,
126 signed long lLastAuthor,
127 const char *pszRevision);
128 BOOL _System dbFindFunction(const char *pszFunctionName,
129 PFNFINDBUF pFnFindBuf,
130 signed long lDll);
131 signed long _System dbFindFile(signed long lDll, const char *pszFilename);
132 signed long _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
133 signed long _System dbGetFunctionState(signed long lRefCode);
134 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc,
135 signed long lDll,
136 char *pszError);
137 BOOL _System dbRemoveDesignNotes(signed long lFile);
138 BOOL _System dbAddDesignNote(signed long lDll,
139 signed long lFile,
140 const char *pszTitle,
141 const char *pszText,
142 signed long lSeqNbr,
143 signed long lSeqNbrFile,
144 signed long lLine);
145 unsigned long _System dbCreateHistory(char *pszError);
146 unsigned long _System dbCheckIntegrity(char *pszError);
147
148 /* kHtml stuff */
149 void * _System dbExecuteQuery(const char *pszQuery);
150 signed long _System dbQueryResultRows(void *pres);
151 BOOL _System dbFreeResult(void *pres);
152 BOOL _System dbFetch(void *pres,
153 DBCALLBACKFETCH dbFetchCallBack,
154 void *pvUser);
155 signed long _System dbDateToDaysAfterChrist(const char *pszDate);
156 BOOL _System dbDaysAfterChristToDate(signed long ulDays,
157 char *pszDate);
158 /* StateUpd stuff */
159 BOOL _System dbGetNotUpdatedFunction(signed long lDll,
160 DBCALLBACKFETCH dbFetchCallBack);
161 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll);
162
163 /* APIImport stuff */
164 BOOL _System dbClearUpdateFlagFile(signed long lDll);
165 BOOL _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll);
166 BOOL _System dbDeleteNotUpdatedFiles(signed long lDll);
167 BOOL _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll);
168
169#ifdef __cplusplus
170}
171#endif
172
173#pragma pack()
174
175#endif
176
Note: See TracBrowser for help on using the repository browser.