Changeset 2765 for trunk/tools/database
- Timestamp:
- Feb 12, 2000, 6:55:04 PM (26 years ago)
- Location:
- trunk/tools/database
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database
-
Property svn:ignore
set to
*.html
*.gif
html/*
-
Property svn:ignore
set to
-
trunk/tools/database/StateUpd.cpp
r2761 r2765 1 /* $Id: StateUpd.cpp,v 1. 9 2000-02-11 23:54:24bird Exp $1 /* $Id: StateUpd.cpp,v 1.10 2000-02-12 17:55:02 bird Exp $ 2 2 * 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 285 285 286 286 /* write status to log */ 287 ul2 = dbGetNumberOfUpdatedFunction(options.lDllRefcode); 288 ul1 = dbCountFunctionInDll(options.lDllRefcode); 287 289 fprintf(phLog, "-------------------------------------------------\n"); 288 290 fprintf(phLog, "-------- Functions which was not updated --------\n"); … … 290 292 fprintf(phLog, "-------------------------------------------------\n"); 291 293 fprintf(phLog, "-------------------------------------------------\n\n"); 292 ul1 = dbCountFunctionInDll(options.lDllRefcode);293 294 fprintf(phLog,"Number of function in this DLL: %4ld\n", ul1); 294 fprintf(phLog,"Number of successfully processed APIs: %4ld \n", (long)(0x0000FFFF & ulRc));295 fprintf(phLog,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), ul2); 295 296 fprintf(phLog,"Number of signals: %4ld\n", (long)(ulRc >> 16)); 296 297 … … 303 304 /* warn if error during processing. */ 304 305 fprintf(stdout,"Number of function in this DLL: %4ld\n", ul1); 305 fprintf(stdout,"Number of successfully processed APIs: %4ld \n", (long)(0x0000FFFF & ulRc));306 fprintf(stdout,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), ul2); 306 307 fprintf(stdout,"Number of signals: %4ld\n", (long)(ulRc >> 16)); 307 308 if ((int)(ulRc >> 16) > 0) … … 1372 1373 static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser) 1373 1374 { 1374 if (stricmp(pszFieldName, "name") == 0) 1375 fprintf(phLog, "%s ", pszValue); 1376 else if (stricmp(pszFieldName, "updated") == 0) 1377 fprintf(phLog, "update=%s ", pszValue); 1378 else if (stricmp(pszFieldName, "intname") == 0) 1379 fprintf(phLog, "(%s)\n", pszValue); 1375 static i = 0; 1376 switch (i++) 1377 { 1378 case 0: 1379 fprintf(phLog, "%s", pszValue); 1380 break; 1381 case 1: 1382 fprintf(phLog, "(%s)", pszValue); 1383 break; 1384 case 2: /* updated */ 1385 fprintf(phLog, " %s=%s", pszFieldName, pszValue); 1386 break; 1387 case 3: /* aliasfn */ 1388 fprintf(phLog, " %s=%s", pszFieldName, pszValue); 1389 break; 1390 case 4: 1391 if (pszValue != NULL) 1392 fprintf(phLog, " --> %s.", pszValue); 1393 break; 1394 case 5: 1395 if (pszValue != NULL) 1396 fprintf(phLog, "%s", pszValue); 1397 break; 1398 case 6: 1399 if (pszValue != NULL) 1400 fprintf(phLog, "(%s)", pszValue); 1401 break; 1402 1403 default: 1404 i = 0; 1405 fprintf(phLog, "\n"); 1406 } 1407 1408 if (stricmp(pszFieldName, "last") == 0) 1409 { 1410 i = 0; 1411 fprintf(phLog, "\n"); 1412 } 1380 1413 1381 1414 pvUser = pvUser; -
trunk/tools/database/db.cpp
r2761 r2765 1 /* $Id: db.cpp,v 1. 6 2000-02-11 23:54:25bird Exp $ *1 /* $Id: db.cpp,v 1.7 2000-02-12 17:55:03 bird Exp $ * 2 2 * 3 3 * DB - contains all database routines. … … 360 360 } 361 361 362 #if 0362 #if 1 363 363 /** 364 364 * Find occurences of a function, given by internal name. … … 436 436 { 437 437 /* get the functions aliases to the functions we have allready found. */ 438 strcpy(&szQuery[0], "SELECT refcode, dll, aliasfn FROM function WHERE (");438 strcpy(&szQuery[0], "SELECT refcode, dll, aliasfn FROM function WHERE aliasfn IN ("); 439 439 for (i = 0; i < pFnFindBuf->cFns; i++) 440 440 { 441 if (i != 0) strcat(&szQuery[0], " OR");442 sprintf(&szQuery[strlen(szQuery)], " aliasfn = %ld", pFnFindBuf->alRefCode[i]);441 if (i != 0) strcat(&szQuery[0], ", "); 442 sprintf(&szQuery[strlen(szQuery)], "%ld", pFnFindBuf->alRefCode[i]); 443 443 } 444 444 sprintf(&szQuery[strlen(szQuery)], ") AND dll <> %ld", lDll); … … 716 716 int i,k,rc; 717 717 unsigned long ulRc = 0; 718 BOOL f = FALSE;719 718 720 719 for (k = 0; k < pFnDesc->cRefCodes; k++) 721 720 { 721 BOOL f = FALSE; 722 722 723 /* set updated flag */ 723 724 sprintf(pszQuery, "UPDATE function SET updated = updated + 1 WHERE refcode = %ld", … … 1420 1421 BOOL fRet = FALSE; 1421 1422 void *pres; 1422 char szQuery[ 128];1423 char szQuery[256]; 1423 1424 1424 1425 /* not updated names */ 1425 sprintf(&szQuery[0], "SELECT name, intname FROM function WHERE dll = %ld AND updated = 0", 1426 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1427 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1428 " LEFT JOIN dll d ON f2.dll = d.refcode " 1429 "WHERE f1.dll = %ld AND f1.updated = 0", 1426 1430 lDll); 1427 1431 pres = dbExecuteQuery(szQuery); … … 1438 1442 1439 1443 /* warn about updated > 1 too */ 1440 sprintf(&szQuery[0], "SELECT updated, name, intname FROM function WHERE dll = %ld AND updated > 1", 1444 sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last " 1445 "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode " 1446 " LEFT JOIN dll d ON f2.dll = d.refcode " 1447 "WHERE f1.dll = %ld AND f1.updated > 1", 1441 1448 lDll); 1442 1449 pres = dbExecuteQuery(szQuery); … … 1456 1463 1457 1464 return fRet; 1465 } 1466 1467 1468 /** 1469 * Counts the function for the given DLL which has been updated. 1470 * @returns -1 on error, number of updated function on success. 1471 * @param lDll Dll reference number. 1472 */ 1473 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll) 1474 { 1475 int rc; 1476 char szQuery[128]; 1477 MYSQL_RES * pres; 1478 1479 sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE dll = (%ld) AND updated > 0\n", lDll); 1480 rc = mysql_query(pmysql, &szQuery[0]); 1481 pres = mysql_store_result(pmysql); 1482 if (rc >= 0 && pres != NULL && mysql_num_rows(pres) == 1) 1483 rc = (int)getvalue(0, mysql_fetch_row(pres)); 1484 else 1485 rc = -1; 1486 mysql_free_result(pres); 1487 return (signed long)rc; 1458 1488 } 1459 1489 -
trunk/tools/database/db.h
r2761 r2765 1 /* $Id: db.h,v 1. 4 2000-02-11 23:54:25bird Exp $ */1 /* $Id: db.h,v 1.5 2000-02-12 17:55:03 bird Exp $ */ 2 2 /* 3 3 * DB - contains all database routines … … 114 114 BOOL _System dbGetNotUpdatedFunction(signed long lDll, 115 115 DBCALLBACKFETCH dbFetchCallBack); 116 signed long _System dbGetNumberOfUpdatedFunction(signed long lDll); 116 117 117 118 #ifdef __cplusplus -
trunk/tools/database/kHtmlPC.cpp
r830 r2765 1 /* $Id: kHtmlPC.cpp,v 1. 1 1999-09-05 02:53:06bird Exp $ */1 /* $Id: kHtmlPC.cpp,v 1.2 2000-02-12 17:55:03 bird Exp $ */ 2 2 /* 3 3 * kHtmlPC - Special-purpose HTML/SQL preprocessor. … … 1416 1416 1417 1417 /* copy string */ 1418 while (*pszFrom != '\"' && *pszFrom != '>'&& *pszFrom != '\0')1418 while (*pszFrom != '\"' /*&& *pszFrom != '>'*/ && *pszFrom != '\0') 1419 1419 *pszTo++ = *pszFrom++; 1420 1420 *pszTo = '\0'; -
trunk/tools/database/sample.kSqlHtml
r830 r2765 1 <!-- $Id: sample.kSqlHtml,v 1.2 2000-02-12 17:55:04 bird Exp $ 2 -- 3 -- kSqlHTML Template Sample. 4 -- 5 -- Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 6 -- 7 -- Project Odin Software License can be found in LICENSE.TXT 8 --> 9 1 10 <!kTemplate filename="odin32ImplementationStatus.html"><HTML> 2 11 <Title>Odin32 Implementation Status</Title>
Note:
See TracChangeset
for help on using the changeset viewer.