/* 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 "refer..c" static int *coord = 0; int hh[50]; extern int *hfreq, hfrflg, hcomp(), hexch(); extern int prfreqs; union ptr { unsigned *a; long *b; }; doquery(hpt, nhash, fb, nitem, qitem, mptr) long *hpt; FILE *fb; char *qitem[]; unsigned *mptr; { long k; union ptr prevdrop, master; int nf = 0, best = 0, nterm = 0, i, g, j; int *prevcoord; long lp; extern int lmaster, colevel, reached; long getl(); extern int iflong; if (iflong) { master.b = (long *) mptr; } else { master.a = mptr; } # if D1 fprintf(stderr, "entering doquery nitem %d\n",nitem); fprintf(stderr, "first few hashes are %ld %ld %ld %ld %ld\n", hpt[0],hpt[1],hpt[2],hpt[3],hpt[4]); fprintf(stderr, "and frequencies are %d %d %d %d %d\n",hfreq[0],hfreq[1],hfreq[2],hfreq[3],hfreq[4]); # endif assert (lmaster>0); if (coord==0) coord = (int *) zalloc(lmaster, sizeof(lmaster)); if (colevel>0) { if (iflong) prevdrop.b = (long *) zalloc(lmaster, sizeof(long)); else prevdrop.a = (unsigned *) zalloc(lmaster, sizeof(int)); prevcoord = (int *) zalloc(lmaster, sizeof(lmaster)); } else { prevdrop.a=master.a; prevcoord=coord; } # if D1 fprintf(stderr, "nitem %d\n",nitem); # endif for(i=0; i0) { for(j=0; j=nf) break; if (j= nterm) { if (iflong) master.b[g]=k; else master.a[g]=k; coord[g++] = 1; } } # if D1 fprintf(stderr,"now have %d items\n",g); # endif if (colevel>0) for ( ; j nterm) { assert(g0) { best=0; for(j=0; jbest) best = coord[j]; # if D1 fprintf(stderr, "colevel %d best %d\n", colevel, best); # endif reached = best; for(g=j=0; j