#ifndef __LUNAIX_HSTR_H
#define __LUNAIX_HSTR_H
-#include <lib/hash.h>
+#include <klibc/hash.h>
#define HSTR_FULL_HASH 32
struct hstr
{
- uint32_t hash;
- uint32_t len;
+ u32_t hash;
+ u32_t len;
const char* value;
};
#define HSTR_EQ(str1, str2) ((str1)->hash == (str2)->hash)
+#define HSTR_VAL(hstr) ((hstr).value)
+#define HSTR_LEN(hstr) ((hstr).len)
+#define HSTR_HASH(hstr) ((hstr).hash)
+
inline void
-hstr_rehash(struct hstr* hash_str, uint32_t truncate_to)
+hstr_rehash(struct hstr* hash_str, u32_t truncate_to)
{
hash_str->hash = strhash_32(hash_str->value, truncate_to);
}