* 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
[] = "@(#)refer1.c 4.6 (Berkeley) 4/18/91";
main(argc
,argv
) /* process command-line arguments */
while (argv
[1][0] == '-') {
keywant
= (argv
[1][2] ? argv
[1][2] : 'L');
if (search
-rdata
> NSERCH
)
err("too many -p options (%d)", NSERCH
);
authrev
= atoi(argv
[1]+2);
bare
= (argv
[1][2] == '1') ? 1 : 2;
refnum
= atoi(argv
[1]+2) - 1;
if (getenv("REFER") != NULL
)
*search
++ = getenv("REFER");
sprintf(ofile
, "%s/rj%db", _PATH_TMP
, getpid());
ftemp
= fopen(ofile
, "w");
fprintf(stderr
, "Can't open scratch file\n");
sprintf(tfile
, "%s/rj%da", _PATH_TMP
, getpid());
fprintf(stderr
, "Can't open scratch file");
sep
= 002; /* separate records without confusing sort..*/
in
= fopen(Ifile
= argv
[1], "r");
err("Can't read %s", Ifile
);
if (biblio
&& *line
== '\n')
else if (biblio
&& Iline
== 1 && *line
== '%')
else if (!prefix(".[", line
))
if (endpush
&& fo
!= NULL
)
if (signal(SIGINT
, SIG_IGN
) != SIG_IGN
)