* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
static char sccsid
[] = "@(#)what3.c 4.3 (Berkeley) 4/18/91";
doclook(argc
, argv
, colevel
)
int fpa
[2], fpb
[2], fpc
[2], pid1
, pid2
, st
;
# define fmv(x,y) close(y); dup(x); close(x);
/* we want to run chkbib and then lhunt and pipe in & out */
pipe (fpa
); /* from this program to chkbib */
pipe (fpb
); /* from chkbib to lhunt */
pipe (fpc
); /* from lhunt to us */
if ( (pid1
= fork()) ==0)
execl(_PATH_MKEY
, "mkey", "-s", 0);
if ( (pid2
= fork()) == 0)
sprintf(coarg
, "-C%d", colevel
);
execl(_PATH_HUNT
, "hunt",
coarg
, "-Ty", "-Fn", _PATH_ALL
, 0);
ansf
= fopen(_PATH_DEVNULL
, "r");
fmv (fpc
[RD
], ansf
->_file
);
for(iarg
=1; iarg
<argc
; iarg
++)
prod(fpa
[WR
], argv
[iarg
]);
while (af
< files
+NFILES
)
if (fgets(af
->nm
=s
, NAMES
, ansf
)==0)
st
= stat(af
->nm
, &statbuf
);
af
->uid
= statbuf
.st_uid
;
af
->fdate
= statbuf
.st_mtime
;
af
->size
= statbuf
.st_size
;