Changeset 2776 for trunk/tools/database/StateUpd.cpp
- Timestamp:
- Feb 14, 2000, 6:18:31 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/StateUpd.cpp
r2773 r2776 1 /* $Id: StateUpd.cpp,v 1.1 2 2000-02-14 13:49:13bird Exp $1 /* $Id: StateUpd.cpp,v 1.13 2000-02-14 17:18:31 bird Exp $ 2 2 * 3 3 * StateUpd - Scans source files for API functions and imports data on them. … … 70 70 unsigned long ulRc = 0; 71 71 char szDLLName[64]; 72 OPTIONS options = { TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, &szDLLName[0], -1};72 OPTIONS options = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, &szDLLName[0], -1}; 73 73 unsigned long ulRc2; 74 74 char *pszErrorDesc = NULL; … … 233 233 234 234 /* check db integrity */ 235 if (options.fIntegrityBefore )235 if (options.fIntegrityBefore || options.fIntegrityOnly) 236 236 { 237 237 pszErrorDesc = (char*)malloc(1048768); assert(pszErrorDesc != NULL); … … 331 331 "\n" 332 332 " -h or -? Syntax help. (this)\n" 333 " -ib<[+]|-> Integrity check at start. default: enabled\n"334 " -ie<[+]|-> Integrity check at end. default: enabled\n"333 " -ib<[+]|-> Integrity check at start. default: disabled\n" 334 " -ie<[+]|-> Integrity check at end. default: disabled\n" 335 335 " -io Integrity check only. default: disabled\n" 336 336 " -s Scan subdirectories. default: disabled\n" … … 918 918 if (strlen(pszEnd) > 128) 919 919 { 920 fprintf(phSignal,"Fatal error! return statement is too larget. len=%d", strlen(pszEnd)); 921 fprintf(phLog, "Fatal error! return statement is too larget. len=%d", strlen(pszEnd)); 922 fprintf(stderr, "Fatal error! return statement is too larget. len=%d", strlen(pszEnd)); 920 /* FIXME LATER! Some constructors calling baseclass constructors "breaks" this rule. Win32MDIChildWindow in /src/user32/win32wmdichild.cpp for example. */ 921 fprintf(phSignal,"Fatal error? return statement is too larget. len=%d", strlen(pszEnd)); 922 fprintf(phLog, "Fatal error? return statement is too larget. len=%d", strlen(pszEnd)); 923 if (strlen(pszEnd) > 512) 924 fprintf(stderr, "Fatal error? return statement is too larget. len=%d", strlen(pszEnd)); 923 925 fflush(phLog); 924 926 fflush(phSignal); … … 930 932 *pszEnd = '\0'; 931 933 934 /* !BugFix! some function occur more than once, usually as inline functions */ 935 if (pFnDesc->pszReturnType != NULL 936 && strstr(pFnDesc->pszReturnType, "inline ") != NULL) 937 { 938 fprintf(phLog, "Not an API. Inlined functions can't be exported!\n"); 939 return 0; 940 } 941 932 942 /* function name */ 933 943 if (pFnDesc->pszReturnType != NULL 934 && stristr(pFnDesc->pszReturnType, "cdecl") != NULL) 944 && (stristr(pFnDesc->pszReturnType, "cdecl") != NULL 945 || strstr(pFnDesc->pszReturnType, "VFWAPIV") != NULL 946 || strstr(pFnDesc->pszReturnType, "WINAPIV") != NULL 947 ) 948 ) 935 949 { /* cdecl function is prefixed with an '_' */ 936 950 strcpy(pszEnd, "_"); … … 951 965 for (j = 0; j < cArgs; j++) 952 966 { 967 int cch = strlen(apszArgs[j]); 953 968 if ((psz = strchr(apszArgs[j], ')')) == NULL) 954 969 { /* Common argument */ 955 if (apszArgs[j][strlen(apszArgs[j]-1)] != '*') 956 { /* Normal case, Type [moretype] Name.*/ 957 pFnDesc->apszParamName[j] = findStartOfWord(apszArgs[j] + strlen(apszArgs[j]) - 1, 958 apszArgs[j]); 959 pFnDesc->apszParamName[j][-1] = '\0'; 970 if (apszArgs[j][cch-1] != '*' || (apszArgs[j][cch - 1] == ']' && cch < 5)) 971 { /* nearly Normal case, Type [moretype] Name.*/ 972 if (apszArgs[j][cch - 1] != ']') 973 { /* Normal case! */ 974 pFnDesc->apszParamName[j] = findStartOfWord(apszArgs[j] + cch - 1, 975 apszArgs[j]); 976 pFnDesc->apszParamName[j][-1] = '\0'; 977 } 978 else 979 { /* arg yet another special case! 'fn(int argc, char *argv[])' */ 980 char *pszP2; 981 cch = strlen(apszArgs[j]); 982 psz = &apszArgs[j][cch-2]; 983 while (psz > apszArgs[j] && ((*psz >= '0' && *psz <= '9') || *psz == ' ')) 984 psz--; 985 986 if (psz > apszArgs[j] && *psz == '[') 987 { 988 pszP2 = psz--; 989 while (psz >= apszArgs[j] && *psz == ' ') 990 psz--; 991 } 992 993 if (psz <= apszArgs[j]) 994 { /* funny case - no name? */ 995 sprintf(pszEnd, "arg%i", j); 996 pFnDesc->apszParamName[j] = pszEnd; 997 pszEnd = strlen(pszEnd) + pszEnd + 1; 998 *pszEnd = '\0'; 999 } 1000 else 1001 { /* *pszP2 = '[' and psz = end of name */ 1002 psz = findStartOfWord(psz, apszArgs[j]); 1003 strncat(pszEnd, psz, pszP2 - psz); 1004 pFnDesc->apszParamName[j] = pszEnd; 1005 pszEnd = strlen(pszEnd) + pszEnd + 1; 1006 *pszEnd = '\0'; 1007 memset(psz, ' ', pszP2 - psz); 1008 } 1009 } 960 1010 } 961 1011 else … … 1046 1096 j -= 2; 1047 1097 fFound = 0; 1048 while (iStart >= 0 && 1049 !(fFound = (papszLines[iStart][j] == '/' && papszLines[iStart][j+1] == '*'))) 1050 if (j-- == 0) 1098 while (iStart >= 0 1099 && (j < 0 1100 || !(fFound = (papszLines[iStart][j] == '/' && papszLines[iStart][j+1] == '*')) 1101 ) 1102 ) 1103 if (j-- <= 0) 1051 1104 if (iStart-- > 0) 1052 1105 { … … 1289 1342 1290 1343 while (*pszP1 != '\0' && *pszP1 == ' ') 1291 pszP1 --;1292 if (*pszP1 != '\0' && *pszP1 != ' \\' && pszP1[1] != '\\'1344 pszP1++; 1345 if (*pszP1 != '\0' && *pszP1 != '/' && pszP1[1] != '/' 1293 1346 && *pszP1 != '{' && *pszP1 != '}') 1294 1347 { … … 1570 1623 /** 1571 1624 * Creates an array of lines from a "memory" file. The last entry in the array contains NULL. 1625 * It also replaces '\t' with ' '. 1572 1626 * @returns Pointer to the array of lines. 1573 1627 * @param pszFile Pointer to "memory" file. … … 1599 1653 while (*psz != '\0') 1600 1654 { 1655 if (*psz == '\t') 1656 *psz = ' '; 1601 1657 if (*psz == '\r') 1602 1658 { … … 1638 1694 1639 1695 1640 /** star ing char of word */1696 /** starting char of word */ 1641 1697 static char *findStartOfWord(char *psz, const char *pszStart) 1642 1698 {
Note:
See TracChangeset
for help on using the changeset viewer.