src/cx/hash_key.h

changeset 1094
aea6f31a82d7
parent 1050
3df63e95921a
equal deleted inserted replaced
1093:bcbf6bf582fa 1094:aea6f31a82d7
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 /** 28 /**
29 * \file hash_key.h 29 * @file hash_key.h
30 * \brief Interface for map implementations. 30 * @brief Interface for map implementations.
31 * \author Mike Becker 31 * @author Mike Becker
32 * \author Olaf Wintermann 32 * @author Olaf Wintermann
33 * \copyright 2-Clause BSD License 33 * @copyright 2-Clause BSD License
34 */ 34 */
35 35
36 36
37 #ifndef UCX_HASH_KEY_H 37 #ifndef UCX_HASH_KEY_H
38 #define UCX_HASH_KEY_H 38 #define UCX_HASH_KEY_H
60 * Type for a hash key. 60 * Type for a hash key.
61 */ 61 */
62 typedef struct cx_hash_key_s CxHashKey; 62 typedef struct cx_hash_key_s CxHashKey;
63 63
64 /** 64 /**
65 * Computes a murmur2 32 bit hash. 65 * Computes a murmur2 32-bit hash.
66 * 66 *
67 * You need to initialize \c data and \c len in the key struct. 67 * You need to initialize @c data and @c len in the key struct.
68 * The hash is then directly written to that struct. 68 * The hash is then directly written to that struct.
69 * 69 *
70 * \note If \c data is \c NULL, the hash is defined as 1574210520. 70 * Usually you should not need this function.
71 * Use cx_hash_key(), instead.
72 *
73 * @note If @c data is @c NULL, the hash is defined as 1574210520.
71 * 74 *
72 * @param key the key, the hash shall be computed for 75 * @param key the key, the hash shall be computed for
76 * @see cx_hash_key()
73 */ 77 */
74 cx_attr_nonnull 78 cx_attr_nonnull
75 void cx_hash_murmur(CxHashKey *key); 79 void cx_hash_murmur(CxHashKey *key);
76 80
77 /** 81 /**
130 } 134 }
131 135
132 /** 136 /**
133 * Computes a hash key from a UCX string. 137 * Computes a hash key from a UCX string.
134 * 138 *
135 * @param str the string 139 * @param str (@c cxstring or @c cxmutstr) the string
136 * @return the hash key 140 * @return (@c CxHashKey) the hash key
137 */ 141 */
138 #define cx_hash_key_cxstr(str) cx_hash_key_cxstr(cx_strcast(str)) 142 #define cx_hash_key_cxstr(str) cx_hash_key_cxstr(cx_strcast(str))
139 143
140 #ifdef __cplusplus 144 #ifdef __cplusplus
141 } // extern "C" 145 } // extern "C"

mercurial