uint32 is a 32bit unsigned integer type. On many systems you can use:
#include <inttypes.h> #define uint32 uint32_t
to get a definition. This is still somewhat unportable, unfortunately. Do not use unsigned int or unsigned long carelessly.
strhash.h includes uint32.h, which is expected to define the uint32 type. The uint32.h provided with the library source may be used together with GNU autoconf.
strhash_io.h provides prototypes for strhash_load and strhash_save.
I used the following invocation of autoconf magic for it, back when i used autoconf:
AC_CHECK_SIZEOF(unsigned short,2) AC_CHECK_SIZEOF(short,2) AC_CHECK_SIZEOF(int,4) AC_CHECK_SIZEOF(unsigned int,4) AC_CHECK_SIZEOF(long,4) AC_CHECK_SIZEOF(unsigned long,4) AC_CHECK_SIZEOF(long long,0) AC_CHECK_SIZEOF(unsigned long long,0)
If HAVE_CONFIG_H
is not defined then auto-typesize.h has to
define the following C macros, possibly to other values:
#define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 #define SIZEOF_UNSIGNED_SHORT 2 #define SIZEOF_UNSIGNED_INT 4 #define SIZEOF_UNSIGNED_LONG 4 #define SIZEOF_LONG_LONG 8 #define SIZEOF_UNSIGNED_LONG_LONG 8
If HAVE_CONFIG_H
is defined then config.h has to be included before
uint32.h.
Each strhash function of non-trivial size comes in an own source file. All files include another header besides ``strhash.h'': ``strhashi.h'', which defines some internally used macros and functions.
You only need to include those function you really use - with the exception of strhash_get, which is used by strhash_lookup* and strhash_walk* functions.
If you choose to not use the standard C library functions then you may
define the DJBLIBS
symbol before compiling the library files. This
will make the library use alloc, alloc_free and byte_copy
instead of malloc, free and memcpy.
The strhash library interface: libstrhash(3), the strhash homepage