Changeset 2765 for trunk/tools/database


Ignore:
Timestamp:
Feb 12, 2000, 6:55:04 PM (26 years ago)
Author:
bird
Message:

Some new reports.
General bugfixes and new features.

Location:
trunk/tools/database
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database

    • Property svn:ignore set to
      *.html
      *.gif
      html/*
  • trunk/tools/database/StateUpd.cpp

    r2761 r2765  
    1 /* $Id: StateUpd.cpp,v 1.9 2000-02-11 23:54:24 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.10 2000-02-12 17:55:02 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    285285
    286286        /* write status to log */
     287        ul2 = dbGetNumberOfUpdatedFunction(options.lDllRefcode);
     288        ul1 = dbCountFunctionInDll(options.lDllRefcode);
    287289        fprintf(phLog, "-------------------------------------------------\n");
    288290        fprintf(phLog, "-------- Functions which was not updated --------\n");
     
    290292        fprintf(phLog, "-------------------------------------------------\n");
    291293        fprintf(phLog, "-------------------------------------------------\n\n");
    292         ul1 = dbCountFunctionInDll(options.lDllRefcode);
    293294        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);
    295296        fprintf(phLog,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
    296297
     
    303304        /* warn if error during processing. */
    304305        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);
    306307        fprintf(stdout,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
    307308        if ((int)(ulRc >> 16) > 0)
     
    13721373static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser)
    13731374{
    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    }
    13801413
    13811414    pvUser = pvUser;
  • trunk/tools/database/db.cpp

    r2761 r2765  
    1 /* $Id: db.cpp,v 1.6 2000-02-11 23:54:25 bird Exp $ *
     1/* $Id: db.cpp,v 1.7 2000-02-12 17:55:03 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    360360}
    361361
    362 #if 0
     362#if 1
    363363/**
    364364 * Find occurences of a function, given by internal name.
     
    436436                        {
    437437                            /* 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 (");
    439439                            for (i = 0; i < pFnFindBuf->cFns; i++)
    440440                            {
    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]);
    443443                            }
    444444                            sprintf(&szQuery[strlen(szQuery)], ") AND dll <> %ld", lDll);
     
    716716    int   i,k,rc;
    717717    unsigned long ulRc = 0;
    718     BOOL          f = FALSE;
    719718
    720719    for (k = 0; k < pFnDesc->cRefCodes; k++)
    721720    {
     721        BOOL    f = FALSE;
     722
    722723        /* set updated flag */
    723724        sprintf(pszQuery, "UPDATE function SET updated = updated + 1 WHERE refcode = %ld",
     
    14201421    BOOL        fRet = FALSE;
    14211422    void       *pres;
    1422     char        szQuery[128];
     1423    char        szQuery[256];
    14231424
    14241425    /* 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",
    14261430            lDll);
    14271431    pres = dbExecuteQuery(szQuery);
     
    14381442
    14391443    /* 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",
    14411448            lDll);
    14421449    pres = dbExecuteQuery(szQuery);
     
    14561463
    14571464    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 */
     1473signed 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;
    14581488}
    14591489
  • trunk/tools/database/db.h

    r2761 r2765  
    1 /* $Id: db.h,v 1.4 2000-02-11 23:54:25 bird Exp $ */
     1/* $Id: db.h,v 1.5 2000-02-12 17:55:03 bird Exp $ */
    22/*
    33 * DB - contains all database routines
     
    114114    BOOL            _System dbGetNotUpdatedFunction(signed long lDll,
    115115                                                    DBCALLBACKFETCH dbFetchCallBack);
     116    signed long     _System dbGetNumberOfUpdatedFunction(signed long lDll);
    116117
    117118#ifdef __cplusplus
  • trunk/tools/database/kHtmlPC.cpp

    r830 r2765  
    1 /* $Id: kHtmlPC.cpp,v 1.1 1999-09-05 02:53:06 bird Exp $ */
     1/* $Id: kHtmlPC.cpp,v 1.2 2000-02-12 17:55:03 bird Exp $ */
    22/*
    33 * kHtmlPC - Special-purpose HTML/SQL preprocessor.
     
    14161416
    14171417    /* copy string */
    1418     while (*pszFrom != '\"' && *pszFrom != '>' && *pszFrom != '\0')
     1418    while (*pszFrom != '\"' /*&& *pszFrom != '>'*/ && *pszFrom != '\0')
    14191419        *pszTo++ = *pszFrom++;
    14201420    *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
    110<!kTemplate filename="odin32ImplementationStatus.html"><HTML>
    211<Title>Odin32 Implementation Status</Title>
Note: See TracChangeset for help on using the changeset viewer.