# include "what..c" struct filans files[NFILES]; char fnames[NAMES]; int relfeed 0; char *rb[NFEED]; char rbb[200], *rbp rbb;; main(argc,argv) char *argv[]; { char *s, *t, *xargv[50], *wd[50]; struct filans *af; int xargc 0, nw, nf, i; while (argc>1 && argv[1][0]=='-') { switch(argv[1][1]) { case 'r': relfeed=1; break; } argc--; argv++; } if (argc<=1) { printf("No query.\n"); return(0); } nf = doclook(argc,argv,0); printf(" %d files\n",nf); if (relfeed && nf>NFEED) { wrdoc(NFEED, argc, argv, 1); nw = freqwd (rb, wd, argc); for(i=0; rb[i]; i++) unlink(rb[i]); } for(i=0; ifdate != p2->fdate) return(p2->fdate > p1->fdate); return(p2->uid >= p1->uid); } wrdoc ( np, argc, argv, relfeed ) { struct filans *af; char *s, *t, buf[200]; int eval, k, pid; FILE *rf NULL; FILE *ans NULL; pid=getpid(); for(af=files; affdate); getpw(af->uid, s=buf); while (*s && *s!=':') s++; *s=0; printf("%s (%.20s) %s, %ld bytes\n",af->nm,t+4,buf,af->size); if (relfeed) { k=af-files; _assert (knm, argc,argv, rf); if (relfeed) { printf("You like that one?"); fflush(stdout); fgets(buf, 100, stdin); switch(buf[0]) { case 'y': case 'Y': eval=1; break; case 'n': case 'N': eval = -1; break; default: eval=0; break; } fclose(rf); if (eval<=0) { unlink(rb[k]); rb[k][0]=0; } } } if (relfeed) rb[np]=0; } lfind( wl, n, wds) char *wl, *wds[]; { int i; for(i=0; i