# include "stdio.h" # include "assert.h" # define TXTLEN 1000 char *outbuf 0; extern char *soutput; extern int soutlen, iflong; extern long indexdate; baddrop(master, nf, fc, nitem, qitem, rprog, full) union ptr {unsigned *a; long *b; } master; FILE *fc; char *qitem[], *rprog; { /* checks list of drops for real bad drops; uses "deliv" to find items. */ int i, g, j, need, got, na, len; long lp; char res[100], *ar[50], output[TXTLEN]; extern int colevel, reached; # if D1 if (iflong) fprintf(stderr,"in baddrop, nf %d master %ld %ld %ld\n", nf, master.b[0], master.b[1], master.b[2]); else fprintf(stderr,"in baddrop, nf %d master %d %d %d\n", nf, master.a[0], master.a[1], master.a[2]); # endif for (i=g=0; i= g) if (soutput==0) fputs(output, stdout); else strcpy (soutput, output); } # ifdef D1 fprintf(stderr, "after fgrep\n"); # endif } return(g); } auxil( res, output) char *res, *output; { extern FILE *fd; long lp, c; int len; if (fd==0)return(0); while (c = *res++) { if (c == ';') { sscanf(res, "%ld,%d", &lp, &len); fseek (fd, lp, 0); fgets(output, len, fd); return(1); } } return(0); }