whash(ft
, fa
, fb
, nhash
, iflong
, ptotct
, phused
)
hpt
= calloc (nhash
+1, sizeof(*hpt
));
hfreq
= calloc (nhash
, sizeof(*hfreq
));
while (fgets(line
, 100, ft
))
sscanf(line
, "%d %ld", &k
, &point
);
if (iflong
) putl(-1L, fb
); else putw(-1, fb
);
hpt
[hash
] = lp
+= iflong
? sizeof(long) : sizeof(int);
putw( (int)(opoint
=point
), fb
);
lp
+= iflong
? sizeof(long) : sizeof(int);
if (iflong
) putl(-1L, fb
); else putw(-1,fb
);
fwrite(&nhash
, sizeof(nhash
), 1, fa
);
fwrite(&iflong
, sizeof(iflong
), 1, fa
);
fwrite(hpt
, sizeof(*hpt
), nhash
, fa
);
fwrite (hfreq
, sizeof(*hfreq
), nhash
, fa
);