/* 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 #include whash(ft, fa, fb, nhash, iflong, ptotct, phused) FILE *fa, *fb, *ft; int nhash, *phused; long *ptotct; { char line[100]; int hash = 0, hused = 0; long totct = 0L; int ct = 0; long point; long opoint = -1; int m; int k; long lp; long *hpt; int *hfreq = NULL; hpt = (long *) calloc (nhash+1, sizeof(*hpt)); assert (hpt != NULL); hfreq = (int *) calloc (nhash, sizeof(*hfreq)); assert (hfreq != NULL); hpt[0] = 0; lp= 0; while (fgets(line, 100, ft)) { totct++; sscanf(line, "%d %ld", &k, &point); if (hash < k) { hused++; if (iflong) putl(-1L, fb); else putw(-1, fb); hfreq[hash]=ct; while (hash