Ignore:
Timestamp:
Aug 2, 2000, 4:18:05 AM (25 years ago)
Author:
bird
Message:

Added line numbers for function and designnote.
Corrected reading of SDS function headers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/StateUpd.cpp

    r3899 r3917  
    1 /* $Id: StateUpd.cpp,v 1.27 2000-07-29 14:12:46 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.28 2000-08-02 02:18:03 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    825825static unsigned long processDesignNote(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)
    826826{
    827     unsigned long   ulRc;
     827    unsigned long   ulRc = 0;
    828828    char            szBuffer[0x10000];
    829829    char *          psz;
    830830
    831831    /*
    832      *  Find and parse the @designnote tag/keyword.
    833      *      syntax:     @designnote [seqnbr] <title>
     832     *  Find and parse the @design tag/keyword.
     833     *      syntax:     @design [seqnbr] <title>
    834834     *                  <text>
    835835     *
    836836     */
    837     psz = stristr(papszLines[i], "@designnote ");
    838     if (psz != NULL)
     837    psz = stristr(papszLines[i], "@design");
     838    if (psz != NULL && (psz[7] == '\0' || psz[7] == ' '))
    839839    {
    840840        signed long     lSeqNbr;
     
    854854
    855855        /* Update database */
    856         if (!dbAddDesignNote(pOptions->lDllRefcode, pOptions->lFileRefcode, psz, &szBuffer[0], lSeqNbr, pOptions->lSeqFile++))
     856        if (!dbAddDesignNote(pOptions->lDllRefcode, pOptions->lFileRefcode, psz, &szBuffer[0], lSeqNbr, pOptions->lSeqFile++, i + 1))
    857857        {
    858858            ulRc = 0x00010000;
     
    867867    else
    868868    {
    869         fprintf(phSignal, "%s(%d): internal error @designnote \n", pszFilename, i);
     869        fprintf(phSignal, "%s(%d): internal error @design\n", pszFilename, i);
    870870        ulRc = 0x00010000;
    871871    }
     
    897897    FnDesc.lStatus = 99;
    898898    FnDesc.lFile = pOptions->lFileRefcode;
     899    FnDesc.lLine = i + 1;
    899900
    900901    /* precondition: isFunction is true.
     
    15211522
    15221523        /* status */
    1523         pFnDesc->pszReturnDesc  = SDSCopyTextUntilNextTag(pszB, FALSE, iStatus, iEnd, papszLines);
     1524        pFnDesc->pszStatus      = SDSCopyTextUntilNextTag(pszB, FALSE, iStatus, iEnd, papszLines);
    15241525        pszB += strlen(pszB) + 1;
    15251526
     
    15461547        /* time */
    15471548        i = findStrLine("@time", iStart, iEnd, papszLines);
    1548         pFnDesc->pszReturnDesc  = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);
     1549        pFnDesc->pszTime        = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);
    15491550        pszB += strlen(pszB) + 1;
    15501551
    15511552        /* equiv */
    15521553        i = findStrLine("@equiv", iStart, iEnd, papszLines);
    1553         pFnDesc->pszReturnDesc  = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);
     1554        pFnDesc->pszEquiv       = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);
    15541555        pszB += strlen(pszB) + 1;
    15551556
     
    15611562         * parameters, new @param for each parameter!
    15621563         */
     1564        i = iStart - 1;
    15631565        do
    15641566        {
     
    15661568
    15671569            /* find first */
    1568             i = findStrLine("@param", iStart, iEnd, papszLines);
     1570            i = findStrLine("@param", i + 1, iEnd, papszLines);
    15691571            if (i >= iEnd)
    15701572                break;
     
    15971599                }
    15981600            }
    1599         } while (i > iEnd);
     1601        } while (i < iEnd);
    16001602    }
    16011603
     
    16051607    if (pFnDesc->pszStatus != NULL && *pFnDesc->pszStatus != '\0')
    16061608    {
    1607         if (strstr(pFnDesc->pszStatus, "STUB") != NULL || *pFnDesc->pszStatus == '1')
     1609        if (stristr(pFnDesc->pszStatus, "STUB") != NULL || *pFnDesc->pszStatus == '1')
    16081610            pFnDesc->lStatus = 1; /* STUB */
    16091611        else if (stristr(pFnDesc->pszStatus, "Partially") != NULL || *pFnDesc->pszStatus == '2' || *pFnDesc->pszStatus == '3')
     
    21002102        return FALSE;
    21012103
    2102     // look for /**@designnote "
     2104    // look for /**@design
    21032105    while (*psz == ' ')
    21042106        psz++;
     
    21082110        while (*psz == '*' || *psz == ' ')
    21092111            psz++;
    2110         return strnicmp(psz, "@designnote ", 12) == 0;
     2112        return strnicmp(psz, "@design", 7) == 0 && (psz[7] == '\0' || psz[7] == ' ');
    21112113    }
    21122114    pOptions = pOptions;
Note: See TracChangeset for help on using the changeset viewer.