X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=ucw%2Fhashfunc.h;h=355acd48cf10c8b857b6e3fafe3666023a0532f1;hb=b56cd57bdce6b573ac0fc973ba4d16057c1e2ca5;hp=5f9dd8851dc48b16c10ad5facefea28d7c7ff75f;hpb=b8729744ecc0b60680fd731f8f45bb86a839d997;p=libucw.git diff --git a/ucw/hashfunc.h b/ucw/hashfunc.h index 5f9dd885..355acd48 100644 --- a/ucw/hashfunc.h +++ b/ucw/hashfunc.h @@ -15,19 +15,19 @@ /*** === String hashes [[strhash]] ***/ -/* The following functions need str to be aligned to `sizeof(uns). */ -uns str_len_aligned(const char *str) PURE; /** Get the string length (not a really useful hash function, but there is no better place for it). The string must be aligned to `sizeof(uns)`. For unaligned see str_len(). **/ -uns hash_string_aligned(const char *str) PURE; /** Hash the string. The string must be aligned to `sizeof(uns)`. For unaligned see hash_string(). **/ -uns hash_block_aligned(const byte *str, uns len) PURE; /** Hash arbitrary data. They must be aligned to `sizeof(uns)`. For unaligned see hash_block(). **/ +/* The following functions need str to be aligned to sizeof(uns). */ +uns str_len_aligned(const char *str) PURE; /** Get the string length (not a really useful hash function, but there is no better place for it). The string must be aligned to sizeof(uns). For unaligned see @str_len(). **/ +uns hash_string_aligned(const char *str) PURE; /** Hash the string. The string must be aligned to sizeof(uns). For unaligned see @hash_string(). **/ +uns hash_block_aligned(const byte *buf, uns len) PURE; /** Hash arbitrary data. They must be aligned to sizeof(uns). For unaligned see @hash_block(). **/ #ifdef CPU_ALLOW_UNALIGNED #define str_len(str) str_len_aligned(str) #define hash_string(str) hash_string_aligned(str) #define hash_block(str, len) hash_block_aligned(str, len) #else -uns str_len(const char *str) PURE; /** Get the string length. If you know it is aligned to `sizeof(uns)`, you can use faster str_len_aligned(). **/ -uns hash_string(const char *str) PURE; /** Hash the string. If it is aligned to `sizeof(uns)`, you can use faster hash_string_aligned(). **/ -uns hash_block(const byte *str, uns len) PURE; /** Hash arbitrary data. If they are aligned to `sizeof(uns)`, use faster hash_block_aligned(). **/ +uns str_len(const char *str) PURE; /** Get the string length. If you know it is aligned to sizeof(uns), you can use faster @str_len_aligned(). **/ +uns hash_string(const char *str) PURE; /** Hash the string. If it is aligned to sizeof(uns), you can use faster @hash_string_aligned(). **/ +uns hash_block(const byte *buf, uns len) PURE; /** Hash arbitrary data. If they are aligned to sizeof(uns), use faster @hash_block_aligned(). **/ #endif uns hash_string_nocase(const char *str) PURE; /** Hash the string in a case insensitive way. Works only with ASCII characters. **/