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
Merge branch 'master' into vfs-dev
[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..f3fa89efd39deb3f07504517766c58b433ee4a16 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,17
@@
struct hstr
#define HSTR(str, length) \
(struct hstr) \
{ \
#define HSTR(str, length) \
(struct hstr) \
{ \
- .len = length, .value = str \
+ .len = (length), .value = (str) \
+ }
+
+#define HHSTR(str, length, strhash) \
+ (struct hstr) \
+ { \
+ .len = (length), .value = (str), .hash = (strhash) \
}
}
+#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)
{