Changeset 3917 for trunk/tools/database
- Timestamp:
- Aug 2, 2000, 4:18:05 AM (25 years ago)
- Location:
- trunk/tools/database
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/StateUpd.cpp
r3899 r3917 1 /* $Id: StateUpd.cpp,v 1.2 7 2000-07-29 14:12:46bird Exp $1 /* $Id: StateUpd.cpp,v 1.28 2000-08-02 02:18:03 bird Exp $ 2 2 * 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 825 825 static unsigned long processDesignNote(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions) 826 826 { 827 unsigned long ulRc ;827 unsigned long ulRc = 0; 828 828 char szBuffer[0x10000]; 829 829 char * psz; 830 830 831 831 /* 832 * Find and parse the @design notetag/keyword.833 * syntax: @design note[seqnbr] <title>832 * Find and parse the @design tag/keyword. 833 * syntax: @design [seqnbr] <title> 834 834 * <text> 835 835 * 836 836 */ 837 psz = stristr(papszLines[i], "@design note");838 if (psz != NULL )837 psz = stristr(papszLines[i], "@design"); 838 if (psz != NULL && (psz[7] == '\0' || psz[7] == ' ')) 839 839 { 840 840 signed long lSeqNbr; … … 854 854 855 855 /* 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)) 857 857 { 858 858 ulRc = 0x00010000; … … 867 867 else 868 868 { 869 fprintf(phSignal, "%s(%d): internal error @design note\n", pszFilename, i);869 fprintf(phSignal, "%s(%d): internal error @design\n", pszFilename, i); 870 870 ulRc = 0x00010000; 871 871 } … … 897 897 FnDesc.lStatus = 99; 898 898 FnDesc.lFile = pOptions->lFileRefcode; 899 FnDesc.lLine = i + 1; 899 900 900 901 /* precondition: isFunction is true. … … 1521 1522 1522 1523 /* status */ 1523 pFnDesc->psz ReturnDesc= SDSCopyTextUntilNextTag(pszB, FALSE, iStatus, iEnd, papszLines);1524 pFnDesc->pszStatus = SDSCopyTextUntilNextTag(pszB, FALSE, iStatus, iEnd, papszLines); 1524 1525 pszB += strlen(pszB) + 1; 1525 1526 … … 1546 1547 /* time */ 1547 1548 i = findStrLine("@time", iStart, iEnd, papszLines); 1548 pFnDesc->psz ReturnDesc= SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);1549 pFnDesc->pszTime = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines); 1549 1550 pszB += strlen(pszB) + 1; 1550 1551 1551 1552 /* equiv */ 1552 1553 i = findStrLine("@equiv", iStart, iEnd, papszLines); 1553 pFnDesc->psz ReturnDesc= SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines);1554 pFnDesc->pszEquiv = SDSCopyTextUntilNextTag(pszB, TRUE, i, iEnd, papszLines); 1554 1555 pszB += strlen(pszB) + 1; 1555 1556 … … 1561 1562 * parameters, new @param for each parameter! 1562 1563 */ 1564 i = iStart - 1; 1563 1565 do 1564 1566 { … … 1566 1568 1567 1569 /* find first */ 1568 i = findStrLine("@param", i Start, iEnd, papszLines);1570 i = findStrLine("@param", i + 1, iEnd, papszLines); 1569 1571 if (i >= iEnd) 1570 1572 break; … … 1597 1599 } 1598 1600 } 1599 } while (i >iEnd);1601 } while (i < iEnd); 1600 1602 } 1601 1603 … … 1605 1607 if (pFnDesc->pszStatus != NULL && *pFnDesc->pszStatus != '\0') 1606 1608 { 1607 if (str str(pFnDesc->pszStatus, "STUB") != NULL || *pFnDesc->pszStatus == '1')1609 if (stristr(pFnDesc->pszStatus, "STUB") != NULL || *pFnDesc->pszStatus == '1') 1608 1610 pFnDesc->lStatus = 1; /* STUB */ 1609 1611 else if (stristr(pFnDesc->pszStatus, "Partially") != NULL || *pFnDesc->pszStatus == '2' || *pFnDesc->pszStatus == '3') … … 2100 2102 return FALSE; 2101 2103 2102 // look for /**@design note "2104 // look for /**@design 2103 2105 while (*psz == ' ') 2104 2106 psz++; … … 2108 2110 while (*psz == '*' || *psz == ' ') 2109 2111 psz++; 2110 return strnicmp(psz, "@design note ", 12) == 0;2112 return strnicmp(psz, "@design", 7) == 0 && (psz[7] == '\0' || psz[7] == ' '); 2111 2113 } 2112 2114 pOptions = pOptions; -
trunk/tools/database/db.cpp
r3899 r3917 1 /* $Id: db.cpp,v 1.1 7 2000-07-29 14:12:47bird Exp $ *1 /* $Id: db.cpp,v 1.18 2000-08-02 02:18:04 bird Exp $ * 2 2 * 3 3 * DB - contains all database routines. … … 941 941 else 942 942 pszQuery += sprintf(pszQuery, ", file = -1"); 943 944 /* Line */ 945 if (pFnDesc->lLine >= 0) 946 pszQuery += sprintf(pszQuery, ", line = %ld", pFnDesc->lLine); 947 else 948 pszQuery += sprintf(pszQuery, ", line = -1"); 943 949 944 950 /* return type */ … … 1166 1172 * @param lSeqNbr Sequence number (in dll). If 0 the use next available number. 1167 1173 * @param lSeqNbrFile Sequence number in file. 1174 * @param lLine Line number (1 - based!). 1168 1175 */ 1169 1176 BOOL _System dbAddDesignNote(signed long lDll, … … 1172 1179 const char *pszText, 1173 1180 signed long lSeqNbr, 1174 signed long lSeqNbrFile) 1181 signed long lSeqNbrFile, 1182 signed long lLine) 1175 1183 { 1176 1184 char szQuery[0x10200]; … … 1209 1217 * Create update query. 1210 1218 */ 1211 sprintf(&szQuery[0], "INSERT INTO designnote(dll, file, seqnbrfile, seqnbr, title, note) "1212 "VALUES (%ld, %ld, %ld, %ld, ",1213 lDll, lFile, lSeqNbrFile, lSeqNbr );1219 sprintf(&szQuery[0], "INSERT INTO designnote(dll, file, seqnbrfile, seqnbr, line, title, note) " 1220 "VALUES (%ld, %ld, %ld, %ld, %ld, ", 1221 lDll, lFile, lSeqNbrFile, lSeqNbr, lLine); 1214 1222 if (pszTitle != NULL && *pszTitle != '\0') 1215 1223 sqlstrcat(&szQuery[0], NULL, pszTitle); -
trunk/tools/database/db.h
r3899 r3917 1 /* $Id: db.h,v 1.1 2 2000-07-29 14:12:47bird Exp $ */1 /* $Id: db.h,v 1.13 2000-08-02 02:18:05 bird Exp $ */ 2 2 /* 3 3 * DB - contains all database routines … … 80 80 long lFile; /* File refcode which this function is implemented in. */ 81 81 /* -1 if not valid. */ 82 /* line */ 83 long lLine; /* Line number of the function start. */ 82 84 } FNDESC, *PFNDESC; 83 85 … … 139 141 const char *pszText, 140 142 signed long lSeqNbr, 141 signed long lSeqNbrFile); 143 signed long lSeqNbrFile, 144 signed long lLine); 142 145 unsigned long _System dbCreateHistory(char *pszError); 143 146 unsigned long _System dbCheckIntegrity(char *pszError);
Note:
See TracChangeset
for help on using the changeset viewer.