blob: 16784a96d0e810e260dfc288259350935961ecd5 [file] [log] [blame]
jjako52c24142002-12-16 13:33:51 +00001/*
2------------------------------------------------------------------------------
3By Bob Jenkins, September 1996.
4lookupa.h, a hash function for table lookup, same function as lookup.c.
5Use this code in any way you wish. Public Domain. It has no warranty.
6Source is http://burtleburtle.net/bob/c/lookupa.h
7------------------------------------------------------------------------------
8*/
9
10/* Uncommented by Jens Jakobsen 20020717
11#ifndef STANDARD
12#include "standard.h"
13#endif
14*/
15
16#ifndef LOOKUPA
17#define LOOKUPA
18
19typedef unsigned long int ub4; /* unsigned 4-byte quantities */
20typedef unsigned char ub1;
21
22#define CHECKSTATE 8
23#define hashsize(n) ((ub4)1<<(n))
24#define hashmask(n) (hashsize(n)-1)
25
26ub4 lookup(/*_ ub1 *k, ub4 length, ub4 level _*/);
27void checksum(/*_ ub1 *k, ub4 length, ub4 *state _*/);
28
29#endif /* LOOKUPA */