hunt1.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
# include <locale.h>
# include <stdio.h>
# include <assert.h>
extern char refdir[];
extern int keepold;
extern char *fgnames[];
extern char **fgnamp;
int lmaster =500;
int colevel =0;
int measure=0;
int soutlen =1000;
int reached =0;
int iflong =0;
int prfreqs =0;
char usedir[100];
char * calloc();
char * todir();
char gfile[50];
static int full =1000;
static int tags =0;
char *argv[];
{
/* read query from stdin, expect name of indexes in argv[1] */
static char oldname[30] ;
static int was =0;
/* these pointers are unions of pointer to int and pointer to long */
long *hpt;
unsigned *master =0;
/* special wart for refpart: default is tags only */
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
falseflg = 0;
{
{
case 'a': /* all output, incl. false drops */
falseflg = 1;
break;
case 'r':
argc--;
argv++;
break;
case 'F': /* put out full text */
break;
case 'T': /* put out tags */
break;
case 'i': /* input in argument string */
argc--;
argv++;
break;
case 's': /*text output to string */
case 'o':
argc--;
argv++;
{
argc--;
argv++;
}
break;
case 't': /*tag output to string */
argc--;
argv++;
break;
case 'l': /* length of internal lists */
argc--;
argv++;
break;
case 'g': /* suppress fgrep search on old files */
keepold = 0;
break;
case 'C': /* coordination level */
# if D1
# endif
break;
case 'P': /* print term freqs */
prfreqs=1;
break;
case 'm':
measure=1;
break;
}
argc--;
argv++;
}
if(argc < 2)
exit(1);
{
if (was)
{
}
{
goto search;
}
was =1;
{
exit(1);
}
}
if(master==0)
# if D1
# endif
# if D1
# endif
while (1)
{
if (nitem==0) continue;
if (nitem < 0) break;
{
# if D1
# endif
if (falseflg == 0)
# if D1
# endif
}
{
int k;
# if D1
# endif
grepquery[0]=0;
for(k=0; k<nitem; k++)
{
}
# if D1
# endif
{
# if D1
# endif
# if D1
# endif
if (tagout==0)
# if D1
# endif
if (full)
{
int nout;
char *bout;
char *tagp;
char *oldtagp;
while (*tagp) {
tagp++;
if (*tagp)
tagp++;
if (nout > 0)
{
}
}
}
}
}
if (tags)
}
/* NOTREACHED */
}
char *
todir(t)
char *t;
{
char *s;
s=t;
while (*s) s++;
while (s>=t && *s != '/') s--;
if (s<t) return(t);
*s++ = 0;
t = (*t ? t : "/");
chdir (t);
return(s);
}
setfrom(c)
{
switch(c)
{
case 'y':
case '\0':
default:
return(1000);
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return(c-'0');
case 'n':
case '0':
return(0);
}
}