diff options
author | jjako <jjako> | 2002-12-16 13:33:51 +0000 |
---|---|---|
committer | jjako <jjako> | 2002-12-16 13:33:51 +0000 |
commit | 52c2414f6cabefb0427475756e8ac4856180bc59 (patch) | |
tree | 5ecb31a74c392c36a7d7c802f18d37349973bf00 /gtp/lookupa.h |
Initial revision
Diffstat (limited to 'gtp/lookupa.h')
-rw-r--r-- | gtp/lookupa.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtp/lookupa.h b/gtp/lookupa.h new file mode 100644 index 0000000..16784a9 --- /dev/null +++ b/gtp/lookupa.h @@ -0,0 +1,29 @@ +/* +------------------------------------------------------------------------------ +By Bob Jenkins, September 1996. +lookupa.h, a hash function for table lookup, same function as lookup.c. +Use this code in any way you wish. Public Domain. It has no warranty. +Source is http://burtleburtle.net/bob/c/lookupa.h +------------------------------------------------------------------------------ +*/ + +/* Uncommented by Jens Jakobsen 20020717 +#ifndef STANDARD +#include "standard.h" +#endif +*/ + +#ifndef LOOKUPA +#define LOOKUPA + +typedef unsigned long int ub4; /* unsigned 4-byte quantities */ +typedef unsigned char ub1; + +#define CHECKSTATE 8 +#define hashsize(n) ((ub4)1<<(n)) +#define hashmask(n) (hashsize(n)-1) + +ub4 lookup(/*_ ub1 *k, ub4 length, ub4 level _*/); +void checksum(/*_ ub1 *k, ub4 length, ub4 *state _*/); + +#endif /* LOOKUPA */ |