git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: simple device abstraction layer
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
ds
/
hstr.h
diff --git
a/lunaix-os/includes/lunaix/ds/hstr.h
b/lunaix-os/includes/lunaix/ds/hstr.h
index 48640529680ce270fbb68c0c41580acc31337be9..5fb84d94bc36f0354b0088d761f53ccea0c8df49 100644
(file)
--- a/
lunaix-os/includes/lunaix/ds/hstr.h
+++ b/
lunaix-os/includes/lunaix/ds/hstr.h
@@
-3,6
+3,8
@@
#include <lib/hash.h>
#include <lib/hash.h>
+#define HSTR_FULL_HASH 32
+
struct hstr
{
unsigned int hash;
struct hstr
{
unsigned int hash;
@@
-13,9
+15,11
@@
struct hstr
#define HSTR(str, length) \
(struct hstr) \
{ \
#define HSTR(str, length) \
(struct hstr) \
{ \
- .len =
length, .value = str
\
+ .len =
(length), .value = (str)
\
}
}
+#define HSTR_EQ(str1, str2) ((str1)->hash == (str2)->hash)
+
inline void
hstr_rehash(struct hstr* hash_str, unsigned int truncate_to)
{
inline void
hstr_rehash(struct hstr* hash_str, unsigned int truncate_to)
{