Changeset 51 for trunk/dll/grep.c


Ignore:
Timestamp:
Feb 12, 2003, 9:22:14 PM (23 years ago)
Author:
root
Message:

Standardize EA match

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
    116#define INCL_DOS
    217#define INCL_WIN
     
    3853
    3954
    40 ULONG SecsSince1980 (FDATE *date,FTIME *time) {
    41 
     55ULONG SecsSince1980 (FDATE *date,FTIME *time)
     56{
    4257  ULONG        total = 0L;
    4358  register int x;
     
    208223
    209224
    210 VOID dogrep (VOID *arg) {
    211 
     225VOID dogrep (VOID *arg)
     226{
    212227  HAB           ghab;
    213228  HMQ           ghmq;
     
    360375
    361376
    362 static BOOL IsExcluded (char *name,char **fle,int numfls) {
    363 
     377static BOOL IsExcluded (char *name,char **fle,int numfls)
     378{
    364379  register int x;
    365380  char        *n;
     
    439454
    440455
    441 static INT domatchingfiles (GREP *grep,CHAR *path,char **fle,int numfls) {
    442 
     456static INT domatchingfiles (GREP *grep,CHAR *path,char **fle,int numfls)
     457{
    443458  /* process all matching files in a directory */
    444459
     
    530545
    531546
    532 static VOID freegreplist (GREP *grep) {
    533 
     547static VOID freegreplist (GREP *grep)
     548{
    534549  register INT x;
    535550
     
    553568
    554569
    555 static BOOL doinsertion (GREP *grep) {
    556 
     570static BOOL doinsertion (GREP *grep)
     571{
    557572  RECORDINSERT ri;
    558573  DIRCNRDATA  *dcd;
     
    614629
    615630
    616 static BOOL insert_grepfile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) {
    617 
     631static BOOL insert_grepfile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f)
     632{
    618633  CHAR        *p,szDirectory[CCHMAXPATH];
    619634
     
    649664        return FALSE;
    650665      }
    651       grep->insertedbytes += (f->cbFile + ((f->cbList > 4L) ? f->cbList : 0L));
     666      grep->insertedbytes += f->cbFile + CBLIST_TO_EASIZE(f->cbList);
    652667      grep->toinsert++;
    653668      if(grep->toinsert == grep->FilesToGet)
     
    662677
    663678
    664 static BOOL doonefile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f) {
    665 
     679static BOOL doonefile (GREP *grep,CHAR *filename,FILEFINDBUF4 *f)
     680{
    666681  /* process a single file */
    667682
     
    681696    ULONG adjsize;
    682697
    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);
    688700    if(grep->greaterthan) {
    689701      if(adjsize < grep->greaterthan)
     
    964976
    965977
    966 LONG CRCBlock (register CHAR *str, register INT blklen, register LONG crc) {
    967 
     978LONG CRCBlock (register CHAR *str, register INT blklen, register LONG crc)
     979{
    968980  while (blklen--) {
    969981    crc = cr3tab[((INT) crc ^ *str) & 0xff] ^ ((crc >> 8) & 0x00FFFFFF);
     
    974986
    975987
    976 LONG CRCFile (CHAR *filename,INT *error) {
    977 
     988LONG CRCFile (CHAR *filename,INT *error)
     989{
    978990  LONG CRC = -1L,len;
    979991  FILE *fp;
     
    10061018
    10071019
    1008 static VOID FreeDupes (GREP *g) {
    1009 
     1020static VOID FreeDupes (GREP *g)
     1021{
    10101022  DUPES *i,*next;
    10111023
     
    10271039
    10281040
    1029 int comparenamesq (const void *v1,const void *v2) {
    1030 
     1041int comparenamesq (const void *v1,const void *v2)
     1042{
    10311043  DUPES *d1 = *(DUPES **)v1;
    10321044  DUPES *d2 = *(DUPES **)v2;
     
    10471059
    10481060
    1049 int comparenamesqe (const void *v1,const void *v2) {
    1050 
     1061int comparenamesqe (const void *v1,const void *v2)
     1062{
    10511063  DUPES *d1 = *(DUPES **)v1;
    10521064  DUPES *d2 = *(DUPES **)v2;
     
    10831095
    10841096
    1085 int comparesizesq (const void *v1,const void *v2) {
    1086 
     1097int comparesizesq (const void *v1,const void *v2)
     1098{
    10871099  DUPES *d1 = *(DUPES **)v1;
    10881100  DUPES *d2 = *(DUPES **)v2;
     
    10921104
    10931105
    1094 int comparenamesb (const void *v1,const void *v2) {
    1095 
     1106int comparenamesb (const void *v1,const void *v2)
     1107{
    10961108  DUPES *d1 = (DUPES *)v1;
    10971109  DUPES *d2 = *(DUPES **)v2;
     
    11121124
    11131125
    1114 int comparenamesbe (const void *v1,const void *v2) {
    1115 
     1126int comparenamesbe (const void *v1,const void *v2)
     1127{
    11161128  DUPES *d1 = (DUPES *)v1;
    11171129  DUPES *d2 = *(DUPES **)v2;
     
    11481160
    11491161
    1150 int comparesizesb (const void *v1,const void *v2) {
    1151 
     1162int comparesizesb (const void *v1,const void *v2)
     1163{
    11521164  DUPES *d1 = (DUPES *)v1;
    11531165  DUPES *d2 = *(DUPES **)v2;
     
    11571169
    11581170
    1159 static VOID FillDupes (GREP *g) {
    1160 
     1171static VOID FillDupes (GREP *g)
     1172{
    11611173  DUPES         *c,*i,**r;
    11621174  register CHAR *pc,*pi;
     
    14921504
    14931505
    1494 static BOOL InsertDupe (GREP *g,CHAR *dir,FILEFINDBUF4 *f) {
    1495 
     1506static BOOL InsertDupe (GREP *g,CHAR *dir,FILEFINDBUF4 *f)
     1507{
    14961508  DUPES *info;
    14971509
     
    15231535  return TRUE;
    15241536}
    1525 
Note: See TracChangeset for help on using the changeset viewer.