diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-11-05 18:13:08 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-11-05 18:13:08 +0300 |
commit | f8e0edcfebc27ea2d5852a2a44e5db4b2585d216 (patch) | |
tree | 7327cb61970e8b5532ff7320c0003b75313a8843 /src/fstring.h | |
parent | a2af801eea032539a464116caf813c593ba0b31c (diff) | |
download | rspamd-f8e0edcfebc27ea2d5852a2a44e5db4b2585d216.tar.gz rspamd-f8e0edcfebc27ea2d5852a2a44e5db4b2585d216.zip |
* Add simple hash function for hashing tokens
Diffstat (limited to 'src/fstring.h')
-rw-r--r-- | src/fstring.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fstring.h b/src/fstring.h index c3087b2c5..6840d9088 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -6,6 +6,11 @@ #define FSTRING_H #include <sys/types.h> +#include "config.h" + +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif #include "mem_pool.h" #define update_buf_size(x) (x)->free = (x)->buf->size - ((x)->pos - (x)->buf->begin); (x)->buf->len = (x)->pos - (x)->buf->begin @@ -83,4 +88,9 @@ f_str_t* fstrgrow (memory_pool_t *pool, f_str_t *orig, size_t newlen); */ #define fstridx(str, pos) *((str)->begin + (pos)) +/* + * Return fast hash value for fixed string + */ +uint32_t fstrhash (f_str_t *str); + #endif |