3 # Perfect Minimal Hash Generator written in Perl, which produces
7 # I don't think this file is even used.
23 @hashinfo = gen_perfect_hash
(\
%data);
25 if (!defined(@hashinfo)) {
26 die "$0: no hash found\n";
29 verify_hash_table
(\
%data, \
@hashinfo);
31 ($n, $sv, $f1, $f2, $g) = @hashinfo;
33 print "static int HASHNAME_fg1[$n] =\n";
35 for ($i = 0; $i < $n; $i++) {
36 print "\t", ${$g}[${$f1}[$i]], "\n";
40 print "static int HASHNAME_fg2[$n] =\n";
42 for ($i = 0; $i < $n; $i++) {
43 print "\t", ${$g}[${$f2}[$i]], "\n";
47 print "struct p_hash HASHNAME =\n";
51 print "\tHASHNAME_fg1,\n";
52 print "\tHASHNAME_fg2,\n";