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

Last change on this file since 3911 was 3899, checked in by bird, 25 years ago

Updates the file column in the function table.

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