torque  4.2.9
 All Data Structures Files Functions Variables Modules
lookup3.h
Go to the documentation of this file.
1 /* $Id: lookup3.h,v 1.2 2006/09/08 18:18:08 ciesnik Exp $ */
2 
11 #ifndef __LOOKUP3_H
12 #define __LOOKUP3_H
13 
14 #ifndef HAVE_CONFIG_H
15 # include <pbs_config.h>
16 #endif
17 
18 #ifdef HAVE_STDINT_H
19 # include <stdint.h>
20 #else
21 # ifdef HAVE_INTTYPES_H
22 # include <inttypes.h>
23 # endif
24 #endif
25 
26 uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval);
27 uint32_t hashlittle(const void *key, size_t length, uint32_t initval);
28 uint32_t hashbig(const void *key, size_t length, uint32_t initval);
29 
30 #if BYTEORDER == 1234 /* little endian */
31 # define hashstr hashlittle
32 #endif
33 
34 #if BYTEORDER == 4321 /* big endian */
35 # define hashstr hashbig
36 #endif
37 
38 #endif /* __LOOKUP3_H */
39 
uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
hashlittle() – hash a variable-length key into a 32-bit value
Definition: lookup3.c:265
uint32_t hashbig(const void *key, size_t length, uint32_t initval)
hashbig(): This is the same as hashword() on big-endian machines.
Definition: lookup3.c:515
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval)
This works on all machines.
Definition: lookup3.c:198