36 |
36 |
37 |
37 |
38 #ifndef UCX_HASH_KEY_H |
38 #ifndef UCX_HASH_KEY_H |
39 #define UCX_HASH_KEY_H |
39 #define UCX_HASH_KEY_H |
40 |
40 |
41 #include "stddef.h" |
41 #include "common.h" |
42 |
42 |
43 #ifdef __cplusplus |
43 #ifdef __cplusplus |
44 extern "C" { |
44 extern "C" { |
45 #endif |
45 #endif |
46 |
46 |
47 /** Internal structure for a key within a hash map. */ |
47 /** Internal structure for a key within a hash map. */ |
48 struct cx_hash_key_s { |
48 struct cx_hash_key_s { |
49 /** The key data. */ |
49 /** The key data. */ |
50 union { |
50 void const *data; |
51 unsigned char *bytes; |
|
52 unsigned char const *cbytes; |
|
53 char *str; |
|
54 char const *cstr; |
|
55 void *obj; |
|
56 void const *cobj; |
|
57 } data; |
|
58 /** |
51 /** |
59 * The key data length. |
52 * The key data length. |
60 */ |
53 */ |
61 size_t len; |
54 size_t len; |
62 /** The hash value of the key data. */ |
55 /** The hash value of the key data. */ |