Changeset 51 for trunk/dll/grep.c
- Timestamp:
- Feb 12, 2003, 9:22:14 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/grep.c
r2 r51 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Info window 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 12 Feb 03 SHL - insert_grepfile: standardize EA math 12 12 Feb 03 SHL - doonefile: standardize EA math 13 14 ***********************************************************************/ 15 1 16 #define INCL_DOS 2 17 #define INCL_WIN … … 38 53 39 54 40 ULONG SecsSince1980 (FDATE *date,FTIME *time) {41 55 ULONG SecsSince1980 (FDATE *date,FTIME *time) 56 { 42 57 ULONG total = 0L; 43 58 register int x; … … 208 223 209 224 210 VOID dogrep (VOID *arg) {211 225 VOID dogrep (VOID *arg) 226 { 212 227 HAB ghab; 213 228 HMQ ghmq; … … 360 375 361 376 362 static BOOL IsExcluded (char *name,char **fle,int numfls) {363 377 static BOOL IsExcluded (char *name,char **fle,int numfls) 378 { 364 379 register int x; 365 380 char *n; … … 439 454 440 455 441 static INT domatchingfiles (GREP *grep,CHAR *path,char **fle,int numfls) {442 456 static INT domatchingfiles (GREP *grep,CHAR *path,char **fle,int numfls) 457 { 443 458 /* process all matching files in a directory */ 444 459 … … 530 545 531 546 532 static VOID freegreplist (GREP *grep) {533 547 static VOID freegreplist (GREP *grep) 548 { 534 549 register INT x; 535 550 … … 553 568 554 569 555 static BOOL doinsertion (GREP *grep) {556 570 static BOOL doinsertion (GREP *grep) 571 { 557 572 RECORDINSERT ri; 558 573 DIRCNRDATA *dcd; … … 614 629 615 630 616 static BOOL insert_grepfile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) {617 631 static BOOL insert_grepfile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) 632 { 618 633 CHAR *p,szDirectory[CCHMAXPATH]; 619 634 … … 649 664 return FALSE; 650 665 } 651 grep->insertedbytes += (f->cbFile + ((f->cbList > 4L) ? f->cbList : 0L));666 grep->insertedbytes += f->cbFile + CBLIST_TO_EASIZE(f->cbList); 652 667 grep->toinsert++; 653 668 if(grep->toinsert == grep->FilesToGet) … … 662 677 663 678 664 static BOOL doonefile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) {665 679 static BOOL doonefile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) 680 { 666 681 /* process a single file */ 667 682 … … 681 696 ULONG adjsize; 682 697 683 adjsize = f->cbFile + ((grep->searchEAs) ? 684 ((f->cbList > 4L) ? 685 0L : 686 f->cbList) : 687 0L); 698 adjsize = f->cbFile + 699 (grep->searchEAs ? CBLIST_TO_EASIZE(f->cbList) : 0); 688 700 if(grep->greaterthan) { 689 701 if(adjsize < grep->greaterthan) … … 964 976 965 977 966 LONG CRCBlock (register CHAR *str, register INT blklen, register LONG crc) {967 978 LONG CRCBlock (register CHAR *str, register INT blklen, register LONG crc) 979 { 968 980 while (blklen--) { 969 981 crc = cr3tab[((INT) crc ^ *str) & 0xff] ^ ((crc >> 8) & 0x00FFFFFF); … … 974 986 975 987 976 LONG CRCFile (CHAR *filename,INT *error) {977 988 LONG CRCFile (CHAR *filename,INT *error) 989 { 978 990 LONG CRC = -1L,len; 979 991 FILE *fp; … … 1006 1018 1007 1019 1008 static VOID FreeDupes (GREP *g) {1009 1020 static VOID FreeDupes (GREP *g) 1021 { 1010 1022 DUPES *i,*next; 1011 1023 … … 1027 1039 1028 1040 1029 int comparenamesq (const void *v1,const void *v2) {1030 1041 int comparenamesq (const void *v1,const void *v2) 1042 { 1031 1043 DUPES *d1 = *(DUPES **)v1; 1032 1044 DUPES *d2 = *(DUPES **)v2; … … 1047 1059 1048 1060 1049 int comparenamesqe (const void *v1,const void *v2) {1050 1061 int comparenamesqe (const void *v1,const void *v2) 1062 { 1051 1063 DUPES *d1 = *(DUPES **)v1; 1052 1064 DUPES *d2 = *(DUPES **)v2; … … 1083 1095 1084 1096 1085 int comparesizesq (const void *v1,const void *v2) {1086 1097 int comparesizesq (const void *v1,const void *v2) 1098 { 1087 1099 DUPES *d1 = *(DUPES **)v1; 1088 1100 DUPES *d2 = *(DUPES **)v2; … … 1092 1104 1093 1105 1094 int comparenamesb (const void *v1,const void *v2) {1095 1106 int comparenamesb (const void *v1,const void *v2) 1107 { 1096 1108 DUPES *d1 = (DUPES *)v1; 1097 1109 DUPES *d2 = *(DUPES **)v2; … … 1112 1124 1113 1125 1114 int comparenamesbe (const void *v1,const void *v2) {1115 1126 int comparenamesbe (const void *v1,const void *v2) 1127 { 1116 1128 DUPES *d1 = (DUPES *)v1; 1117 1129 DUPES *d2 = *(DUPES **)v2; … … 1148 1160 1149 1161 1150 int comparesizesb (const void *v1,const void *v2) {1151 1162 int comparesizesb (const void *v1,const void *v2) 1163 { 1152 1164 DUPES *d1 = (DUPES *)v1; 1153 1165 DUPES *d2 = *(DUPES **)v2; … … 1157 1169 1158 1170 1159 static VOID FillDupes (GREP *g) {1160 1171 static VOID FillDupes (GREP *g) 1172 { 1161 1173 DUPES *c,*i,**r; 1162 1174 register CHAR *pc,*pi; … … 1492 1504 1493 1505 1494 static BOOL InsertDupe (GREP *g,CHAR *dir,FILEFINDBUF4 *f) {1495 1506 static BOOL InsertDupe (GREP *g,CHAR *dir,FILEFINDBUF4 *f) 1507 { 1496 1508 DUPES *info; 1497 1509 … … 1523 1535 return TRUE; 1524 1536 } 1525
Note:
See TracChangeset
for help on using the changeset viewer.