4 #include <isl_stdint.h>
6 #if defined(__cplusplus)
10 #define isl_hash_init() (2166136261u)
11 #define isl_hash_byte(h,b) do { \
15 #define isl_hash_hash(h,h2) \
17 isl_hash_byte(h, (h2) & 0xFF); \
18 isl_hash_byte(h, ((h2) >> 8) & 0xFF); \
19 isl_hash_byte(h, ((h2) >> 16) & 0xFF); \
20 isl_hash_byte(h, ((h2) >> 24) & 0xFF); \
22 #define isl_hash_bits(h,bits) \
23 ((bits) == 32) ? (h) : \
25 ((h) >> (bits)) ^ ((h) & (((uint32_t)1 << (bits)) - 1)) : \
26 (((h) >> (bits)) ^ (h)) & (((uint32_t)1 << (bits)) - 1)
28 uint32_t isl_hash_string(uint32_t hash, const char *s);
30 struct isl_hash_table_entry
36 struct isl_hash_table {
39 struct isl_hash_table_entry *entries;
44 int isl_hash_table_init(struct isl_ctx *ctx, struct isl_hash_table *table,
46 void isl_hash_table_clear(struct isl_hash_table *table);
47 struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx,
48 struct isl_hash_table *table,
50 int (*eq)(const void *entry, const void *val),
51 const void *val, int reserve);
52 void isl_hash_table_remove(struct isl_ctx *ctx,
53 struct isl_hash_table *table,
54 struct isl_hash_table_entry *entry);
56 #if defined(__cplusplus)