/* 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 recopy (ft, fb, fa, nhash) FILE *ft, *fb, *fa; { /* copy fb (old hash items/pointers) to ft (new ones) */ int n, i, iflong; long getl(); int getw(); int *hpt_s; int (*getfun)(); long *hpt_l; long k, lp; if (fa==NULL) { err(gettext("No old pointers"),0); return; } fread(&n, sizeof(n), 1, fa); fread(&iflong, sizeof(iflong), 1, fa); if (iflong) { hpt_l = (long *) calloc(sizeof(*hpt_l), n+1); n =fread(hpt_l, sizeof(*hpt_l), n, fa); } else { hpt_s = (int *) calloc(sizeof(*hpt_s), n+1); n =fread(hpt_s, sizeof(*hpt_s), n, fa); } if (n!= nhash) fprintf(stderr, gettext("Changing hash value to old %d\n"),n); fclose(fa); if (iflong) getfun = (int(*)())getl; else getfun = getw; for(i=0; i