Mstdlib-1.24.0
|
Typedefs | |
typedef struct M_hash_multi | M_hash_multi_t |
typedef void(* | M_hash_multi_free_func) (void *) |
Enumerations | |
enum | M_hash_multi_flags_t { M_HASH_MULTI_NONE = 0 , M_HASH_MULTI_STR_CASECMP = 1 << 0 } |
enum | M_hash_multi_val_type_t { M_HASH_MULTI_VAL_TYPE_UNKNOWN = 0 , M_HASH_MULTI_VAL_TYPE_BOOL , M_HASH_MULTI_VAL_TYPE_INT , M_HASH_MULTI_VAL_TYPE_STR , M_HASH_MULTI_VAL_TYPE_BIN , M_HASH_MULTI_VAL_TYPE_VP } |
Functions | |
M_hash_multi_t * | M_hash_multi_create (M_uint32 flags) M_MALLOC |
void | M_hash_multi_destroy (M_hash_multi_t *h) M_FREE(1) |
M_bool | M_hash_multi_u64_insert_bool (M_hash_multi_t *h, M_uint64 key, M_bool val) |
M_bool | M_hash_multi_u64_insert_int (M_hash_multi_t *h, M_uint64 key, M_int64 val) |
M_bool | M_hash_multi_u64_insert_uint (M_hash_multi_t *h, M_uint64 key, M_uint64 val) |
M_bool | M_hash_multi_u64_insert_str (M_hash_multi_t *h, M_uint64 key, const char *val) |
M_bool | M_hash_multi_u64_insert_bin (M_hash_multi_t *h, M_uint64 key, const unsigned char *val, size_t len) |
M_bool | M_hash_multi_u64_insert_vp (M_hash_multi_t *h, M_uint64 key, void *val, M_hash_multi_free_func val_free) |
M_bool | M_hash_multi_u64_get_bool (const M_hash_multi_t *h, M_uint64 key, M_bool *val) |
M_bool | M_hash_multi_u64_get_int (const M_hash_multi_t *h, M_uint64 key, M_int64 *val) |
M_bool | M_hash_multi_u64_get_uint (const M_hash_multi_t *h, M_uint64 key, M_uint64 *val) |
M_bool | M_hash_multi_u64_get_str (const M_hash_multi_t *h, M_uint64 key, const char **val) |
M_bool | M_hash_multi_u64_get_bin (const M_hash_multi_t *h, M_uint64 key, const unsigned char **val, size_t *len) |
M_bool | M_hash_multi_u64_get_vp (const M_hash_multi_t *h, M_uint64 key, void **val) |
M_bool | M_hash_multi_u64_remove (M_hash_multi_t *h, M_uint64 key, M_bool destroy_vp) |
M_hash_multi_val_type_t | M_hash_multi_u64_type (const M_hash_multi_t *h, M_uint64 key) |
M_bool | M_hash_multi_str_insert_bool (M_hash_multi_t *h, const char *key, M_bool val) |
M_bool | M_hash_multi_str_insert_int (M_hash_multi_t *h, const char *key, M_int64 val) |
M_bool | M_hash_multi_str_insert_uint (M_hash_multi_t *h, const char *key, M_uint64 val) |
M_bool | M_hash_multi_str_insert_str (M_hash_multi_t *h, const char *key, const char *val) |
M_bool | M_hash_multi_str_insert_bin (M_hash_multi_t *h, const char *key, const unsigned char *val, size_t len) |
M_bool | M_hash_multi_str_insert_vp (M_hash_multi_t *h, const char *key, void *val, M_hash_multi_free_func val_free) |
M_bool | M_hash_multi_str_get_bool (const M_hash_multi_t *h, const char *key, M_bool *val) |
M_bool | M_hash_multi_str_get_int (const M_hash_multi_t *h, const char *key, M_int64 *val) |
M_bool | M_hash_multi_str_get_uint (const M_hash_multi_t *h, const char *key, M_uint64 *val) |
M_bool | M_hash_multi_str_get_str (const M_hash_multi_t *h, const char *key, const char **val) |
M_bool | M_hash_multi_str_get_bin (const M_hash_multi_t *h, const char *key, const unsigned char **val, size_t *len) |
M_bool | M_hash_multi_str_get_vp (const M_hash_multi_t *h, const char *key, void **val) |
M_bool | M_hash_multi_str_remove (M_hash_multi_t *h, const char *key, M_bool destroy_vp) |
M_hash_multi_val_type_t | M_hash_multi_str_type (const M_hash_multi_t *h, const char *key) |
Hashtable, meant for storing a variety of key and value types.
All data except void pointers will be duplicated.
typedef struct M_hash_multi M_hash_multi_t |
typedef void(* M_hash_multi_free_func) (void *) |
Callback for freeing void pointer data.
enum M_hash_multi_flags_t |
M_hash_multi_t * M_hash_multi_create | ( | M_uint32 | flags | ) |
Create a new multi hashtable.
[in] | flags | M_hash_multi_flags_t flags for modifying behavior. |
return multi table.
void M_hash_multi_destroy | ( | M_hash_multi_t * | h | ) |
Destroy the hashtable.
[in] | h | Hashtable to destroy. |
M_bool M_hash_multi_u64_insert_bool | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_bool | val | ||
) |
Insert bool with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | Boolean value. |
M_bool M_hash_multi_u64_insert_int | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_int64 | val | ||
) |
Insert signed integer with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | Signed integer val. |
M_bool M_hash_multi_u64_insert_uint | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_uint64 | val | ||
) |
Insert unsigned integer with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | Unsigned integer val. |
M_bool M_hash_multi_u64_insert_str | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
const char * | val | ||
) |
Insert string with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | NULL terminated string. |
M_bool M_hash_multi_u64_insert_bin | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
const unsigned char * | val, | ||
size_t | len | ||
) |
Insert binary data with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | Binary data. |
[in] | len | Length of binary data. |
M_bool M_hash_multi_u64_insert_vp | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
void * | val, | ||
M_hash_multi_free_func | val_free | ||
) |
Insert a void pointer with an integer key.
This will not duplicate the value. It only stores the memory address of the data. If a value exists at the given key, it will be destroyed if it was inserted with a value free function.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | The memory location of the data. |
[in] | val_free | Callback for freeing the data. |
M_bool M_hash_multi_u64_get_bool | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_bool * | val | ||
) |
Get a bool value with a string key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_u64_get_int | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_int64 * | val | ||
) |
Get a signed integer value with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_u64_get_uint | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_uint64 * | val | ||
) |
Get an unsigned integer value with an integer key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_u64_get_str | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
const char ** | val | ||
) |
Get a string value with an integer key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_u64_get_bin | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
const unsigned char ** | val, | ||
size_t * | len | ||
) |
Get binary data with an integer key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
[in,out] | len | The value length. |
M_bool M_hash_multi_u64_get_vp | ( | const M_hash_multi_t * | h, |
M_uint64 | key, | ||
void ** | val | ||
) |
Get a void pointer value with an integer key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_u64_remove | ( | M_hash_multi_t * | h, |
M_uint64 | key, | ||
M_bool | destroy_vp | ||
) |
Remove a value with an integer key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | destroy_vp | If the value is a void pointer M_TRUE if the associated (if set) value free callback should be called. |
M_hash_multi_val_type_t M_hash_multi_u64_type | ( | const M_hash_multi_t * | h, |
M_uint64 | key | ||
) |
Get the type of data stored in with an integer key.
[in] | h | Hashtable. |
[in] | key | Integer key. |
M_bool M_hash_multi_str_insert_bool | ( | M_hash_multi_t * | h, |
const char * | key, | ||
M_bool | val | ||
) |
Insert bool with an string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | val | Boolean value. |
M_bool M_hash_multi_str_insert_int | ( | M_hash_multi_t * | h, |
const char * | key, | ||
M_int64 | val | ||
) |
Insert signed integer with a string key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in] | val | Signed integer val |
M_bool M_hash_multi_str_insert_uint | ( | M_hash_multi_t * | h, |
const char * | key, | ||
M_uint64 | val | ||
) |
Insert unsigned integer with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | val | Unsigned integer val. |
M_bool M_hash_multi_str_insert_str | ( | M_hash_multi_t * | h, |
const char * | key, | ||
const char * | val | ||
) |
Insert string with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | val | NULL terminated string. |
M_bool M_hash_multi_str_insert_bin | ( | M_hash_multi_t * | h, |
const char * | key, | ||
const unsigned char * | val, | ||
size_t | len | ||
) |
Insert binary data with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | val | Binary data. |
[in] | len | Length of binary data. |
M_bool M_hash_multi_str_insert_vp | ( | M_hash_multi_t * | h, |
const char * | key, | ||
void * | val, | ||
M_hash_multi_free_func | val_free | ||
) |
Insert a void pointer with a string key.
This will not duplicate the value. It only stores the memory address of the data. The if a value exists at the given key it will be destroyed if it was inserted with a value free function.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | val | The memory location of the data. |
[in] | val_free | Callback for freeing the data. |
M_bool M_hash_multi_str_get_bool | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
M_bool * | val | ||
) |
Get a bool value with a string key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_str_get_int | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
M_int64 * | val | ||
) |
Get a signed integer value with a string key.
[in,out] | h | Hashtable. |
[in] | key | Integer key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_str_get_uint | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
M_uint64 * | val | ||
) |
Get an unsigned integer value with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_str_get_str | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
const char ** | val | ||
) |
Get a string value with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_str_get_bin | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
const unsigned char ** | val, | ||
size_t * | len | ||
) |
Get binary data with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in,out] | val | The value to get. |
[in,out] | len | The value length. |
M_bool M_hash_multi_str_get_vp | ( | const M_hash_multi_t * | h, |
const char * | key, | ||
void ** | val | ||
) |
Get a void pointer value with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in,out] | val | The value to get. |
M_bool M_hash_multi_str_remove | ( | M_hash_multi_t * | h, |
const char * | key, | ||
M_bool | destroy_vp | ||
) |
Remove a value with a string key.
[in,out] | h | Hashtable. |
[in] | key | String key. |
[in] | destroy_vp | If the value is a void pointer M_TRUE if the associated (if set) value free callback should be called. |
M_hash_multi_val_type_t M_hash_multi_str_type | ( | const M_hash_multi_t * | h, |
const char * | key | ||
) |
Get the type of data stored in with a string key.
[in] | h | Hashtable. |
[in] | key | String key. |