Changeset 2004 for trunk/tools/database


Ignore:
Timestamp:
Dec 7, 1999, 12:52:44 AM (26 years ago)
Author:
bird
Message:

Bugfixes.

Location:
trunk/tools/database
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/Makefile

    r1993 r2004  
    1 # $Id: Makefile,v 1.2 1999-12-06 18:11:50 bird Exp $
     1# $Id: Makefile,v 1.3 1999-12-06 23:52:43 bird Exp $
    22
    33#
     
    147147Odin32: CreateTables.sql States.sql Authors.sql
    148148   -mysqladmin refresh
    149    mysqladmin DROP Odin32
     149   -mysqladmin DROP Odin32
    150150   mysql < CreateTables.sql
    151151   mysql < States.sql
     
    179179
    180180force:
    181     @$(ECHO) -
     181    @$(ECHO) ...
  • trunk/tools/database/StateUpd.cpp

    r1993 r2004  
    1 /* $Id: StateUpd.cpp,v 1.4 1999-12-06 18:11:49 bird Exp $ */
    2 /*
     1/* $Id: StateUpd.cpp,v 1.5 1999-12-06 23:52:42 bird Exp $
     2 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
    44 *
     
    3636static void openLogs(void);
    3737static void closeLogs(void);
    38 static unsigned long processDir(char *pszDir, BOOL fFile, POPTIONS pOptions);
     38static unsigned long processDir(const char *pszDirOrFile, POPTIONS pOptions);
    3939static unsigned long processFile(const char *pszFilename, POPTIONS pOptions);
    4040static unsigned long processAPI(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
     
    215215            /* processing */
    216216            if (argv[argi] == NULL || *argv[argi] == '\0')
    217                 ulRc = processDir(".", FALSE, &options);
     217                ulRc = processDir(".", &options);
    218218            else
    219219                while (argv[argi] != NULL)
    220220                {
    221                     ulRc += processDir(argv[argi],
    222                                        argv[argi][strlen(argv[argi])-1] != '\\' && argv[argi][strlen(argv[argi])-1] != '/',
    223                                        &options);
     221                    ulRc += processDir(argv[argi], &options);
    224222                    argi++;
    225223                }
     
    344342
    345343/**
    346  * Processes a subdirectory and files.
     344 * Processes a file or a subdirectory with files.
    347345 * @returns   high word = number of signals
    348346 *            low  word = number of APIs processed. (1 or 0).
    349  * @param     pszDir    Directory or file, see fFile.
    350  * @param     fFile     File indicator, TRUE: pszDir is a file, FALSE: pszDir is a dir.
    351  * @param     pOptions  Pointer to options.
    352  * @sketch    0. Interpret parameters.
     347 * @param     pszDirOrFile  Directory or file, see fFile.
     348 * @param     pOptions      Pointer to options.
     349 * @sketch    -0. Determin dir or file.
     350 *            0. Interpret parameters.
    353351 *            1. Scan current directory for *.cpp and *.c files and process them.
    354352 *            2. If recusion option is enabled:
    355353 *                   Scan current directory for sub-directories, scan them using recursion.
    356354 */
    357 static unsigned long processDir(char *pszDir, BOOL fFile, POPTIONS pOptions)
     355static unsigned long processDir(const char *pszDirOrFile, POPTIONS pOptions)
    358356{
    359357    unsigned long ulRc = 0; /* high word = #signals, low word = #APIs successfully processed */
     358    char         szBuf[CCHMAXPATH];
    360359    char         szFileSpec[CCHMAXPATH];
    361360    APIRET       rc;
    362361    FILEFINDBUF3 ffb;
     362    FILESTATUS3  fs;
    363363    ULONG        ul = 1;
    364364    HDIR         hDir = (HDIR)HDIR_CREATE;
    365     char        *pszFile;
    366 
    367     /* O. */
     365    PSZ          pszDir;
     366    PSZ          pszFile;
     367    BOOL         fFile;
     368
     369    /* -0.*/
     370    rc = DosQueryPathInfo(pszDirOrFile, FIL_STANDARD, &fs , sizeof(fs));
     371    fFile = rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY;
     372
     373    /* 0. */
     374    strcpy(szBuf, pszDirOrFile);
     375    pszDir = szBuf;
    368376    if (fFile)
    369377    {
    370         if ((pszFile = strrchr(pszDir, '\\')) == NULL)
    371             pszFile = strrchr(pszDir, '/');
    372         if (pszFile != NULL)
     378        if ((pszFile = strrchr(pszDir, '\\')) != NULL
     379            || (pszFile = strrchr(pszDir, '/')) != NULL)
    373380            *pszFile++ = '\0';
    374381        else
     
    379386    }
    380387    else
     388    {
    381389        pszFile = NULL;
     390        ul = strlen(pszDir)-1;
     391        if (pszDir[ul] == '\\' || pszDir[ul] == '/')
     392            pszDir[ul] = '\0';
     393    }
    382394
    383395
     
    387399    else
    388400        strcat(strcpy(&szFileSpec[0], pszDir), "\\*.c*");
     401    ul = 1;
    389402    rc = DosFindFirst((PCSZ)&szFileSpec[0], &hDir,
    390403                      FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED,
     
    419432                if (fFile)
    420433                    strcat(strcat(&szFileSpec[0], "\\"), pszFile);
    421                 ulRc += processDir(&szFileSpec[0], fFile, pOptions);
     434                ulRc += processDir(&szFileSpec[0], pOptions);
    422435            }
    423436
  • trunk/tools/database/db.cpp

    r1993 r2004  
    1 /* $Id: db.cpp,v 1.2 1999-12-06 18:11:49 bird Exp $ */
     1/* $Id: db.cpp,v 1.3 1999-12-06 23:52:43 bird Exp $ */
    22/*
    33 * DB - contains all database routines.
     
    248248    if (rc >= 0 && pres != NULL && mysql_num_rows(pres) > 0)
    249249    {   /* update function (function is found) */
     250        MYSQL_ROW parow;
    250251        if (mysql_num_rows(pres) > 1)
    251252        {
     
    255256        }
    256257
    257         lFunction = getvalue(0, mysql_fetch_row(pres));
     258        parow = mysql_fetch_row(pres);
     259        if (parow != NULL)
     260            lFunction = getvalue(0, parow);
    258261        mysql_free_result(pres);
    259262
     
    356359        if (pres != NULL)
    357360        {
     361            MYSQL_ROW parow;
     362
    358363            /* integrety check */
    359364            if (mysql_num_rows(pres) > 1)
    360365                fprintf(stderr, "Integrety: author '%s' is not unique!\n", pszAuthor);
    361             refcode = getvalue(0, mysql_fetch_row(pres));
     366            parow = mysql_fetch_row(pres);
     367            if (parow != NULL)
     368                refcode = getvalue(0, parow);
     369
    362370            mysql_free_result(pres);
    363371        }
     
    385393        if (pres != NULL)
    386394        {
    387             lState = getvalue(0, mysql_fetch_row(pres));
     395            MYSQL_ROW parow = mysql_fetch_row(pres);
     396            if (parow != NULL)
     397                lState = getvalue(0, parow);
    388398            mysql_free_result(pres);
    389399        }
  • trunk/tools/database/gd/Makefile

    r1993 r2004  
    2020
    2121force:
    22     @echo -
     22    @echo ...
    2323
    2424clean:
  • trunk/tools/database/makefile.icc

    r1993 r2004  
    1 # $Id: makefile.icc,v 1.2 1999-12-06 18:11:50 bird Exp $
     1# $Id: makefile.icc,v 1.3 1999-12-06 23:52:43 bird Exp $
    22
    33#
     
    136136
    137137force:
    138     @$(ECHO) -
     138    @$(ECHO) ...
Note: See TracChangeset for help on using the changeset viewer.