inv2.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 <stdio.h>
#include <assert.h>
#define LINESIZ 1250
int *iflong;
{
/* reads key lines from inf; hashes and writes on outf;
* writes orig key on recf, records pointer on outf too.
* format of outf is : hash code space record pointer
*/
long ld = 0;
char *p, *s;
char *keyv[500];
{
p = line;
while (*p != '\t') p++;
*p++ =0;
if (fd)
{
}
for(s=p; *s; s++);
if (*--s == '\n')
{
more=0;
*s=0;
}
else
more=1;
if (more)
nk--;
for(i=0; i<nk; i++)
# if D1
for(i=0; i<nk; i++)
# endif
if (more) /* allow more than LINESIZ keys */
{
for(s=key; *s; s++);
{
if (c != ' ')
{
*s++ = c;
continue;
}
*s=0;
if (s>key)
s = key;
}
}
ndoc++;
}
return(ndoc);
}
trimnl(p)
char *p;
{
while (*p) p++;
p--;
if (*p == '\n') *p=0;
}