source: trunk/tools/database/db.h

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

New kFile* classes; now in sync with os2tools.

File size: 8.1 KB
RevLine 
[8006]1/* $Id: db.h,v 1.17 2002-02-24 02:58:29 bird Exp $ */
[830]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
[2759]17
[830]18/*******************************************************************************
[2759]19* Defined Constants *
20*******************************************************************************/
[3882]21#define NBR_PARAMETERS 30
22#define NBR_FUNCTIONS 20
23#define NBR_AUTHORS 20
[2759]24
[3882]25#define ALIAS_NULL -1
26#define ALIAS_DONTMIND -2
[2761]27
[3882]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) */
[6678]31#define FUNCTION_OTHER 'O' /* for all other functions (ie. OSLibInitWSeBFileIO) */
[3882]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
[2759]40/*******************************************************************************
[830]41* Structures and Typedefs *
42*******************************************************************************/
43 typedef struct _FunctionDescription
44 {
45 /* buffers */
[3899]46 char szFnDclBuffer[2048];
47 char szFnHdrBuffer[10240];
[830]48
49 /* function name and type */
[3899]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. */
[830]55
56 /* parameters */
[3899]57 int cParams;
58 char * apszParamType[NBR_PARAMETERS];
59 char * apszParamName[NBR_PARAMETERS];
60 char * apszParamDesc[NBR_PARAMETERS];
[830]61
62 /* authors */
[3899]63 int cAuthors;
64 char * apszAuthor[NBR_AUTHORS];
65 long alAuthorRefCode[NBR_AUTHORS];
[830]66
[2818]67 /* other description fields */
[3899]68 char * pszDescription;
69 char * pszRemark;
70 char * pszReturnDesc;
71 char * pszSketch;
72 char * pszEquiv;
73 char * pszTime;
[2818]74
[830]75 /* status */
[3899]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. */
[3917]82 /* line */
83 long lLine; /* Line number of the function start. */
[830]84 } FNDESC, *PFNDESC;
85
86
87 typedef struct _FunctionFindBuffer
88 {
[3899]89 unsigned long cFns;
90 signed long alRefCode[NBR_FUNCTIONS];
[6678]91 signed long alDllRefCode[NBR_FUNCTIONS];
[3899]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. */
[830]94 } FNFINDBUF, *PFNFINDBUF;
95
96 typedef long (_System DBCALLBACKFETCH)(const char*, const char *, void *);
97
98/*******************************************************************************
99* Exported Functions *
100*******************************************************************************/
[3882]101 char * _System dbGetLastErrorDesc(void);
[830]102
[8006]103 KBOOL _System dbConnect(const char *pszHost,
[3882]104 const char *pszUser,
105 const char *pszPassword,
106 const char *pszDatabase);
[8006]107 KBOOL _System dbDisconnect();
[6678]108 signed long _System dbGetDll(const char *pszDllName);
109 signed long _System dbCountFunctionInDll(signed long ulDll,
[8006]110 KBOOL fNotAliases);
[6678]111 signed long _System dbCheckInsertDll(const char *pszDll, char fchType);
[3882]112 unsigned short _System dbGet(const char *pszTable,
113 const char *pszGetColumn,
114 const char *pszMatch1,
115 const char *pszMatchValue1);
[8006]116 KBOOL _System dbInsertUpdateFunction(signed long lDll,
[3882]117 const char *pszFunction,
118 const char *pszIntFunction,
119 unsigned long ulOrdinal,
[8006]120 KBOOL fIgnoreOrdinal,
[3882]121 char fchType);
[8006]122 KBOOL _System dbInsertUpdateFile(signed long lDll,
[3882]123 const char *pszFilename,
124 const char *pszDescription,
125 const char *pszLastDateTime,
126 signed long lLastAuthor,
127 const char *pszRevision);
[8006]128 KBOOL _System dbFindFunction(const char *pszFunctionName,
[3882]129 PFNFINDBUF pFnFindBuf,
[6678]130 signed long lDll);
131 signed long _System dbFindFile(signed long lDll, const char *pszFilename);
[3882]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,
[6678]135 signed long lDll,
[3882]136 char *pszError);
[8006]137 KBOOL _System dbRemoveDesignNotes(signed long lFile);
138 KBOOL _System dbAddDesignNote(signed long lDll,
[3882]139 signed long lFile,
140 const char *pszTitle,
141 const char *pszText,
[6663]142 signed long lLevel,
[3882]143 signed long lSeqNbr,
[6663]144 signed long lSeqNbrNote,
145 signed long lLine,
[8006]146 KBOOL fSubSection,
[6663]147 signed long *plRefCode);
[3882]148 unsigned long _System dbCreateHistory(char *pszError);
149 unsigned long _System dbCheckIntegrity(char *pszError);
[830]150
151 /* kHtml stuff */
[3882]152 void * _System dbExecuteQuery(const char *pszQuery);
153 signed long _System dbQueryResultRows(void *pres);
[8006]154 KBOOL _System dbFreeResult(void *pres);
155 KBOOL _System dbFetch(void *pres,
[3882]156 DBCALLBACKFETCH dbFetchCallBack,
157 void *pvUser);
158 signed long _System dbDateToDaysAfterChrist(const char *pszDate);
[8006]159 KBOOL _System dbDaysAfterChristToDate(signed long ulDays,
[2759]160 char *pszDate);
161 /* StateUpd stuff */
[8006]162 KBOOL _System dbGetNotUpdatedFunction(signed long lDll,
[3882]163 DBCALLBACKFETCH dbFetchCallBack);
[6678]164 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll);
[830]165
[3882]166 /* APIImport stuff */
[8006]167 KBOOL _System dbClearUpdateFlagFile(signed long lDll);
168 KBOOL _System dbClearUpdateFlagFunction(signed long lDll, KBOOL fAll);
169 KBOOL _System dbDeleteNotUpdatedFiles(signed long lDll);
170 KBOOL _System dbDeleteNotUpdatedFunctions(signed long lDll, KBOOL fAll);
[3882]171
[830]172#ifdef __cplusplus
173}
174#endif
175
176#pragma pack()
177
178#endif
179
Note: See TracBrowser for help on using the repository browser.