HuntnGather – Diff between revs 7 and 8
?pathlinks?
Rev 7 | Rev 8 | |||
---|---|---|---|---|
Line 19... | Line 19... | |||
19 | #if !defined ___HAVE_GETOPT___ |
19 | #if !defined ___HAVE_GETOPT___ |
|
20 | #include "getopt.h" |
20 | #include "getopt.h" |
|
21 | #endif |
21 | #endif |
|
Line 22... | Line 22... | |||
22 | |
22 | |
|
23 | #if defined ___AmigaOS___ |
- | ||
24 | #include <dos/dos.h> |
- | ||
25 | #include <dos/rdargs.h> |
- | ||
26 | #define TEMPLATE "Q=Quiet/S,D=Database/K,P=Path/A/F" |
- | ||
27 | #define OPT_QUIET 0 |
- | ||
28 | #define OPT_DATABASE 1 |
- | ||
29 | #define OPT_PATH 2 |
- | ||
30 | #define OPT_COUNT 3 |
- | ||
31 | LONG result[OPT_COUNT]; |
23 | #if defined ___AmigaOS___ |
|
32 | /*************************************************************************/ |
24 | /*************************************************************************/ |
|
33 | /* Version string used for querrying the program version. */ |
25 | /* Version string used for querrying the program version. */ |
|
34 | /*************************************************************************/ |
26 | /*************************************************************************/ |
|
35 | TEXT version_string[] = |
27 | TEXT version_string[] = |
|
36 | "\0$VER: Gather 1.4 "__DATE__" by Wizardry and Steamworks"; |
28 | "\0$VER: Gather 1.5 "__DATE__" by Wizardry and Steamworks"; |
|
Line 37... | Line 29... | |||
37 | #endif |
29 | #endif |
|
38 | |
30 | |
|
39 | #if !defined TRUE |
31 | #if !defined TRUE |
|
Line 648... | Line 640... | |||
648 | /* |
640 | /* |
|
649 | * |
641 | * |
|
650 | * Main entry point. |
642 | * Main entry point. |
|
651 | */ |
643 | */ |
|
652 | int main(int argc, char **argv) { |
644 | int main(int argc, char **argv) { |
|
653 | #if defined ___AmigaOS___ |
- | ||
654 | struct RDArgs *rdargs; |
- | ||
655 | struct stat statPath; |
- | ||
656 | UBYTE *dbFile; |
- | ||
657 | UBYTE *argPattern; |
- | ||
658 | |
- | ||
659 | dbFile = DEFAULT_DATABASE_FILE; |
- | ||
660 | argPattern = NULL; |
- | ||
661 | if(rdargs = (struct RDArgs *) AllocDosObject(DOS_RDARGS, NULL)) { |
- | ||
662 | if(ReadArgs(TEMPLATE, result, rdargs) == NULL) { |
- | ||
663 | FreeArgs(rdargs); |
- | ||
664 | FreeDosObject(DOS_RDARGS, rdargs); |
- | ||
665 | return 1; |
- | ||
666 | } |
- | ||
667 | |
- | ||
668 | if(result[OPT_DATABASE] != NULL) { |
- | ||
669 | dbFile = (UBYTE *) result[OPT_DATABASE]; |
- | ||
670 | } |
- | ||
671 | |
- | ||
672 | argPattern = (UBYTE *) result[OPT_PATH]; |
- | ||
673 | |
- | ||
674 | FreeArgs(rdargs); |
- | ||
675 | FreeDosObject(DOS_RDARGS, rdargs); |
- | ||
676 | } |
- | ||
677 | |
- | ||
678 | stat(dbFile, &statPath); |
- | ||
679 | if(!S_ISREG(statPath.st_mode)) { |
- | ||
680 | fprintf(stderr, "Database file '%s' is not a file.\n", dbFile); |
- | ||
681 | return 1; |
- | ||
682 | } |
- | ||
683 | |
- | ||
684 | Gather(dbFile, argPattern); |
- | ||
685 | #else |
- | ||
686 | int option; |
645 | int option; |
|
687 | char *dbFile; |
646 | char *dbFile; |
|
688 | struct stat path; |
647 | struct stat path; |
|
Line 689... | Line 648... | |||
689 | |
648 | |
|
Line 724... | Line 683... | |||
724 | fprintf(stdout, "Gathering to database file: %s\n", dbFile); |
683 | fprintf(stdout, "Gathering to database file: %s\n", dbFile); |
|
725 | } |
684 | } |
|
Line 726... | Line 685... | |||
726 | |
685 | |
|
727 | // Gather. |
686 | // Gather. |
|
728 | Gather(dbFile, argv[optind]); |
- | ||
Line 729... | Line 687... | |||
729 | #endif |
687 | Gather(dbFile, argv[optind]); |
|
730 | |
688 | |