Changeset 4700 for trunk/tools
- Timestamp:
- Nov 26, 2000, 12:26:40 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/fastdep/fastdep.c
r4653 r4700 1 /* $Id: fastdep.c,v 1.2 3 2000-11-21 04:35:36bird Exp $1 /* $Id: fastdep.c,v 1.24 2000-11-26 11:26:40 bird Exp $ 2 2 * 3 3 * Fast dependents. (Fast = Quick and Dirty!) … … 99 99 BOOL fCheckCyclic; /* allways check for cylic dependency before inserting an dependent. */ 100 100 BOOL fCacheSearchDirs; /* cache entire search dirs. */ 101 const char * pszExcludeFiles; /* List of excluded files. */ 101 102 } OPTIONS, *POPTIONS; 102 103 … … 314 315 static char szInclude[32768] = ";"; 315 316 static char szExclude[32768] = ";"; 317 static char szExcludeFiles[65536] = ""; 316 318 317 319 OPTIONS options = … … 329 331 FALSE, /* fAppend */ 330 332 TRUE, /* fCheckCyclic */ 331 TRUE /* fCacheSearchDirs */ 333 TRUE, /* fCacheSearchDirs */ 334 szExcludeFiles /* pszExcludeFiles */ 332 335 }; 333 336 … … 401 404 else 402 405 { 403 if (argi + 1 < argc) 404 pszDepFile = argv[++argi]; 406 argi++; 407 if (argi < argc) 408 pszDepFile = argv[argi]; 405 409 else 406 410 { … … 441 445 else 442 446 { 443 psz = argv[argi+1]; 444 argi++; 447 if (++argi >= argc) 448 { 449 fprintf(stderr, "syntax error! Option -e.\n"); 450 return 1; 451 } 452 psz = argv[argi]; 445 453 } 446 454 /* check if enviroment variable */ … … 478 486 else 479 487 { 480 psz = argv[argi+1]; 481 argi++; 488 if (++argi >= argc) 489 { 490 fprintf(stderr, "syntax error! Option -i.\n"); 491 return 1; 492 } 493 psz = argv[argi]; 482 494 } 483 495 /* check if enviroment variable */ … … 534 546 else 535 547 { 536 strcpy(szObjectExt, argv[argi+1]); 537 argi++; 548 if (++argi >= argc) 549 { 550 fprintf(stderr, "syntax error! Option -obj.\n"); 551 return 1; 552 } 553 strcpy(szObjectExt, argv[argi]); 538 554 } 539 555 break; … … 551 567 else 552 568 { 553 strcpy(szObjectDir, argv[argi+1]); 554 argi++; 569 if (++argi >= argc) 570 { 571 fprintf(stderr, "syntax error! Option -o.\n"); 572 return 1; 573 } 574 strcpy(szObjectDir, argv[argi]); 555 575 } 556 576 if (szObjectDir[0] != '\0' … … 567 587 else 568 588 { 569 strcpy(szRsrcExt, argv[argi+1]); 570 argi++; 589 if (++argi >= argc) 590 { 591 fprintf(stderr, "syntax error! Option -r.\n"); 592 return 1; 593 } 594 strcpy(szRsrcExt, argv[argi]); 595 } 596 break; 597 598 case 'x': 599 case 'X': /* Exclude files */ 600 psz = &achBuffer[CCHMAXPATH+8]; 601 if (strlen(argv[argi]) > 2) 602 strcpy(psz, &argv[argi][2]); 603 else 604 { 605 if (++argi >= argc) 606 { 607 fprintf(stderr, "syntax error! Option -x.\n"); 608 return 1; 609 } 610 strcpy(psz, argv[argi]); 611 } 612 while (psz != NULL && *psz != ';') 613 { 614 char * pszNext = strchr(psz, ';'); 615 int cch = strlen(szExcludeFiles); 616 if (pszNext) 617 *pszNext++ = '\0'; 618 if (DosQueryPathInfo(psz, FIL_QUERYFULLNAME, &szExcludeFiles[cch], CCHMAXPATH)) 619 { 620 fprintf(stderr, "error: Invalid exclude name\n"); 621 return -1; 622 } 623 strlwr(&szExcludeFiles[cch]); 624 strcat(&szExcludeFiles[cch], ";"); 625 psz = pszNext; 571 626 } 572 627 break; … … 670 725 ) 671 726 { 672 char *psz; 673 char szSource[CCHMAXPATH]; 727 const char * psz; 728 char szSource[CCHMAXPATH]; 729 BOOL fExcluded; 674 730 675 731 /* … … 688 744 689 745 /* 746 * Check if this is an excluded file. 747 */ 748 fExcluded = FALSE; 749 psz = options.pszExcludeFiles; 750 while (*psz != '\0' && *psz != ';') 751 { 752 const char * pszNext = strchr(psz, ';'); 753 if (strlen(szSource) == pszNext - psz && strncmp(szSource, psz, pszNext - psz) == 0) 754 fExcluded = TRUE; 755 psz = pszNext + 1; 756 } 757 if (fExcluded) 758 continue; 759 760 /* 690 761 * Analyse the file. 691 762 */ … … 729 800 "Syntax: FastDep [-a<[+]|->] [-ca] [-cy<[+]|->] [-d <outputfn>]\n" 730 801 " [-e <excludepath>] [-eall<[+]|->] [-i <include>] [-n<[+]|->]\n" 731 " [-o <objdir>] [-obr<[+]|->] <files>\n" 802 " [-o <objdir>] [-obr<[+]|->] [-x <f1[;f2]>] [-r <rsrcext>]\n" 803 " <files> [more options [more files [...]]]\n" 732 804 " or\n" 733 805 " FastDep [options] @<parameterfile>\n" … … 756 828 " -obj[ ]<objext> Object extention. Default: obj\n" 757 829 " -r[ ]<rsrcext> Resource binary extention. Default: res\n" 830 " -x[ ]<f1[;f2]> Files to exclude. Only exact filenames.\n" 758 831 " <files> Files to scan. Wildchars are allowed.\n" 759 832 "\n" 833 "Options and files could be mixed.\n" 760 834 " copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)\n", 761 835 pszDefaultDepFile
Note:
See TracChangeset
for help on using the changeset viewer.