9
0
Fork 0
This repository has been archived on 2022-06-17. You can view files and clone it, but cannot push or open issues or pull requests.
openggsn/gtp/lookupa.h

30 lines
832 B
C
Raw Normal View History

2002-12-16 13:33:51 +00:00
/*
------------------------------------------------------------------------------
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;
2002-12-16 13:33:51 +00:00
#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 _*/ );
2002-12-16 13:33:51 +00:00
#endif /* LOOKUPA */