2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
23 recopy(FILE *ft
, FILE *fb
, FILE *fa
, int nhash
)
25 /* copy fb (old hash items/pointers) to ft (new ones) */
34 err(gettext("No old pointers"), 0);
37 fread(&n
, sizeof (n
), 1, fa
);
38 fread(&iflong
, sizeof (iflong
), 1, fa
);
40 hpt_l
= (long *)calloc(sizeof (*hpt_l
), n
+1);
41 n
= fread(hpt_l
, sizeof (*hpt_l
), n
, fa
);
43 hpt_s
= (int *)calloc(sizeof (*hpt_s
), n
+1);
44 n
= fread(hpt_s
, sizeof (*hpt_s
), n
, fa
);
47 fprintf(stderr
, gettext("Changing hash value to old %d\n"), n
);
50 getfun
= (int(*)())getl
;
53 for (i
= 0; i
< n
; i
++) {
59 while ((k
= (*getfun
)(fb
)) != -1)
60 fprintf(ft
, "%04d %06ld\n", i
, k
);