Changeset 6678 for trunk/tools/database
- Timestamp:
- Sep 7, 2001, 12:33:10 PM (24 years ago)
- Location:
- trunk/tools/database
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/APIImport.cpp
r6677 r6678 1 /* $Id: APIImport.cpp,v 1.1 1 2001-09-07 10:24:05bird Exp $ */1 /* $Id: APIImport.cpp,v 1.12 2001-09-07 10:31:42 bird Exp $ */ 2 2 /* 3 3 * … … 92 92 break; 93 93 94 case '-':95 94 case 'h': 96 95 case 'H': … … 258 257 char achDataBuffer[0x200]; 259 258 char *pszModuleName = &achDataBuffer[0]; 260 signed long l Module;259 signed long lDll; 261 260 262 261 /* try create file objects */ … … 287 286 288 287 /* find or insert module name */ 289 if ((l Module = dbCheckInsertModule(pszModuleName, DLL_ODIN32_API)) >= 0)288 if ((lDll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0) 290 289 { 291 290 BOOL fClearUpdateOk = FALSE; … … 295 294 /* Clear the update flag for all functions in this DLL. */ 296 295 if (pOptions->fErase) 297 fClearUpdateOk = dbClearUpdateFlagFunction(l Module, FALSE);296 fClearUpdateOk = dbClearUpdateFlagFunction(lDll, FALSE); 298 297 299 298 lRc = 0; … … 335 334 else 336 335 { /* Update Database */ 337 fOk = dbInsertUpdateFunction(l Module,336 fOk = dbInsertUpdateFunction(lDll, 338 337 &szName[0], 339 338 &szIntName[0], … … 359 358 /* Clear the update flag for all functions in this DLL. */ 360 359 if (fClearUpdateOk && pOptions->fErase) 361 if (!dbDeleteNotUpdatedFunctions(l Module, FALSE))360 if (!dbDeleteNotUpdatedFunctions(lDll, FALSE)) 362 361 { 363 362 fprintf(phLog, "%s: error - dbDeleteNotUpdatedFunctions failed.\n\terror description: %s\n", -
trunk/tools/database/Codes.sql
r6677 r6678 1 -- $Id: Codes.sql,v 1. 2 2001-09-07 10:24:05bird Exp $1 -- $Id: Codes.sql,v 1.3 2001-09-07 10:31:43 bird Exp $ 2 2 -- 3 3 -- Codes. … … 28 28 VALUES ('FTYP', 'I ', 'Internal Odin32 API'); 29 29 INSERT INTO code 30 VALUES ('FTYP', ' F ', 'Some Function');30 VALUES ('FTYP', 'O ', 'Other function'); 31 31 32 INSERT INTO code33 VALUES ('FTYP', 'M ', 'Class public method');34 INSERT INTO code35 VALUES ('FTYP', 'O ', 'Class operator');36 INSERT INTO code37 VALUES ('FTYP', 'C ', 'Class constructor');38 INSERT INTO code39 VALUES ('FTYP', 'D ', 'Class donstructor');40 32 -
trunk/tools/database/CreateTables.sql
r6677 r6678 1 -- $Id: CreateTables.sql,v 1. 19 2001-09-07 10:24:06bird Exp $1 -- $Id: CreateTables.sql,v 1.20 2001-09-07 10:31:43 bird Exp $ 2 2 -- 3 3 -- Create all tables. … … 55 55 -- 56 56 CREATE TABLE state ( 57 refcode 58 color 59 weight 60 name 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 modulenames.69 -- This table holds the dll 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 module(77 refcode SMALLINTNOT NULL AUTO_INCREMENT PRIMARY KEY,76 CREATE TABLE dll ( 77 refcode TINYINT 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 module).87 -- This table holds fileinformation (per dll). 88 88 -- 89 89 CREATE TABLE file ( 90 90 refcode INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, 91 module SMALLINT NOT NULL,91 dll TINYINT 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( module, name),99 UNIQUE u2(dll, name), 100 100 INDEX i1(name) 101 101 ); … … 112 112 CREATE TABLE designnote ( 113 113 refcode INTEGER NOT NULL AUTO_INCREMENT, 114 module SMALLINT NOT NULL,114 dll TINYINT 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( module, seqnbr, level, seqnbrnote, refcode),125 UNIQUE u3(dll, seqnbr, level, seqnbrnote, refcode), 126 126 INDEX i1(file, refcode) 127 127 ); … … 129 129 130 130 -- 131 -- This table holds API information (per module/ file).131 -- This table holds API information (per dll / 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 (?)142 136 -- 143 137 CREATE TABLE function ( 144 138 refcode INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, 145 module SMALLINTNOT NULL,139 dll TINYINT NOT NULL, 146 140 aliasfn INTEGER NOT NULL DEFAULT -1, 147 141 file INTEGER NOT NULL DEFAULT -1, … … 162 156 time TEXT, 163 157 UNIQUE i1(refcode, aliasfn), 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),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), 170 164 INDEX i5(file, refcode), 171 165 INDEX i6(state, file), 172 166 UNIQUE i7(state, refcode), 173 167 UNIQUE i8(refcode, state), 174 UNIQUE i9( module, state, refcode),175 UNIQUE u1(refcode), 176 UNIQUE u2(name, module, refcode),168 UNIQUE i9(dll, state, refcode), 169 UNIQUE u1(refcode), 170 UNIQUE u2(name, dll), 177 171 UNIQUE u3(type, refcode) 178 172 ); … … 183 177 -- 184 178 CREATE TABLE parameter ( 185 function 179 function INTEGER NOT NULL, 186 180 sequencenbr TINYINT NOT NULL, 187 name 188 type 181 name VARCHAR(64) NOT NULL, 182 type VARCHAR(64) NOT NULL, 189 183 description TEXT, 190 184 INDEX i1(function, name), … … 197 191 -- 198 192 CREATE TABLE fnauthor ( 199 author 200 function 193 author SMALLINT NOT NULL, 194 function INTEGER NOT NULL, 201 195 UNIQUE u1(author, function), 202 196 UNIQUE u2(function, author) … … 208 202 -- 209 203 CREATE TABLE apigroup ( 210 refcode 211 module SMALLINT NOT NULL,212 name 204 refcode SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 205 dll TINYINT NOT NULL, 206 name VARCHAR(64) NOT NULL, 213 207 description VARCHAR(128), 214 208 UNIQUE u1(refcode), … … 225 219 226 220 -- 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) 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) 236 229 ); 237 230 … … 241 234 -- 242 235 CREATE TABLE historyapigroup ( 243 apigroup 244 state 245 date DATENOT NULL,246 count 236 apigroup SMALLINT NOT NULL, 237 state SMALLINT NOT NULL, 238 date DATE NOT NULL, 239 count SMALLINT NOT NULL, 247 240 UNIQUE u1(apigroup, state, date) 248 241 ); … … 250 243 251 244 -- 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) 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) 260 252 ); 261 253 … … 265 257 -- 266 258 CREATE TABLE historyapigrouptotal ( 267 apigroup 268 date DATENOT NULL,269 totalcount 259 apigroup SMALLINT NOT NULL, 260 date DATE NOT NULL, 261 totalcount SMALLINT NOT NULL, 270 262 UNIQUE u1(apigroup, date) 271 263 ); … … 322 314 323 315 -- 324 -- This table relates a tgroup with a module.325 -- 326 CREATE TABLE tgroup module(316 -- This table relates a tgroup with a dll. 317 -- 318 CREATE TABLE tgroupdll ( 327 319 tgroup SMALLINT NOT NULL, 328 module SMALLINT NOT NULL,329 UNIQUE u1(tgroup, module)320 dll TINYINT NOT NULL, 321 UNIQUE u1(tgroup, dll) 330 322 ); 331 323 -
trunk/tools/database/Makefile
r6677 r6678 1 # $Id: Makefile,v 1.1 8 2001-09-07 10:24:06bird Exp $1 # $Id: Makefile,v 1.19 2001-09-07 10:31:43 bird Exp $ 2 2 3 3 # … … 35 35 mysqladmin DROP Odin32 36 36 mysql < CreateTables.sql 37 mysql $@ < States.sql 38 mysql $@ < Authors.sql 39 mysql $@ < Codes.sql 37 mysql < States.sql 38 mysql < Authors.sql 40 39 -mysqladmin refresh 41 40 -
trunk/tools/database/StateUpd.cpp
r6677 r6678 1 /* $Id: StateUpd.cpp,v 1.3 8 2001-09-07 10:24:06bird Exp $1 /* $Id: StateUpd.cpp,v 1.39 2001-09-07 10:31:43 bird Exp $ 2 2 * 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 8 8 9 9 /******************************************************************************* 10 * Defined Constants And Macros*10 * Header Files * 11 11 *******************************************************************************/ 12 #define DEBUGLOG 1 /* enables debug logging. */13 #ifdef DEBUGLOG14 #define logprintf(a) fprintf a15 #else16 #define logprintf(a) ((int)0)17 #endif18 19 12 #define INCL_DOSFILEMGR 20 13 #define INCL_DOSERRORS 21 14 #define INCL_DOSMISC 22 15 #define INCL_DOSPROCESS 23 24 25 /*******************************************************************************26 * Header Files *27 *******************************************************************************/28 16 #include <os2.h> 29 17 #include <malloc.h> … … 36 24 #include "db.h" 37 25 26 27 38 28 /******************************************************************************* 39 29 * Global Variables * 40 30 *******************************************************************************/ 41 #ifdef DEBUGLOG42 31 static FILE *phLog = NULL; 43 #endif44 32 static FILE *phSignal = NULL; 45 33 … … 58 46 static void closeLogs(void); 59 47 static unsigned long processDir(const char *pszDirOrFile, POPTIONS pOptions); 60 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions , BOOL fHeader);61 static unsigned long process FileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);48 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions); 49 static unsigned long processModuleHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 62 50 static unsigned long processDesignNote(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 63 static unsigned long process Function(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);51 static unsigned long processAPI(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 64 52 static unsigned long analyseFnHdr(PFNDESC pFnDesc, char **papszLines, int i, const char *pszFilename, POPTIONS pOptions); 65 53 static unsigned long analyseFnDcl(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions); 66 54 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);69 55 static char *SDSCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL); 70 56 static char *CommonCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL); 71 57 static BOOL isFunction(char **papszLines, int i, POPTIONS pOptions); 72 58 static BOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions); 73 static BOOL isClass(char **papszLines, int i, POPTIONS pOptions);74 59 static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser); 75 60 static char *skipInsignificantChars(char **papszLines, int &i, char *psz); … … 89 74 static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines); 90 75 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);97 76 98 77 … … 108 87 BOOL fFatal = FALSE; 109 88 unsigned long ulRc = 0; 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 }; 89 char szDLLName[64]; 90 OPTIONS options = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, &szDLLName[0], -1}; 127 91 unsigned long ulRc2; 128 92 char *pszErrorDesc = NULL; … … 137 101 /*DosSetPriority(PRTYS_PROCESSTREE, PRTYC_REGULAR, 1, 0);*/ 138 102 139 /* get modulename from directory */103 /* get dll name from directory */ 140 104 ul1 = ul2 = 0; 141 105 DosQueryCurrentDisk(&ul1, &ul2); 142 ul2 = sizeof(sz ModName);143 DosQueryCurrentDir(ul1, &sz ModName[0], &ul2);106 ul2 = sizeof(szDLLName); 107 DosQueryCurrentDir(ul1, &szDLLName[0], &ul2); 144 108 if (ul2 != 0) 145 109 { 146 if (sz ModName[ul2-1] == '\\' || szModName[ul2-1] == '/')147 sz ModName[--ul2] = '\0';110 if (szDLLName[ul2-1] == '\\' || szDLLName[ul2-1] == '/') 111 szDLLName[--ul2] = '\0'; 148 112 ul1 = ul2; 149 while (ul1 != 0 && sz ModName[ul1-1] != '\\' && szModName[ul1-1] != '/')113 while (ul1 != 0 && szDLLName[ul1-1] != '\\' && szDLLName[ul1-1] != '/') 150 114 ul1--; 151 115 if (ul1 != 0) 152 options.psz ModName = &szModName[ul1];116 options.pszDLLName = &szDLLName[ul1]; 153 117 } 154 118 else 155 sz ModName[0] = '\0';119 szDLLName[0] = '\0'; 156 120 157 121 … … 163 127 * -io Integrity check only. 164 128 * -s Scan subdirectories. 129 * -Old <[+]|-> Old API Style. 165 130 * -OS2<[+]|-> Removes 'OS2'-prefix from function name. 166 131 * -COMCTL32<[+]|-> Removes 'COMCTL32'-prefix from function name. 167 132 * -VERSION<[+]|-> Removes 'VERSION'-prefix from function name. 168 * -Mod:<modname> Name of the module being processed. 169 * -Type:<modtype> Module type. default API or whatever is in DB. 133 * -Dll:<dllname> Name of the dll being processed. 170 134 * -d:<dbname> Database name 171 135 * -p:<passwd> Password … … 183 147 case 'D': 184 148 if (strnicmp(&argv[argi][1], "dll:", 4) == 0 ) 185 options.psz ModName = &argv[argi][5];149 options.pszDLLName = &argv[argi][5]; 186 150 else 187 151 { … … 193 157 break; 194 158 195 case '-':196 159 case 'h': 197 160 case 'H': … … 229 192 } 230 193 break; 231 232 case 'm':233 case 'M':234 if (strchr(&argv[argi][1], ':'))235 options.pszModName = strchr(&argv[argi][1], ':') + 1;236 else237 {238 fFatal = TRUE;239 fprintf(stderr, "warning: option '-mod:' requires a module name.\n");240 }241 break;242 243 194 244 195 case 'o': … … 266 217 case 'S': 267 218 options.fRecursive = TRUE; 268 fprintf(stderr, "Warning: -s processes subdirs of source for one module\n");219 fprintf(stderr, "Warning: -s processes subdirs of source for one DLL\n"); 269 220 break; 270 221 … … 277 228 break; 278 229 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 else287 {288 fFatal = TRUE;289 fprintf(stderr, "warning: option '-type:' requires type char.\n");290 }291 }292 else293 {294 fFatal = TRUE;295 fprintf(stderr, "warning: option '-type:' requires type char.\n");296 }297 break;298 299 230 default: 300 231 fprintf(stderr, "incorrect parameter. (argi=%d, argv[argi]=%s)\n", argi, argv[argi]); … … 303 234 } 304 235 } 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 to311 * the parameter count.312 * Restrictions: Parameters enclosed in "" is not implemented.313 * No commandline parameters are processed after the @file314 */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 else357 {358 fprintf(stderr, "error: could not open parameter file\n");359 return -1;360 }361 break;362 }363 236 else 364 237 break; /* files has started */ … … 393 266 } 394 267 395 396 268 if (!options.fIntegrityOnly) 397 269 { 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) 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) 406 274 { 407 275 /* processing */ … … 409 277 ulRc = processDir(".", &options); 410 278 else 411 while (arg i < argc)279 while (argv[argi] != NULL) 412 280 { 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); 281 ulRc += processDir(argv[argi], &options); 434 282 argi++; 435 283 } … … 461 309 } 462 310 else 463 { /* failed to find module- concidered nearly fatal. */464 fprintf(phSignal, "-,-: failed to find module(%s)!\n\t%s\n",465 options.psz ModName ? options.pszModName : "<NULL>",311 { /* failed to find dll - concidered nearly fatal. */ 312 fprintf(phSignal, "-,-: failed to find dll (%s)!\n\t%s\n", 313 options.pszDLLName ? options.pszDLLName : "<NULL>", 466 314 dbGetLastErrorDesc()); 467 315 ulRc++; … … 472 320 if (!options.fIntegrityOnly) 473 321 { 474 cUpdated = dbGetNumberOfUpdatedFunction(options.l ModRefcode);475 cAll = dbCountFunctionIn Module(options.lModRefcode, FALSE);476 cNotAliased = dbCountFunctionIn Module(options.lModRefcode, TRUE);322 cUpdated = dbGetNumberOfUpdatedFunction(options.lDllRefcode); 323 cAll = dbCountFunctionInDll(options.lDllRefcode, FALSE); 324 cNotAliased = dbCountFunctionInDll(options.lDllRefcode, TRUE); 477 325 if (cNotAliased > cUpdated) 478 326 { … … 481 329 ulRc += 0x00010000; 482 330 } 483 logprintf((phLog, "------------------------------------------------------\n"));484 logprintf((phLog, "-------- Functions which was not updated -------------\n"));485 dbGetNotUpdatedFunction(options.l ModRefcode, 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)));331 fprintf(phLog, "-------------------------------------------------\n"); 332 fprintf(phLog, "-------- Functions which was not updated --------\n"); 333 dbGetNotUpdatedFunction(options.lDllRefcode, 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)); 492 340 493 341 /* close the logs */ … … 500 348 if (!options.fIntegrityOnly) 501 349 { 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));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)); 506 354 if ((int)(ulRc >> 16) > 0) 507 355 fprintf(stderr, "Check signal file 'Signals.Log'.\n"); … … 528 376 " -io Integrity check only. default: disabled\n" 529 377 " -s Scan subdirectories. default: disabled\n" 378 " -Old Use old API style. default: disabled\n" 530 379 " -OS2 Ignore 'OS2'-prefix on APIs. default: disabled\n" 531 " -Mod:<modname> Name of the module. default: currentdirname\n" 532 " -Type:<type> Module type. AIST. default: read database\n" 380 " -Dll:<dllname> Name of the dll. default: currentdirname\n" 533 381 " -h:<hostname> Database server hostname. default: localhost\n" 534 382 " -u:<username> Username on the server. default: root\n" … … 554 402 static void openLogs(void) 555 403 { 556 #ifdef DEBUGLOG557 404 if (phLog == NULL) 558 405 { … … 564 411 } 565 412 } 566 #endif567 413 568 414 if (phSignal == NULL) … … 583 429 static void closeLogs(void) 584 430 { 585 #ifdef DEBUGLOG586 431 if (phLog != stderr && phLog != NULL) 587 432 fclose(phLog); 588 #endif589 433 if (phSignal != stdout && phSignal != NULL) 590 434 { … … 629 473 rc = DosQueryPathInfo(pszDirOrFile, FIL_STANDARD, &fs , sizeof(fs)); 630 474 fFile = rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY; 631 if (!fFile)632 fFile = strpbrk(pszDirOrFile, "*?") != NULL;633 475 634 476 /* 0. */ … … 668 510 char *psz = strrchr(&ffb.achName[0], '.'); 669 511 if (psz != NULL && (!stricmp(psz, ".cpp") || !stricmp(psz, ".c"))) 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); 512 ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions); 673 513 674 514 /* next */ … … 711 551 /** 712 552 * Processes a file. 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. 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. 718 557 * @sketch 1. read file into memory. 719 558 * 2. create line array. 720 559 * (3. simple preprocessing - TODO) 721 * 4. process file header.560 * 4. process module header. 722 561 * 5. scan thru the line array, looking for APIs and designnotes. 723 562 * 5b. when API is found, process it. 724 563 * 5c. when designnote found, process it. 725 564 */ 726 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions , BOOL fHeader)565 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions) 727 566 { 728 567 unsigned long cSignals = 0; … … 730 569 char *pszFile; 731 570 732 logprintf((phLog, "Processing '%s':\n", pszFilename)); 733 734 /* 735 * (1) Read file into memory 736 */ 571 fprintf(phLog, "Processing '%s':\n", pszFilename); 572 /* 1.*/ 737 573 pszFile = readFileIntoMemory(pszFilename); 738 574 if (pszFile != NULL) … … 740 576 char **papszLines; 741 577 742 /* 743 * (2) Create line array. 744 */ 578 /* 2.*/ 745 579 papszLines = createLineArray(pszFile); 746 580 if (papszLines != NULL) … … 749 583 int i = 0; 750 584 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); 585 /* 3. - TODO */ 586 587 /* 4. */ 588 ulRc = processModuleHeader(papszLines, i, i, pszFilename, pOptions); 760 589 cSignals += ulRc >> 16; 761 590 if (ulRc & 0x0000ffff) 762 591 { 763 /* 764 * (4b)Remove Design notes.592 /* 4b. 593 * Remove Design notes. 765 594 */ 595 pOptions->lSeqFile = 0; 766 596 if (!dbRemoveDesignNotes(pOptions->lFileRefcode)) 767 597 { … … 772 602 773 603 774 /* 775 * (5) The scan loop. 776 */ 604 /* 5.*/ 777 605 while (papszLines[i] != NULL) 778 606 { 779 /*780 * (5b) Function.781 */782 607 if (isFunction(papszLines, i, pOptions)) 783 608 { 784 ulRc = process Function(papszLines, i, i, pszFilename, pOptions);609 ulRc = processAPI(papszLines, i, i, pszFilename, pOptions); 785 610 cAPIs += 0x0000ffff & ulRc; 786 611 cSignals += ulRc >> 16; 787 612 } 788 /* 789 * (5c) Design note. 790 */ 791 else if (isDesignNote(papszLines, i, pOptions)) 613 else 792 614 { 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])); 615 if (isDesignNote(papszLines, i, pOptions)) 616 { 617 ulRc = processDesignNote(papszLines, i, i, pszFilename, pOptions); 618 cSignals += ulRc >> 16; 619 } 803 620 i++; 804 621 } 805 #endif 806 /* 807 * Nothing. 808 */ 809 else 810 i++; 811 } /* while - scan loop */ 812 } 813 814 /* 815 * Cleanup. 816 */ 622 } 623 } 624 817 625 free(papszLines); 818 626 } … … 829 637 cSignals++; 830 638 } 831 logprintf((phLog, "Processing of '%s' is completed.\n\n", pszFilename)); 832 833 fHeader = fHeader; 639 fprintf(phLog, "Processing of '%s' is completed.\n\n", pszFilename); 640 834 641 835 642 return (unsigned long)((cSignals << 16) | cAPIs); … … 838 645 839 646 /** 840 * Processes an file header and other file information.647 * Processes an module header and other file information. 841 648 * @returns high word = number of signals. 842 649 * low word = Success indicator (TRUE / FALSE). … … 848 655 * @sketch Extract module information if any.... 849 656 */ 850 static unsigned long process FileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)851 { 852 char 853 char 854 char * 657 static unsigned long processModuleHeader(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; 855 662 const char * pszDBFilename; 856 663 char * pszLastDateTime = NULL; … … 976 783 * Insert or update the database. 977 784 */ 978 if (dbInsertUpdateFile((unsigned short)pOptions->l ModRefcode, pszDBFilename,785 if (dbInsertUpdateFile((unsigned short)pOptions->lDllRefcode, pszDBFilename, 979 786 &szDescription[0], pszLastDateTime, lLastAuthor, pszRevision)) 980 787 { … … 982 789 * Get file refcode. 983 790 */ 984 pOptions->lFileRefcode = dbFindFile(pOptions->l ModRefcode, pszDBFilename);791 pOptions->lFileRefcode = dbFindFile(pOptions->lDllRefcode, pszDBFilename); 985 792 if (pOptions->lFileRefcode < 0) 986 793 { … … 1126 933 * Add the note. 1127 934 */ 1128 if (!dbAddDesignNote(pOptions->l ModRefcode, pOptions->lFileRefcode,935 if (!dbAddDesignNote(pOptions->lDllRefcode, pOptions->lFileRefcode, 1129 936 pszTitle, psz, 1130 937 lLevel, lSeqNbr, lSeqNbrNote++, i + 1, lLevel > 0, &lRefCode)) … … 1163 970 1164 971 /** 1165 * Processes an function.972 * Processes an API function. 1166 973 * @returns high word = number of signals 1167 974 * low word = number of APIs processed. (1 or 0). … … 1172 979 * @param pOptions Pointer to options. 1173 980 */ 1174 static unsigned long process Function(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)981 static unsigned long processAPI(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions) 1175 982 { 1176 983 unsigned long ulRc; … … 1192 999 */ 1193 1000 1194 /* 1195 * (1) Analyse function declaration. 1196 */ 1001 /* 1.*/ 1197 1002 ulRc = analyseFnDcl(&FnDesc, papszLines, i, iRet, pszFilename, pOptions); 1198 1003 if (0x0000ffff & ulRc) /* if low word is 0 the fatal */ 1199 1004 { 1200 unsigned long ulRcTmp; 1201 char * pszErrorDesc = (char*)malloc(20480); 1202 1203 /* 1204 * (2) Analyse function header. 1205 */ 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.*/ 1206 1010 ulRcTmp = analyseFnHdr(&FnDesc, papszLines, i, pszFilename, pOptions); 1207 1011 if (ulRcTmp == ~0UL) /* check for fatal error */ 1208 {1209 free(pszErrorDesc);1210 1012 return (0xffff0000UL & ulRc) + 0x00010000UL; 1211 }1212 1013 ulRc += 0xffff0000UL & ulRcTmp; 1213 1014 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); 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); 1223 1041 if (ulRcTmp != 0) 1224 1042 { … … 1246 1064 const char *pszFilename, POPTIONS pOptions) 1247 1065 { 1066 static long lPrevFnDll = -1L; /* fix for duplicate dlls */ 1248 1067 unsigned long ulRc; 1249 1068 FNFINDBUF FnFindBuf; … … 1251 1070 1252 1071 /* brief algorithm: 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. 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.) 1259 1076 */ 1260 1077 1261 /* 1262 * (1) Read function declaration using analyseFnDcl2. 1263 */ 1078 /* 1. */ 1264 1079 ulRc = analyseFnDcl2(pFnDesc, papszLines, i, iRet, pszFilename, pOptions); 1265 1080 if (ulRc != 1) 1266 1081 return ulRc; 1267 1082 1268 /* 1269 * (2) Apply name rules (if api only?). 1270 */ 1083 /* 2. */ 1271 1084 if (pOptions->fOS2 && strncmp(pFnDesc->pszName, "OS2", 3) == 0) 1272 1085 pFnDesc->pszName += 3; … … 1278 1091 pFnDesc->pszName += 3; 1279 1092 1280 /* 1281 * (3) Do a database lookup on the name. 1282 */ 1283 if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lModRefcode)) 1093 /* 3. */ 1094 if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lDllRefcode)) 1284 1095 { 1285 1096 fprintf(phSignal, "%s, %s: error occured while reading from database, %s\n", … … 1291 1102 if (FnFindBuf.cFns != 0) 1292 1103 { 1293 if (pOptions->l ModRefcode < 0)1104 if (pOptions->lDllRefcode < 0) 1294 1105 { 1295 1106 if (FnFindBuf.cFns > 1) 1296 1107 { 1297 fprintf(phSignal, "%s: unknown moduleand more than two occurences of this function!\n", pszFilename);1108 fprintf(phSignal, "%s: unknown dll and more than two occurences of this function!\n", pszFilename); 1298 1109 return 0x00010000; 1299 1110 } 1300 pOptions->l ModRefcode = FnFindBuf.alModRefCode[0];1301 logprintf((phLog, "ModRef = %d\n", pOptions->lModRefcode));1111 pOptions->lDllRefcode = FnFindBuf.alDllRefCode[0]; 1112 fprintf(phLog, "DllRef = %d\n", pOptions->lDllRefcode); 1302 1113 } 1303 1114 … … 1306 1117 1307 1118 if (pFnDesc->cRefCodes == 0) 1308 logprintf((phLog, "%s was not an API in this module(%d)!\n", pFnDesc->pszName, pOptions->lModRefcode));1119 fprintf(phLog, "%s was not an API in this dll(%d)!\n", pFnDesc->pszName, pOptions->lDllRefcode); 1309 1120 } 1310 1121 else 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 } 1122 fprintf(phLog, "%s was not an API\n", pFnDesc->pszName); 1345 1123 1346 1124 ulRc = pFnDesc->cRefCodes; … … 1365 1143 { 1366 1144 /** @sketch 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. 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 1375 1151 */ 1376 1152 … … 1395 1171 } 1396 1172 1397 /* 1398 * (2) find the word ahead of the '(', this is the function name. 1399 */ 1173 /* 2. */ 1400 1174 iFn = iP1; 1401 1175 if (papszLines[iFn] != pszP1) … … 1425 1199 pszFn = findStartOfWord(pszFn, papszLines[iFn]); 1426 1200 1427 /* 1428 * (2a) class test. 1429 */ 1201 /* 2a. */ 1430 1202 /* operators are not supported (BOOL kTime::operator > (const kTime &time) const) */ 1431 1203 if (pszFn > papszLines[iFn]) … … 1453 1225 pszClass = pszClassEnd = NULL; 1454 1226 1455 /* 1456 * (3) find the closing ')' 1457 */ 1227 /* 3. */ 1458 1228 c = 1; 1459 1229 iP2 = iP1; … … 1473 1243 iRet = iP2 + 1; //assumes: only one function on a single line! 1474 1244 1475 /* 1476 * (4) Copy the parameters, which is between the two '()' 1477 */ 1245 /* 4. */ 1478 1246 psz = pFnDesc->szFnDclBuffer; 1479 1247 copy(pFnDesc->szFnDclBuffer, pszP1, iP1, pszP2, iP2, papszLines); 1480 1248 pszEnd = psz + strlen(psz) + 1; 1481 1249 1482 /* 1483 * (5) Format the parameters. 1484 */ 1250 /* 5.*/ 1485 1251 cArgs = 0; 1486 1252 if (stricmp(psz, "(void)") != 0 && strcmp(psz, "()") != 0 && strcmp(psz, "( )")) … … 1509 1275 } 1510 1276 1511 /* 1512 * (6) Return type, function name and arguments. 1513 * Check for the ODINFUNCTION macro. 1514 */ 1277 /* 6. */ 1515 1278 if (strnicmp(pszFn, "ODINFUNCTION", 12) == 0 || strnicmp(pszFn, "ODINPROCEDURE", 13) == 0) 1516 1279 { … … 1562 1325 /* FIXME LATER! Some constructors calling baseclass constructors "breaks" this rule. Win32MDIChildWindow in /src/user32/win32wmdichild.cpp for example. */ 1563 1326 fprintf(phSignal,"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)));1327 fprintf(phLog, "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd)); 1565 1328 if (strlen(pszEnd) > 512) 1566 1329 fprintf(stderr, "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd)); 1567 #ifdef DEBUGLOG1568 1330 fflush(phLog); 1569 #endif1570 1331 fflush(phSignal); 1571 1332 fflush(stderr); … … 1578 1339 /* !BugFix! some function occur more than once, usually as inline functions */ 1579 1340 if (pFnDesc->pszReturnType != NULL 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")); 1341 && strstr(pFnDesc->pszReturnType, "inline ") != NULL) 1342 { 1343 fprintf(phLog, "Not an API. Inlined functions can't be exported!\n"); 1584 1344 return 0; 1585 1345 } … … 1593 1353 ) 1594 1354 { /* cdecl function is prefixed with an '_' */ 1595 strcpy(pszEnd, "_"); /* BUGBUG */1355 strcpy(pszEnd, "_"); 1596 1356 } 1597 1357 if (pszClass != NULL) … … 1605 1365 *pszEnd = '\0'; 1606 1366 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 else1615 pFnDesc->fchType = FUNCTION_METHOD; /* BUGBUG operator. */1616 pszEnd = strlen(pszEnd) + pszEnd + 1;1617 *pszEnd = '\0';1618 }1619 1367 1620 1368 /* arguments */ … … 1659 1407 else 1660 1408 { /* arg yet another special case! 'fn(int argc, char *argv[])' */ 1661 char *pszP2 = NULL;1409 char *pszP2; 1662 1410 cch = strlen(apszArgs[j]); 1663 1411 psz = &apszArgs[j][cch-2]; … … 1689 1437 memset(psz, ' ', pszP2 - psz); 1690 1438 else 1691 logprintf((phLog, "assert: line %d\n", __LINE__));1439 fprintf(phLog, "assert: line %d\n", __LINE__); 1692 1440 } 1693 1441 pFnDesc->apszParamType[j] = trim(apszArgs[j]); … … 1836 1584 /* 2c.*/ 1837 1585 if (iName <= iEnd && strstr(papszLines[iName], pFnDesc->pszName) == NULL) 1838 logprintf((phLog, "Warning: a matching function name is not found in the name Field\n"));1586 fprintf(phLog, "Warning: a matching function name is not found in the name Field\n"); 1839 1587 } 1840 1588 … … 2067 1815 } 2068 1816 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 DEBUGLOG2077 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 #else2102 pFnDesc = pFnDesc;2103 #endif2104 }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 }2154 1817 2155 1818 … … 2498 2161 if (pszB != NULL && *pszB == '{') 2499 2162 { 2500 logprintf((phLog, "Function found: %.*s\n", cchFnName, pszFnName));2163 fprintf(phLog, "Function found: %.*s\n", cchFnName, pszFnName); 2501 2164 return TRUE; 2502 2165 } … … 2561 2224 if (pszB != NULL && *pszB == '{') 2562 2225 { 2563 logprintf((phLog, "Possible API: %.*s\n", cchFnName, pszOS2));2226 fprintf(phLog, "Possible API: %.*s\n", cchFnName, pszOS2); 2564 2227 return TRUE; 2565 2228 } … … 2603 2266 2604 2267 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 class2620 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 2628 2268 2629 2269 … … 2638 2278 { 2639 2279 case 0: 2640 logprintf((phLog, "%s", pszValue));2280 fprintf(phLog, "%s", pszValue); 2641 2281 break; 2642 2282 case 1: 2643 logprintf((phLog, "(%s)", pszValue));2283 fprintf(phLog, "(%s)", pszValue); 2644 2284 break; 2645 2285 case 2: /* updated */ 2646 logprintf((phLog, " %s=%s", pszFieldName, pszValue));2286 fprintf(phLog, " %s=%s", pszFieldName, pszValue); 2647 2287 break; 2648 2288 case 3: /* aliasfn */ 2649 logprintf((phLog, " %s=%s", pszFieldName, pszValue));2289 fprintf(phLog, " %s=%s", pszFieldName, pszValue); 2650 2290 break; 2651 2291 case 4: 2652 2292 if (pszValue != NULL) 2653 logprintf((phLog, " --> %s.", pszValue));2293 fprintf(phLog, " --> %s.", pszValue); 2654 2294 break; 2655 2295 case 5: 2656 2296 if (pszValue != NULL) 2657 logprintf((phLog, "%s", pszValue));2297 fprintf(phLog, "%s", pszValue); 2658 2298 break; 2659 2299 case 6: 2660 2300 if (pszValue != NULL) 2661 logprintf((phLog, "(%s)", pszValue));2301 fprintf(phLog, "(%s)", pszValue); 2662 2302 break; 2663 2303 2664 2304 default: 2665 2305 i = 0; 2666 logprintf((phLog, "\n"));2306 fprintf(phLog, "\n"); 2667 2307 } 2668 2308 … … 2670 2310 { 2671 2311 i = 0; 2672 logprintf((phLog, "\n"));2312 fprintf(phLog, "\n"); 2673 2313 } 2674 2314 … … 2801 2441 psz++; 2802 2442 } 2803 logprintf((phLog, "%d lines\n", cLines));2443 fprintf(phLog, "%d lines\n", cLines); 2804 2444 2805 2445 papszLines = (char**)calloc(cLines + 1, sizeof(char *)); … … 3354 2994 3355 2995 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 2996 2997 -
trunk/tools/database/StateUpd.h
r6677 r6678 1 /* $Id: StateUpd.h,v 1. 6 2001-09-07 10:24:06bird Exp $ */1 /* $Id: StateUpd.h,v 1.7 2001-09-07 10:33:10 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 * 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. */ 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 */ 29 28 signed long lFileRefcode; /* File reference code. */ 30 char ** papszDirs; /* Pointer to NULL terminated array of directories*/ 31 /* to be searched when .obj files are specified. */ 29 signed long lSeqFile; /* Design note file sequence number. */ 32 30 } OPTIONS, *POPTIONS; 33 31 -
trunk/tools/database/db.cpp
r6677 r6678 1 /* $Id: db.cpp,v 1.2 6 2001-09-07 10:24:07bird Exp $ *1 /* $Id: db.cpp,v 1.27 2001-09-07 10:31:44 bird Exp $ * 2 2 * 3 3 * DB - contains all database routines. … … 154 154 155 155 /** 156 * Gets the refid for the give modname.157 * @returns Modulerefid. -1 on error.158 * @param pszModName Modulename.159 */ 160 signed long _System dbGet Module(const char *pszModName)156 * Gets the refid for the give dll name. 157 * @returns Dll refid. -1 on error. 158 * @param pszDllName Dll name. 159 */ 160 signed long _System dbGetDll(const char *pszDllName) 161 161 { 162 162 int rc; … … 164 164 MYSQL_RES * pres; 165 165 166 sprintf(&szQuery[0], "SELECT refcode FROM module WHERE name = '%s'\n", pszModName);166 sprintf(&szQuery[0], "SELECT refcode FROM dll WHERE name = '%s'\n", pszDllName); 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 module.181 * @returns Number of functions. -1 on error.182 * @param lModule Modulerefcode.183 * @param fNotAliasesTRUE: don't count aliased functions.184 */ 185 signed long _System dbCountFunctionIn Module(signed long lModule, BOOL fNotAliases)180 * Count the function in a given dll. 181 * @returns Number of functions. -1 on error. 182 * @param lDll Dll refcode. 183 * @param fNotAliases TRUE: don't count aliased functions. 184 */ 185 signed long _System dbCountFunctionInDll(signed long lDll, BOOL fNotAliases) 186 186 { 187 187 signed long rc; … … 189 189 MYSQL_RES * pres; 190 190 191 if (l Module>= 0)192 { 193 sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE module = %ld\n", lModule);191 if (lDll >= 0) 192 { 193 sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE dll = %ld\n", lDll); 194 194 if (fNotAliases) 195 195 strcat(&szQuery[0], " AND aliasfn < 0"); … … 211 211 212 212 /** 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) 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) 221 220 { 222 221 int rc; … … 225 224 226 225 /* try find match */ 227 sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule);226 sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll); 228 227 rc = mysql_query(pmysql, &szQuery[0]); 229 228 pres = mysql_store_result(pmysql); 230 229 231 /* not found? - insert module*/230 /* not found? - insert dll */ 232 231 if (rc < 0 || pres == NULL || mysql_num_rows(pres) == 0) 233 232 { 234 233 mysql_free_result(pres); 235 234 236 sprintf(&szQuery[0], "INSERT INTO module(name, type) VALUES('%s', '%c')\n", pszModule, fchType);235 sprintf(&szQuery[0], "INSERT INTO dll(name, type) VALUES('%s', '%c')\n", pszDll, fchType); 237 236 rc = mysql_query(pmysql, &szQuery[0]); 238 237 if (rc < 0) … … 240 239 241 240 /* select row to get refcode */ 242 sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule);241 sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll); 243 242 rc = mysql_query(pmysql, &szQuery[0]); 244 243 pres = mysql_store_result(pmysql); … … 291 290 * The update flags is always updated. 292 291 * @returns Success indicator. TRUE / FALSE. 293 * @param l Module Modulerefcode.292 * @param lDll Dll refcode. 294 293 * @param pszFunction Function name. 295 294 * @param pszIntFunction Internal function name. (required!) … … 298 297 * @param fchType Function type flag. One of the FUNCTION_* defines. 299 298 */ 300 BOOL _System dbInsertUpdateFunction(signed long l Module,299 BOOL _System dbInsertUpdateFunction(signed long lDll, 301 300 const char *pszFunction, const char *pszIntFunction, 302 301 unsigned long ulOrdinal, BOOL fIgnoreOrdinal, char fchType) … … 313 312 314 313 /* try find function */ 315 sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE module = %d AND name = '%s'", lModule, pszFunction);314 sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE dll = %d AND name = '%s'", lDll, pszFunction); 316 315 rc = mysql_query(pmysql, pszQuery); 317 316 pres = mysql_store_result(pmysql); … … 323 322 if (mysql_num_rows(pres) > 1) 324 323 { 325 fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same module. "326 "l Module = %d, pszFunction = %s\n", __FUNCTION__, lModule, pszFunction);324 fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same dll. " 325 "lDll = %d, pszFunction = %s\n", __FUNCTION__, lDll, pszFunction); 327 326 return FALSE; 328 327 } … … 348 347 * Insert it. 349 348 */ 350 sprintf(&szQuery[0], "INSERT INTO function( module, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')",351 l Module, pszFunction, pszIntFunction, ulOrdinal, fchType);349 sprintf(&szQuery[0], "INSERT INTO function(dll, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')", 350 lDll, pszFunction, pszIntFunction, ulOrdinal, fchType); 352 351 rc = mysql_query(pmysql, &szQuery[0]); 353 352 } … … 361 360 * Inserts or updates (existing) file information. 362 361 * @returns Success indicator (TRUE / FALSE). 363 * @param l Module Modulereference code.362 * @param lDll Dll reference code. 364 363 * @param pszFilename Filename. 365 364 * @param pszDescription Pointer to file description. … … 370 369 * @remark 371 370 */ 372 BOOL _System dbInsertUpdateFile(signed long l Module,371 BOOL _System dbInsertUpdateFile(signed long lDll, 373 372 const char *pszFilename, 374 373 const char *pszDescription, … … 383 382 384 383 /* parameter assertions */ 385 assert(l Module!= 0);384 assert(lDll != 0); 386 385 assert(pszFilename != NULL); 387 386 assert(*pszFilename != '\0'); 388 387 389 388 /* try find file */ 390 sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE module = %d AND name = '%s'", lModule, pszFilename);389 sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE dll = %d AND name = '%s'", lDll, pszFilename); 391 390 rc = mysql_query(pmysql, &szQuery[0]); 392 391 pres = mysql_store_result(pmysql); … … 396 395 if (mysql_num_rows(pres) > 1) 397 396 { 398 fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same module. "399 "l Module = %d, pszFilename = %s\n", __FUNCTION__, lModule, pszFilename);397 fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same dll. " 398 "lDll = %d, pszFilename = %s\n", __FUNCTION__, lDll, pszFilename); 400 399 return FALSE; 401 400 } … … 451 450 else 452 451 { /* insert */ 453 sprintf(&szQuery[0], "INSERT INTO file( module, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ",454 l Module, pszFilename, lLastAuthor);452 sprintf(&szQuery[0], "INSERT INTO file(dll, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ", 453 lDll, pszFilename, lLastAuthor); 455 454 if (pszDescription != NULL && *pszDescription != '\0') 456 455 sqlstrcat(&szQuery[0], NULL, pszDescription); … … 525 524 * @param pszFunctionName Pointer to a function name string. (input) 526 525 * @param pFnFindBuf Pointer to a find buffer. (output) 527 * @param l Module Modulerefcode (optional). If given the search is limited to528 * the given moduleand aliasing functions is updated (slow!).529 * @sketch 1) Get functions for this module(if given).526 * @param lDll Dll refcode (optional). If given the search is limited to 527 * the given dll and aliasing functions is updated (slow!). 528 * @sketch 1) Get functions for this dll(if given). 530 529 * 2) Get functions which aliases the functions found in (1). 531 530 * 3) Get new aliases by intname … … 534 533 * 6) Update all functions from (3) and (4) to alias the first function from 1. 535 534 */ 536 BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long l Module)535 BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long lDll) 537 536 { 538 537 MYSQL_RES *pres; … … 542 541 543 542 /* 544 * 1) Get functions for this module(if given).543 * 1) Get functions for this dll(if given). 545 544 */ 546 if (l Module< 0)547 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function WHERE intname = '%s'",545 if (lDll < 0) 546 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE intname = '%s'", 548 547 pszFunctionName); 549 548 else 550 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function "551 "WHERE intname = '%s' AND module= %ld",552 pszFunctionName, l Module);549 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function " 550 "WHERE intname = '%s' AND dll = %ld", 551 pszFunctionName, lDll); 553 552 554 553 rc = mysql_query1(pmysql, &szQuery[0]); … … 559 558 { 560 559 char szFnName[NBR_FUNCTIONS][80]; 561 BOOL fAPI = FALSE;562 560 563 561 pFnFindBuf->cFns = 0; … … 565 563 { 566 564 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 567 pFnFindBuf->al ModRefCode[pFnFindBuf->cFns] = atol(row[1]);565 pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]); 568 566 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); 569 567 pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]); 570 568 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;575 569 576 570 /* next */ … … 579 573 mysql_free_result(pres); 580 574 581 /* alias check and fix for apis.*/582 if ( fAPI && lModule>= 0 && pFnFindBuf->cFns != 0)575 /* alias check and fix */ 576 if (lDll >= 0 && pFnFindBuf->cFns != 0) 583 577 { 584 int cFnsThis Module, cFnsAliasesAndThisModule, i, f;578 int cFnsThisDll, cFnsAliasesAndThisDll, i, f; 585 579 586 580 /* 587 581 * 2) Get functions which aliases the functions found in (1). 588 582 */ 589 cFnsThis Module= (int)pFnFindBuf->cFns;590 strcpy(&szQuery[0], "SELECT refcode, module, aliasfn, file, name FROM function WHERE aliasfn IN (");591 for (i = 0; i < cFnsThis Module; i++)583 cFnsThisDll = (int)pFnFindBuf->cFns; 584 strcpy(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE aliasfn IN ("); 585 for (i = 0; i < cFnsThisDll; i++) 592 586 { 593 587 if (i > 0) strcat(&szQuery[0], " OR "); … … 605 599 { 606 600 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 607 pFnFindBuf->al ModRefCode[pFnFindBuf->cFns] = atol(row[1]);601 pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]); 608 602 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); 609 603 pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]); … … 618 612 * 3) Get new aliases by intname 619 613 */ 620 cFnsAliasesAndThis Module= (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 l Module, pszFunctionName);624 for (i = 0; i < cFnsAliasesAndThis Module; i++)614 cFnsAliasesAndThisDll = (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 lDll, pszFunctionName); 618 for (i = 0; i < cFnsAliasesAndThisDll; i++) 625 619 sprintf(&szQuery[strlen(&szQuery[0])], " OR intname = '%s'", szFnName[i]); 626 620 strcat(&szQuery[0], ")"); … … 635 629 { 636 630 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 637 pFnFindBuf->al ModRefCode[pFnFindBuf->cFns] = atol(row[1]);631 pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]); 638 632 if (row[2] != NULL) 639 633 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); … … 651 645 * 4) Get new aliases by name 652 646 */ 653 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file FROM function "654 "WHERE aliasfn = (-1) AND module<> %ld AND (name = '%s'",655 l Module, pszFunctionName);656 for (i = 0; i < cFnsAliasesAndThis Module; i++)647 sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file FROM function " 648 "WHERE aliasfn = (-1) AND dll <> %ld AND (name = '%s'", 649 lDll, pszFunctionName); 650 for (i = 0; i < cFnsAliasesAndThisDll; i++) 657 651 sprintf(&szQuery[strlen(&szQuery[0])], " OR name = '%s'", szFnName[i]); 658 652 strcat(&szQuery[0], ")"); … … 667 661 { 668 662 pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]); 669 pFnFindBuf->al ModRefCode[pFnFindBuf->cFns] = atol(row[1]);663 pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]); 670 664 if (row[2] != NULL) 671 665 pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]); … … 684 678 sprintf(&szQuery[0], "UPDATE function SET aliasfn = (-2) " 685 679 "WHERE refcode IN (", 686 l Module, pszFunctionName);687 for (f = 0, i = 0; i < cFnsThis Module; i++)680 lDll, pszFunctionName); 681 for (f = 0, i = 0; i < cFnsThisDll; i++) 688 682 if (pFnFindBuf->alAliasFn[i] != ALIAS_DONTMIND) 689 683 sprintf(&szQuery[strlen(&szQuery[0])], … … 694 688 else 695 689 rc = 0; 696 if (rc >= 0 && cFnsAliasesAndThis Module< pFnFindBuf->cFns)690 if (rc >= 0 && cFnsAliasesAndThisDll < pFnFindBuf->cFns) 697 691 { 698 692 /* … … 702 696 "WHERE aliasfn = (-1) AND refcode IN (", 703 697 pFnFindBuf->alRefCode[0], pFnFindBuf->alFileRefCode[0]); 704 for (i = cFnsAliasesAndThis Module; i < pFnFindBuf->cFns; i++)698 for (i = cFnsAliasesAndThisDll; i < pFnFindBuf->cFns; i++) 705 699 { 706 700 sprintf(&szQuery[strlen(&szQuery[0])], 707 i > cFnsAliasesAndThis Module? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);701 i > cFnsAliasesAndThisDll ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]); 708 702 } 709 703 strcat(&szQuery[0], ")"); … … 728 722 /** 729 723 * Finds the refcode for a file (if it exists). 730 * @returns File 'refcode'.731 * -1 on error or not found.732 * @param lModule Refcode of the modulewhich this file belongs to.733 * @param pszFilename The filename to search for.734 */ 735 signed long _System dbFindFile(signed long l Module, const char *pszFilename)724 * @returns File 'refcode'. 725 * -1 on error or not found. 726 * @param lDll Refcode of the dll which this file belongs to. 727 * @param pszFilename The filename to search for. 728 */ 729 signed long _System dbFindFile(signed long lDll, const char *pszFilename) 736 730 { 737 731 char szQuery[256]; … … 739 733 signed long lRefCode = -1; 740 734 741 assert(l Module>= 0);735 assert(lDll >= 0); 742 736 assert(pszFilename != NULL); 743 737 assert(*pszFilename != '\0'); 744 738 745 sprintf(&szQuery[0], "SELECT refcode FROM file WHERE module= %ld AND name = '%s'",746 l Module, pszFilename);739 sprintf(&szQuery[0], "SELECT refcode FROM file WHERE dll = %ld AND name = '%s'", 740 lDll, pszFilename); 747 741 if (mysql_query(pmysql, &szQuery[0]) >= 0) 748 742 { … … 884 878 * @returns number of errors. 885 879 * @param pFnDesc Function description struct. 886 * @param l Module Modulewhich we are working at.880 * @param lDll Dll which we are working at. 887 881 * @param pszError Buffer for error messages 888 882 * @result on error(s) pszError will hold information about the error(s). 889 883 */ 890 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long l Module, char *pszError)884 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long lDll, char *pszError) 891 885 { 892 886 MYSQL_RES * pres; … … 1146 1140 } /* for */ 1147 1141 1148 l Module = lModule;1142 lDll = lDll; 1149 1143 free(pszQuery2); 1150 1144 return ulRc; … … 1154 1148 /** 1155 1149 * Removes all the existing design notes in the specified file. 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) 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 1159 1156 */ 1160 1157 BOOL _System dbRemoveDesignNotes(signed long lFile) … … 1171 1168 * Adds a design note. 1172 1169 * @returns Success indicator. 1173 * @param l Module Modulerefcode.1170 * @param lDll Dll refcode. 1174 1171 * @param lFile File refcode. 1175 1172 * @param pszTitle Design note title. 1176 1173 * @param pszText Design note text. 1177 1174 * @param lLevel Level of the note section. 0 is the design note it self. 1178 * @param lSeqNbr Sequence number (in module). If 0 the use next available number.1175 * @param lSeqNbr Sequence number (in dll). If 0 the use next available number. 1179 1176 * @param lSeqNbrNote Sequence number in note. 1180 1177 * @param lLine Line number (1 - based!). … … 1184 1181 * @param plRefCode Pointer to reference id of the design note. see fSubSection for more info. 1185 1182 */ 1186 BOOL _System dbAddDesignNote(signed long l Module,1183 BOOL _System dbAddDesignNote(signed long lDll, 1187 1184 signed long lFile, 1188 1185 const char *pszTitle, … … 1200 1197 1201 1198 1202 assert(l Module>= 0 && lFile >= 0);1199 assert(lDll >= 0 && lFile >= 0); 1203 1200 assert(lSeqNbrNote >= 0); 1204 1201 … … 1208 1205 if (lSeqNbr == 0 && !fSubSection) 1209 1206 { 1210 sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE module = %ld AND level = 0", lModule);1207 sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE dll = %ld AND level = 0", lDll); 1211 1208 if (mysql_query(pmysql, &szQuery[0]) >= 0) 1212 1209 { … … 1232 1229 */ 1233 1230 if (!fSubSection) 1234 sprintf(&szQuery[0], "INSERT INTO designnote( module, file, level, seqnbrnote, seqnbr, line, name, note) "1231 sprintf(&szQuery[0], "INSERT INTO designnote(dll, file, level, seqnbrnote, seqnbr, line, name, note) " 1235 1232 "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, ", 1236 l Module, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);1233 lDll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine); 1237 1234 else 1238 sprintf(&szQuery[0], "INSERT INTO designnote(refcode, module, file, level, seqnbrnote, seqnbr, line, name, note) "1235 sprintf(&szQuery[0], "INSERT INTO designnote(refcode, dll, file, level, seqnbrnote, seqnbr, line, name, note) " 1239 1236 "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, %ld, ", 1240 *plRefCode, l Module, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);1237 *plRefCode, lDll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine); 1241 1238 1242 1239 if (pszTitle != NULL && *pszTitle != '\0') … … 1289 1286 1290 1287 /* delete - all rows on this date in the history tables */ 1291 sprintf(pszQuery, "DELETE FROM history moduleWHERE date = '%s'", &szCurDt[0]);1288 sprintf(pszQuery, "DELETE FROM historydll WHERE date = '%s'", &szCurDt[0]); 1292 1289 rc = mysql_query(pmysql, pszQuery); 1293 1290 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); … … 1297 1294 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); 1298 1295 1299 sprintf(pszQuery, "DELETE FROM history moduletotal WHERE date = '%s'", &szCurDt[0]);1296 sprintf(pszQuery, "DELETE FROM historydlltotal WHERE date = '%s'", &szCurDt[0]); 1300 1297 rc = mysql_query(pmysql, pszQuery); 1301 1298 CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery)); … … 1305 1302 1306 1303 /* insert new stats */ 1307 sprintf(pszQuery, "INSERT INTO history module(module, state, date, count, type) "1308 "SELECT module, state, '%s', count(*), type FROM function GROUP BY module, state, type",1304 sprintf(pszQuery, "INSERT INTO historydll(dll, state, date, count) " 1305 "SELECT dll, state, '%s', count(*) FROM function GROUP BY dll, state", 1309 1306 &szCurDt[0]); 1310 1307 rc = mysql_query(pmysql, pszQuery); … … 1319 1316 1320 1317 /* inserting new totals */ 1321 sprintf(pszQuery, "INSERT INTO history moduletotal(module, date, totalcount, type) "1322 "SELECT module, '%s', count(*), type FROM function GROUP BY module, type",1318 sprintf(pszQuery, "INSERT INTO historydlltotal(dll, date, totalcount) " 1319 "SELECT dll, '%s', count(*) FROM function GROUP BY dll", 1323 1320 &szCurDt[0]); 1324 1321 rc = mysql_query(pmysql, pszQuery); … … 1326 1323 1327 1324 sprintf(pszQuery, "INSERT INTO historyapigrouptotal(apigroup, date, totalcount) " 1328 "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL AND type = 'A'"1325 "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL " 1329 1326 "GROUP BY apigroup", 1330 1327 &szCurDt[0]); … … 1372 1369 1373 1370 /* foreign keys in function table */ 1374 strcpy(pszQuery, "SELECT refcode, module, state, apigroup, file FROM function");1371 strcpy(pszQuery, "SELECT refcode, dll, state, apigroup, file FROM function"); 1375 1372 rc = mysql_query(pmysql, pszQuery); 1376 1373 if (rc >= 0) … … 1381 1378 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1382 1379 { 1383 /* check module*/1384 sprintf(pszQuery, "SELECT refcode FROM moduleWHERE refcode = %s", row1[1]);1380 /* check dll */ 1381 sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]); 1385 1382 rc = mysql_query(pmysql, pszQuery); 1386 CheckFKError("function/ module", "Foreign key 'module' not found in the moduletable");1383 CheckFKError("function/dll", "Foreign key 'dll' not found in the dll table"); 1387 1384 1388 1385 /* check state */ … … 1414 1411 1415 1412 /* foreign keys in file */ 1416 strcpy(pszQuery, "SELECT refcode, moduleFROM file");1413 strcpy(pszQuery, "SELECT refcode, dll FROM file"); 1417 1414 rc = mysql_query(pmysql, pszQuery); 1418 1415 if (rc >= 0) … … 1423 1420 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1424 1421 { 1425 /* check module*/1426 sprintf(pszQuery, "SELECT refcode FROM moduleWHERE refcode = %s", row1[1]);1422 /* check dll */ 1423 sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]); 1427 1424 rc = mysql_query(pmysql, pszQuery); 1428 CheckFKError("apigroup/ module", "Foreign key 'module' not found in the moduletable");1425 CheckFKError("apigroup/dll", "Foreign key 'dll' not found in the dll table"); 1429 1426 } 1430 1427 mysql_free_result(pres1); … … 1435 1432 1436 1433 /* foreign keys in apigroup */ 1437 strcpy(pszQuery, "SELECT refcode, moduleFROM apigroup");1434 strcpy(pszQuery, "SELECT refcode, dll FROM apigroup"); 1438 1435 rc = mysql_query(pmysql, pszQuery); 1439 1436 if (rc >= 0) … … 1444 1441 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1445 1442 { 1446 /* check module*/1447 sprintf(pszQuery, "SELECT refcode FROM moduleWHERE refcode = %s", row1[1]);1443 /* check dll */ 1444 sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]); 1448 1445 rc = mysql_query(pmysql, pszQuery); 1449 CheckFKError("file/ module", "Foreign key 'module' not found in the moduletable");1446 CheckFKError("file/dll", "Foreign key 'dll' not found in the dll table"); 1450 1447 } 1451 1448 mysql_free_result(pres1); … … 1481 1478 ulRc += logDbError(pszError, pszQuery); 1482 1479 1483 /* foreign keys in history moduletable */1484 strcpy(pszQuery, "SELECT date, module, state FROM historymodule");1480 /* foreign keys in historydll table */ 1481 strcpy(pszQuery, "SELECT date, dll, state FROM historydll"); 1485 1482 rc = mysql_query(pmysql, pszQuery); 1486 1483 if (rc >= 0) … … 1491 1488 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1492 1489 { 1493 /* check module*/1494 sprintf(pszQuery, "SELECT refcode FROM moduleWHERE refcode = %s", row1[1]);1490 /* check dll */ 1491 sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]); 1495 1492 rc = mysql_query(pmysql, pszQuery); 1496 CheckFKError("history module/module", "Foreign key 'module' not found in the moduletable");1493 CheckFKError("historydll/dll", "Foreign key 'dll' not found in the dll table"); 1497 1494 1498 1495 /* check state */ 1499 1496 sprintf(pszQuery, "SELECT refcode FROM state WHERE refcode = %s", row1[2]); 1500 1497 rc = mysql_query(pmysql, pszQuery); 1501 CheckFKError("history module/state", "Foreign key 'state' not found in the state table");1498 CheckFKError("historydll/state", "Foreign key 'state' not found in the state table"); 1502 1499 } 1503 1500 mysql_free_result(pres1); … … 1517 1514 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1518 1515 { 1519 /* check module*/1516 /* check dll */ 1520 1517 sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]); 1521 1518 rc = mysql_query(pmysql, pszQuery); … … 1533 1530 ulRc += logDbError(pszError, pszQuery); 1534 1531 1535 /* foreign keys in history moduletotal table */1536 strcpy(pszQuery, "SELECT date, module FROM historymoduletotal");1532 /* foreign keys in historydlltotal table */ 1533 strcpy(pszQuery, "SELECT date, dll FROM historydlltotal"); 1537 1534 rc = mysql_query(pmysql, pszQuery); 1538 1535 if (rc >= 0) … … 1543 1540 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1544 1541 { 1545 /* check module*/1546 sprintf(pszQuery, "SELECT refcode FROM moduleWHERE refcode = %s", row1[1]);1542 /* check dll */ 1543 sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]); 1547 1544 rc = mysql_query(pmysql, pszQuery); 1548 CheckFKError("history moduletotal/module", "Foreign key 'module' not found in the moduletable");1545 CheckFKError("historydlltotal/dll", "Foreign key 'dll' not found in the dll table"); 1549 1546 } 1550 1547 mysql_free_result(pres1); … … 1564 1561 while ((row1 = mysql_fetch_row(pres1)) != NULL) 1565 1562 { 1566 /* check module*/1563 /* check dll */ 1567 1564 sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]); 1568 1565 rc = mysql_query(pmysql, pszQuery); … … 1858 1855 1859 1856 /** 1860 * Display all functions for, the given module, that is not updated.1857 * Display all functions for, the given dll, that is not updated. 1861 1858 * @returns TRUE / FALSE. 1862 * @param l Module Modulereference number.1859 * @param lDll Dll reference number. 1863 1860 * @param dbFetchCall Callback function which will be called once for each 1864 1861 * field for all the functions not updated. 1865 1862 * pvUser is NULL, pszValue field value, pszFieldName the field name. 1866 1863 */ 1867 BOOL _System dbGetNotUpdatedFunction(signed long l Module, DBCALLBACKFETCH dbFetchCallBack)1864 BOOL _System dbGetNotUpdatedFunction(signed long lDll, DBCALLBACKFETCH dbFetchCallBack) 1868 1865 { 1869 1866 BOOL fRet = FALSE; … … 1874 1871 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1875 1872 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1876 " LEFT JOIN module d ON f2.module= d.refcode "1877 "WHERE f1. module= %ld AND f1.updated = 0",1878 l Module);1873 " LEFT JOIN dll d ON f2.dll = d.refcode " 1874 "WHERE f1.dll = %ld AND f1.updated = 0", 1875 lDll); 1879 1876 pres = dbExecuteQuery(szQuery); 1880 1877 if (pres != NULL) … … 1892 1889 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1893 1890 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1894 " LEFT JOIN module d ON f2.module= d.refcode "1895 "WHERE f1. module= %ld AND f1.updated > 1",1896 l Module);1891 " LEFT JOIN dll d ON f2.dll = d.refcode " 1892 "WHERE f1.dll = %ld AND f1.updated > 1", 1893 lDll); 1897 1894 pres = dbExecuteQuery(szQuery); 1898 1895 if (pres != NULL) … … 1915 1912 1916 1913 /** 1917 * Counts the function for the given MODULEwhich has been updated.1918 * @returns -1 on error, number of updated function on success.1919 * @param lModule Modulereference number.1920 */ 1921 signed long _System dbGetNumberOfUpdatedFunction(signed long l Module)1914 * Counts the function for the given DLL which has been updated. 1915 * @returns -1 on error, number of updated function on success. 1916 * @param lDll Dll reference number. 1917 */ 1918 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll) 1922 1919 { 1923 1920 int rc; … … 1925 1922 MYSQL_RES * pres; 1926 1923 1927 sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE module = (%ld) AND updated > 0\n", lModule);1924 sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE dll = (%ld) AND updated > 0\n", lDll); 1928 1925 rc = mysql_query(pmysql, &szQuery[0]); 1929 1926 pres = mysql_store_result(pmysql); … … 1939 1936 1940 1937 /** 1941 * Clear the update flags for all file in a module/module.1942 * @returns Success indicator. (TRUE / FALSE)1943 * @param lModule Modulerefcode.1944 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)1945 * @remark Intended for use by APIImport.1946 */ 1947 BOOL _System dbClearUpdateFlagFile(signed long l Module)1938 * Clear the update flags for all file in a dll/module. 1939 * @returns Success indicator. (TRUE / FALSE) 1940 * @param lDll Dll refcode. 1941 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 1942 * @remark Intended for use by APIImport. 1943 */ 1944 BOOL _System dbClearUpdateFlagFile(signed long lDll) 1948 1945 { 1949 1946 int rc; … … 1951 1948 1952 1949 sprintf(&szQuery[0], 1953 "UPDATE file SET updated = 0 WHERE module= (%ld)",1954 l Module);1950 "UPDATE file SET updated = 0 WHERE dll = (%ld)", 1951 lDll); 1955 1952 rc = mysql_query(pmysql, &szQuery[0]); 1956 1953 return rc == 0; … … 1960 1957 /** 1961 1958 * Clear update flag 1962 * @returns Success indicator.1963 * @param lModule Modulerefcode.1964 * @param fAll All module. If false only APIs and Internal APIs are cleared1965 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)1966 * @remark Intended for use by APIImport.1967 */ 1968 BOOL _System dbClearUpdateFlagFunction(signed long l Module, BOOL fAll)1959 * @returns Success indicator. 1960 * @param lDll Dll refcode. 1961 * @param fAll All dll. If false only APIs and Internal APIs are cleared 1962 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 1963 * @remark Intended for use by APIImport. 1964 */ 1965 BOOL _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll) 1969 1966 { 1970 1967 int rc; … … 1972 1969 1973 1970 sprintf(&szQuery[0], 1974 "UPDATE function SET updated = 0 WHERE module= (%ld)",1975 l Module);1971 "UPDATE function SET updated = 0 WHERE dll = (%ld)", 1972 lDll); 1976 1973 if (!fAll) 1977 1974 strcat(&szQuery[0], " AND type IN ('A', 'I')"); … … 1983 1980 1984 1981 /** 1985 * Deletes all the files in a module/module which was not found/updated.1982 * Deletes all the files in a dll/module which was not found/updated. 1986 1983 * @returns Success indicator. 1987 * @param l Module Modulerefcode.1984 * @param lDll Dll refcode. 1988 1985 * @sketch Select all files which is to be deleted. 1989 1986 * Set all references to each file in function to -1. … … 1992 1989 * @remark Use with GRATE CARE! 1993 1990 */ 1994 BOOL _System dbDeleteNotUpdatedFiles(signed long l Module)1991 BOOL _System dbDeleteNotUpdatedFiles(signed long lDll) 1995 1992 { 1996 1993 MYSQL_RES * pres; … … 2000 1997 2001 1998 sprintf(&szQuery[0], 2002 "SELECT refcode FROM file WHERE module= (%ld) AND updated = 0",2003 l Module);1999 "SELECT refcode FROM file WHERE dll = (%ld) AND updated = 0", 2000 lDll); 2004 2001 rc = mysql_query(pmysql, &szQuery[0]); 2005 2002 pres = mysql_store_result(pmysql); … … 2018 2015 2019 2016 sprintf(&szQuery[0], 2020 "DELETE FROM file WHERE module= %ld AND updated = 0",2021 l Module);2017 "DELETE FROM file WHERE dll = %ld AND updated = 0", 2018 lDll); 2022 2019 rc = mysql_query(pmysql, &szQuery[0]); 2023 2020 if (rc) fRc = FALSE; … … 2033 2030 * 2034 2031 * @returns Success indicator. (TRUE / FALSE) 2035 * @param l Module The refcode of the moduleowning the functions.2036 * @param fAll 2037 * @sketch Select all functions which wan't updated (ie. updated = 0 and module = lModule).2032 * @param lDll The refcode of the dll owning 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). 2038 2035 * If anyone Then 2039 2036 * Delete the referenced to the functions in: … … 2044 2041 * @remark Use with GREATE CARE! 2045 2042 */ 2046 BOOL _System dbDeleteNotUpdatedFunctions(signed long l Module, BOOL fAll)2043 BOOL _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll) 2047 2044 { 2048 2045 MYSQL_RES * pres; … … 2052 2049 2053 2050 sprintf(&szQuery[0], 2054 "SELECT refcode FROM function WHERE module= %ld AND updated = 0",2055 l Module);2051 "SELECT refcode FROM function WHERE dll = %ld AND updated = 0", 2052 lDll); 2056 2053 if (!fAll) 2057 2054 strcat(&szQuery[0], " AND type IN ('A', 'I')"); … … 2084 2081 { 2085 2082 sprintf(&szQuery[0], 2086 "DELETE FROM function WHERE module= %ld AND updated = 0",2087 l Module);2083 "DELETE FROM function WHERE dll = %ld AND updated = 0", 2084 lDll); 2088 2085 if (!fAll) 2089 2086 strcat(&szQuery[0], " AND type IN ('A', 'I')"); -
trunk/tools/database/db.h
r6677 r6678 1 /* $Id: db.h,v 1.1 5 2001-09-07 10:24:07bird Exp $ */1 /* $Id: db.h,v 1.16 2001-09-07 10:31:44 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 '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' 31 #define FUNCTION_OTHER 'O' /* for all other functions (ie. OSLibInitWSeBFileIO) */ 36 32 37 33 /* type flags of dll */ … … 53 49 /* function name and type */ 54 50 char * pszName; 55 char * pszClass;56 char fchType; /* function type. */57 51 char * pszReturnType; 58 52 long cRefCodes; … … 95 89 unsigned long cFns; 96 90 signed long alRefCode[NBR_FUNCTIONS]; 97 signed long al ModRefCode[NBR_FUNCTIONS];91 signed long alDllRefCode[NBR_FUNCTIONS]; 98 92 signed long alAliasFn[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */ 99 93 signed long alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */ 100 char achType[NBR_FUNCTIONS];101 94 } FNFINDBUF, *PFNFINDBUF; 102 95 … … 113 106 const char *pszDatabase); 114 107 BOOL _System dbDisconnect(); 115 signed long _System dbGetModule(const char *pszModName); 116 signed long _System dbCountFunctionInModule(signed long lModule, 117 BOOL fNotAliases); 118 //signed long _System dbCheckInsertDll(const char *pszDll, char fchType); 119 signed long _System dbCheckInsertModule(const char *pszModule, char fchType); 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); 120 112 unsigned short _System dbGet(const char *pszTable, 121 113 const char *pszGetColumn, 122 114 const char *pszMatch1, 123 115 const char *pszMatchValue1); 124 BOOL _System dbInsertUpdateFunction(signed long l Module,116 BOOL _System dbInsertUpdateFunction(signed long lDll, 125 117 const char *pszFunction, 126 118 const char *pszIntFunction, … … 128 120 BOOL fIgnoreOrdinal, 129 121 char fchType); 130 BOOL _System dbInsertUpdateFile(signed long l Module,122 BOOL _System dbInsertUpdateFile(signed long lDll, 131 123 const char *pszFilename, 132 124 const char *pszDescription, … … 136 128 BOOL _System dbFindFunction(const char *pszFunctionName, 137 129 PFNFINDBUF pFnFindBuf, 138 signed long l Module);139 signed long _System dbFindFile(signed long l Module, const char *pszFilename);130 signed long lDll); 131 signed long _System dbFindFile(signed long lDll, const char *pszFilename); 140 132 signed long _System dbFindAuthor(const char *pszAuthor, const char *pszEmail); 141 133 signed long _System dbGetFunctionState(signed long lRefCode); 142 134 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, 143 signed long l Module,135 signed long lDll, 144 136 char *pszError); 145 137 BOOL _System dbRemoveDesignNotes(signed long lFile); 146 BOOL _System dbAddDesignNote(signed long l Module,138 BOOL _System dbAddDesignNote(signed long lDll, 147 139 signed long lFile, 148 140 const char *pszTitle, … … 168 160 char *pszDate); 169 161 /* StateUpd stuff */ 170 BOOL _System dbGetNotUpdatedFunction(signed long l Module,162 BOOL _System dbGetNotUpdatedFunction(signed long lDll, 171 163 DBCALLBACKFETCH dbFetchCallBack); 172 signed long _System dbGetNumberOfUpdatedFunction(signed long l Module);164 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll); 173 165 174 166 /* APIImport stuff */ 175 BOOL _System dbClearUpdateFlagFile(signed long l Module);176 BOOL _System dbClearUpdateFlagFunction(signed long l Module, BOOL fAll);177 BOOL _System dbDeleteNotUpdatedFiles(signed long l Module);178 BOOL _System dbDeleteNotUpdatedFunctions(signed long l Module, BOOL fAll);167 BOOL _System dbClearUpdateFlagFile(signed long lDll); 168 BOOL _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll); 169 BOOL _System dbDeleteNotUpdatedFiles(signed long lDll); 170 BOOL _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll); 179 171 180 172 #ifdef __cplusplus -
trunk/tools/database/www/Odin32DB.phtml
r6677 r6678 31 31 * What are we up to? We'll parse the input parameter (if any) to find out. 32 32 */ 33 if (isset($ modrefcode))34 { /* Modules by refcode */35 $sCategory = " module";36 $sCategoryName = " Module";37 if ($ modrefcode != "")38 $iRefcode = (int)$ modrefcode;33 if (isset($dllrefcode)) 34 { /* DLLs by refcode */ 35 $sCategory = "dll"; 36 $sCategoryName = "Dll"; 37 if ($dllrefcode != "") 38 $iRefcode = (int)$dllrefcode; 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 Modules = (isset($fModules) && $fModules!= '0');80 $fDlls = (isset($fDlls) && $fDlls != '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 mod) && $authormod != "" && @(int)$authormod>= 0))86 $author mod= -1;85 if (!(isset($authordll) && $authordll != "" && @(int)$authordll >= 0)) 86 $authordll = -1; 87 87 } 88 88 else if (isset($designnoterefcode)) … … 95 95 else if (isset($dlls)) 96 96 { /* All dlls */ 97 $sCategory = " modules";97 $sCategory = "dlls"; 98 98 $sCategoryName = "All Dlls"; 99 $s ModType = 'A';99 $sDllType = 'A'; 100 100 } 101 101 else if (isset($internal)) 102 { /* All Internal Modules */103 $sCategory = " modules";102 { /* All Internal Dlls */ 103 $sCategory = "dlls"; 104 104 $sCategoryName = "Internal Dlls"; 105 $s ModType = 'I';105 $sDllType = 'I'; 106 106 } 107 107 else if (isset($support)) 108 { /* All Suppors Stuff*/109 $sCategory = " modules";108 { /* All dlls */ 109 $sCategory = "dlls"; 110 110 $sCategoryName = "Support Stuff"; 111 $s ModType = 'S';111 $sDllType = 'S'; 112 112 } 113 113 else if (isset($tools)) 114 114 { /* Tools */ 115 $sCategory = " modules";115 $sCategory = "dlls"; 116 116 $sCategoryName = "Tools"; 117 $s ModType = 'T';117 $sDllType = 'T'; 118 118 } 119 119 else if (isset($apigroups)) … … 179 179 switch ($sCategory) 180 180 { 181 case " module":182 { 183 Odin32DB ModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);181 case "dll": 182 { 183 Odin32DBDllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState); 184 184 break; 185 185 } … … 205 205 case "author": 206 206 { 207 Odin32DBAuthorInfo($db, $iRefcode, $f Modules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authormod);207 Odin32DBAuthorInfo($db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll); 208 208 break; 209 209 } … … 249 249 } 250 250 251 case " modules":251 case "dlls": 252 252 { 253 253 /* 254 * List all modules.254 * List all dlls. 255 255 */ 256 256 Odin32DBNavigationTop("",""); … … 269 269 " COUNT(f.refcode) AS functions\n". 270 270 "FROM\n". 271 " moduled\n".271 " dll d\n". 272 272 " LEFT OUTER JOIN function f\n". 273 " ON f. module= d.refcode\n".273 " ON f.dll = d.refcode\n". 274 274 "WHERE\n". 275 " d.type = '".$s ModuleType."'\n".275 " d.type = '".$sDllType."'\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 Module= mysql_fetch_array($result))285 while ($aDll = mysql_fetch_array($result)) 286 286 { 287 echo "<li><a href=\"Odin32DB.phtml? modrefcode=".$aModule["refcode"].288 "\">".$a Module["name"]."</a> (".$aModule["functions"].")\n";287 echo "<li><a href=\"Odin32DB.phtml?dllrefcode=".$aDll["refcode"]. 288 "\">".$aDll["name"]."</a> (".$aDll["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 Authors!</i>\n";326 echo "<i>No dlls!</i>\n"; 327 327 else 328 328 { … … 371 371 { 372 372 if (mysql_num_rows($result) <= 0) 373 echo "<i>No Apigroups!</i>\n";373 echo "<i>No dlls!</i>\n"; 374 374 else 375 375 { … … 409 409 " dn.seqnbr AS seqnbr,\n". 410 410 " dn.level AS level,\n". 411 " m.name AS modname,\n".411 " d.name AS dllname,\n". 412 412 " f.name AS filename\n". 413 413 "FROM\n". 414 414 " designnote dn,\n". 415 " module m,\n".415 " dll d,\n". 416 416 " file f\n". 417 "WHERE dn. module= d.refcode\n".417 "WHERE dn.dll = d.refcode\n". 418 418 " AND dn.file = f.refcode\n". 419 419 " AND dn.level <= 1\n". 420 "ORDER BY m.name, dn.seqnbr, dn.seqnbrnote\n";420 "ORDER BY d.name, dn.seqnbr, dn.seqnbrnote\n"; 421 421 if ($result = mysql_query($sql, $db)) 422 422 { -
trunk/tools/database/www/Odin32DBHelpers.php3
r6677 r6678 113 113 114 114 /** 115 * Compute completion percentage for a module.115 * Compute completion percentage for a dll. 116 116 * @returns Completion percentage. Range 0-100. 117 117 * On error -1 or -2 is returned. 118 * @param $i Module Modulereference code.119 * @param $db 120 * @sketch Get total number of function in the module.121 * Get number of completed functions in the module.118 * @param $iDll Dll reference 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. 122 122 * return complete*100 / total 123 123 * @status Completely implemented … … 125 125 * @remark 126 126 */ 127 function Odin32DBComputeCompletion($i Module, $db)128 { 129 /* 130 * Count the total number of functions in the module.127 function Odin32DBComputeCompletion($iDll, $db) 128 { 129 /* 130 * Count the total number of functions in the DLL. 131 131 */ 132 132 $sql = sprintf("SELECT SUM(s.weight)/COUNT(f.state) … … 136 136 WHERE 137 137 f.state = s.refcode 138 AND module= %d",139 $i Module);138 AND dll = %d", 139 $iDll); 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 module (or all modules.).168 * @param $i Module Modulereference code.167 * Draws a completion bar for a dll (or all dlls). 168 * @param $iDll Dll reference code. 169 169 * If < 0 then for the entire project. 170 * @param $i ModName Modulename.170 * @param $iDllName Dll 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 Module($iModule, $sModName, $db)177 { 178 if ($i Module< 0)179 return Odin32DBcompletionBar2("", $s ModName, $db);180 return Odin32DBcompletionBar2(" module = ".$iModule." AND f.type IN ('A', 'I')", $sModName, $db);176 function Odin32DBCompletionBarDll($iDll, $sDllName, $db) 177 { 178 if ($iDll < 0) 179 return Odin32DBcompletionBar2("", $sDllName, $db); 180 return Odin32DBcompletionBar2("dll = ".$iDll, $sDllName, $db); 181 181 } 182 182 … … 221 221 { 222 222 /* 223 * Count the total number of functions for the author.223 * Count the total number of functions in the DLL. 224 224 */ 225 225 $sql = "SELECT COUNT(*) FROM fnauthor fa JOIN function f\n". 226 "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor ." AND f.type IN ('A', 'I')";226 "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor; 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 AND\n". 263 " f.type IN ('A', 'I')\n". 262 " f.state = s.refcode\n". 264 263 "GROUP BY s.refcode\n". 265 264 "ORDER BY state\n"; … … 296 295 /** 297 296 * Draws a completion bar. 298 * @param $ sCondition Where conditions.299 * @param $sName Name...300 * @param $db 301 * @sketch Get total number of function in the selection.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. 302 301 * Get the number of function per status. (+state color) 303 302 * Draw bar. … … 308 307 { 309 308 /* 310 * Count the total number of functions in selection.309 * Count the total number of functions in the DLL. 311 310 */ 312 311 $sql = "SELECT COUNT(*) FROM function f"; … … 392 391 { 393 392 /* 394 * Select the states. 395 */ 396 $sql = "SELECT name, 397 color 398 FROM state 399 ORDER BY refcode"; 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"; 400 401 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1) 401 402 { … … 667 668 /** 668 669 * Writes the a function listing base sqlstatement with these columns (ordered): 669 * 0. Modulerefcode670 * 1. Modulename670 * 0. dll refcode 671 * 1. dll name 671 672 * 2. number of functions 672 673 * … … 676 677 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 677 678 */ 678 function Odin32DBWrite Modules($sql, $db)679 function Odin32DBWriteDlls($sql, $db) 679 680 { 680 681 if ($result2 = mysql_query($sql, $db)) … … 684 685 echo "\n<table width=100% border=0 cellpadding=0>\n". 685 686 "<tr>\n". 686 " <td width=75%><font size=-1><b> Modules</b></font></td>\n".687 " <td width=75%><font size=-1><b>Dlls</b></font></td>\n". 687 688 " <td align=right><font size=-1><b>Functions</b></font></td>\n". 688 689 "</tr>\n"; 689 690 while ($aFunction = mysql_fetch_array($result2)) 690 691 printf("<tr>". 691 "<td><font size=-1><a href=\"Odin32DB.phtml? modrefcode=%s\">%s</a></font></td>".692 "<td><font size=-1><a href=\"Odin32DB.phtml?dllrefcode=%s\">%s</a></font></td>". 692 693 "<td align=right><font size=-1>%s</font></td>". 693 694 "</tr>\n", … … 761 762 /** 762 763 * Writes the a function listing base sqlstatement with these columns (ordered): 763 * 0. modulerefcode764 * 1. modulename764 * 0. dll refcode 765 * 1. dll name 765 766 * 2. function refcode 766 767 * 3. function name … … 774 775 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 775 776 */ 776 function Odin32DBWriteFunctionsWith Modules($sql, $db, $sURLArgs)777 function Odin32DBWriteFunctionsWithDlls($sql, $db, $sURLArgs) 777 778 { 778 779 if ($result2 = mysql_query($sql, $db)) … … 782 783 echo "\n<table width=100% border=0 cellpadding=0>\n". 783 784 "<tr>\n". 784 " <td width=30%><font size=-1><b> ModuleName</b></font></td>\n".785 " <td width=30%><font size=-1><b>Dll Name</b></font></td>\n". 785 786 " <td width=45%><font size=-1><b>Function Name</b></font></td>\n". 786 787 " <td><font size=-1><b>State</b></font></td>\n". … … 788 789 while ($aFunction = mysql_fetch_row($result2)) 789 790 printf("<tr>". 790 "<td><font size=-1><a href=\"Odin32DB.phtml? modrefcode=%s\">%s</a></font></td>".791 "<td><font size=-1><a href=\"Odin32DB.phtml?dllrefcode=%s\">%s</a></font></td>". 791 792 "<td><font size=-1><a href=\"Odin32DB.phtml?functionrefcode=%s\">%s</a></font></td>". 792 793 "<td><font size=-1 color=%s>%s</font></td>". … … 808 809 809 810 echo "<p>Click <a href=\"Odin32DB.phtml#functions?".$sURLArgs."\">here</a> to view functions sorted ". 810 ($fSortByState ? "alphabetical by module" : "by state"). ".<br>";811 ($fSortByState ? "alphabetical by dll" : "by state"). ".<br>"; 811 812 } 812 813 else … … 952 953 953 954 echo "<a href=\"Odin32DB.phtml\">Root</a>\n". 954 " - <a href=\"Odin32DB.phtml? modules=1\">Moduless</a>\n".955 " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n". 955 956 " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n". 956 957 " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n"; … … 985 986 echo 986 987 "<a href=\"Odin32DB.phtml\">Root</a>\n". 987 " - <a href=\"Odin32DB.phtml? moduless=1\">Modules</a>\n".988 " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n". 988 989 " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n". 989 990 " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n"; … … 1028 1029 " a.name AS aliasname,\n". 1029 1030 " a.refcode AS aliasrefcode,\n". 1030 " ad.name AS alias nmodname,\n".1031 " ad.refcode AS alias modrefcode,\n".1032 " d.name AS modname,\n".1033 " d.refcode AS modrefcode,\n".1031 " ad.name AS aliasdllname,\n". 1032 " ad.refcode AS aliasdllrefcode,\n". 1033 " d.name AS dllname,\n". 1034 " d.refcode AS dllrefcode,\n". 1034 1035 " i.name AS filename,\n". 1035 1036 " i.refcode AS filerefcode,\n". … … 1039 1040 " function f\n". 1040 1041 " LEFT OUTER JOIN function a ON f.aliasfn = a.refcode\n". 1041 " LEFT OUTER JOIN module ad ON a.module= ad.refcode\n".1042 " LEFT OUTER JOIN dll ad ON a.dll = ad.refcode\n". 1042 1043 " LEFT OUTER JOIN apigroup g ON f.apigroup = g.refcode\n". 1043 " LEFT JOIN module d ON f.module= d.refcode\n".1044 " LEFT JOIN dll d ON f.dll = d.refcode\n". 1044 1045 " LEFT JOIN state s ON f.state = s.refcode\n". 1045 1046 " LEFT OUTER JOIN file i ON f.file = i.refcode\n". … … 1063 1064 Odin32DBInfoRow1("Type", $array, "type", "", "","invalid",""); 1064 1065 Odin32DBInfoRow1("State", $array, "state", "", "","invalid",""); 1065 Odin32DBInfoRow1(" Module", $array, "modname", "modrefcode", "modrefcode","","");1066 Odin32DBInfoRow1("Dll", $array, "dllname", "dllrefcode", "dllrefcode","",""); 1066 1067 Odin32DBInfoRow1("Ordinal", $array, "ordinal","","","not available",""); 1067 1068 if (isset($array["apigroupname"])) 1068 1069 Odin32DBInfoRow1("API Group", $array, "apigroupname", "apigrouprefcode", "apigrouprefcode","",""); 1069 1070 Odin32DBInfoRow1("File", $array, "filename", "filerefcode", "filerefcode", "not available", 1070 " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array[" modname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)");1071 " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array["dllname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)"); 1071 1072 if ($array["line"] > 0) 1072 1073 Odin32DBInfoRow1("Line", $array, "line", "", "","",""); … … 1074 1075 Odin32DBInfoRow1("Line", $array, "unavailable", "", "","not available",""); 1075 1076 if (isset($array["aliasrefcode"])) 1076 Odin32DBInfoRow2("Forwards", $array, "alias modname", "aliasmodrefcode", "modrefcode","",".",1077 Odin32DBInfoRow2("Forwards", $array, "aliasdllname", "aliasdllrefcode", "dllrefcode","",".", 1077 1078 "aliasname", "aliasrefcode", "functionrefcode"); 1078 1079 else 1079 1080 { 1080 1081 $sql = sprintf("SELECT\n". 1081 " m.name AS modname,\n".1082 " m.refcode AS modrefcode,\n".1082 " d.name AS dllname,\n". 1083 " d.refcode AS dllrefcode,\n". 1083 1084 " f.name AS fnname,\n". 1084 1085 " f.refcode AS fnrefcode\n". 1085 1086 "FROM\n". 1086 1087 " function f,\n". 1087 " module m\n".1088 " dll d\n". 1088 1089 "WHERE\n". 1089 1090 " f.aliasfn = %d AND\n". 1090 " f. module = m.refcode\n".1091 "ORDER BY m.name, f.name\n",1091 " f.dll = d.refcode\n". 1092 "ORDER BY d.name, f.name\n", 1092 1093 $iRefcode); 1093 1094 if (($result2 = mysql_query($sql, $db))) … … 1101 1102 if ($f) $sValue = $sValue."<br>"; 1102 1103 else $f = 1; 1103 $sValue = $sValue."<a href=\"Odin32DB.phtml? modrefcode=".1104 $aAlias[" modrefcode"]."\">".$aAlias["modname"]."</a>.".1104 $sValue = $sValue."<a href=\"Odin32DB.phtml?dllrefcode=". 1105 $aAlias["dllrefcode"]."\">".$aAlias["dllname"]."</a>.". 1105 1106 "<a href=\"Odin32DB.phtml?functionrefcode=". 1106 1107 $aAlias["fnrefcode"]."\">".$aAlias["fnname"]."</a>"; … … 1244 1245 1245 1246 /** 1246 * Writes standard moduleinfo.1247 * Writes standard dll info. 1247 1248 * 1248 1249 * @returns void 1249 1250 * @param $db Database handle. 1250 * @param $iRefcode Modulereference code.1251 * @param $iRefcode Dll reference code. 1251 1252 * @param $fFunctions Flags which tells wether to list all functions or not. 1252 1253 * @param $fFiles Flags which tells wether to list all files or not. … … 1259 1260 * @remark 1260 1261 */ 1261 function Odin32DB ModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState)1262 { 1263 $sURLArgs = " modrefcode=".$iRefcode.1262 function Odin32DBDllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState) 1263 { 1264 $sURLArgs = "dllrefcode=".$iRefcode. 1264 1265 ($fFunctions ? "&fFunctions=1" : ""). 1265 1266 ($fFiles ? "&fFiles=1" : ""). … … 1271 1272 * Navigation - TOP 1272 1273 */ 1273 $sExpand = " modrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";1274 $sExpand = "dllrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1"; 1274 1275 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 1275 $sCollapse = " modrefcode=".$iRefcode;1276 $sCollapse = "dllrefcode=".$iRefcode; 1276 1277 Odin32DBNavigationTop($sExpand, $sCollapse); 1277 1278 … … 1280 1281 */ 1281 1282 $sql = sprintf("SELECT\n". 1282 " m.name AS name,\n".1283 " m.description AS description,\n".1283 " d.name AS name,\n". 1284 " d.description AS description,\n". 1284 1285 " c.description AS type\n". 1285 1286 "FROM\n". 1286 " moduled,\n".1287 " dll d,\n". 1287 1288 " code c\n". 1288 1289 "WHERE\n". 1289 1290 " c.codegroup = 'DTYP' AND\n". 1290 " m.type = c.code AND\n".1291 " m.refcode = %d",1291 " d.type = c.code AND\n". 1292 " d.refcode = %d", 1292 1293 $iRefcode); 1293 1294 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) … … 1306 1307 " function\n". 1307 1308 "WHERE\n". 1308 " module= %d",1309 " dll = %d", 1309 1310 $iRefcode); 1310 1311 $cFunctions = 0; … … 1320 1321 " file\n". 1321 1322 "WHERE\n". 1322 " module= %d",1323 " dll = %d", 1323 1324 $iRefcode); 1324 1325 $cFiles = 0; … … 1334 1335 " apigroup\n". 1335 1336 "WHERE\n". 1336 " module= %d",1337 " dll = %d", 1337 1338 $iRefcode); 1338 1339 $cAPIGroups = 0; … … 1350 1351 */ 1351 1352 Odin32DBNaslov("Completion", "completion"); 1352 Odin32DBCompletionBar Module($iRefcode, "", $db);1353 Odin32DBCompletionBarDll($iRefcode, "", $db); 1353 1354 1354 1355 /* … … 1361 1362 " function\n". 1362 1363 "WHERE\n". 1363 " module= %d\n".1364 " dll = %d\n". 1364 1365 "GROUP BY state\n". 1365 1366 "ORDER BY state", … … 1382 1383 " LEFT JOIN state s ON f.state = s.refcode\n". 1383 1384 "WHERE\n". 1384 " f. module= %d\n",1385 " f.dll = %d\n", 1385 1386 $iRefcode); 1386 1387 if ($fSortByState) … … 1409 1410 " LEFT OUTER JOIN function fn ON fn.file = f.refcode\n". 1410 1411 "WHERE\n". 1411 " f. module= %d\n".1412 " f.dll = %d\n". 1412 1413 "GROUP BY f.refcode\n". 1413 1414 "ORDER BY f.name\n", … … 1436 1437 " JOIN function f\n". 1437 1438 "WHERE\n". 1438 " g. module= %d AND\n".1439 " f. module= %d AND\n".1439 " g.dll = %d AND\n". 1440 " f.dll = %d AND\n". 1440 1441 " f.apigroup = g.refcode\n". 1441 1442 "GROUP BY f.apigroup\n". … … 1466 1467 " JOIN author a\n". 1467 1468 "WHERE\n". 1468 " f. module= %d AND\n".1469 " f.dll = %d AND\n". 1469 1470 " fa.function = f.refcode AND\n". 1470 1471 " fa.author = a.refcode\n". … … 1534 1535 " f.revision AS revision,\n". 1535 1536 " f.description AS description,\n". 1536 " f. module AS modrefcode,\n".1537 " m.name AS modname\n".1537 " f.dll AS dllrefcode,\n". 1538 " d.name AS dllname\n". 1538 1539 "FROM\n". 1539 1540 " file f,\n". 1540 " module m,\n".1541 " dll d,\n". 1541 1542 " author a\n". 1542 1543 "WHERE\n". 1543 1544 " f.refcode = %d AND\n". 1544 " f. module = m.refcode AND\n".1545 " f.dll = d.refcode AND\n". 1545 1546 " f.lastauthor= a.refcode", 1546 1547 $iRefcode); … … 1553 1554 echo "\n<table width=100% border=3 cellpadding=0>\n"; 1554 1555 Odin32DBInfoRow1("Name", $array, "name","","","", 1555 " (<a href=\"cvs.phtml?sFile=./src/".$array[" modname"]."/".$array["name"].",v&sRevision=\">cvs</a>)");1556 " (<a href=\"cvs.phtml?sFile=./src/".$array["dllname"]."/".$array["name"].",v&sRevision=\">cvs</a>)"); 1556 1557 Odin32DBInfoRow1("Revision", $array, "revision","","","",""); 1557 1558 Odin32DBInfoRow1("Changed", $array, "lastdatetime","","","",""); 1558 1559 Odin32DBInfoRow1("Last Author", $array, "lastauthorname","lastauthorrefcode","authorrefcode","",""); 1559 Odin32DBInfoRow1(" Module", $array, "modname","modrefcode","modrefcode","","");1560 Odin32DBInfoRow1("Dll", $array, "dllname","dllrefcode","dllrefcode","",""); 1560 1561 $sql = sprintf("SELECT\n". 1561 1562 " COUNT(*) as functions\n". … … 1721 1722 * @param $db Database handle. 1722 1723 * @param $iRefcode Author reference code. 1723 * @param $f Modules Flags which tells wether to list all modules or not.1724 * @param $fDlls Flags which tells wether to list all dlls or not. 1724 1725 * @param $fFunctions Flags which tells wether to list all functions or not. 1725 1726 * @param $fFiles Flags which tells wether to list all files or not. … … 1727 1728 * @param $fSortByState Flags which tells wether to sort functions by 1728 1729 * state and function name or just by function name. 1729 * @param $i ModRefcode Module refcode. All modulesif < 0.1730 * @param $iDllRefcode Dll refcode. All Dll if < 0. 1730 1731 * (not implemented yet) 1731 1732 * @sketch … … 1733 1734 * @remark 1734 1735 */ 1735 function Odin32DBAuthorInfo($db, $iRefcode, $f Modules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iModRefcode)1736 function Odin32DBAuthorInfo($db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iDllRefcode) 1736 1737 { 1737 1738 $sURLArgs = "authorrefcode=".$iRefcode. 1738 ($f Modules ? "&fModules=1" : "").1739 ($fDlls ? "&fDlls=1" : ""). 1739 1740 ($fFunctions ? "&fFunctions=1" : ""). 1740 1741 ($fFiles ? "&fFiles=1" : ""). … … 1745 1746 * Navigation - TOP 1746 1747 */ 1747 $sExpand = "authorrefcode=".$iRefcode."&f Modules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&mod=".$iModRefcode;1748 $sExpand = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode; 1748 1749 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 1749 1750 $sCollapse = "authorrefcode=".$iRefcode; … … 1795 1796 } 1796 1797 $sql = sprintf("SELECT\n". 1797 " COUNT(f. module) as functions1798 " COUNT(f.dll) as functions 1798 1799 \n". 1799 1800 "FROM\n". … … 1803 1804 " fa.author = %d AND". 1804 1805 " f.refcode = fa.function\n". 1805 "GROUP BY f. module",1806 "GROUP BY f.dll", 1806 1807 $iRefcode); 1807 $c Modules = 0;1808 if (($result2 = mysql_query($sql, $db)) && ($c Modules = mysql_num_rows($result2)) > 0)1809 Odin32DBInfoRow1NoArray("# Moduless", $cModules, "","","","");1808 $cDlls = 0; 1809 if (($result2 = mysql_query($sql, $db)) && ($cDlls = mysql_num_rows($result2)) > 0) 1810 Odin32DBInfoRow1NoArray("# Dlls", $cDlls, "","","",""); 1810 1811 $sql = sprintf("SELECT\n". 1811 " COUNT(f. module) as functions1812 " COUNT(f.dll) as functions 1812 1813 \n". 1813 1814 "FROM\n". … … 1824 1825 Odin32DBInfoRow1NoArray("# Files", $cFiles, "","","",""); 1825 1826 $sql = sprintf("SELECT\n". 1826 " COUNT(f. module) as functions1827 " COUNT(f.dll) as functions 1827 1828 \n". 1828 1829 "FROM\n". … … 1866 1867 1867 1868 /* 1868 * Modules1869 */ 1870 Odin32DBNaslov(" Modules", "Modules");1871 if ($f Modules)1869 * Dlls 1870 */ 1871 Odin32DBNaslov("Dlls", "dlls"); 1872 if ($fDlls) 1872 1873 { 1873 1874 $sql = sprintf("SELECT\n". 1874 " m.refcode,\n".1875 " m.name,\n".1875 " d.refcode,\n". 1876 " d.name,\n". 1876 1877 " COUNT(f.refcode)\n". 1877 1878 "FROM\n". 1878 1879 " fnauthor fa,\n". 1879 " module m,\n".1880 " dll d,\n". 1880 1881 " function f\n". 1881 1882 "WHERE\n". 1882 1883 " fa.author = %d AND\n". 1883 1884 " fa.function = f.refcode AND\n". 1884 " f. module = m.refcode\n".1885 "GROUP BY m.refcode\n".1886 "ORDER BY m.name\n",1885 " f.dll = d.refcode\n". 1886 "GROUP BY d.refcode\n". 1887 "ORDER BY d.name\n", 1887 1888 $iRefcode); 1888 Odin32DBWrite Modules($sql, $db, $sURLArgs);1889 Odin32DBWriteDlls($sql, $db, $sURLArgs); 1889 1890 } 1890 1891 else 1891 echo "Click <a href=\"Odin32DB.phtml# modules?".$sURLArgs."&fModules=1".1892 echo "Click <a href=\"Odin32DB.phtml#dlls?".$sURLArgs."&fDlls=1". 1892 1893 "\">here</a> to see all files.\n"; 1893 1894 … … 1902 1903 " f.refcode,\n". 1903 1904 " f.name,\n". 1904 " m.refcode,\n".1905 " m.name,\n".1905 " d.refcode,\n". 1906 " d.name,\n". 1906 1907 " s.color,\n". 1907 1908 " s.name\n". … … 1909 1910 " fnauthor fa\n". 1910 1911 " JOIN function f\n". 1911 " JOIN module m\n".1912 " JOIN dll d\n". 1912 1913 " LEFT JOIN state s ON f.state = s.refcode\n". 1913 1914 "WHERE\n". 1914 1915 " fa.author = %d AND\n". 1915 1916 " fa.function = f.refcode AND \n". 1916 " f. module = m.refcode\n",1917 " f.dll = d.refcode\n", 1917 1918 $iRefcode); 1918 1919 if ($fSortByState) … … 1920 1921 else 1921 1922 $sql = $sql."ORDER BY d.name, f.name"; 1922 Odin32DBWriteFunctionsWith Modules($sql, $db, $sURLArgs);1923 Odin32DBWriteFunctionsWithDlls($sql, $db, $sURLArgs); 1923 1924 } 1924 1925 else … … 2037 2038 " g.refcode AS refcode,\n". 2038 2039 " g.description AS description,\n". 2039 " m.name AS modname,\n".2040 " m.refcode AS modrefcode\n".2040 " d.name AS dllname,\n". 2041 " d.refcode AS dllrefcode\n". 2041 2042 "FROM\n". 2042 2043 " apigroup g\n". 2043 " JOIN module m\n".2044 " JOIN dll d\n". 2044 2045 "WHERE\n". 2045 2046 " g.refcode = %d AND". 2046 " g. module = m.refcode\n",2047 " g.dll = d.refcode\n", 2047 2048 $iRefcode); 2048 2049 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) … … 2054 2055 echo "\n<table width=100% border=3 cellpadding=0>\n"; 2055 2056 Odin32DBInfoRow1("Name", $array, "name","","","",""); 2056 Odin32DBInfoRow1(" Module", $array, "modname","modrefcode","modrefcode","bad configuration","");2057 Odin32DBInfoRow1("Dll", $array, "dllname","dllrefcode","dllrefcode","bad configuration",""); 2057 2058 if (isset($array["description"])) 2058 2059 Odin32DBInfoRow1("Description", $array, "description","","","",""); … … 2084 2085 2085 2086 $sql = sprintf("SELECT\n". 2086 " COUNT(f. module) as functions\n".2087 " COUNT(f.dll) as functions\n". 2087 2088 "FROM\n". 2088 2089 " fnauthor fa,\n". … … 2230 2231 * Navigation - TOP 2231 2232 */ 2232 $sExpand = "authorrefcode=".$iRefcode."&f Modules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&module=".$iModRefcode;2233 $sExpand = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode; 2233 2234 if ($fSortByState) $sExpand = $sExpand."&fSortByState=".$fSortByState; 2234 2235 $sCollapse = "authorrefcode=".$iRefcode; … … 2242 2243 " dn.note AS note,\n". 2243 2244 " dn.refcode AS refcode,\n". 2244 " dn. module AS modrefcode,\n".2245 " dn.dll AS dllrefcode,\n". 2245 2246 " dn.file AS filerefcode,\n". 2246 2247 " dn.seqnbrnote AS seqnbnote,\n". … … 2248 2249 " dn.seqnbr AS seqnbr,\n". 2249 2250 " dn.line AS line,\n". 2250 " m.name AS modname,\n".2251 " d.name AS dll,\n". 2251 2252 " f.name AS file\n". 2252 2253 "FROM\n". 2253 2254 " designnote dn,\n". 2254 " module m,\n".2255 " dll d,\n". 2255 2256 " file f\n". 2256 2257 "WHERE dn.refcode = %d\n". 2257 " AND dn. module = m.refcode\n".2258 " AND dn.dll = d.refcode\n". 2258 2259 " AND dn.file = f.refcode\n". 2259 2260 "ORDER BY dn.seqnbrnote\n", … … 2267 2268 echo "\n<table width=100% border=3 cellpadding=0>\n"; 2268 2269 Odin32DBInfoRow1("Title", $array, "name","","","",""); 2269 Odin32DBInfoRow1("Module", $array, " modname","","","","");2270 Odin32DBInfoRow1("Module", $array, "dll","","","",""); 2270 2271 Odin32DBInfoRow1("File", $array, "file","","","",""); 2271 2272 Odin32DBInfoRow1("Line", $array, "line","","","","");
Note:
See TracChangeset
for help on using the changeset viewer.