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

Last change on this file since 6677 was 6677, checked in by bird, 24 years ago

dll to module conversion.

File size: 8.5 KB
Line 
1/* $Id: db.h,v 1.15 2001-09-07 10:24:07 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 'F' /* for all other functions (ie. OSLibInitWSeBFileIO) */
32#define FUNCTION_METHOD 'M'
33#define FUNCTION_OPERATOR 'O'
34#define FUNCTION_CONSTRUCTOR 'C'
35#define FUNCTION_DESTRUCTOR 'D'
36
37/* type flags of dll */
38#define DLL_ODIN32_API 'A' /* for Odin32 API dll (ie. kernel32) */
39#define DLL_INTERNAL 'I' /* for Internal Odin32 (API) dll (ie. odincrt) */
40#define DLL_SUPPORT 'S' /* for support stuff (ie. pe.exe and win32k.sys). */
41#define DLL_TOOLS 'T' /* for tools (executables and dlls) */
42
43
44/*******************************************************************************
45* Structures and Typedefs *
46*******************************************************************************/
47 typedef struct _FunctionDescription
48 {
49 /* buffers */
50 char szFnDclBuffer[2048];
51 char szFnHdrBuffer[10240];
52
53 /* function name and type */
54 char * pszName;
55 char * pszClass;
56 char fchType; /* function type. */
57 char * pszReturnType;
58 long cRefCodes;
59 long alRefCode[NBR_FUNCTIONS];
60 signed long lImpDll; /* -1 is SQL-NULL, -2 is do not mind, >= 0 ref to dll. */
61
62 /* parameters */
63 int cParams;
64 char * apszParamType[NBR_PARAMETERS];
65 char * apszParamName[NBR_PARAMETERS];
66 char * apszParamDesc[NBR_PARAMETERS];
67
68 /* authors */
69 int cAuthors;
70 char * apszAuthor[NBR_AUTHORS];
71 long alAuthorRefCode[NBR_AUTHORS];
72
73 /* other description fields */
74 char * pszDescription;
75 char * pszRemark;
76 char * pszReturnDesc;
77 char * pszSketch;
78 char * pszEquiv;
79 char * pszTime;
80
81 /* status */
82 char * pszStatus;
83 long lStatus;
84
85 /* file */
86 long lFile; /* File refcode which this function is implemented in. */
87 /* -1 if not valid. */
88 /* line */
89 long lLine; /* Line number of the function start. */
90 } FNDESC, *PFNDESC;
91
92
93 typedef struct _FunctionFindBuffer
94 {
95 unsigned long cFns;
96 signed long alRefCode[NBR_FUNCTIONS];
97 signed long alModRefCode[NBR_FUNCTIONS];
98 signed long alAliasFn[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */
99 signed long alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */
100 char achType[NBR_FUNCTIONS];
101 } FNFINDBUF, *PFNFINDBUF;
102
103 typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
104
105/*******************************************************************************
106* Exported Functions *
107*******************************************************************************/
108 char * _System dbGetLastErrorDesc(void);
109
110 BOOL _System dbConnect(const char *pszHost,
111 const char *pszUser,
112 const char *pszPassword,
113 const char *pszDatabase);
114 BOOL _System dbDisconnect();
115 signed long _System dbGetModule(const char *pszModName);
116 signed long _System dbCountFunctionInModule(signed long lModule,
117 BOOL fNotAliases);
118 //signed long _System dbCheckInsertDll(const char *pszDll, char fchType);
119 signed long _System dbCheckInsertModule(const char *pszModule, char fchType);
120 unsigned short _System dbGet(const char *pszTable,
121 const char *pszGetColumn,
122 const char *pszMatch1,
123 const char *pszMatchValue1);
124 BOOL _System dbInsertUpdateFunction(signed long lModule,
125 const char *pszFunction,
126 const char *pszIntFunction,
127 unsigned long ulOrdinal,
128 BOOL fIgnoreOrdinal,
129 char fchType);
130 BOOL _System dbInsertUpdateFile(signed long lModule,
131 const char *pszFilename,
132 const char *pszDescription,
133 const char *pszLastDateTime,
134 signed long lLastAuthor,
135 const char *pszRevision);
136 BOOL _System dbFindFunction(const char *pszFunctionName,
137 PFNFINDBUF pFnFindBuf,
138 signed long lModule);
139 signed long _System dbFindFile(signed long lModule, const char *pszFilename);
140 signed long _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
141 signed long _System dbGetFunctionState(signed long lRefCode);
142 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc,
143 signed long lModule,
144 char *pszError);
145 BOOL _System dbRemoveDesignNotes(signed long lFile);
146 BOOL _System dbAddDesignNote(signed long lModule,
147 signed long lFile,
148 const char *pszTitle,
149 const char *pszText,
150 signed long lLevel,
151 signed long lSeqNbr,
152 signed long lSeqNbrNote,
153 signed long lLine,
154 BOOL fSubSection,
155 signed long *plRefCode);
156 unsigned long _System dbCreateHistory(char *pszError);
157 unsigned long _System dbCheckIntegrity(char *pszError);
158
159 /* kHtml stuff */
160 void * _System dbExecuteQuery(const char *pszQuery);
161 signed long _System dbQueryResultRows(void *pres);
162 BOOL _System dbFreeResult(void *pres);
163 BOOL _System dbFetch(void *pres,
164 DBCALLBACKFETCH dbFetchCallBack,
165 void *pvUser);
166 signed long _System dbDateToDaysAfterChrist(const char *pszDate);
167 BOOL _System dbDaysAfterChristToDate(signed long ulDays,
168 char *pszDate);
169 /* StateUpd stuff */
170 BOOL _System dbGetNotUpdatedFunction(signed long lModule,
171 DBCALLBACKFETCH dbFetchCallBack);
172 signed long _System dbGetNumberOfUpdatedFunction(signed long lModule);
173
174 /* APIImport stuff */
175 BOOL _System dbClearUpdateFlagFile(signed long lModule);
176 BOOL _System dbClearUpdateFlagFunction(signed long lModule, BOOL fAll);
177 BOOL _System dbDeleteNotUpdatedFiles(signed long lModule);
178 BOOL _System dbDeleteNotUpdatedFunctions(signed long lModule, BOOL fAll);
179
180#ifdef __cplusplus
181}
182#endif
183
184#pragma pack()
185
186#endif
187
Note: See TracBrowser for help on using the repository browser.