src/cx/hash_key.h

changeset 890
54565fd74e74
parent 759
475335643af4
child 985
68754c7de906
equal deleted inserted replaced
889:f549fd9fbd8f 890:54565fd74e74
44 #endif 44 #endif
45 45
46 /** Internal structure for a key within a hash map. */ 46 /** Internal structure for a key within a hash map. */
47 struct cx_hash_key_s { 47 struct cx_hash_key_s {
48 /** The key data. */ 48 /** The key data. */
49 void const *data; 49 const void *data;
50 /** 50 /**
51 * The key data length. 51 * The key data length.
52 */ 52 */
53 size_t len; 53 size_t len;
54 /** The hash value of the key data. */ 54 /** The hash value of the key data. */
79 * 79 *
80 * @param str the string 80 * @param str the string
81 * @return the hash key 81 * @return the hash key
82 */ 82 */
83 __attribute__((__warn_unused_result__)) 83 __attribute__((__warn_unused_result__))
84 CxHashKey cx_hash_key_str(char const *str); 84 CxHashKey cx_hash_key_str(const char *str);
85 85
86 /** 86 /**
87 * Computes a hash key from a byte array. 87 * Computes a hash key from a byte array.
88 * 88 *
89 * @param bytes the array 89 * @param bytes the array
90 * @param len the length 90 * @param len the length
91 * @return the hash key 91 * @return the hash key
92 */ 92 */
93 __attribute__((__warn_unused_result__)) 93 __attribute__((__warn_unused_result__))
94 CxHashKey cx_hash_key_bytes( 94 CxHashKey cx_hash_key_bytes(
95 unsigned char const *bytes, 95 const unsigned char *bytes,
96 size_t len 96 size_t len
97 ); 97 );
98 98
99 /** 99 /**
100 * Computes a hash key for an arbitrary object. 100 * Computes a hash key for an arbitrary object.
107 * @param len the length of object in memory 107 * @param len the length of object in memory
108 * @return the hash key 108 * @return the hash key
109 */ 109 */
110 __attribute__((__warn_unused_result__)) 110 __attribute__((__warn_unused_result__))
111 CxHashKey cx_hash_key( 111 CxHashKey cx_hash_key(
112 void const *obj, 112 const void *obj,
113 size_t len 113 size_t len
114 ); 114 );
115 115
116 /** 116 /**
117 * Computes a hash key from a UCX string. 117 * Computes a hash key from a UCX string.

mercurial