blob: a7335095989c60fa685ade3f9364fc82cea73e85 [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
Harald Weltebed35df2011-11-02 13:06:18 +010019typedef unsigned long int ub4; /* unsigned 4-byte quantities */
20typedef unsigned char ub1;
jjako52c24142002-12-16 13:33:51 +000021
22#define CHECKSTATE 8
23#define hashsize(n) ((ub4)1<<(n))
24#define hashmask(n) (hashsize(n)-1)
25
Harald Weltebed35df2011-11-02 13:06:18 +010026ub4 lookup( /*_ ub1 *k, ub4 length, ub4 level _*/ );
27void checksum( /*_ ub1 *k, ub4 length, ub4 *state _*/ );
jjako52c24142002-12-16 13:33:51 +000028
29#endif /* LOOKUPA */