Changeset 6677 for trunk/tools/database
- Timestamp:
- Sep 7, 2001, 12:26:42 PM (24 years ago)
- Location:
- trunk/tools/database
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/APIImport.cpp
r6065 r6677 1 /* $Id: APIImport.cpp,v 1.1 0 2001-06-22 17:07:18bird Exp $ */1 /* $Id: APIImport.cpp,v 1.11 2001-09-07 10:24:05 bird Exp $ */ 2 2 /* 3 3 * … … 92 92 break; 93 93 94 case '-': 94 95 case 'h': 95 96 case 'H': … … 257 258 char achDataBuffer[0x200]; 258 259 char *pszModuleName = &achDataBuffer[0]; 259 signed long l Dll;260 signed long lModule; 260 261 261 262 /* try create file objects */ … … 286 287 287 288 /* find or insert module name */ 288 if ((l Dll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0)289 if ((lModule = dbCheckInsertModule(pszModuleName, DLL_ODIN32_API)) >= 0) 289 290 { 290 291 BOOL fClearUpdateOk = FALSE; … … 294 295 /* Clear the update flag for all functions in this DLL. */ 295 296 if (pOptions->fErase) 296 fClearUpdateOk = dbClearUpdateFlagFunction(l Dll, FALSE);297 fClearUpdateOk = dbClearUpdateFlagFunction(lModule, FALSE); 297 298 298 299 lRc = 0; … … 334 335 else 335 336 { /* Update Database */ 336 fOk = dbInsertUpdateFunction(l Dll,337 fOk = dbInsertUpdateFunction(lModule, 337 338 &szName[0], 338 339 &szIntName[0], … … 358 359 /* Clear the update flag for all functions in this DLL. */ 359 360 if (fClearUpdateOk && pOptions->fErase) 360 if (!dbDeleteNotUpdatedFunctions(l Dll, FALSE))361 if (!dbDeleteNotUpdatedFunctions(lModule, FALSE)) 361 362 { 362 363 fprintf(phLog, "%s: error - dbDeleteNotUpdatedFunctions failed.\n\terror description: %s\n", -
trunk/tools/database/Codes.sql
r3900 r6677 1 -- $Id: Codes.sql,v 1. 1 2000-07-29 21:19:33bird Exp $1 -- $Id: Codes.sql,v 1.2 2001-09-07 10:24:05 bird Exp $ 2 2 -- 3 3 -- Codes. … … 28 28 VALUES ('FTYP', 'I ', 'Internal Odin32 API'); 29 29 INSERT INTO code 30 VALUES ('FTYP', ' O ', 'Other function');30 VALUES ('FTYP', 'F ', 'Some Function'); 31 31 32 INSERT INTO code 33 VALUES ('FTYP', 'M ', 'Class public method'); 34 INSERT INTO code 35 VALUES ('FTYP', 'O ', 'Class operator'); 36 INSERT INTO code 37 VALUES ('FTYP', 'C ', 'Class constructor'); 38 INSERT INTO code 39 VALUES ('FTYP', 'D ', 'Class donstructor'); 32 40 -
trunk/tools/database/CreateTables.sql
r6663 r6677 1 -- $Id: CreateTables.sql,v 1.1 8 2001-09-06 03:07:31bird Exp $1 -- $Id: CreateTables.sql,v 1.19 2001-09-07 10:24:06 bird Exp $ 2 2 -- 3 3 -- Create all tables. … … 55 55 -- 56 56 CREATE TABLE state ( 57 refcode TINYINT NOT NULL PRIMARY KEY,58 color CHAR(7) NOT NULL,59 weight TINYINT NOT NULL,60 name VARCHAR(32) NOT NULL,57 refcode TINYINT NOT NULL PRIMARY KEY, 58 color CHAR(7) NOT NULL, 59 weight TINYINT NOT NULL, 60 name VARCHAR(32) NOT NULL, 61 61 description TEXT NOT NULL, 62 62 UNIQUE u1(refcode), … … 67 67 68 68 -- 69 -- This table holds the dllnames.69 -- This table holds the module names. 70 70 -- Type has these known types: 71 71 -- 'A' for Odin32 API dll … … 74 74 -- 'T' for tools (executables and dlls) 75 75 -- 76 CREATE TABLE dll(77 refcode TINYINTNOT NULL AUTO_INCREMENT PRIMARY KEY,76 CREATE TABLE module ( 77 refcode SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 78 78 name VARCHAR(32) NOT NULL, 79 79 type CHAR NOT NULL DEFAULT 'A', … … 85 85 86 86 -- 87 -- This table holds fileinformation (per dll).87 -- This table holds fileinformation (per module). 88 88 -- 89 89 CREATE TABLE file ( 90 90 refcode INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, 91 dll TINYINT NOT NULL,91 module SMALLINT NOT NULL, 92 92 name VARCHAR(128) NOT NULL, 93 93 lastdatetime DATETIME NOT NULL, … … 97 97 description TEXT, 98 98 UNIQUE u1(refcode), 99 UNIQUE u2( dll, name),99 UNIQUE u2(module, name), 100 100 INDEX i1(name) 101 101 ); … … 112 112 CREATE TABLE designnote ( 113 113 refcode INTEGER NOT NULL AUTO_INCREMENT, 114 dll TINYINT NOT NULL,114 module SMALLINT NOT NULL, 115 115 file INTEGER NOT NULL, 116 116 line INTEGER NOT NULL DEFAULT -1, … … 123 123 UNIQUE u1(refcode, seqnbrnote), 124 124 UNIQUE u2(refcode, seqnbrnote, level), 125 UNIQUE u3( dll, seqnbr, level, seqnbrnote, refcode),125 UNIQUE u3(module, seqnbr, level, seqnbrnote, refcode), 126 126 INDEX i1(file, refcode) 127 127 ); … … 129 129 130 130 -- 131 -- This table holds API information (per dll/ file).131 -- This table holds API information (per module / file). 132 132 -- 133 133 -- Type has these known values: 134 134 -- 'A' for API 135 135 -- 'I' for Internal Odin32 API 136 -- 'F' for All other functions. 137 --- 138 -- 'M' for Class method (?) 139 -- 'O' for Class operator (?) 140 -- 'C' for Class constructor (?) 141 -- 'D' for Class destructor (?) 136 142 -- 137 143 CREATE TABLE function ( 138 144 refcode INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, 139 dll TINYINTNOT NULL,145 module SMALLINT NOT NULL, 140 146 aliasfn INTEGER NOT NULL DEFAULT -1, 141 147 file INTEGER NOT NULL DEFAULT -1, … … 156 162 time TEXT, 157 163 UNIQUE i1(refcode, aliasfn), 158 UNIQUE i1a( dll, aliasfn, refcode),159 UNIQUE i1b(aliasfn, name, dll),160 UNIQUE i1c(aliasfn, intname, dll, refcode),161 UNIQUE i2(name, dll, refcode),162 UNIQUE i3(intname, dll, refcode),163 INDEX i4( dll, file),164 UNIQUE i1a(module, aliasfn, refcode), 165 UNIQUE i1b(aliasfn, name, module, refcode), 166 UNIQUE i1c(aliasfn, intname, module, refcode), 167 UNIQUE i2(name, module, refcode), 168 UNIQUE i3(intname, module, refcode), 169 INDEX i4(module, file), 164 170 INDEX i5(file, refcode), 165 171 INDEX i6(state, file), 166 172 UNIQUE i7(state, refcode), 167 173 UNIQUE i8(refcode, state), 168 UNIQUE i9( dll, state, refcode),169 UNIQUE u1(refcode), 170 UNIQUE u2(name, dll),174 UNIQUE i9(module, state, refcode), 175 UNIQUE u1(refcode), 176 UNIQUE u2(name, module, refcode), 171 177 UNIQUE u3(type, refcode) 172 178 ); … … 177 183 -- 178 184 CREATE TABLE parameter ( 179 function INTEGER NOT NULL,185 function INTEGER NOT NULL, 180 186 sequencenbr TINYINT NOT NULL, 181 name VARCHAR(64) NOT NULL,182 type VARCHAR(64) NOT NULL,187 name VARCHAR(64) NOT NULL, 188 type VARCHAR(64) NOT NULL, 183 189 description TEXT, 184 190 INDEX i1(function, name), … … 191 197 -- 192 198 CREATE TABLE fnauthor ( 193 author SMALLINT NOT NULL,194 function INTEGER NOT NULL,199 author SMALLINT NOT NULL, 200 function INTEGER NOT NULL, 195 201 UNIQUE u1(author, function), 196 202 UNIQUE u2(function, author) … … 202 208 -- 203 209 CREATE TABLE apigroup ( 204 refcode SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,205 dll TINYINT NOT NULL,206 name VARCHAR(64) NOT NULL,210 refcode SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 211 module SMALLINT NOT NULL, 212 name VARCHAR(64) NOT NULL, 207 213 description VARCHAR(128), 208 214 UNIQUE u1(refcode), … … 219 225 220 226 -- 221 -- Status history for dlls. 222 -- 223 CREATE TABLE historydll ( 224 dll TINYINT NOT NULL, 225 state SMALLINT NOT NULL, 226 date DATE NOT NULL, 227 count SMALLINT NOT NULL, 228 UNIQUE u1(dll, state, date) 227 -- Status history for modules. 228 -- 229 CREATE TABLE historymodule ( 230 module SMALLINT NOT NULL, 231 state SMALLINT NOT NULL, 232 date DATE NOT NULL, 233 count SMALLINT NOT NULL, 234 TYPE CHAR NOT NULL DEFAULT 'A', 235 UNIQUE u1(module, state, date) 229 236 ); 230 237 … … 234 241 -- 235 242 CREATE TABLE historyapigroup ( 236 apigroup SMALLINT NOT NULL,237 state SMALLINT NOT NULL,238 date DATENOT NULL,239 count SMALLINT NOT NULL,243 apigroup SMALLINT NOT NULL, 244 state SMALLINT NOT NULL, 245 date DATE NOT NULL, 246 count SMALLINT NOT NULL, 240 247 UNIQUE u1(apigroup, state, date) 241 248 ); … … 243 250 244 251 -- 245 -- Dll API count history. 246 -- 247 CREATE TABLE historydlltotal ( 248 dll SMALLINT NOT NULL, 249 date DATE NOT NULL, 250 totalcount SMALLINT NOT NULL, 251 UNIQUE u1(dll, DATE) 252 -- Module API count history. 253 -- 254 CREATE TABLE historymoduletotal ( 255 module SMALLINT NOT NULL, 256 date DATE NOT NULL, 257 totalcount SMALLINT NOT NULL, 258 type CHAR NOT NULL DEFAULT 'A', 259 UNIQUE u1(module, DATE) 252 260 ); 253 261 … … 257 265 -- 258 266 CREATE TABLE historyapigrouptotal ( 259 apigroup SMALLINT NOT NULL,260 date DATENOT NULL,261 totalcount SMALLINT NOT NULL,267 apigroup SMALLINT NOT NULL, 268 date DATE NOT NULL, 269 totalcount SMALLINT NOT NULL, 262 270 UNIQUE u1(apigroup, date) 263 271 ); … … 314 322 315 323 -- 316 -- This table relates a tgroup with a dll.317 -- 318 CREATE TABLE tgroup dll(324 -- This table relates a tgroup with a module. 325 -- 326 CREATE TABLE tgroupmodule ( 319 327 tgroup SMALLINT NOT NULL, 320 dll TINYINT NOT NULL,321 UNIQUE u1(tgroup, dll)328 module SMALLINT NOT NULL, 329 UNIQUE u1(tgroup, module) 322 330 ); 323 331 -
trunk/tools/database/Makefile
r5530 r6677 1 # $Id: Makefile,v 1.1 7 2001-04-17 00:24:09bird Exp $1 # $Id: Makefile,v 1.18 2001-09-07 10:24:06 bird Exp $ 2 2 3 3 # … … 35 35 mysqladmin DROP Odin32 36 36 mysql < CreateTables.sql 37 mysql < States.sql 38 mysql < Authors.sql 37 mysql $@ < States.sql 38 mysql $@ < Authors.sql 39 mysql $@ < Codes.sql 39 40 -mysqladmin refresh 40 41 -
trunk/tools/database/StateUpd.cpp
r6665 r6677 1 /* $Id: StateUpd.cpp,v 1.3 7 2001-09-06 03:17:37bird Exp $1 /* $Id: StateUpd.cpp,v 1.38 2001-09-07 10:24:06 bird Exp $ 2 2 * 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 8 8 9 9 /******************************************************************************* 10 * Header Files*10 * Defined Constants And Macros * 11 11 *******************************************************************************/ 12 #define DEBUGLOG 1 /* enables debug logging. */ 13 #ifdef DEBUGLOG 14 #define logprintf(a) fprintf a 15 #else 16 #define logprintf(a) ((int)0) 17 #endif 18 12 19 #define INCL_DOSFILEMGR 13 20 #define INCL_DOSERRORS 14 21 #define INCL_DOSMISC 15 22 #define INCL_DOSPROCESS 23 24 25 /******************************************************************************* 26 * Header Files * 27 *******************************************************************************/ 16 28 #include <os2.h> 17 29 #include <malloc.h> … … 24 36 #include "db.h" 25 37 26 27 28 38 /******************************************************************************* 29 39 * Global Variables * 30 40 *******************************************************************************/ 41 #ifdef DEBUGLOG 31 42 static FILE *phLog = NULL; 43 #endif 32 44 static FILE *phSignal = NULL; 33 45 … … 46 58 static void closeLogs(void); 47 59 static unsigned long processDir(const char *pszDirOrFile, POPTIONS pOptions); 48 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions );49 static unsigned long process ModuleHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);60 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions, BOOL fHeader); 61 static unsigned long processFileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 50 62 static unsigned long processDesignNote(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 51 static unsigned long process API(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);63 static unsigned long processFunction(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 52 64 static unsigned long analyseFnHdr(PFNDESC pFnDesc, char **papszLines, int i, const char *pszFilename, POPTIONS pOptions); 53 65 static unsigned long analyseFnDcl(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 54 66 static unsigned long analyseFnDcl2(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 67 static void logFunction(PFNDESC pFnDesc); 68 static char *ResolvSourceFile(char *pszFileObj, char **papszDirs); 55 69 static char *SDSCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL); 56 70 static char *CommonCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL); 57 71 static BOOL isFunction(char **papszLines, int i, POPTIONS pOptions); 58 72 static BOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions); 73 static BOOL isClass(char **papszLines, int i, POPTIONS pOptions); 59 74 static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser); 60 75 static char *skipInsignificantChars(char **papszLines, int &i, char *psz); … … 74 89 static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines); 75 90 static int findStrLine(const char *psz, int iStart, int iEnd, char **papszLines); 91 static void *textbufferCreate(const char *pszFilename); 92 static char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer); 93 static char *textbufferNextLine(void *pvBuffer, register char *psz); 94 static void textbufferDestroy(void *pvBuffer); 95 static signed long fsize(FILE *phFile); 96 static char *fileNameNoExt(const char *pszFilename, char *pszBuffer); 76 97 77 98 … … 87 108 BOOL fFatal = FALSE; 88 109 unsigned long ulRc = 0; 89 char szDLLName[64]; 90 OPTIONS options = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, &szDLLName[0], -1}; 110 char szModName[64]; 111 char * apszDirs[2] = {".", NULL}; 112 OPTIONS options = 113 { FALSE, /* fIntegrityBefore */ 114 FALSE, /* fIntegrityAfter; */ 115 FALSE, /* fIntegrityOnly; */ 116 FALSE, /* fRecursive; */ 117 FALSE, /* fOld; */ 118 FALSE, /* fOS2; */ 119 FALSE, /* fCOMCTL32; */ 120 FALSE, /* fVERSION; */ 121 &szModName[0], /* pszModName; */ 122 ' ', /* chModType; */ 123 -1, /* lModRefcode; */ 124 -1, /* lFileRefcode; */ 125 &apszDirs[0] /* apszDirs; */ 126 }; 91 127 unsigned long ulRc2; 92 128 char *pszErrorDesc = NULL; … … 101 137 /*DosSetPriority(PRTYS_PROCESSTREE, PRTYC_REGULAR, 1, 0);*/ 102 138 103 /* get dllname from directory */139 /* get module name from directory */ 104 140 ul1 = ul2 = 0; 105 141 DosQueryCurrentDisk(&ul1, &ul2); 106 ul2 = sizeof(sz DLLName);107 DosQueryCurrentDir(ul1, &sz DLLName[0], &ul2);142 ul2 = sizeof(szModName); 143 DosQueryCurrentDir(ul1, &szModName[0], &ul2); 108 144 if (ul2 != 0) 109 145 { 110 if (sz DLLName[ul2-1] == '\\' || szDLLName[ul2-1] == '/')111 sz DLLName[--ul2] = '\0';146 if (szModName[ul2-1] == '\\' || szModName[ul2-1] == '/') 147 szModName[--ul2] = '\0'; 112 148 ul1 = ul2; 113 while (ul1 != 0 && sz DLLName[ul1-1] != '\\' && szDLLName[ul1-1] != '/')149 while (ul1 != 0 && szModName[ul1-1] != '\\' && szModName[ul1-1] != '/') 114 150 ul1--; 115 151 if (ul1 != 0) 116 options.psz DLLName = &szDLLName[ul1];152 options.pszModName = &szModName[ul1]; 117 153 } 118 154 else 119 sz DLLName[0] = '\0';155 szModName[0] = '\0'; 120 156 121 157 … … 127 163 * -io Integrity check only. 128 164 * -s Scan subdirectories. 129 * -Old <[+]|-> Old API Style.130 165 * -OS2<[+]|-> Removes 'OS2'-prefix from function name. 131 166 * -COMCTL32<[+]|-> Removes 'COMCTL32'-prefix from function name. 132 167 * -VERSION<[+]|-> Removes 'VERSION'-prefix from function name. 133 * -Dll:<dllname> Name of the dll being processed. 168 * -Mod:<modname> Name of the module being processed. 169 * -Type:<modtype> Module type. default API or whatever is in DB. 134 170 * -d:<dbname> Database name 135 171 * -p:<passwd> Password … … 147 183 case 'D': 148 184 if (strnicmp(&argv[argi][1], "dll:", 4) == 0 ) 149 options.psz DLLName = &argv[argi][5];185 options.pszModName = &argv[argi][5]; 150 186 else 151 187 { … … 157 193 break; 158 194 195 case '-': 159 196 case 'h': 160 197 case 'H': … … 192 229 } 193 230 break; 231 232 case 'm': 233 case 'M': 234 if (strchr(&argv[argi][1], ':')) 235 options.pszModName = strchr(&argv[argi][1], ':') + 1; 236 else 237 { 238 fFatal = TRUE; 239 fprintf(stderr, "warning: option '-mod:' requires a module name.\n"); 240 } 241 break; 242 194 243 195 244 case 'o': … … 217 266 case 'S': 218 267 options.fRecursive = TRUE; 219 fprintf(stderr, "Warning: -s processes subdirs of source for one DLL\n");268 fprintf(stderr, "Warning: -s processes subdirs of source for one module\n"); 220 269 break; 221 270 … … 228 277 break; 229 278 279 case 't': 280 case 'T': 281 if (strchr(&argv[argi][1], ':')) 282 { 283 char ch = *(strchr(&argv[argi][1], ':') + 1); 284 if (strchr("AIST", ch)) 285 options.chModType = ch; 286 else 287 { 288 fFatal = TRUE; 289 fprintf(stderr, "warning: option '-type:' requires type char.\n"); 290 } 291 } 292 else 293 { 294 fFatal = TRUE; 295 fprintf(stderr, "warning: option '-type:' requires type char.\n"); 296 } 297 break; 298 230 299 default: 231 300 fprintf(stderr, "incorrect parameter. (argi=%d, argv[argi]=%s)\n", argi, argv[argi]); … … 234 303 } 235 304 } 305 else if (argv[argi][0] == '@') 306 { /* 307 * Parameter file (debugger parameter length restrictions led to this): 308 * Create a textbuffer. 309 * Parse the file and create a new parameter vector. 310 * Set argv to the new parameter vector, argi to 0 and argc to 311 * the parameter count. 312 * Restrictions: Parameters enclosed in "" is not implemented. 313 * No commandline parameters are processed after the @file 314 */ 315 char *pszBuffer = (char*)textbufferCreate(&argv[argi][1]); /* !ASSUMS! that pvBuffer is the file string! */ 316 if (pszBuffer != NULL) 317 { 318 char **apszArgs = NULL; 319 char *psz = pszBuffer; 320 int i = 0; 321 322 while (*psz != '\0') 323 { 324 /* find end of parameter word */ 325 char *pszEnd = psz + 1; 326 char ch = *pszEnd; 327 while (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r' && ch != '\0') 328 ch = *++pszEnd; 329 330 /* allocate more arg array space? */ 331 if ((i % 512) == 0) 332 { 333 apszArgs = (char**)realloc(apszArgs, sizeof(char*) * (514 + i)); 334 if (apszArgs == NULL) 335 { 336 fprintf(stderr, "error: out of memory. (line=%d)\n", __LINE__); 337 return -8; 338 } 339 } 340 *pszEnd = '\0'; 341 apszArgs[i++] = psz; 342 343 /* next */ 344 psz = pszEnd + 1; 345 ch = *psz; 346 while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') 347 ch = *++psz; 348 } 349 350 argc = i; 351 argi = 0; 352 argv = apszArgs; 353 apszArgs[argc] = NULL; 354 continue; 355 } 356 else 357 { 358 fprintf(stderr, "error: could not open parameter file\n"); 359 return -1; 360 } 361 break; 362 } 236 363 else 237 364 break; /* files has started */ … … 266 393 } 267 394 395 268 396 if (!options.fIntegrityOnly) 269 397 { 270 /* find dll */ 271 options.lDllRefcode = dbGetDll(options.pszDLLName); 272 fprintf(phLog, "DLL: refcode=%d, name=%s\n", options.lDllRefcode, options.pszDLLName); 273 if (options.lDllRefcode >= 0) 398 /* add/update module */ 399 if (options.chModType != ' ' && options.pszModName) 400 dbCheckInsertModule(options.pszModName, options.chModType); 401 402 /* find module */ 403 options.lModRefcode = dbGetModule(options.pszModName); 404 logprintf((phLog, "Module: refcode=%d, name=%s\n", options.lModRefcode, options.pszModName)); 405 if (options.lModRefcode >= 0) 274 406 { 275 407 /* processing */ … … 277 409 ulRc = processDir(".", &options); 278 410 else 279 while (arg v[argi] != NULL)411 while (argi < argc) 280 412 { 281 ulRc += processDir(argv[argi], &options); 413 char * pszDirOrFile = argv[argi]; 414 int cchDirOrFile = strlen(pszDirOrFile); 415 416 if (cchDirOrFile > 4 && !stricmp(pszDirOrFile + cchDirOrFile - 4, ".obj") ) /* check for .obj */ 417 { 418 pszDirOrFile = ResolvSourceFile(pszDirOrFile, options.papszDirs); 419 if (!pszDirOrFile) 420 { 421 /* 422 * Ignore dllentry. 423 */ 424 if (!stristr(argv[argi], "dllentry")) 425 { 426 fprintf(phSignal, "%s: Failed to resolve source file\n", argv[argi]); 427 ulRc += 0x00010000; 428 } 429 argi++; 430 break; 431 } 432 } 433 ulRc += processDir(pszDirOrFile, &options); 282 434 argi++; 283 435 } … … 309 461 } 310 462 else 311 { /* failed to find dll- concidered nearly fatal. */312 fprintf(phSignal, "-,-: failed to find dll(%s)!\n\t%s\n",313 options.psz DLLName ? options.pszDLLName : "<NULL>",463 { /* failed to find module - concidered nearly fatal. */ 464 fprintf(phSignal, "-,-: failed to find module (%s)!\n\t%s\n", 465 options.pszModName ? options.pszModName : "<NULL>", 314 466 dbGetLastErrorDesc()); 315 467 ulRc++; … … 320 472 if (!options.fIntegrityOnly) 321 473 { 322 cUpdated = dbGetNumberOfUpdatedFunction(options.l DllRefcode);323 cAll = dbCountFunctionIn Dll(options.lDllRefcode, FALSE);324 cNotAliased = dbCountFunctionIn Dll(options.lDllRefcode, TRUE);474 cUpdated = dbGetNumberOfUpdatedFunction(options.lModRefcode); 475 cAll = dbCountFunctionInModule(options.lModRefcode, FALSE); 476 cNotAliased = dbCountFunctionInModule(options.lModRefcode, TRUE); 325 477 if (cNotAliased > cUpdated) 326 478 { … … 329 481 ulRc += 0x00010000; 330 482 } 331 fprintf(phLog, "-------------------------------------------------\n");332 fprintf(phLog, "-------- Functions which was not updated --------\n");333 dbGetNotUpdatedFunction(options.l DllRefcode, dbNotUpdatedCallBack);334 fprintf(phLog, "-------------------------------------------------\n");335 fprintf(phLog, "-------------------------------------------------\n\n");336 fprintf(phLog,"Number of function in this DLL: %4ld (%ld)\n", cAll, cNotAliased);337 fprintf(phLog,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);338 } 339 fprintf(phLog,"Number of signals: %4ld\n", (long)(ulRc >> 16));483 logprintf((phLog, "------------------------------------------------------\n")); 484 logprintf((phLog, "-------- Functions which was not updated -------------\n")); 485 dbGetNotUpdatedFunction(options.lModRefcode, dbNotUpdatedCallBack); 486 logprintf((phLog, "------------------------------------------------------\n")); 487 logprintf((phLog, "------------------------------------------------------\n\n")); 488 logprintf((phLog,"Number of function in this module: %4ld (%ld)\n", cAll, cNotAliased)); 489 logprintf((phLog,"Number of successfully processed functions: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated)); 490 } 491 logprintf((phLog, "Number of signals: %4ld\n", (long)(ulRc >> 16))); 340 492 341 493 /* close the logs */ … … 348 500 if (!options.fIntegrityOnly) 349 501 { 350 fprintf(stdout,"Number of function in this DLL:%4ld (%ld)\n", cAll, cNotAliased);351 fprintf(stdout,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);352 } 353 fprintf(stdout, "Number of signals:%4ld\n", (long)(ulRc >> 16));502 fprintf(stdout,"Number of function in this module: %4ld (%ld)\n", cAll, cNotAliased); 503 fprintf(stdout,"Number of successfully processed functions: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated); 504 } 505 fprintf(stdout, "Number of signals: %4ld\n", (long)(ulRc >> 16)); 354 506 if ((int)(ulRc >> 16) > 0) 355 507 fprintf(stderr, "Check signal file 'Signals.Log'.\n"); … … 376 528 " -io Integrity check only. default: disabled\n" 377 529 " -s Scan subdirectories. default: disabled\n" 378 " -Old Use old API style. default: disabled\n"379 530 " -OS2 Ignore 'OS2'-prefix on APIs. default: disabled\n" 380 " -Dll:<dllname> Name of the dll. default: currentdirname\n" 531 " -Mod:<modname> Name of the module. default: currentdirname\n" 532 " -Type:<type> Module type. AIST. default: read database\n" 381 533 " -h:<hostname> Database server hostname. default: localhost\n" 382 534 " -u:<username> Username on the server. default: root\n" … … 402 554 static void openLogs(void) 403 555 { 556 #ifdef DEBUGLOG 404 557 if (phLog == NULL) 405 558 { … … 411 564 } 412 565 } 566 #endif 413 567 414 568 if (phSignal == NULL) … … 429 583 static void closeLogs(void) 430 584 { 585 #ifdef DEBUGLOG 431 586 if (phLog != stderr && phLog != NULL) 432 587 fclose(phLog); 588 #endif 433 589 if (phSignal != stdout && phSignal != NULL) 434 590 { … … 473 629 rc = DosQueryPathInfo(pszDirOrFile, FIL_STANDARD, &fs , sizeof(fs)); 474 630 fFile = rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY; 631 if (!fFile) 632 fFile = strpbrk(pszDirOrFile, "*?") != NULL; 475 633 476 634 /* 0. */ … … 510 668 char *psz = strrchr(&ffb.achName[0], '.'); 511 669 if (psz != NULL && (!stricmp(psz, ".cpp") || !stricmp(psz, ".c"))) 512 ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions); 670 ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions, FALSE); 671 else if (psz != NULL && (!stricmp(psz, ".h") || !stricmp(psz, ".hpp"))) 672 ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions, TRUE); 513 673 514 674 /* next */ … … 551 711 /** 552 712 * Processes a file. 553 * @returns high word = number of signals 554 * low word = number of APIs processed. (1 or 0). 555 * @param pszFilename Filename 556 * @param pOptions Pointer to options. 713 * @returns high word = number of signals 714 * low word = number of APIs processed. (1 or 0). 715 * @param pszFilename Filename 716 * @param pOptions Pointer to options. 717 * @param fHeader Flags if we're processing a header file or not. 557 718 * @sketch 1. read file into memory. 558 719 * 2. create line array. 559 720 * (3. simple preprocessing - TODO) 560 * 4. process module header.721 * 4. process file header. 561 722 * 5. scan thru the line array, looking for APIs and designnotes. 562 723 * 5b. when API is found, process it. 563 724 * 5c. when designnote found, process it. 564 725 */ 565 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions )726 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions, BOOL fHeader) 566 727 { 567 728 unsigned long cSignals = 0; … … 569 730 char *pszFile; 570 731 571 fprintf(phLog, "Processing '%s':\n", pszFilename); 572 /* 1.*/ 732 logprintf((phLog, "Processing '%s':\n", pszFilename)); 733 734 /* 735 * (1) Read file into memory 736 */ 573 737 pszFile = readFileIntoMemory(pszFilename); 574 738 if (pszFile != NULL) … … 576 740 char **papszLines; 577 741 578 /* 2.*/ 742 /* 743 * (2) Create line array. 744 */ 579 745 papszLines = createLineArray(pszFile); 580 746 if (papszLines != NULL) … … 583 749 int i = 0; 584 750 585 /* 3. - TODO */ 586 587 /* 4. */ 588 ulRc = processModuleHeader(papszLines, i, i, pszFilename, pOptions); 751 /* 752 * 3. Simple preprocessing - TODO 753 */ 754 755 756 /* 757 * (4) Process the file header. 758 */ 759 ulRc = processFileHeader(papszLines, i, i, pszFilename, pOptions); 589 760 cSignals += ulRc >> 16; 590 761 if (ulRc & 0x0000ffff) 591 762 { 592 /* 4b.593 * Remove Design notes.763 /* 764 * (4b) Remove Design notes. 594 765 */ 595 pOptions->lSeqFile = 0;596 766 if (!dbRemoveDesignNotes(pOptions->lFileRefcode)) 597 767 { … … 602 772 603 773 604 /* 5.*/ 774 /* 775 * (5) The scan loop. 776 */ 605 777 while (papszLines[i] != NULL) 606 778 { 779 /* 780 * (5b) Function. 781 */ 607 782 if (isFunction(papszLines, i, pOptions)) 608 783 { 609 ulRc = process API(papszLines, i, i, pszFilename, pOptions);784 ulRc = processFunction(papszLines, i, i, pszFilename, pOptions); 610 785 cAPIs += 0x0000ffff & ulRc; 611 786 cSignals += ulRc >> 16; 612 787 } 613 else 788 /* 789 * (5c) Design note. 790 */ 791 else if (isDesignNote(papszLines, i, pOptions)) 614 792 { 615 if (isDesignNote(papszLines, i, pOptions)) 616 { 617 ulRc = processDesignNote(papszLines, i, i, pszFilename, pOptions); 618 cSignals += ulRc >> 16; 619 } 793 ulRc = processDesignNote(papszLines, i, i, pszFilename, pOptions); 794 cSignals += ulRc >> 16; 795 } 796 /* 797 * (5d) Class detection (experimental) 798 */ 799 #ifdef DEBUGLOG 800 else if (isClass(papszLines, i, pOptions)) 801 { 802 logprintf((phLog, "Found class at line %d. %s\n", i, papszLines[i])); 620 803 i++; 621 804 } 622 } 623 } 624 805 #endif 806 /* 807 * Nothing. 808 */ 809 else 810 i++; 811 } /* while - scan loop */ 812 } 813 814 /* 815 * Cleanup. 816 */ 625 817 free(papszLines); 626 818 } … … 637 829 cSignals++; 638 830 } 639 fprintf(phLog, "Processing of '%s' is completed.\n\n", pszFilename); 640 831 logprintf((phLog, "Processing of '%s' is completed.\n\n", pszFilename)); 832 833 fHeader = fHeader; 641 834 642 835 return (unsigned long)((cSignals << 16) | cAPIs); … … 645 838 646 839 /** 647 * Processes an module header and other file information.840 * Processes an file header and other file information. 648 841 * @returns high word = number of signals. 649 842 * low word = Success indicator (TRUE / FALSE). … … 655 848 * @sketch Extract module information if any.... 656 849 */ 657 static unsigned long process ModuleHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)658 { 659 char szDescription[10240]; /* File description buffer. */660 char szId[128]; /* CVS Id keyword buffer. */661 char * psz, *psz2;850 static unsigned long processFileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions) 851 { 852 char szDescription[10240]; /* File description buffer. */ 853 char szId[128]; /* CVS Id keyword buffer. */ 854 char * psz, *psz2; 662 855 const char * pszDBFilename; 663 856 char * pszLastDateTime = NULL; … … 783 976 * Insert or update the database. 784 977 */ 785 if (dbInsertUpdateFile((unsigned short)pOptions->l DllRefcode, pszDBFilename,978 if (dbInsertUpdateFile((unsigned short)pOptions->lModRefcode, pszDBFilename, 786 979 &szDescription[0], pszLastDateTime, lLastAuthor, pszRevision)) 787 980 { … … 789 982 * Get file refcode. 790 983 */ 791 pOptions->lFileRefcode = dbFindFile(pOptions->l DllRefcode, pszDBFilename);984 pOptions->lFileRefcode = dbFindFile(pOptions->lModRefcode, pszDBFilename); 792 985 if (pOptions->lFileRefcode < 0) 793 986 { … … 933 1126 * Add the note. 934 1127 */ 935 if (!dbAddDesignNote(pOptions->l DllRefcode, pOptions->lFileRefcode,1128 if (!dbAddDesignNote(pOptions->lModRefcode, pOptions->lFileRefcode, 936 1129 pszTitle, psz, 937 1130 lLevel, lSeqNbr, lSeqNbrNote++, i + 1, lLevel > 0, &lRefCode)) … … 970 1163 971 1164 /** 972 * Processes an APIfunction.1165 * Processes an function. 973 1166 * @returns high word = number of signals 974 1167 * low word = number of APIs processed. (1 or 0). … … 979 1172 * @param pOptions Pointer to options. 980 1173 */ 981 static unsigned long process API(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)1174 static unsigned long processFunction(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions) 982 1175 { 983 1176 unsigned long ulRc; … … 999 1192 */ 1000 1193 1001 /* 1.*/ 1194 /* 1195 * (1) Analyse function declaration. 1196 */ 1002 1197 ulRc = analyseFnDcl(&FnDesc, papszLines, i, iRet, pszFilename, pOptions); 1003 1198 if (0x0000ffff & ulRc) /* if low word is 0 the fatal */ 1004 1199 { 1005 unsigned long ulRcTmp; 1006 //char szErrorDesc[2113]; /* due to some limitation in the latest EMX release size is 2112 and not 4096 as initially implemented. */ 1007 char *pszErrorDesc = (char*)malloc(20480); 1008 1009 /* 2.*/ 1200 unsigned long ulRcTmp; 1201 char * pszErrorDesc = (char*)malloc(20480); 1202 1203 /* 1204 * (2) Analyse function header. 1205 */ 1010 1206 ulRcTmp = analyseFnHdr(&FnDesc, papszLines, i, pszFilename, pOptions); 1011 1207 if (ulRcTmp == ~0UL) /* check for fatal error */ 1208 { 1209 free(pszErrorDesc); 1012 1210 return (0xffff0000UL & ulRc) + 0x00010000UL; 1211 } 1013 1212 ulRc += 0xffff0000UL & ulRcTmp; 1014 1213 1015 /* 3.*/ 1016 fprintf(phLog, "Name: '%s' (refcodes=", FnDesc.pszName); 1017 for (j = 0; j < FnDesc.cRefCodes; j++) 1018 fprintf(phLog, j > 0 ? ", %ld" : "%ld", FnDesc.alRefCode[j]); 1019 fprintf(phLog, ")\n"); 1020 fprintf(phLog, " Returns: '%s'\n", FnDesc.pszReturnType != NULL ? FnDesc.pszReturnType : "<missing>"); 1021 fprintf(phLog, " cParams: %2d\n", FnDesc.cParams); 1022 for (j = 0; j < FnDesc.cParams; j++) 1023 fprintf(phLog, " Param %2d: type '%s' %*s name '%s' description: %s\n", j, FnDesc.apszParamType[j], 1024 max((int)(15 - strlen(FnDesc.apszParamType[j])), 0), "", FnDesc.apszParamName[j], 1025 FnDesc.apszParamDesc[j] != NULL ? FnDesc.apszParamDesc[j] : "(null)"); 1026 fprintf(phLog, " Status: %ld - '%s'\n", FnDesc.lStatus, FnDesc.pszStatus != NULL ? FnDesc.pszStatus : "<missing>"); 1027 fprintf(phLog, " cAuthors: %2d\n", FnDesc.cAuthors); 1028 for (j = 0; j < FnDesc.cAuthors; j++) 1029 fprintf(phLog, " Author %d: '%s' (refcode=%ld)\n", j, FnDesc.apszAuthor[j], FnDesc.alAuthorRefCode[j]); 1030 1031 fprintf(phLog, " Description: %s\n", FnDesc.pszDescription != NULL ? FnDesc.pszDescription : "(null)"); 1032 fprintf(phLog, " Remark: %s\n", FnDesc.pszRemark != NULL ? FnDesc.pszRemark : "(null)"); 1033 fprintf(phLog, " Return Desc: %s\n", FnDesc.pszReturnDesc != NULL ? FnDesc.pszReturnDesc : "(null)"); 1034 fprintf(phLog, " Sketch: %s\n", FnDesc.pszSketch != NULL ? FnDesc.pszSketch : "(null)"); 1035 fprintf(phLog, " Equiv: %s\n", FnDesc.pszEquiv != NULL ? FnDesc.pszEquiv : "(null)"); 1036 fprintf(phLog, " Time: %s\n", FnDesc.pszTime != NULL ? FnDesc.pszTime : "(null)"); 1037 fprintf(phLog, "------------\n"); 1038 1039 /* 4.*/ 1040 ulRcTmp = dbUpdateFunction(&FnDesc, pOptions->lDllRefcode, pszErrorDesc); 1214 /* 1215 * (3) Log data (for debug purpose). 1216 */ 1217 logFunction(&FnDesc); 1218 1219 /* 1220 * (4) Update database. 1221 */ 1222 ulRcTmp = dbUpdateFunction(&FnDesc, pOptions->lModRefcode, pszErrorDesc); 1041 1223 if (ulRcTmp != 0) 1042 1224 { … … 1064 1246 const char *pszFilename, POPTIONS pOptions) 1065 1247 { 1066 static long lPrevFnDll = -1L; /* fix for duplicate dlls */1067 1248 unsigned long ulRc; 1068 1249 FNFINDBUF FnFindBuf; … … 1070 1251 1071 1252 /* brief algorithm: 1072 * 1. read function declaration using analyseFnDcl2. 1073 * 2. apply name rules. 1074 * 3. do a database lookup on the name. 1075 * 3b. if more that one match, write a signal. (TODO: a simple fix is done, but there are holes.) 1253 * 1. Read function declaration using analyseFnDcl2. 1254 * 2. Apply name rules. 1255 * 3. Do a database lookup on the name. 1256 * 3b. If more that one match, write a signal. (TODO: a simple fix is done, but there are holes.) 1257 * 4. if not found then add the function as other (type=O). Only do this if we know which module we're in. 1258 * 4b. do 3. 1076 1259 */ 1077 1260 1078 /* 1. */ 1261 /* 1262 * (1) Read function declaration using analyseFnDcl2. 1263 */ 1079 1264 ulRc = analyseFnDcl2(pFnDesc, papszLines, i, iRet, pszFilename, pOptions); 1080 1265 if (ulRc != 1) 1081 1266 return ulRc; 1082 1267 1083 /* 2. */ 1268 /* 1269 * (2) Apply name rules (if api only?). 1270 */ 1084 1271 if (pOptions->fOS2 && strncmp(pFnDesc->pszName, "OS2", 3) == 0) 1085 1272 pFnDesc->pszName += 3; … … 1091 1278 pFnDesc->pszName += 3; 1092 1279 1093 /* 3. */ 1094 if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lDllRefcode)) 1280 /* 1281 * (3) Do a database lookup on the name. 1282 */ 1283 if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lModRefcode)) 1095 1284 { 1096 1285 fprintf(phSignal, "%s, %s: error occured while reading from database, %s\n", … … 1102 1291 if (FnFindBuf.cFns != 0) 1103 1292 { 1104 if (pOptions->l DllRefcode < 0)1293 if (pOptions->lModRefcode < 0) 1105 1294 { 1106 1295 if (FnFindBuf.cFns > 1) 1107 1296 { 1108 fprintf(phSignal, "%s: unknown dlland more than two occurences of this function!\n", pszFilename);1297 fprintf(phSignal, "%s: unknown module and more than two occurences of this function!\n", pszFilename); 1109 1298 return 0x00010000; 1110 1299 } 1111 pOptions->l DllRefcode = FnFindBuf.alDllRefCode[0];1112 fprintf(phLog, "DllRef = %d\n", pOptions->lDllRefcode);1300 pOptions->lModRefcode = FnFindBuf.alModRefCode[0]; 1301 logprintf((phLog, "ModRef = %d\n", pOptions->lModRefcode)); 1113 1302 } 1114 1303 … … 1117 1306 1118 1307 if (pFnDesc->cRefCodes == 0) 1119 fprintf(phLog, "%s was not an API in this dll(%d)!\n", pFnDesc->pszName, pOptions->lDllRefcode);1308 logprintf((phLog, "%s was not an API in this module(%d)!\n", pFnDesc->pszName, pOptions->lModRefcode)); 1120 1309 } 1121 1310 else 1122 fprintf(phLog, "%s was not an API\n", pFnDesc->pszName); 1311 logprintf((phLog, "%s was not an API\n", pFnDesc->pszName)); 1312 1313 /* 1314 * (4) If not found then add the function as other (type=O). 1315 * Only do this if we know which module we're in. 1316 */ 1317 if (FnFindBuf.cFns == 0 || pFnDesc->cRefCodes == 0 && pOptions->lModRefcode >= 0) 1318 { 1319 if (!dbInsertUpdateFunction(pOptions->lModRefcode, 1320 pFnDesc->pszName, pFnDesc->pszName, 1321 -1, TRUE, FUNCTION_OTHER)) 1322 { 1323 fprintf(phSignal, "%s, %s: error occured inserting new function, %s\n", 1324 pszFilename, pFnDesc->pszName, dbGetLastErrorDesc()); 1325 return 0x00010000; 1326 } 1327 1328 if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lModRefcode)) 1329 { 1330 fprintf(phSignal, "%s, %s: error occured while reading from database, %s\n", 1331 pszFilename, pFnDesc->pszName, dbGetLastErrorDesc()); 1332 return 0x00010000; 1333 } 1334 1335 for (lFn = 0; lFn < FnFindBuf.cFns; lFn++) 1336 pFnDesc->alRefCode[pFnDesc->cRefCodes++] = FnFindBuf.alRefCode[lFn]; 1337 1338 if (pFnDesc->cRefCodes == 0) 1339 { 1340 fprintf(phSignal, "%s, %s: Function was not found even though it was just added.\n", 1341 pszFilename, pFnDesc->pszName); 1342 return 0x00010000; 1343 } 1344 } 1123 1345 1124 1346 ulRc = pFnDesc->cRefCodes; … … 1143 1365 { 1144 1366 /** @sketch 1145 * 1. find the '(' 1146 * 2. find the word ahead of the '(', this is the function name. 1147 * 2a. class test. 1148 * 3. find the closing ')' 1149 * 4. copy the parameters, which is between the two '()' 1150 * 5. format the parameters 1367 * 1. Find the '(' 1368 * 2. Find the word ahead of the '(', this is the function name. 1369 * 2a. Class test. 1370 * 3. Find the closing ')' 1371 * 4. Copy the parameters, which is between the two '()' 1372 * 5. Format the parameters 1373 * 6. Return type, function name and arguments. 1374 * Check for the ODINFUNCTION macro. 1151 1375 */ 1152 1376 … … 1171 1395 } 1172 1396 1173 /* 2. */ 1397 /* 1398 * (2) find the word ahead of the '(', this is the function name. 1399 */ 1174 1400 iFn = iP1; 1175 1401 if (papszLines[iFn] != pszP1) … … 1199 1425 pszFn = findStartOfWord(pszFn, papszLines[iFn]); 1200 1426 1201 /* 2a. */ 1427 /* 1428 * (2a) class test. 1429 */ 1202 1430 /* operators are not supported (BOOL kTime::operator > (const kTime &time) const) */ 1203 1431 if (pszFn > papszLines[iFn]) … … 1225 1453 pszClass = pszClassEnd = NULL; 1226 1454 1227 /* 3. */ 1455 /* 1456 * (3) find the closing ')' 1457 */ 1228 1458 c = 1; 1229 1459 iP2 = iP1; … … 1243 1473 iRet = iP2 + 1; //assumes: only one function on a single line! 1244 1474 1245 /* 4. */ 1475 /* 1476 * (4) Copy the parameters, which is between the two '()' 1477 */ 1246 1478 psz = pFnDesc->szFnDclBuffer; 1247 1479 copy(pFnDesc->szFnDclBuffer, pszP1, iP1, pszP2, iP2, papszLines); 1248 1480 pszEnd = psz + strlen(psz) + 1; 1249 1481 1250 /* 5.*/ 1482 /* 1483 * (5) Format the parameters. 1484 */ 1251 1485 cArgs = 0; 1252 1486 if (stricmp(psz, "(void)") != 0 && strcmp(psz, "()") != 0 && strcmp(psz, "( )")) … … 1275 1509 } 1276 1510 1277 /* 6. */ 1511 /* 1512 * (6) Return type, function name and arguments. 1513 * Check for the ODINFUNCTION macro. 1514 */ 1278 1515 if (strnicmp(pszFn, "ODINFUNCTION", 12) == 0 || strnicmp(pszFn, "ODINPROCEDURE", 13) == 0) 1279 1516 { … … 1325 1562 /* FIXME LATER! Some constructors calling baseclass constructors "breaks" this rule. Win32MDIChildWindow in /src/user32/win32wmdichild.cpp for example. */ 1326 1563 fprintf(phSignal,"Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd)); 1327 fprintf(phLog, "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd));1564 logprintf((phLog, "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd))); 1328 1565 if (strlen(pszEnd) > 512) 1329 1566 fprintf(stderr, "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd)); 1567 #ifdef DEBUGLOG 1330 1568 fflush(phLog); 1569 #endif 1331 1570 fflush(phSignal); 1332 1571 fflush(stderr); … … 1339 1578 /* !BugFix! some function occur more than once, usually as inline functions */ 1340 1579 if (pFnDesc->pszReturnType != NULL 1341 && strstr(pFnDesc->pszReturnType, "inline ") != NULL) 1342 { 1343 fprintf(phLog, "Not an API. Inlined functions can't be exported!\n"); 1580 && (pFnDesc->fchType == FUNCTION_ODIN32_API || pFnDesc->fchType == FUNCTION_INTERNAL_ODIN32_API) 1581 && stristr(pFnDesc->pszReturnType, "inline ") != NULL) 1582 { 1583 logprintf((phLog, "Not an API. Inlined functions can't be exported!\n")); 1344 1584 return 0; 1345 1585 } … … 1353 1593 ) 1354 1594 { /* cdecl function is prefixed with an '_' */ 1355 strcpy(pszEnd, "_"); 1595 strcpy(pszEnd, "_"); /* BUGBUG */ 1356 1596 } 1357 1597 if (pszClass != NULL) … … 1365 1605 *pszEnd = '\0'; 1366 1606 1607 /* class name and type */ 1608 if (pszClass != NULL) 1609 { 1610 pFnDesc->pszClass = pszEnd; 1611 strncat(pszEnd,pszClass, pszClassEnd - pszClass + 1); 1612 if (!pFnDesc->pszReturnType || !*pFnDesc->pszReturnType) 1613 pFnDesc->fchType = *pszFn != '~' ? FUNCTION_CONSTRUCTOR : FUNCTION_DESTRUCTOR; 1614 else 1615 pFnDesc->fchType = FUNCTION_METHOD; /* BUGBUG operator. */ 1616 pszEnd = strlen(pszEnd) + pszEnd + 1; 1617 *pszEnd = '\0'; 1618 } 1367 1619 1368 1620 /* arguments */ … … 1407 1659 else 1408 1660 { /* arg yet another special case! 'fn(int argc, char *argv[])' */ 1409 char *pszP2 ;1661 char *pszP2 = NULL; 1410 1662 cch = strlen(apszArgs[j]); 1411 1663 psz = &apszArgs[j][cch-2]; … … 1437 1689 memset(psz, ' ', pszP2 - psz); 1438 1690 else 1439 fprintf(phLog, "assert: line %d\n", __LINE__);1691 logprintf((phLog, "assert: line %d\n", __LINE__)); 1440 1692 } 1441 1693 pFnDesc->apszParamType[j] = trim(apszArgs[j]); … … 1584 1836 /* 2c.*/ 1585 1837 if (iName <= iEnd && strstr(papszLines[iName], pFnDesc->pszName) == NULL) 1586 fprintf(phLog, "Warning: a matching function name is not found in the name Field\n");1838 logprintf((phLog, "Warning: a matching function name is not found in the name Field\n")); 1587 1839 } 1588 1840 … … 1815 2067 } 1816 2068 2069 2070 /** 2071 * Writes debug log data on a function. 2072 * @param pFnDesc Pointer to function description block. 2073 */ 2074 void logFunction(PFNDESC pFnDesc) 2075 { 2076 #ifdef DEBUGLOG 2077 int j; 2078 2079 fprintf(phLog, "Name: '%s' (refcodes=", pFnDesc->pszName); 2080 for (j = 0; j < pFnDesc->cRefCodes; j++) 2081 fprintf(phLog, j > 0 ? ", %ld" : "%ld", pFnDesc->alRefCode[j]); 2082 fprintf(phLog, ")\n"); 2083 fprintf(phLog, " Returns: '%s'\n", pFnDesc->pszReturnType != NULL ? pFnDesc->pszReturnType : "<missing>"); 2084 fprintf(phLog, " cParams: %2d\n", pFnDesc->cParams); 2085 for (j = 0; j < pFnDesc->cParams; j++) 2086 fprintf(phLog, " Param %2d: type '%s' %*s name '%s' description: %s\n", j, pFnDesc->apszParamType[j], 2087 max((int)(15 - strlen(pFnDesc->apszParamType[j])), 0), "", pFnDesc->apszParamName[j], 2088 pFnDesc->apszParamDesc[j] != NULL ? pFnDesc->apszParamDesc[j] : "(null)"); 2089 fprintf(phLog, " Status: %ld - '%s'\n", pFnDesc->lStatus, pFnDesc->pszStatus != NULL ? pFnDesc->pszStatus : "<missing>"); 2090 fprintf(phLog, " cAuthors: %2d\n", pFnDesc->cAuthors); 2091 for (j = 0; j < pFnDesc->cAuthors; j++) 2092 fprintf(phLog, " Author %d: '%s' (refcode=%ld)\n", j, pFnDesc->apszAuthor[j], pFnDesc->alAuthorRefCode[j]); 2093 2094 fprintf(phLog, " Description: %s\n", pFnDesc->pszDescription != NULL ? pFnDesc->pszDescription : "(null)"); 2095 fprintf(phLog, " Remark: %s\n", pFnDesc->pszRemark != NULL ? pFnDesc->pszRemark : "(null)"); 2096 fprintf(phLog, " Return Desc: %s\n", pFnDesc->pszReturnDesc != NULL ? pFnDesc->pszReturnDesc : "(null)"); 2097 fprintf(phLog, " Sketch: %s\n", pFnDesc->pszSketch != NULL ? pFnDesc->pszSketch : "(null)"); 2098 fprintf(phLog, " Equiv: %s\n", pFnDesc->pszEquiv != NULL ? pFnDesc->pszEquiv : "(null)"); 2099 fprintf(phLog, " Time: %s\n", pFnDesc->pszTime != NULL ? pFnDesc->pszTime : "(null)"); 2100 fprintf(phLog, "------------\n"); 2101 #else 2102 pFnDesc = pFnDesc; 2103 #endif 2104 } 2105 2106 2107 /** 2108 * Resolves the source filename of an .obj file. 2109 * @returns Pointer to static filename buffer. 2110 * @param pszFileObj Name of object file. 2111 * @param papszDirs Array of directories to search. NULL terminated. 2112 * @remark The string returned is in _static_ memory. 2113 */ 2114 char *ResolvSourceFile(char *pszFileObj, char **papszDirs) 2115 { 2116 static char szFile[CCHMAXPATH]; 2117 static char * aszSuffixes[] = { ".cpp", ".c", ".orc", NULL }; 2118 char * aszDirs[] = { ".;", NULL }; 2119 char * pszDir; 2120 int i; 2121 char szFileTmp[CCHMAXPATH]; 2122 2123 /* 2124 * Extract file name. 2125 */ 2126 fileNameNoExt(pszFileObj, szFileTmp); 2127 2128 2129 /* 2130 * Loop dirs. 2131 */ 2132 for (i = 0; papszDirs[i]; i++) 2133 { 2134 int j; 2135 2136 for (j = 0; aszSuffixes[j]; j++) 2137 { 2138 APIRET rc; 2139 FILESTATUS3 fs; 2140 2141 strcat(strcat(strcat(strcpy(szFile, papszDirs[i]), "\\"), szFileTmp), aszSuffixes[j]); 2142 rc = DosQueryPathInfo(szFile, FIL_STANDARD, &fs , sizeof(fs)); 2143 if (rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY) 2144 { 2145 logprintf((phLog, "ResolveSourceFile(%s,..) -> %s\n", pszFileObj, szFile)); 2146 return szFile; 2147 } 2148 } 2149 } 2150 2151 logprintf((phLog, "ResolveSourceFile(%s,..) -> NULL\n", pszFileObj)); 2152 return NULL; 2153 } 1817 2154 1818 2155 … … 2161 2498 if (pszB != NULL && *pszB == '{') 2162 2499 { 2163 fprintf(phLog, "Function found: %.*s\n", cchFnName, pszFnName);2500 logprintf((phLog, "Function found: %.*s\n", cchFnName, pszFnName)); 2164 2501 return TRUE; 2165 2502 } … … 2224 2561 if (pszB != NULL && *pszB == '{') 2225 2562 { 2226 fprintf(phLog, "Possible API: %.*s\n", cchFnName, pszOS2);2563 logprintf((phLog, "Possible API: %.*s\n", cchFnName, pszOS2)); 2227 2564 return TRUE; 2228 2565 } … … 2266 2603 2267 2604 2605 /** 2606 * Checks if there is a class declaration starting at the current line. 2607 * @returns TRUE if design note found, else FALSE. 2608 * @param papszLines Array of lines in the file. 2609 * @param i Index into papszLines. 2610 * @param pOptions Pointer to options. 2611 */ 2612 BOOL isClass(char **papszLines, int i, POPTIONS pOptions) 2613 { 2614 char *psz = papszLines[i]; 2615 2616 if (psz == NULL) 2617 return FALSE; 2618 2619 // look for class 2620 while (*psz == ' ') 2621 psz++; 2622 2623 pOptions = pOptions; 2624 return !strncmp(psz, "class", 5) 2625 && (psz[5] == '\t' || psz[5] == ' ' || psz[5] == '\n' || psz[5] == '\r' || psz[5] == '\0'); 2626 } 2627 2268 2628 2269 2629 … … 2278 2638 { 2279 2639 case 0: 2280 fprintf(phLog, "%s", pszValue);2640 logprintf((phLog, "%s", pszValue)); 2281 2641 break; 2282 2642 case 1: 2283 fprintf(phLog, "(%s)", pszValue);2643 logprintf((phLog, "(%s)", pszValue)); 2284 2644 break; 2285 2645 case 2: /* updated */ 2286 fprintf(phLog, " %s=%s", pszFieldName, pszValue);2646 logprintf((phLog, " %s=%s", pszFieldName, pszValue)); 2287 2647 break; 2288 2648 case 3: /* aliasfn */ 2289 fprintf(phLog, " %s=%s", pszFieldName, pszValue);2649 logprintf((phLog, " %s=%s", pszFieldName, pszValue)); 2290 2650 break; 2291 2651 case 4: 2292 2652 if (pszValue != NULL) 2293 fprintf(phLog, " --> %s.", pszValue);2653 logprintf((phLog, " --> %s.", pszValue)); 2294 2654 break; 2295 2655 case 5: 2296 2656 if (pszValue != NULL) 2297 fprintf(phLog, "%s", pszValue);2657 logprintf((phLog, "%s", pszValue)); 2298 2658 break; 2299 2659 case 6: 2300 2660 if (pszValue != NULL) 2301 fprintf(phLog, "(%s)", pszValue);2661 logprintf((phLog, "(%s)", pszValue)); 2302 2662 break; 2303 2663 2304 2664 default: 2305 2665 i = 0; 2306 fprintf(phLog, "\n");2666 logprintf((phLog, "\n")); 2307 2667 } 2308 2668 … … 2310 2670 { 2311 2671 i = 0; 2312 fprintf(phLog, "\n");2672 logprintf((phLog, "\n")); 2313 2673 } 2314 2674 … … 2441 2801 psz++; 2442 2802 } 2443 fprintf(phLog, "%d lines\n", cLines);2803 logprintf((phLog, "%d lines\n", cLines)); 2444 2804 2445 2805 papszLines = (char**)calloc(cLines + 1, sizeof(char *)); … … 2994 3354 2995 3355 2996 2997 3356 /** 3357 * Creates a memory buffer for a text file. 3358 * @returns Pointer to file memoryblock. NULL on error. 3359 * @param pszFilename Pointer to filename string. 3360 * @remark This function is the one using most of the execution 3361 * time (DosRead + DosOpen) - about 70% of the execution time! 3362 */ 3363 void *textbufferCreate(const char *pszFilename) 3364 { 3365 void *pvFile = NULL; 3366 FILE *phFile; 3367 3368 phFile = fopen(pszFilename, "rb"); 3369 if (phFile != NULL) 3370 { 3371 signed long cbFile = fsize(phFile); 3372 if (cbFile >= 0) 3373 { 3374 pvFile = malloc(cbFile + 1); 3375 if (pvFile != NULL) 3376 { 3377 memset(pvFile, 0, cbFile + 1); 3378 if (cbFile > 0 && fread(pvFile, 1, cbFile, phFile) == 0) 3379 { /* failed! */ 3380 free(pvFile); 3381 pvFile = NULL; 3382 } 3383 } 3384 else 3385 fprintf(stderr, "warning/error: failed to open file %s\n", pszFilename); 3386 } 3387 fclose(phFile); 3388 } 3389 return pvFile; 3390 } 3391 3392 3393 /** 3394 * Destroys a text textbuffer. 3395 * @param pvBuffer Buffer handle. 3396 */ 3397 void textbufferDestroy(void *pvBuffer) 3398 { 3399 free(pvBuffer); 3400 } 3401 3402 3403 /** 3404 * Gets the next line from an textbuffer. 3405 * @returns Pointer to the next line. 3406 * @param pvBuffer Buffer handle. 3407 * @param psz Pointer to current line. 3408 * NULL is passed in to get the first line. 3409 */ 3410 char *textbufferNextLine(void *pvBuffer, register char *psz) 3411 { 3412 register char ch; 3413 3414 /* if first line psz is NULL. */ 3415 if (psz == NULL) 3416 return (char*)pvBuffer; 3417 3418 /* skip till end of file or end of line. */ 3419 ch = *psz; 3420 while (ch != '\0' && ch != '\n' && ch != '\r') 3421 ch = *++psz; 3422 3423 /* skip line end */ 3424 if (ch == '\r') 3425 ch = *++psz; 3426 if (ch == '\n') 3427 psz++; 3428 3429 return psz; 3430 } 3431 3432 3433 /** 3434 * Gets the next line from an textbuffer. 3435 * (fgets for textbuffer) 3436 * @returns Pointer to pszOutBuffer. NULL when end of file. 3437 * @param pvBuffer Buffer handle. 3438 * @param ppv Pointer to a buffer index pointer. (holds the current buffer index) 3439 * Pointer to a null pointer is passed in to get the first line. 3440 * @param pszLineBuffer Output line buffer. (!= NULL) 3441 * @param cchLineBuffer Size of the output line buffer. (> 0) 3442 * @remark '\n' and '\r' are removed! 3443 */ 3444 char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer) 3445 { 3446 char * pszLine = pszLineBuffer; 3447 char * psz = *(char**)(void*)ppv; 3448 register char ch; 3449 3450 /* first line? */ 3451 if (psz == NULL) 3452 psz = (char*)pvBuffer; 3453 3454 /* Copy to end of the line or end of the linebuffer. */ 3455 ch = *psz; 3456 cchLineBuffer--; /* reserve space for '\0' */ 3457 while (cchLineBuffer > 0 && ch != '\0' && ch != '\n' && ch != '\r') 3458 { 3459 *pszLine++ = ch; 3460 ch = *++psz; 3461 } 3462 *pszLine = '\0'; 3463 3464 /* skip line end */ 3465 if (ch == '\r') 3466 ch = *++psz; 3467 if (ch == '\n') 3468 psz++; 3469 3470 /* check if position has changed - if unchanged it's the end of file! */ 3471 if (*ppv == (void*)psz) 3472 pszLineBuffer = NULL; 3473 3474 /* store current position */ 3475 *ppv = (void*)psz; 3476 3477 return pszLineBuffer; 3478 } 3479 3480 3481 /** 3482 * Find the size of a file. 3483 * @returns Size of file. -1 on error. 3484 * @param phFile File handle. 3485 */ 3486 signed long fsize(FILE *phFile) 3487 { 3488 int ipos; 3489 signed long cb; 3490 3491 if ((ipos = ftell(phFile)) < 0 3492 || 3493 fseek(phFile, 0, SEEK_END) != 0 3494 || 3495 (cb = ftell(phFile)) < 0 3496 || 3497 fseek(phFile, ipos, SEEK_SET) != 0 3498 ) 3499 cb = -1; 3500 return cb; 3501 } 3502 3503 3504 /** 3505 * Copies the name part with out extention into pszBuffer and returns 3506 * a pointer to the buffer. 3507 * If no name is found "" is returned. 3508 * @returns Pointer to pszBuffer with path. 3509 * @param pszFilename Pointer to readonly filename. 3510 * @param pszBuffer Pointer to output Buffer. 3511 * @status completely implemented. 3512 * @author knut st. osmundsen 3513 */ 3514 char *fileNameNoExt(const char *pszFilename, char *pszBuffer) 3515 { 3516 char *psz = strrchr(pszFilename, '\\'); 3517 if (psz == NULL) 3518 psz = strrchr(pszFilename, '/'); 3519 3520 strcpy(pszBuffer, psz == NULL ? pszFilename : psz + 1); 3521 3522 psz = strrchr(pszBuffer, '.'); 3523 if (psz > pszBuffer) /* an extetion on it's own (.depend) is a filename not an extetion! */ 3524 *psz = '\0'; 3525 3526 return pszBuffer; 3527 } 3528 -
trunk/tools/database/StateUpd.h
r3841 r6677 1 /* $Id: StateUpd.h,v 1. 5 2000-07-18 07:34:08bird Exp $ */1 /* $Id: StateUpd.h,v 1.6 2001-09-07 10:24:06 bird Exp $ */ 2 2 /* 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 19 19 BOOL fIntegrityAfter; /* ie */ 20 20 BOOL fIntegrityOnly; /* io */ 21 BOOL fRecursive; /* s 21 BOOL fRecursive; /* s */ 22 22 BOOL fOld; /* Old */ 23 BOOL fOS2; /* Ignore OS2 prefixes */ 24 BOOL fCOMCTL32; /* Ignore COMCTL32 prefixes */ 25 BOOL fVERSION; /* Ignore VERSION prefixes */ 26 char * pszDLLName; /* Name of the dll being processed */ 27 signed long lDllRefcode; /* Database reference code of the dll */ 23 BOOL fOS2; /* Ignore OS2 prefixes. */ 24 BOOL fCOMCTL32; /* Ignore COMCTL32 prefixes. */ 25 BOOL fVERSION; /* Ignore VERSION prefixes. */ 26 char * pszModName; /* Name of the module being processed. */ 27 char chModType; /* Type of module being processed. */ 28 signed long lModRefcode; /* Database reference code of the module. */ 28 29 signed long lFileRefcode; /* File reference code. */ 29 signed long lSeqFile; /* Design note file sequence number. */ 30 char ** papszDirs; /* Pointer to NULL terminated array of directories*/ 31 /* to be searched when .obj files are specified. */ 30 32 } OPTIONS, *POPTIONS; 31 33 -
trunk/tools/database/db.cpp
r6663 r6677 1 /* $Id: db.cpp,v 1.2 5 2001-09-06 03:07:32bird Exp $ *1 /* $Id: db.cpp,v 1.26 2001-09-07 10:24:07 bird Exp $ * 2 2 * 3 3 * DB - contains all database routines. … … 154 154 155 155 /** 156 * Gets the refid for the give dllname.157 * @returns Dllrefid. -1 on error.158 * @param pszDllName Dllname.159 */ 160 signed long _System dbGet Dll(const char *pszDllName)156 * Gets the refid for the give mod name. 157 * @returns Module refid. -1 on error. 158 * @param pszModName Module name. 159 */ 160 signed long _System dbGetModule(const char *pszModName) 161 161 { 162 162 int rc; … … 164 164 MYSQL_RES * pres; 165 165 166 sprintf(&szQuery[0], "SELECT refcode FROM dll WHERE name = '%s'\n", pszDllName);166 sprintf(&szQuery[0], "SELECT refcode FROM module WHERE name = '%s'\n", pszModName); 167 167 rc = mysql_query(pmysql, &szQuery[0]); 168 168 pres = mysql_store_result(pmysql); … … 178 178 179 179 /** 180 * Count the function in a given dll.181 * @returns 182 * @param lDll Dllrefcode.183 * @param fNotAliasesTRUE: don't count aliased functions.184 */ 185 signed long _System dbCountFunctionIn Dll(signed long lDll, BOOL fNotAliases)180 * Count the function in a given module. 181 * @returns Number of functions. -1 on error. 182 * @param lModule Module refcode. 183 * @param fNotAliases TRUE: don't count aliased functions. 184 */ 185 signed long _System dbCountFunctionInModule(signed long lModule, BOOL fNotAliases) 186 186 { 187 187 signed long rc; … … 189 189 MYSQL_RES * pres; 190 190 191 if (l Dll>= 0)192 { 193 sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE dll = %ld\n", lDll);191 if (lModule >= 0) 192 { 193 sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE module = %ld\n", lModule); 194 194 if (fNotAliases) 195 195 strcat(&szQuery[0], " AND aliasfn < 0"); … … 211 211 212 212 /** 213 * Checks if dll exists. If not exists the dll is inserted. 214 * @returns Dll refcode. -1 on errors. 215 * @param pszDll Dll name. 216 * @remark This search must be case insensitive. 217 * (In the mysql-world everything is case insensitive!) 218 */ 219 signed long _System dbCheckInsertDll(const char *pszDll, char fchType) 213 * Checks if module exists. If not exists the module is inserted. 214 * @returns Module refcode. -1 on errors. 215 * @param pszModule Module name. 216 * @param fchType Module type. 217 * @remark This search must be case insensitive. 218 * (In the mysql-world everything is case insensitive!) 219 */ 220 signed long _System dbCheckInsertModule(const char *pszModule, char fchType) 220 221 { 221 222 int rc; … … 224 225 225 226 /* try find match */ 226 sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll);227 sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule); 227 228 rc = mysql_query(pmysql, &szQuery[0]); 228 229 pres = mysql_store_result(pmysql); 229 230 230 /* not found? - insert dll*/231 /* not found? - insert module */ 231 232 if (rc < 0 || pres == NULL || mysql_num_rows(pres) == 0) 232 233 { 233 234 mysql_free_result(pres); 234 235 235 sprintf(&szQuery[0], "INSERT INTO dll(name, type) VALUES('%s', '%c')\n", pszDll, fchType);236 sprintf(&szQuery[0], "INSERT INTO module(name, type) VALUES('%s', '%c')\n", pszModule, fchType); 236 237 rc = mysql_query(pmysql, &szQuery[0]); 237 238 if (rc < 0) … … 239 240 240 241 /* select row to get refcode */ 241 sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll);242 sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule); 242 243 rc = mysql_query(pmysql, &szQuery[0]); 243 244 pres = mysql_store_result(pmysql); … … 290 291 * The update flags is always updated. 291 292 * @returns Success indicator. TRUE / FALSE. 292 * @param l Dll Dllrefcode.293 * @param lModule Module refcode. 293 294 * @param pszFunction Function name. 294 295 * @param pszIntFunction Internal function name. (required!) … … 297 298 * @param fchType Function type flag. One of the FUNCTION_* defines. 298 299 */ 299 BOOL _System dbInsertUpdateFunction(signed long l Dll,300 BOOL _System dbInsertUpdateFunction(signed long lModule, 300 301 const char *pszFunction, const char *pszIntFunction, 301 302 unsigned long ulOrdinal, BOOL fIgnoreOrdinal, char fchType) … … 312 313 313 314 /* try find function */ 314 sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE dll = %d AND name = '%s'", lDll, pszFunction);315 sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE module = %d AND name = '%s'", lModule, pszFunction); 315 316 rc = mysql_query(pmysql, pszQuery); 316 317 pres = mysql_store_result(pmysql); … … 322 323 if (mysql_num_rows(pres) > 1) 323 324 { 324 fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same dll. "325 "l Dll = %d, pszFunction = %s\n", __FUNCTION__, lDll, pszFunction);325 fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same module. " 326 "lModule = %d, pszFunction = %s\n", __FUNCTION__, lModule, pszFunction); 326 327 return FALSE; 327 328 } … … 347 348 * Insert it. 348 349 */ 349 sprintf(&szQuery[0], "INSERT INTO function( dll, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')",350 l Dll, pszFunction, pszIntFunction, ulOrdinal, fchType);350 sprintf(&szQuery[0], "INSERT INTO function(module, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')", 351 lModule, pszFunction, pszIntFunction, ulOrdinal, fchType); 351 352 rc = mysql_query(pmysql, &szQuery[0]); 352 353 } … … 360 361 * Inserts or updates (existing) file information. 361 362 * @returns Success indicator (TRUE / FALSE). 362 * @param l Dll Dllreference code.363 * @param lModule Module reference code. 363 364 * @param pszFilename Filename. 364 365 * @param pszDescription Pointer to file description. … … 369 370 * @remark 370 371 */ 371 BOOL _System dbInsertUpdateFile(signed long l Dll,372 BOOL _System dbInsertUpdateFile(signed long lModule, 372 373 const char *pszFilename, 373 374 const char *pszDescription, … … 382 383 383 384 /* parameter assertions */ 384 assert(l Dll!= 0);385 assert(lModule != 0); 385 386 assert(pszFilename != NULL); 386 387 assert(*pszFilename != '\0'); 387 388 388 389 /* try find file */ 389 sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE dll = %d AND name = '%s'", lDll, pszFilename);390 sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE module = %d AND name = '%s'", lModule, pszFilename); 390 391 rc = mysql_query(pmysql, &szQuery[0]); 391 392 pres = mysql_store_result(pmysql); … … 395 396 if (mysql_num_rows(pres) > 1) 396 397 { 397 fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same dll. "398 "l Dll = %d, pszFilename = %s\n", __FUNCTION__, lDll, pszFilename);398 fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same module. " 399 "lModule = %d, pszFilename = %s\n", __FUNCTION__, lModule, pszFilename); 399 400 return FALSE; 400 401 } … … 450 451 else 451 452 { /* insert */ 452 sprintf(&szQuery[0], "INSERT INTO file( dll, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ",453 l Dll, pszFilename, lLastAuthor);453 sprintf(&szQuery[0], "INSERT INTO file(module, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ", 454 lModule, pszFilename, lLastAuthor); 454 455 if (pszDescription != NULL && *pszDescription != '\0') 455 456 sqlstrcat(&szQuery[0], NULL, pszDescription); … … 524 525 * @param pszFunctionName Pointer to a function name string. (input) 525 526 * @param pFnFindBuf Pointer to a find buffer. (output) 526 * @param l Dll Dllrefcode (optional). If given the search is limited to527 * the given dlland aliasing functions is updated (slow!).528 * @sketch 1) Get functions for this dll(if given).527 * @param lModule Module refcode (optional). If given the search is limited to 528 * the given module and aliasing functions is updated (slow!). 529 * @sketch 1) Get functions for this module(if given). 529 530 * 2) Get functions which aliases the functions found in (1). 530 531 * 3) Get new aliases by intname … … 533 534 * 6) Update all functions from (3) and (4) to alias the first function from 1. 534 535 */ 535 BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long l Dll)536 BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long lModule) 536 537 { 537 538 MYSQL_RES *pres; … … 541 542 542 543 /* 543 * 1) Get functions for this dll(if given).544 * 1) Get functions for this module(if given). 544 545 */ 545 if (l Dll< 0)546 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE intname = '%s'",546 if (lModule < 0) 547 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function WHERE intname = '%s'", 547 548 pszFunctionName); 548 549 else 549 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function "550 "WHERE intname = '%s' AND dll= %ld",551 pszFunctionName, l Dll);550 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function " 551 "WHERE intname = '%s' AND module = %ld", 552 pszFunctionName, lModule); 552 553 553 554 rc = mysql_query1(pmysql, &szQuery[0]); … … 558 559 { 559 560 char szFnName[NBR_FUNCTIONS][80]; 561 BOOL fAPI = FALSE; 560 562 561 563 pFnFindBuf->cFns = 0; … … 563 565 { 564 566 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 565 pFnFindBuf->al DllRefCode[pFnFindBuf->cFns] = atol(row[1]);567 pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]); 566 568 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); 567 569 pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]); 568 570 strcpy(szFnName[pFnFindBuf->cFns], row[4]); 571 pFnFindBuf->achType[pFnFindBuf->cFns] = *row[5]; 572 if (pFnFindBuf->achType[pFnFindBuf->cFns] == FUNCTION_ODIN32_API || 573 pFnFindBuf->achType[pFnFindBuf->cFns] == FUNCTION_INTERNAL_ODIN32_API) 574 fAPI = TRUE; 569 575 570 576 /* next */ … … 573 579 mysql_free_result(pres); 574 580 575 /* alias check and fix */576 if ( lDll>= 0 && pFnFindBuf->cFns != 0)581 /* alias check and fix for apis. */ 582 if (fAPI && lModule >= 0 && pFnFindBuf->cFns != 0) 577 583 { 578 int cFnsThis Dll, cFnsAliasesAndThisDll, i, f;584 int cFnsThisModule, cFnsAliasesAndThisModule, i, f; 579 585 580 586 /* 581 587 * 2) Get functions which aliases the functions found in (1). 582 588 */ 583 cFnsThis Dll= (int)pFnFindBuf->cFns;584 strcpy(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE aliasfn IN (");585 for (i = 0; i < cFnsThis Dll; i++)589 cFnsThisModule = (int)pFnFindBuf->cFns; 590 strcpy(&szQuery[0], "SELECT refcode, module, aliasfn, file, name FROM function WHERE aliasfn IN ("); 591 for (i = 0; i < cFnsThisModule; i++) 586 592 { 587 593 if (i > 0) strcat(&szQuery[0], " OR "); … … 599 605 { 600 606 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 601 pFnFindBuf->al DllRefCode[pFnFindBuf->cFns] = atol(row[1]);607 pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]); 602 608 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); 603 609 pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]); … … 612 618 * 3) Get new aliases by intname 613 619 */ 614 cFnsAliasesAndThis Dll= (int)pFnFindBuf->cFns;615 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file FROM function "616 "WHERE aliasfn = (-1) AND dll<> %ld AND (intname = '%s'",617 l Dll, pszFunctionName);618 for (i = 0; i < cFnsAliasesAndThis Dll; i++)620 cFnsAliasesAndThisModule = (int)pFnFindBuf->cFns; 621 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file FROM function " 622 "WHERE aliasfn = (-1) AND module <> %ld AND (intname = '%s'", 623 lModule, pszFunctionName); 624 for (i = 0; i < cFnsAliasesAndThisModule; i++) 619 625 sprintf(&szQuery[strlen(&szQuery[0])], " OR intname = '%s'", szFnName[i]); 620 626 strcat(&szQuery[0], ")"); … … 629 635 { 630 636 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 631 pFnFindBuf->al DllRefCode[pFnFindBuf->cFns] = atol(row[1]);637 pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]); 632 638 if (row[2] != NULL) 633 639 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); … … 645 651 * 4) Get new aliases by name 646 652 */ 647 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file FROM function "648 "WHERE aliasfn = (-1) AND dll<> %ld AND (name = '%s'",649 l Dll, pszFunctionName);650 for (i = 0; i < cFnsAliasesAndThis Dll; i++)653 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file FROM function " 654 "WHERE aliasfn = (-1) AND module <> %ld AND (name = '%s'", 655 lModule, pszFunctionName); 656 for (i = 0; i < cFnsAliasesAndThisModule; i++) 651 657 sprintf(&szQuery[strlen(&szQuery[0])], " OR name = '%s'", szFnName[i]); 652 658 strcat(&szQuery[0], ")"); … … 661 667 { 662 668 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 663 pFnFindBuf->al DllRefCode[pFnFindBuf->cFns] = atol(row[1]);669 pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]); 664 670 if (row[2] != NULL) 665 671 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); … … 678 684 sprintf(&szQuery[0], "UPDATE function SET aliasfn = (-2) " 679 685 "WHERE refcode IN (", 680 l Dll, pszFunctionName);681 for (f = 0, i = 0; i < cFnsThis Dll; i++)686 lModule, pszFunctionName); 687 for (f = 0, i = 0; i < cFnsThisModule; i++) 682 688 if (pFnFindBuf->alAliasFn[i] != ALIAS_DONTMIND) 683 689 sprintf(&szQuery[strlen(&szQuery[0])], … … 688 694 else 689 695 rc = 0; 690 if (rc >= 0 && cFnsAliasesAndThis Dll< pFnFindBuf->cFns)696 if (rc >= 0 && cFnsAliasesAndThisModule < pFnFindBuf->cFns) 691 697 { 692 698 /* … … 696 702 "WHERE aliasfn = (-1) AND refcode IN (", 697 703 pFnFindBuf->alRefCode[0], pFnFindBuf->alFileRefCode[0]); 698 for (i = cFnsAliasesAndThis Dll; i < pFnFindBuf->cFns; i++)704 for (i = cFnsAliasesAndThisModule; i < pFnFindBuf->cFns; i++) 699 705 { 700 706 sprintf(&szQuery[strlen(&szQuery[0])], 701 i > cFnsAliasesAndThis Dll? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);707 i > cFnsAliasesAndThisModule ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]); 702 708 } 703 709 strcat(&szQuery[0], ")"); … … 722 728 /** 723 729 * Finds the refcode for a file (if it exists). 724 * @returns 725 * 726 * @param lDll Refcode of the dllwhich this file belongs to.727 * @param 728 */ 729 signed long _System dbFindFile(signed long l Dll, const char *pszFilename)730 * @returns File 'refcode'. 731 * -1 on error or not found. 732 * @param lModule Refcode of the module which this file belongs to. 733 * @param pszFilename The filename to search for. 734 */ 735 signed long _System dbFindFile(signed long lModule, const char *pszFilename) 730 736 { 731 737 char szQuery[256]; … … 733 739 signed long lRefCode = -1; 734 740 735 assert(l Dll>= 0);741 assert(lModule >= 0); 736 742 assert(pszFilename != NULL); 737 743 assert(*pszFilename != '\0'); 738 744 739 sprintf(&szQuery[0], "SELECT refcode FROM file WHERE dll= %ld AND name = '%s'",740 l Dll, pszFilename);745 sprintf(&szQuery[0], "SELECT refcode FROM file WHERE module = %ld AND name = '%s'", 746 lModule, pszFilename); 741 747 if (mysql_query(pmysql, &szQuery[0]) >= 0) 742 748 { … … 878 884 * @returns number of errors. 879 885 * @param pFnDesc Function description struct. 880 * @param l Dll Dllwhich we are working at.886 * @param lModule Module which we are working at. 881 887 * @param pszError Buffer for error messages 882 888 * @result on error(s) pszError will hold information about the error(s). 883 889 */ 884 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long l Dll, char *pszError)890 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long lModule, char *pszError) 885 891 { 886 892 MYSQL_RES * pres; … … 1140 1146 } /* for */ 1141 1147 1142 l Dll = lDll;1148 lModule = lModule; 1143 1149 free(pszQuery2); 1144 1150 return ulRc; … … 1148 1154 /** 1149 1155 * Removes all the existing design notes in the specified file. 1150 * @returns Success indicator. 1151 * @param lFile File refcode of the file to remove all design notes for. 1152 * @sketch 1153 * @status 1154 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 1155 * @remark 1156 * @returns Success indicator. 1157 * @param lFile File refcode of the file to remove all design notes for. 1158 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 1156 1159 */ 1157 1160 BOOL _System dbRemoveDesignNotes(signed long lFile) … … 1168 1171 * Adds a design note. 1169 1172 * @returns Success indicator. 1170 * @param l Dll Dllrefcode.1173 * @param lModule Module refcode. 1171 1174 * @param lFile File refcode. 1172 1175 * @param pszTitle Design note title. 1173 1176 * @param pszText Design note text. 1174 1177 * @param lLevel Level of the note section. 0 is the design note it self. 1175 * @param lSeqNbr Sequence number (in dll). If 0 the use next available number.1178 * @param lSeqNbr Sequence number (in module). If 0 the use next available number. 1176 1179 * @param lSeqNbrNote Sequence number in note. 1177 1180 * @param lLine Line number (1 - based!). … … 1181 1184 * @param plRefCode Pointer to reference id of the design note. see fSubSection for more info. 1182 1185 */ 1183 BOOL _System dbAddDesignNote(signed long l Dll,1186 BOOL _System dbAddDesignNote(signed long lModule, 1184 1187 signed long lFile, 1185 1188 const char *pszTitle, … … 1197 1200 1198 1201 1199 assert(l Dll>= 0 && lFile >= 0);1202 assert(lModule >= 0 && lFile >= 0); 1200 1203 assert(lSeqNbrNote >= 0); 1201 1204 … … 1205 1208 if (lSeqNbr == 0 && !fSubSection) 1206 1209 { 1207 sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE dll = %ld AND level = 0", lDll);1210 sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE module = %ld AND level = 0", lModule); 1208 1211 if (mysql_query(pmysql, &szQuery[0]) >= 0) 1209 1212 { … … 1229 1232 */ 1230 1233 if (!fSubSection) 1231 sprintf(&szQuery[0], "INSERT INTO designnote( dll, file, level, seqnbrnote, seqnbr, line, name, note) "1234 sprintf(&szQuery[0], "INSERT INTO designnote(module, file, level, seqnbrnote, seqnbr, line, name, note) " 1232 1235 "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, ", 1233 l Dll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);1236 lModule, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine); 1234 1237 else 1235 sprintf(&szQuery[0], "INSERT INTO designnote(refcode, dll, file, level, seqnbrnote, seqnbr, line, name, note) "1238 sprintf(&szQuery[0], "INSERT INTO designnote(refcode, module, file, level, seqnbrnote, seqnbr, line, name, note) " 1236 1239 "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, %ld, ", 1237 *plRefCode, l Dll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);1240 *plRefCode, lModule, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine); 1238 1241 1239 1242 if (pszTitle != NULL && *pszTitle != '\0') … … 1286 1289 1287 1290 /* delete - all rows on this date in the history tables */ 1288 sprintf(pszQuery, "DELETE FROM history dllWHERE date = '%s'", &szCurDt[0]);1291 sprintf(pszQuery, "DELETE FROM historymodule WHERE date = '%s'", &szCurDt[0]); 1289 1292 rc = mysql_query(pmysql, pszQuery); 1290 1293 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); … … 1294 1297 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); 1295 1298 1296 sprintf(pszQuery, "DELETE FROM history dlltotal WHERE date = '%s'", &szCurDt[0]);1299 sprintf(pszQuery, "DELETE FROM historymoduletotal WHERE date = '%s'", &szCurDt[0]); 1297 1300 rc = mysql_query(pmysql, pszQuery); 1298 1301 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); … … 1302 1305 1303 1306 /* insert new stats */ 1304 sprintf(pszQuery, "INSERT INTO history dll(dll, state, date, count) "1305 "SELECT dll, state, '%s', count(*) FROM function GROUP BY dll, state",1307 sprintf(pszQuery, "INSERT INTO historymodule(module, state, date, count, type) " 1308 "SELECT module, state, '%s', count(*), type FROM function GROUP BY module, state, type", 1306 1309 &szCurDt[0]); 1307 1310 rc = mysql_query(pmysql, pszQuery); … … 1316 1319 1317 1320 /* inserting new totals */ 1318 sprintf(pszQuery, "INSERT INTO history dlltotal(dll, date, totalcount) "1319 "SELECT dll, '%s', count(*) FROM function GROUP BY dll",1321 sprintf(pszQuery, "INSERT INTO historymoduletotal(module, date, totalcount, type) " 1322 "SELECT module, '%s', count(*), type FROM function GROUP BY module, type", 1320 1323 &szCurDt[0]); 1321 1324 rc = mysql_query(pmysql, pszQuery); … … 1323 1326 1324 1327 sprintf(pszQuery, "INSERT INTO historyapigrouptotal(apigroup, date, totalcount) " 1325 "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL "1328 "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL AND type = 'A' " 1326 1329 "GROUP BY apigroup", 1327 1330 &szCurDt[0]); … … 1369 1372 1370 1373 /* foreign keys in function table */ 1371 strcpy(pszQuery, "SELECT refcode, dll, state, apigroup, file FROM function");1374 strcpy(pszQuery, "SELECT refcode, module, state, apigroup, file FROM function"); 1372 1375 rc = mysql_query(pmysql, pszQuery); 1373 1376 if (rc >= 0) … … 1378 1381 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1379 1382 { 1380 /* check dll*/1381 sprintf(pszQuery, "SELECT refcode FROM dllWHERE refcode = %s", row1[1]);1383 /* check module */ 1384 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]); 1382 1385 rc = mysql_query(pmysql, pszQuery); 1383 CheckFKError("function/ dll", "Foreign key 'dll' not found in the dlltable");1386 CheckFKError("function/module", "Foreign key 'module' not found in the module table"); 1384 1387 1385 1388 /* check state */ … … 1411 1414 1412 1415 /* foreign keys in file */ 1413 strcpy(pszQuery, "SELECT refcode, dllFROM file");1416 strcpy(pszQuery, "SELECT refcode, module FROM file"); 1414 1417 rc = mysql_query(pmysql, pszQuery); 1415 1418 if (rc >= 0) … … 1420 1423 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1421 1424 { 1422 /* check dll*/1423 sprintf(pszQuery, "SELECT refcode FROM dllWHERE refcode = %s", row1[1]);1425 /* check module */ 1426 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]); 1424 1427 rc = mysql_query(pmysql, pszQuery); 1425 CheckFKError("apigroup/ dll", "Foreign key 'dll' not found in the dlltable");1428 CheckFKError("apigroup/module", "Foreign key 'module' not found in the module table"); 1426 1429 } 1427 1430 mysql_free_result(pres1); … … 1432 1435 1433 1436 /* foreign keys in apigroup */ 1434 strcpy(pszQuery, "SELECT refcode, dllFROM apigroup");1437 strcpy(pszQuery, "SELECT refcode, module FROM apigroup"); 1435 1438 rc = mysql_query(pmysql, pszQuery); 1436 1439 if (rc >= 0) … … 1441 1444 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1442 1445 { 1443 /* check dll*/1444 sprintf(pszQuery, "SELECT refcode FROM dllWHERE refcode = %s", row1[1]);1446 /* check module */ 1447 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]); 1445 1448 rc = mysql_query(pmysql, pszQuery); 1446 CheckFKError("file/ dll", "Foreign key 'dll' not found in the dlltable");1449 CheckFKError("file/module", "Foreign key 'module' not found in the module table"); 1447 1450 } 1448 1451 mysql_free_result(pres1); … … 1478 1481 ulRc += logDbError(pszError, pszQuery); 1479 1482 1480 /* foreign keys in history dlltable */1481 strcpy(pszQuery, "SELECT date, dll, state FROM historydll");1483 /* foreign keys in historymodule table */ 1484 strcpy(pszQuery, "SELECT date, module, state FROM historymodule"); 1482 1485 rc = mysql_query(pmysql, pszQuery); 1483 1486 if (rc >= 0) … … 1488 1491 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1489 1492 { 1490 /* check dll*/1491 sprintf(pszQuery, "SELECT refcode FROM dllWHERE refcode = %s", row1[1]);1493 /* check module */ 1494 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]); 1492 1495 rc = mysql_query(pmysql, pszQuery); 1493 CheckFKError("history dll/dll", "Foreign key 'dll' not found in the dlltable");1496 CheckFKError("historymodule/module", "Foreign key 'module' not found in the module table"); 1494 1497 1495 1498 /* check state */ 1496 1499 sprintf(pszQuery, "SELECT refcode FROM state WHERE refcode = %s", row1[2]); 1497 1500 rc = mysql_query(pmysql, pszQuery); 1498 CheckFKError("history dll/state", "Foreign key 'state' not found in the state table");1501 CheckFKError("historymodule/state", "Foreign key 'state' not found in the state table"); 1499 1502 } 1500 1503 mysql_free_result(pres1); … … 1514 1517 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1515 1518 { 1516 /* check dll*/1519 /* check module */ 1517 1520 sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]); 1518 1521 rc = mysql_query(pmysql, pszQuery); … … 1530 1533 ulRc += logDbError(pszError, pszQuery); 1531 1534 1532 /* foreign keys in history dlltotal table */1533 strcpy(pszQuery, "SELECT date, dll FROM historydlltotal");1535 /* foreign keys in historymoduletotal table */ 1536 strcpy(pszQuery, "SELECT date, module FROM historymoduletotal"); 1534 1537 rc = mysql_query(pmysql, pszQuery); 1535 1538 if (rc >= 0) … … 1540 1543 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1541 1544 { 1542 /* check dll*/1543 sprintf(pszQuery, "SELECT refcode FROM dllWHERE refcode = %s", row1[1]);1545 /* check module */ 1546 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]); 1544 1547 rc = mysql_query(pmysql, pszQuery); 1545 CheckFKError("history dlltotal/dll", "Foreign key 'dll' not found in the dlltable");1548 CheckFKError("historymoduletotal/module", "Foreign key 'module' not found in the module table"); 1546 1549 } 1547 1550 mysql_free_result(pres1); … … 1561 1564 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1562 1565 { 1563 /* check dll*/1566 /* check module */ 1564 1567 sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]); 1565 1568 rc = mysql_query(pmysql, pszQuery); … … 1855 1858 1856 1859 /** 1857 * Display all functions for, the given dll, that is not updated.1860 * Display all functions for, the given module, that is not updated. 1858 1861 * @returns TRUE / FALSE. 1859 * @param l Dll Dllreference number.1862 * @param lModule Module reference number. 1860 1863 * @param dbFetchCall Callback function which will be called once for each 1861 1864 * field for all the functions not updated. 1862 1865 * pvUser is NULL, pszValue field value, pszFieldName the field name. 1863 1866 */ 1864 BOOL _System dbGetNotUpdatedFunction(signed long l Dll, DBCALLBACKFETCH dbFetchCallBack)1867 BOOL _System dbGetNotUpdatedFunction(signed long lModule, DBCALLBACKFETCH dbFetchCallBack) 1865 1868 { 1866 1869 BOOL fRet = FALSE; … … 1871 1874 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1872 1875 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1873 " LEFT JOIN dll d ON f2.dll= d.refcode "1874 "WHERE f1. dll= %ld AND f1.updated = 0",1875 l Dll);1876 " LEFT JOIN module d ON f2.module = d.refcode " 1877 "WHERE f1.module = %ld AND f1.updated = 0", 1878 lModule); 1876 1879 pres = dbExecuteQuery(szQuery); 1877 1880 if (pres != NULL) … … 1889 1892 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1890 1893 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1891 " LEFT JOIN dll d ON f2.dll= d.refcode "1892 "WHERE f1. dll= %ld AND f1.updated > 1",1893 l Dll);1894 " LEFT JOIN module d ON f2.module = d.refcode " 1895 "WHERE f1.module = %ld AND f1.updated > 1", 1896 lModule); 1894 1897 pres = dbExecuteQuery(szQuery); 1895 1898 if (pres != NULL) … … 1912 1915 1913 1916 /** 1914 * Counts the function for the given DLLwhich has been updated.1915 * @returns 1916 * @param lDll Dllreference number.1917 */ 1918 signed long _System dbGetNumberOfUpdatedFunction(signed long l Dll)1917 * Counts the function for the given MODULE which has been updated. 1918 * @returns -1 on error, number of updated function on success. 1919 * @param lModule Module reference number. 1920 */ 1921 signed long _System dbGetNumberOfUpdatedFunction(signed long lModule) 1919 1922 { 1920 1923 int rc; … … 1922 1925 MYSQL_RES * pres; 1923 1926 1924 sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE dll = (%ld) AND updated > 0\n", lDll);1927 sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE module = (%ld) AND updated > 0\n", lModule); 1925 1928 rc = mysql_query(pmysql, &szQuery[0]); 1926 1929 pres = mysql_store_result(pmysql); … … 1936 1939 1937 1940 /** 1938 * Clear the update flags for all file in a dll/module.1939 * @returns 1940 * @param lDll Dllrefcode.1941 * @author 1942 * @remark 1943 */ 1944 BOOL _System dbClearUpdateFlagFile(signed long l Dll)1941 * Clear the update flags for all file in a module/module. 1942 * @returns Success indicator. (TRUE / FALSE) 1943 * @param lModule Module refcode. 1944 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 1945 * @remark Intended for use by APIImport. 1946 */ 1947 BOOL _System dbClearUpdateFlagFile(signed long lModule) 1945 1948 { 1946 1949 int rc; … … 1948 1951 1949 1952 sprintf(&szQuery[0], 1950 "UPDATE file SET updated = 0 WHERE dll= (%ld)",1951 l Dll);1953 "UPDATE file SET updated = 0 WHERE module = (%ld)", 1954 lModule); 1952 1955 rc = mysql_query(pmysql, &szQuery[0]); 1953 1956 return rc == 0; … … 1957 1960 /** 1958 1961 * Clear update flag 1959 * @returns 1960 * @param lDll Dllrefcode.1961 * @param fAll All dll. If false only APIs and Internal APIs are cleared1962 * @author 1963 * @remark 1964 */ 1965 BOOL _System dbClearUpdateFlagFunction(signed long l Dll, BOOL fAll)1962 * @returns Success indicator. 1963 * @param lModule Module refcode. 1964 * @param fAll All module. If false only APIs and Internal APIs are cleared 1965 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 1966 * @remark Intended for use by APIImport. 1967 */ 1968 BOOL _System dbClearUpdateFlagFunction(signed long lModule, BOOL fAll) 1966 1969 { 1967 1970 int rc; … … 1969 1972 1970 1973 sprintf(&szQuery[0], 1971 "UPDATE function SET updated = 0 WHERE dll= (%ld)",1972 l Dll);1974 "UPDATE function SET updated = 0 WHERE module = (%ld)", 1975 lModule); 1973 1976 if (!fAll) 1974 1977 strcat(&szQuery[0], " AND type IN ('A', 'I')"); … … 1980 1983 1981 1984 /** 1982 * Deletes all the files in a dll/module which was not found/updated.1985 * Deletes all the files in a module/module which was not found/updated. 1983 1986 * @returns Success indicator. 1984 * @param l Dll Dllrefcode.1987 * @param lModule Module refcode. 1985 1988 * @sketch Select all files which is to be deleted. 1986 1989 * Set all references to each file in function to -1. … … 1989 1992 * @remark Use with GRATE CARE! 1990 1993 */ 1991 BOOL _System dbDeleteNotUpdatedFiles(signed long l Dll)1994 BOOL _System dbDeleteNotUpdatedFiles(signed long lModule) 1992 1995 { 1993 1996 MYSQL_RES * pres; … … 1997 2000 1998 2001 sprintf(&szQuery[0], 1999 "SELECT refcode FROM file WHERE dll= (%ld) AND updated = 0",2000 l Dll);2002 "SELECT refcode FROM file WHERE module = (%ld) AND updated = 0", 2003 lModule); 2001 2004 rc = mysql_query(pmysql, &szQuery[0]); 2002 2005 pres = mysql_store_result(pmysql); … … 2015 2018 2016 2019 sprintf(&szQuery[0], 2017 "DELETE FROM file WHERE dll= %ld AND updated = 0",2018 l Dll);2020 "DELETE FROM file WHERE module = %ld AND updated = 0", 2021 lModule); 2019 2022 rc = mysql_query(pmysql, &szQuery[0]); 2020 2023 if (rc) fRc = FALSE; … … 2030 2033 * 2031 2034 * @returns Success indicator. (TRUE / FALSE) 2032 * @param l Dll The refcode of the dllowning the functions.2033 * @param fAll All function. If FALSE then only APIs and Internal APIs.2034 * @sketch Select all functions which wan't updated (ie. updated = 0 and dll = lDll).2035 * @param lModule The refcode of the module owning the functions. 2036 * @param fAll All function. If FALSE then only APIs and Internal APIs. 2037 * @sketch Select all functions which wan't updated (ie. updated = 0 and module = lModule). 2035 2038 * If anyone Then 2036 2039 * Delete the referenced to the functions in: … … 2041 2044 * @remark Use with GREATE CARE! 2042 2045 */ 2043 BOOL _System dbDeleteNotUpdatedFunctions(signed long l Dll, BOOL fAll)2046 BOOL _System dbDeleteNotUpdatedFunctions(signed long lModule, BOOL fAll) 2044 2047 { 2045 2048 MYSQL_RES * pres; … … 2049 2052 2050 2053 sprintf(&szQuery[0], 2051 "SELECT refcode FROM function WHERE dll= %ld AND updated = 0",2052 l Dll);2054 "SELECT refcode FROM function WHERE module = %ld AND updated = 0", 2055 lModule); 2053 2056 if (!fAll) 2054 2057 strcat(&szQuery[0], " AND type IN ('A', 'I')"); … … 2081 2084 { 2082 2085 sprintf(&szQuery[0], 2083 "DELETE FROM function WHERE dll= %ld AND updated = 0",2084 l Dll);2086 "DELETE FROM function WHERE module = %ld AND updated = 0", 2087 lModule); 2085 2088 if (!fAll) 2086 2089 strcat(&szQuery[0], " AND type IN ('A', 'I')"); -
trunk/tools/database/db.h
r6663 r6677 1 /* $Id: db.h,v 1.1 4 2001-09-06 03:07:32bird Exp $ */1 /* $Id: db.h,v 1.15 2001-09-07 10:24:07 bird Exp $ */ 2 2 /* 3 3 * DB - contains all database routines … … 29 29 #define FUNCTION_ODIN32_API 'A' /* for Odin32 APIs (ie. LoadLibrary) */ 30 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) */ 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' 32 36 33 37 /* type flags of dll */ … … 49 53 /* function name and type */ 50 54 char * pszName; 55 char * pszClass; 56 char fchType; /* function type. */ 51 57 char * pszReturnType; 52 58 long cRefCodes; … … 89 95 unsigned long cFns; 90 96 signed long alRefCode[NBR_FUNCTIONS]; 91 signed long al DllRefCode[NBR_FUNCTIONS];97 signed long alModRefCode[NBR_FUNCTIONS]; 92 98 signed long alAliasFn[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */ 93 99 signed long alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */ 100 char achType[NBR_FUNCTIONS]; 94 101 } FNFINDBUF, *PFNFINDBUF; 95 102 … … 106 113 const char *pszDatabase); 107 114 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); 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); 112 120 unsigned short _System dbGet(const char *pszTable, 113 121 const char *pszGetColumn, 114 122 const char *pszMatch1, 115 123 const char *pszMatchValue1); 116 BOOL _System dbInsertUpdateFunction(signed long l Dll,124 BOOL _System dbInsertUpdateFunction(signed long lModule, 117 125 const char *pszFunction, 118 126 const char *pszIntFunction, … … 120 128 BOOL fIgnoreOrdinal, 121 129 char fchType); 122 BOOL _System dbInsertUpdateFile(signed long l Dll,130 BOOL _System dbInsertUpdateFile(signed long lModule, 123 131 const char *pszFilename, 124 132 const char *pszDescription, … … 128 136 BOOL _System dbFindFunction(const char *pszFunctionName, 129 137 PFNFINDBUF pFnFindBuf, 130 signed long l Dll);131 signed long _System dbFindFile(signed long l Dll, const char *pszFilename);138 signed long lModule); 139 signed long _System dbFindFile(signed long lModule, const char *pszFilename); 132 140 signed long _System dbFindAuthor(const char *pszAuthor, const char *pszEmail); 133 141 signed long _System dbGetFunctionState(signed long lRefCode); 134 142 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, 135 signed long l Dll,143 signed long lModule, 136 144 char *pszError); 137 145 BOOL _System dbRemoveDesignNotes(signed long lFile); 138 BOOL _System dbAddDesignNote(signed long l Dll,146 BOOL _System dbAddDesignNote(signed long lModule, 139 147 signed long lFile, 140 148 const char *pszTitle, … … 160 168 char *pszDate); 161 169 /* StateUpd stuff */ 162 BOOL _System dbGetNotUpdatedFunction(signed long l Dll,170 BOOL _System dbGetNotUpdatedFunction(signed long lModule, 163 171 DBCALLBACKFETCH dbFetchCallBack); 164 signed long _System dbGetNumberOfUpdatedFunction(signed long l Dll);172 signed long _System dbGetNumberOfUpdatedFunction(signed long lModule); 165 173 166 174 /* APIImport stuff */ 167 BOOL _System dbClearUpdateFlagFile(signed long l Dll);168 BOOL _System dbClearUpdateFlagFunction(signed long l Dll, BOOL fAll);169 BOOL _System dbDeleteNotUpdatedFiles(signed long l Dll);170 BOOL _System dbDeleteNotUpdatedFunctions(signed long l Dll, BOOL fAll);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); 171 179 172 180 #ifdef __cplusplus -
trunk/tools/database/www/Odin32DB.phtml
r6662 r6677 31 31 * What are we up to? We'll parse the input parameter (if any) to find out. 32 32 */ 33 if (isset($ dllrefcode))34 { /* DLLs by refcode */35 $sCategory = " dll";36 $sCategoryName = " Dll";37 if ($ dllrefcode != "")38 $iRefcode = (int)$ dllrefcode;33 if (isset($modrefcode)) 34 { /* Modules by refcode */ 35 $sCategory = "module"; 36 $sCategoryName = "Module"; 37 if ($modrefcode != "") 38 $iRefcode = (int)$modrefcode; 39 39 $fFunctions = (isset($fFunctions) && $fFunctions != '0'); 40 40 $fFiles = (isset($fFiles) && $fFiles != '0'); … … 78 78 if ($authorrefcode != "") 79 79 $iRefcode = (int)$authorrefcode; 80 $f Dlls = (isset($fDlls) && $fDlls!= '0');80 $fModules = (isset($fModules) && $fModules != '0'); 81 81 $fFunctions = (isset($fFunctions) && $fFunctions != '0'); 82 82 $fFiles = (isset($fFiles) && $fFiles != '0'); 83 83 $fAPIGroups = (isset($fAPIGroups) && $fAPIGroups != '0'); 84 84 $fSortByState=(isset($fSortByState) && $fSortByState!= '0'); 85 if (!(isset($author dll) && $authordll != "" && @(int)$authordll>= 0))86 $author dll= -1;85 if (!(isset($authormod) && $authormod != "" && @(int)$authormod >= 0)) 86 $authormod = -1; 87 87 } 88 88 else if (isset($designnoterefcode)) … … 95 95 else if (isset($dlls)) 96 96 { /* All dlls */ 97 $sCategory = " dlls";97 $sCategory = "modules"; 98 98 $sCategoryName = "All Dlls"; 99 $s DllType = 'A';99 $sModType = 'A'; 100 100 } 101 101 else if (isset($internal)) 102 { /* All Internal Dlls */103 $sCategory = " dlls";102 { /* All Internal Modules */ 103 $sCategory = "modules"; 104 104 $sCategoryName = "Internal Dlls"; 105 $s DllType = 'I';105 $sModType = 'I'; 106 106 } 107 107 else if (isset($support)) 108 { /* All dlls*/109 $sCategory = " dlls";108 { /* All Suppors Stuff */ 109 $sCategory = "modules"; 110 110 $sCategoryName = "Support Stuff"; 111 $s DllType = 'S';111 $sModType = 'S'; 112 112 } 113 113 else if (isset($tools)) 114 114 { /* Tools */ 115 $sCategory = " dlls";115 $sCategory = "modules"; 116 116 $sCategoryName = "Tools"; 117 $s DllType = 'T';117 $sModType = 'T'; 118 118 } 119 119 else if (isset($apigroups)) … … 179 179 switch ($sCategory) 180 180 { 181 case " dll":182 { 183 Odin32DB DllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);181 case "module": 182 { 183 Odin32DBModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState); 184 184 break; 185 185 } … … 205 205 case "author": 206 206 { 207 Odin32DBAuthorInfo($db, $iRefcode, $f Dlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll);207 Odin32DBAuthorInfo($db, $iRefcode, $fModules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authormod); 208 208 break; 209 209 } … … 249 249 } 250 250 251 case " dlls":251 case "modules": 252 252 { 253 253 /* 254 * List all dlls.254 * List all modules. 255 255 */ 256 256 Odin32DBNavigationTop("",""); … … 269 269 " COUNT(f.refcode) AS functions\n". 270 270 "FROM\n". 271 " dlld\n".271 " module d\n". 272 272 " LEFT OUTER JOIN function f\n". 273 " ON f. dll= d.refcode\n".273 " ON f.module = d.refcode\n". 274 274 "WHERE\n". 275 " d.type = '".$s DllType."'\n".275 " d.type = '".$sModuleType."'\n". 276 276 "GROUP BY d.refcode\n". 277 277 "ORDER BY d.name\n"; … … 283 283 { 284 284 echo "\n<font size=-1><ul><b>"; 285 while ($a Dll= mysql_fetch_array($result))285 while ($aModule = mysql_fetch_array($result)) 286 286 { 287 echo "<li><a href=\"Odin32DB.phtml? dllrefcode=".$aDll["refcode"].288 "\">".$a Dll["name"]."</a> (".$aDll["functions"].")\n";287 echo "<li><a href=\"Odin32DB.phtml?modrefcode=".$aModule["refcode"]. 288 "\">".$aModule["name"]."</a> (".$aModule["functions"].")\n"; 289 289 } 290 290 echo "</b></ul></font>\n"; … … 324 324 { 325 325 if (mysql_num_rows($result) <= 0) 326 echo "<i>No dlls!</i>\n";326 echo "<i>No Authors!</i>\n"; 327 327 else 328 328 { … … 371 371 { 372 372 if (mysql_num_rows($result) <= 0) 373 echo "<i>No dlls!</i>\n";373 echo "<i>No Apigroups!</i>\n"; 374 374 else 375 375 { … … 409 409 " dn.seqnbr AS seqnbr,\n". 410 410 " dn.level AS level,\n". 411 " d.name AS dllname,\n".411 " m.name AS modname,\n". 412 412 " f.name AS filename\n". 413 413 "FROM\n". 414 414 " designnote dn,\n". 415 " dll d,\n".415 " module m,\n". 416 416 " file f\n". 417 "WHERE dn. dll= d.refcode\n".417 "WHERE dn.module = d.refcode\n". 418 418 " AND dn.file = f.refcode\n". 419 419 " AND dn.level <= 1\n". 420 "ORDER BY d.name, dn.seqnbr, dn.seqnbrnote\n";420 "ORDER BY m.name, dn.seqnbr, dn.seqnbrnote\n"; 421 421 if ($result = mysql_query($sql, $db)) 422 422 { -
trunk/tools/database/www/Odin32DBHelpers.php3
r6664 r6677 113 113 114 114 /** 115 * Compute completion percentage for a dll.115 * Compute completion percentage for a module. 116 116 * @returns Completion percentage. Range 0-100. 117 117 * On error -1 or -2 is returned. 118 * @param $i Dll Dllreference code.119 * @param $db Database connection variable.120 * @sketch Get total number of function in the dll.121 * Get number of completed functions in the dll.118 * @param $iModule Module reference code. 119 * @param $db Database connection variable. 120 * @sketch Get total number of function in the module. 121 * Get number of completed functions in the module. 122 122 * return complete*100 / total 123 123 * @status Completely implemented … … 125 125 * @remark 126 126 */ 127 function Odin32DBComputeCompletion($i Dll, $db)128 { 129 /* 130 * Count the total number of functions in the DLL.127 function Odin32DBComputeCompletion($iModule, $db) 128 { 129 /* 130 * Count the total number of functions in the module. 131 131 */ 132 132 $sql = sprintf("SELECT SUM(s.weight)/COUNT(f.state) … … 136 136 WHERE 137 137 f.state = s.refcode 138 AND dll= %d",139 $i Dll);138 AND module = %d", 139 $iModule); 140 140 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1) 141 141 { … … 165 165 166 166 /** 167 * Draws a completion bar for a dll (or all dlls).168 * @param $i Dll Dllreference code.167 * Draws a completion bar for a module (or all modules.). 168 * @param $iModule Module reference code. 169 169 * If < 0 then for the entire project. 170 * @param $i DllName Dllname.170 * @param $iModName Module name. 171 171 * @param $db Database connection variable. 172 172 * @sketch Call Odin32DBCompletionBar2 with an appropriate condition. … … 174 174 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 175 175 */ 176 function Odin32DBCompletionBar Dll($iDll, $sDllName, $db)177 { 178 if ($i Dll< 0)179 return Odin32DBcompletionBar2("", $s DllName, $db);180 return Odin32DBcompletionBar2(" dll = ".$iDll, $sDllName, $db);176 function Odin32DBCompletionBarModule($iModule, $sModName, $db) 177 { 178 if ($iModule < 0) 179 return Odin32DBcompletionBar2("", $sModName, $db); 180 return Odin32DBcompletionBar2("module = ".$iModule." AND f.type IN ('A', 'I')", $sModName, $db); 181 181 } 182 182 … … 221 221 { 222 222 /* 223 * Count the total number of functions in the DLL.223 * Count the total number of functions for the author. 224 224 */ 225 225 $sql = "SELECT COUNT(*) FROM fnauthor fa JOIN function f\n". 226 "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor ;226 "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor." AND f.type IN ('A', 'I')"; 227 227 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1) 228 228 { … … 260 260 " fa.author = ".$iAuthor." AND\n". 261 261 " fa.function = f.refcode AND\n". 262 " f.state = s.refcode\n". 262 " f.state = s.refcode AND\n". 263 " f.type IN ('A', 'I')\n". 263 264 "GROUP BY s.refcode\n". 264 265 "ORDER BY state\n"; … … 295 296 /** 296 297 * Draws a completion bar. 297 * @param $ iDll Dll reference code.298 * If < 0 then for the entire project.299 * @param $db Database connection variable.300 * @sketch Get total number of function in the dll.298 * @param $sCondition Where conditions. 299 * @param $sName Name... 300 * @param $db Database connection variable. 301 * @sketch Get total number of function in the selection. 301 302 * Get the number of function per status. (+state color) 302 303 * Draw bar. … … 307 308 { 308 309 /* 309 * Count the total number of functions in the DLL.310 * Count the total number of functions in selection. 310 311 */ 311 312 $sql = "SELECT COUNT(*) FROM function f"; … … 391 392 { 392 393 /* 393 * Count the total number of functions in the DLL. 394 */ 395 $sql = "SELECT 396 name, 397 color 398 FROM 399 state 400 ORDER BY refcode"; 394 * Select the states. 395 */ 396 $sql = "SELECT name, 397 color 398 FROM state 399 ORDER BY refcode"; 401 400 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1) 402 401 { … … 668 667 /** 669 668 * Writes the a function listing base sqlstatement with these columns (ordered): 670 * 0. dllrefcode671 * 1. dllname669 * 0. Module refcode 670 * 1. Module name 672 671 * 2. number of functions 673 672 * … … 677 676 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 678 677 */ 679 function Odin32DBWrite Dlls($sql, $db)678 function Odin32DBWriteModules($sql, $db) 680 679 { 681 680 if ($result2 = mysql_query($sql, $db)) … … 685 684 echo "\n<table width=100% border=0 cellpadding=0>\n". 686 685 "<tr>\n". 687 " <td width=75%><font size=-1><b> Dlls</b></font></td>\n".686 " <td width=75%><font size=-1><b>Modules</b></font></td>\n". 688 687 " <td align=right><font size=-1><b>Functions</b></font></td>\n". 689 688 "</tr>\n"; 690 689 while ($aFunction = mysql_fetch_array($result2)) 691 690 printf("<tr>". 692 "<td><font size=-1><a href=\"Odin32DB.phtml? dllrefcode=%s\">%s</a></font></td>".691 "<td><font size=-1><a href=\"Odin32DB.phtml?modrefcode=%s\">%s</a></font></td>". 693 692 "<td align=right><font size=-1>%s</font></td>". 694 693 "</tr>\n", … … 762 761 /** 763 762 * Writes the a function listing base sqlstatement with these columns (ordered): 764 * 0. dllrefcode765 * 1. dllname763 * 0. module refcode 764 * 1. module name 766 765 * 2. function refcode 767 766 * 3. function name … … 775 774 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 776 775 */ 777 function Odin32DBWriteFunctionsWith Dlls($sql, $db, $sURLArgs)776 function Odin32DBWriteFunctionsWithModules($sql, $db, $sURLArgs) 778 777 { 779 778 if ($result2 = mysql_query($sql, $db)) … … 783 782 echo "\n<table width=100% border=0 cellpadding=0>\n". 784 783 "<tr>\n". 785 " <td width=30%><font size=-1><b> DllName</b></font></td>\n".784 " <td width=30%><font size=-1><b>Module Name</b></font></td>\n". 786 785 " <td width=45%><font size=-1><b>Function Name</b></font></td>\n". 787 786 " <td><font size=-1><b>State</b></font></td>\n". … … 789 788 while ($aFunction = mysql_fetch_row($result2)) 790 789 printf("<tr>". 791 "<td><font size=-1><a href=\"Odin32DB.phtml? dllrefcode=%s\">%s</a></font></td>".790 "<td><font size=-1><a href=\"Odin32DB.phtml?modrefcode=%s\">%s</a></font></td>". 792 791 "<td><font size=-1><a href=\"Odin32DB.phtml?functionrefcode=%s\">%s</a></font></td>". 793 792 "<td><font size=-1 color=%s>%s</font></td>". … … 809 808 810 809 echo "<p>Click <a href=\"Odin32DB.phtml#functions?".$sURLArgs."\">here</a> to view functions sorted ". 811 ($fSortByState ? "alphabetical by dll" : "by state"). ".<br>";810 ($fSortByState ? "alphabetical by module" : "by state"). ".<br>"; 812 811 } 813 812 else … … 953 952 954 953 echo "<a href=\"Odin32DB.phtml\">Root</a>\n". 955 " - <a href=\"Odin32DB.phtml? dlls=1\">Dlls</a>\n".954 " - <a href=\"Odin32DB.phtml?modules=1\">Moduless</a>\n". 956 955 " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n". 957 956 " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n"; … … 986 985 echo 987 986 "<a href=\"Odin32DB.phtml\">Root</a>\n". 988 " - <a href=\"Odin32DB.phtml? dlls=1\">Dlls</a>\n".987 " - <a href=\"Odin32DB.phtml?moduless=1\">Modules</a>\n". 989 988 " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n". 990 989 " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n"; … … 1029 1028 " a.name AS aliasname,\n". 1030 1029 " a.refcode AS aliasrefcode,\n". 1031 " ad.name AS alias dllname,\n".1032 " ad.refcode AS alias dllrefcode,\n".1033 " d.name AS dllname,\n".1034 " d.refcode AS dllrefcode,\n".1030 " ad.name AS aliasnmodname,\n". 1031 " ad.refcode AS aliasmodrefcode,\n". 1032 " d.name AS modname,\n". 1033 " d.refcode AS modrefcode,\n". 1035 1034 " i.name AS filename,\n". 1036 1035 " i.refcode AS filerefcode,\n". … … 1040 1039 " function f\n". 1041 1040 " LEFT OUTER JOIN function a ON f.aliasfn = a.refcode\n". 1042 " LEFT OUTER JOIN dll ad ON a.dll= ad.refcode\n".1041 " LEFT OUTER JOIN module ad ON a.module = ad.refcode\n". 1043 1042 " LEFT OUTER JOIN apigroup g ON f.apigroup = g.refcode\n". 1044 " LEFT JOIN dll d ON f.dll= d.refcode\n".1043 " LEFT JOIN module d ON f.module = d.refcode\n". 1045 1044 " LEFT JOIN state s ON f.state = s.refcode\n". 1046 1045 " LEFT OUTER JOIN file i ON f.file = i.refcode\n". … … 1064 1063 Odin32DBInfoRow1("Type", $array, "type", "", "","invalid",""); 1065 1064 Odin32DBInfoRow1("State", $array, "state", "", "","invalid",""); 1066 Odin32DBInfoRow1(" Dll", $array, "dllname", "dllrefcode", "dllrefcode","","");1065 Odin32DBInfoRow1("Module", $array, "modname", "modrefcode", "modrefcode","",""); 1067 1066 Odin32DBInfoRow1("Ordinal", $array, "ordinal","","","not available",""); 1068 1067 if (isset($array["apigroupname"])) 1069 1068 Odin32DBInfoRow1("API Group", $array, "apigroupname", "apigrouprefcode", "apigrouprefcode","",""); 1070 1069 Odin32DBInfoRow1("File", $array, "filename", "filerefcode", "filerefcode", "not available", 1071 " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array[" dllname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)");1070 " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array["modname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)"); 1072 1071 if ($array["line"] > 0) 1073 1072 Odin32DBInfoRow1("Line", $array, "line", "", "","",""); … … 1075 1074 Odin32DBInfoRow1("Line", $array, "unavailable", "", "","not available",""); 1076 1075 if (isset($array["aliasrefcode"])) 1077 Odin32DBInfoRow2("Forwards", $array, "alias dllname", "aliasdllrefcode", "dllrefcode","",".",1076 Odin32DBInfoRow2("Forwards", $array, "aliasmodname", "aliasmodrefcode", "modrefcode","",".", 1078 1077 "aliasname", "aliasrefcode", "functionrefcode"); 1079 1078 else 1080 1079 { 1081 1080 $sql = sprintf("SELECT\n". 1082 " d.name AS dllname,\n".1083 " d.refcode AS dllrefcode,\n".1081 " m.name AS modname,\n". 1082 " m.refcode AS modrefcode,\n". 1084 1083 " f.name AS fnname,\n". 1085 1084 " f.refcode AS fnrefcode\n". 1086 1085 "FROM\n". 1087 1086 " function f,\n". 1088 " dll d\n".1087 " module m\n". 1089 1088 "WHERE\n". 1090 1089 " f.aliasfn = %d AND\n". 1091 " f. dll = d.refcode\n".1092 "ORDER BY d.name, f.name\n",1090 " f.module = m.refcode\n". 1091 "ORDER BY m.name, f.name\n", 1093 1092 $iRefcode); 1094 1093 if (($result2 = mysql_query($sql, $db))) … … 1102 1101 if ($f) $sValue = $sValue."<br>"; 1103 1102 else $f = 1; 1104 $sValue = $sValue."<a href=\"Odin32DB.phtml? dllrefcode=".1105 $aAlias[" dllrefcode"]."\">".$aAlias["dllname"]."</a>.".1103 $sValue = $sValue."<a href=\"Odin32DB.phtml?modrefcode=". 1104 $aAlias["modrefcode"]."\">".$aAlias["modname"]."</a>.". 1106 1105 "<a href=\"Odin32DB.phtml?functionrefcode=". 1107 1106 $aAlias["fnrefcode"]."\">".$aAlias["fnname"]."</a>"; … … 1245 1244 1246 1245 /** 1247 * Writes standard dllinfo.1246 * Writes standard module info. 1248 1247 * 1249 1248 * @returns void 1250 1249 * @param $db Database handle. 1251 * @param $iRefcode Dllreference code.1250 * @param $iRefcode Module reference code. 1252 1251 * @param $fFunctions Flags which tells wether to list all functions or not. 1253 1252 * @param $fFiles Flags which tells wether to list all files or not. … … 1260 1259 * @remark 1261 1260 */ 1262 function Odin32DB DllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState)1263 { 1264 $sURLArgs = " dllrefcode=".$iRefcode.1261 function Odin32DBModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState) 1262 { 1263 $sURLArgs = "modrefcode=".$iRefcode. 1265 1264 ($fFunctions ? "&fFunctions=1" : ""). 1266 1265 ($fFiles ? "&fFiles=1" : ""). … … 1272 1271 * Navigation - TOP 1273 1272 */ 1274 $sExpand = " dllrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";1273 $sExpand = "modrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1"; 1275 1274 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 1276 $sCollapse = " dllrefcode=".$iRefcode;1275 $sCollapse = "modrefcode=".$iRefcode; 1277 1276 Odin32DBNavigationTop($sExpand, $sCollapse); 1278 1277 … … 1281 1280 */ 1282 1281 $sql = sprintf("SELECT\n". 1283 " d.name AS name,\n".1284 " d.description AS description,\n".1282 " m.name AS name,\n". 1283 " m.description AS description,\n". 1285 1284 " c.description AS type\n". 1286 1285 "FROM\n". 1287 " dlld,\n".1286 " module d,\n". 1288 1287 " code c\n". 1289 1288 "WHERE\n". 1290 1289 " c.codegroup = 'DTYP' AND\n". 1291 " d.type = c.code AND\n".1292 " d.refcode = %d",1290 " m.type = c.code AND\n". 1291 " m.refcode = %d", 1293 1292 $iRefcode); 1294 1293 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) … … 1307 1306 " function\n". 1308 1307 "WHERE\n". 1309 " dll= %d",1308 " module = %d", 1310 1309 $iRefcode); 1311 1310 $cFunctions = 0; … … 1321 1320 " file\n". 1322 1321 "WHERE\n". 1323 " dll= %d",1322 " module = %d", 1324 1323 $iRefcode); 1325 1324 $cFiles = 0; … … 1335 1334 " apigroup\n". 1336 1335 "WHERE\n". 1337 " dll= %d",1336 " module = %d", 1338 1337 $iRefcode); 1339 1338 $cAPIGroups = 0; … … 1351 1350 */ 1352 1351 Odin32DBNaslov("Completion", "completion"); 1353 Odin32DBCompletionBar Dll($iRefcode, "", $db);1352 Odin32DBCompletionBarModule($iRefcode, "", $db); 1354 1353 1355 1354 /* … … 1362 1361 " function\n". 1363 1362 "WHERE\n". 1364 " dll= %d\n".1363 " module = %d\n". 1365 1364 "GROUP BY state\n". 1366 1365 "ORDER BY state", … … 1383 1382 " LEFT JOIN state s ON f.state = s.refcode\n". 1384 1383 "WHERE\n". 1385 " f. dll= %d\n",1384 " f.module = %d\n", 1386 1385 $iRefcode); 1387 1386 if ($fSortByState) … … 1410 1409 " LEFT OUTER JOIN function fn ON fn.file = f.refcode\n". 1411 1410 "WHERE\n". 1412 " f. dll= %d\n".1411 " f.module = %d\n". 1413 1412 "GROUP BY f.refcode\n". 1414 1413 "ORDER BY f.name\n", … … 1437 1436 " JOIN function f\n". 1438 1437 "WHERE\n". 1439 " g. dll= %d AND\n".1440 " f. dll= %d AND\n".1438 " g.module = %d AND\n". 1439 " f.module = %d AND\n". 1441 1440 " f.apigroup = g.refcode\n". 1442 1441 "GROUP BY f.apigroup\n". … … 1467 1466 " JOIN author a\n". 1468 1467 "WHERE\n". 1469 " f. dll= %d AND\n".1468 " f.module = %d AND\n". 1470 1469 " fa.function = f.refcode AND\n". 1471 1470 " fa.author = a.refcode\n". … … 1535 1534 " f.revision AS revision,\n". 1536 1535 " f.description AS description,\n". 1537 " f. dll AS dllrefcode,\n".1538 " d.name AS dllname\n".1536 " f.module AS modrefcode,\n". 1537 " m.name AS modname\n". 1539 1538 "FROM\n". 1540 1539 " file f,\n". 1541 " dll d,\n".1540 " module m,\n". 1542 1541 " author a\n". 1543 1542 "WHERE\n". 1544 1543 " f.refcode = %d AND\n". 1545 " f. dll = d.refcode AND\n".1544 " f.module = m.refcode AND\n". 1546 1545 " f.lastauthor= a.refcode", 1547 1546 $iRefcode); … … 1554 1553 echo "\n<table width=100% border=3 cellpadding=0>\n"; 1555 1554 Odin32DBInfoRow1("Name", $array, "name","","","", 1556 " (<a href=\"cvs.phtml?sFile=./src/".$array[" dllname"]."/".$array["name"].",v&sRevision=\">cvs</a>)");1555 " (<a href=\"cvs.phtml?sFile=./src/".$array["modname"]."/".$array["name"].",v&sRevision=\">cvs</a>)"); 1557 1556 Odin32DBInfoRow1("Revision", $array, "revision","","","",""); 1558 1557 Odin32DBInfoRow1("Changed", $array, "lastdatetime","","","",""); 1559 1558 Odin32DBInfoRow1("Last Author", $array, "lastauthorname","lastauthorrefcode","authorrefcode","",""); 1560 Odin32DBInfoRow1(" Dll", $array, "dllname","dllrefcode","dllrefcode","","");1559 Odin32DBInfoRow1("Module", $array, "modname","modrefcode","modrefcode","",""); 1561 1560 $sql = sprintf("SELECT\n". 1562 1561 " COUNT(*) as functions\n". … … 1722 1721 * @param $db Database handle. 1723 1722 * @param $iRefcode Author reference code. 1724 * @param $f Dlls Flags which tells wether to list all dlls or not.1723 * @param $fModules Flags which tells wether to list all modules or not. 1725 1724 * @param $fFunctions Flags which tells wether to list all functions or not. 1726 1725 * @param $fFiles Flags which tells wether to list all files or not. … … 1728 1727 * @param $fSortByState Flags which tells wether to sort functions by 1729 1728 * state and function name or just by function name. 1730 * @param $i DllRefcode Dll refcode. All Dllif < 0.1729 * @param $iModRefcode Module refcode. All modules if < 0. 1731 1730 * (not implemented yet) 1732 1731 * @sketch … … 1734 1733 * @remark 1735 1734 */ 1736 function Odin32DBAuthorInfo($db, $iRefcode, $f Dlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iDllRefcode)1735 function Odin32DBAuthorInfo($db, $iRefcode, $fModules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iModRefcode) 1737 1736 { 1738 1737 $sURLArgs = "authorrefcode=".$iRefcode. 1739 ($f Dlls ? "&fDlls=1" : "").1738 ($fModules ? "&fModules=1" : ""). 1740 1739 ($fFunctions ? "&fFunctions=1" : ""). 1741 1740 ($fFiles ? "&fFiles=1" : ""). … … 1746 1745 * Navigation - TOP 1747 1746 */ 1748 $sExpand = "authorrefcode=".$iRefcode."&f Dlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;1747 $sExpand = "authorrefcode=".$iRefcode."&fModules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&mod=".$iModRefcode; 1749 1748 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 1750 1749 $sCollapse = "authorrefcode=".$iRefcode; … … 1796 1795 } 1797 1796 $sql = sprintf("SELECT\n". 1798 " COUNT(f. dll) as functions1797 " COUNT(f.module) as functions 1799 1798 \n". 1800 1799 "FROM\n". … … 1804 1803 " fa.author = %d AND". 1805 1804 " f.refcode = fa.function\n". 1806 "GROUP BY f. dll",1805 "GROUP BY f.module", 1807 1806 $iRefcode); 1808 $c Dlls = 0;1809 if (($result2 = mysql_query($sql, $db)) && ($c Dlls = mysql_num_rows($result2)) > 0)1810 Odin32DBInfoRow1NoArray("# Dlls", $cDlls, "","","","");1807 $cModules = 0; 1808 if (($result2 = mysql_query($sql, $db)) && ($cModules = mysql_num_rows($result2)) > 0) 1809 Odin32DBInfoRow1NoArray("# Moduless", $cModules, "","","",""); 1811 1810 $sql = sprintf("SELECT\n". 1812 " COUNT(f. dll) as functions1811 " COUNT(f.module) as functions 1813 1812 \n". 1814 1813 "FROM\n". … … 1825 1824 Odin32DBInfoRow1NoArray("# Files", $cFiles, "","","",""); 1826 1825 $sql = sprintf("SELECT\n". 1827 " COUNT(f. dll) as functions1826 " COUNT(f.module) as functions 1828 1827 \n". 1829 1828 "FROM\n". … … 1867 1866 1868 1867 /* 1869 * Dlls1870 */ 1871 Odin32DBNaslov(" Dlls", "dlls");1872 if ($f Dlls)1868 * Modules 1869 */ 1870 Odin32DBNaslov("Modules", "Modules"); 1871 if ($fModules) 1873 1872 { 1874 1873 $sql = sprintf("SELECT\n". 1875 " d.refcode,\n".1876 " d.name,\n".1874 " m.refcode,\n". 1875 " m.name,\n". 1877 1876 " COUNT(f.refcode)\n". 1878 1877 "FROM\n". 1879 1878 " fnauthor fa,\n". 1880 " dll d,\n".1879 " module m,\n". 1881 1880 " function f\n". 1882 1881 "WHERE\n". 1883 1882 " fa.author = %d AND\n". 1884 1883 " fa.function = f.refcode AND\n". 1885 " f. dll = d.refcode\n".1886 "GROUP BY d.refcode\n".1887 "ORDER BY d.name\n",1884 " f.module = m.refcode\n". 1885 "GROUP BY m.refcode\n". 1886 "ORDER BY m.name\n", 1888 1887 $iRefcode); 1889 Odin32DBWrite Dlls($sql, $db, $sURLArgs);1888 Odin32DBWriteModules($sql, $db, $sURLArgs); 1890 1889 } 1891 1890 else 1892 echo "Click <a href=\"Odin32DB.phtml# dlls?".$sURLArgs."&fDlls=1".1891 echo "Click <a href=\"Odin32DB.phtml#modules?".$sURLArgs."&fModules=1". 1893 1892 "\">here</a> to see all files.\n"; 1894 1893 … … 1903 1902 " f.refcode,\n". 1904 1903 " f.name,\n". 1905 " d.refcode,\n".1906 " d.name,\n".1904 " m.refcode,\n". 1905 " m.name,\n". 1907 1906 " s.color,\n". 1908 1907 " s.name\n". … … 1910 1909 " fnauthor fa\n". 1911 1910 " JOIN function f\n". 1912 " JOIN dll d\n".1911 " JOIN module m\n". 1913 1912 " LEFT JOIN state s ON f.state = s.refcode\n". 1914 1913 "WHERE\n". 1915 1914 " fa.author = %d AND\n". 1916 1915 " fa.function = f.refcode AND \n". 1917 " f. dll = d.refcode\n",1916 " f.module = m.refcode\n", 1918 1917 $iRefcode); 1919 1918 if ($fSortByState) … … 1921 1920 else 1922 1921 $sql = $sql."ORDER BY d.name, f.name"; 1923 Odin32DBWriteFunctionsWith Dlls($sql, $db, $sURLArgs);1922 Odin32DBWriteFunctionsWithModules($sql, $db, $sURLArgs); 1924 1923 } 1925 1924 else … … 2038 2037 " g.refcode AS refcode,\n". 2039 2038 " g.description AS description,\n". 2040 " d.name AS dllname,\n".2041 " d.refcode AS dllrefcode\n".2039 " m.name AS modname,\n". 2040 " m.refcode AS modrefcode\n". 2042 2041 "FROM\n". 2043 2042 " apigroup g\n". 2044 " JOIN dll d\n".2043 " JOIN module m\n". 2045 2044 "WHERE\n". 2046 2045 " g.refcode = %d AND". 2047 " g. dll = d.refcode\n",2046 " g.module = m.refcode\n", 2048 2047 $iRefcode); 2049 2048 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) … … 2055 2054 echo "\n<table width=100% border=3 cellpadding=0>\n"; 2056 2055 Odin32DBInfoRow1("Name", $array, "name","","","",""); 2057 Odin32DBInfoRow1(" Dll", $array, "dllname","dllrefcode","dllrefcode","bad configuration","");2056 Odin32DBInfoRow1("Module", $array, "modname","modrefcode","modrefcode","bad configuration",""); 2058 2057 if (isset($array["description"])) 2059 2058 Odin32DBInfoRow1("Description", $array, "description","","","",""); … … 2085 2084 2086 2085 $sql = sprintf("SELECT\n". 2087 " COUNT(f. dll) as functions\n".2086 " COUNT(f.module) as functions\n". 2088 2087 "FROM\n". 2089 2088 " fnauthor fa,\n". … … 2231 2230 * Navigation - TOP 2232 2231 */ 2233 $sExpand = "authorrefcode=".$iRefcode."&f Dlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;2232 $sExpand = "authorrefcode=".$iRefcode."&fModules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&module=".$iModRefcode; 2234 2233 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 2235 2234 $sCollapse = "authorrefcode=".$iRefcode; … … 2243 2242 " dn.note AS note,\n". 2244 2243 " dn.refcode AS refcode,\n". 2245 " dn. dll AS dllrefcode,\n".2244 " dn.module AS modrefcode,\n". 2246 2245 " dn.file AS filerefcode,\n". 2247 2246 " dn.seqnbrnote AS seqnbnote,\n". … … 2249 2248 " dn.seqnbr AS seqnbr,\n". 2250 2249 " dn.line AS line,\n". 2251 " d.name AS dll,\n".2250 " m.name AS modname,\n". 2252 2251 " f.name AS file\n". 2253 2252 "FROM\n". 2254 2253 " designnote dn,\n". 2255 " dll d,\n".2254 " module m,\n". 2256 2255 " file f\n". 2257 2256 "WHERE dn.refcode = %d\n". 2258 " AND dn. dll = d.refcode\n".2257 " AND dn.module = m.refcode\n". 2259 2258 " AND dn.file = f.refcode\n". 2260 2259 "ORDER BY dn.seqnbrnote\n", … … 2268 2267 echo "\n<table width=100% border=3 cellpadding=0>\n"; 2269 2268 Odin32DBInfoRow1("Title", $array, "name","","","",""); 2270 Odin32DBInfoRow1("Module", $array, " dll","","","","");2269 Odin32DBInfoRow1("Module", $array, "modname","","","",""); 2271 2270 Odin32DBInfoRow1("File", $array, "file","","","",""); 2272 2271 Odin32DBInfoRow1("Line", $array, "line","","","","");
Note:
See TracChangeset
for help on using the changeset viewer.