corosync
3.1.0
|
Go to the source code of this file.
Data Structures | |
struct | icmap_notify_value |
Structure passed as new_value and old_value in change callback. More... | |
Macros | |
#define | ICMAP_KEYNAME_MAXLEN 255 |
Maximum length of key in icmap. More... | |
#define | ICMAP_KEYNAME_MINLEN 3 |
Minimum lenght of key in icmap. More... | |
#define | ICMAP_TRACK_ADD 4 |
#define | ICMAP_TRACK_DELETE 1 |
#define | ICMAP_TRACK_MODIFY 2 |
#define | ICMAP_TRACK_PREFIX 8 |
Whole prefix is tracked, instead of key only (so "totem." tracking means that "totem.nodeid", "totem.version", ... More... | |
Typedefs | |
typedef void(* | icmap_notify_fn_t) (int32_t event, const char *key_name, struct icmap_notify_value new_value, struct icmap_notify_value old_value, void *user_data) |
Prototype for notify callback function. More... | |
typedef struct icmap_map * | icmap_map_t |
icmap type. More... | |
typedef qb_map_iter_t * | icmap_iter_t |
Itterator type. More... | |
typedef struct icmap_track * | icmap_track_t |
Track type. More... | |
Enumerations | |
enum | icmap_value_types_t { ICMAP_VALUETYPE_INT8 = 1, ICMAP_VALUETYPE_UINT8 = 2, ICMAP_VALUETYPE_INT16 = 3, ICMAP_VALUETYPE_UINT16 = 4, ICMAP_VALUETYPE_INT32 = 5, ICMAP_VALUETYPE_UINT32 = 6, ICMAP_VALUETYPE_INT64 = 7, ICMAP_VALUETYPE_UINT64 = 8, ICMAP_VALUETYPE_FLOAT = 9, ICMAP_VALUETYPE_DOUBLE = 10, ICMAP_VALUETYPE_STRING = 11, ICMAP_VALUETYPE_BINARY = 12 } |
Possible types of value. More... | |
Functions | |
cs_error_t | icmap_init (void) |
Initialize global icmap. More... | |
cs_error_t | icmap_init_r (icmap_map_t *result) |
Initialize additional (local, reentrant) icmap_map. More... | |
void | icmap_fini (void) |
Finalize global icmap. More... | |
void | icmap_fini_r (const icmap_map_t map) |
Finalize local, reentrant icmap. More... | |
icmap_map_t | icmap_get_global_map (void) |
Return global icmap. More... | |
int | icmap_key_value_eq (const icmap_map_t map1, const char *key_name1, const icmap_map_t map2, const char *key_name2) |
Compare value of key with name key_name1 in map1 with key with name key_name2 in map2. More... | |
cs_error_t | icmap_set (const char *key_name, const void *value, size_t value_len, icmap_value_types_t type) |
Store value with value_len length and type as key_name name in global icmap. More... | |
cs_error_t | icmap_set_r (const icmap_map_t map, const char *key_name, const void *value, size_t value_len, icmap_value_types_t type) |
Reentrant version of icmap_set. More... | |
cs_error_t | icmap_set_int8 (const char *key_name, int8_t value) |
cs_error_t | icmap_set_uint8 (const char *key_name, uint8_t value) |
cs_error_t | icmap_set_int16 (const char *key_name, int16_t value) |
cs_error_t | icmap_set_uint16 (const char *key_name, uint16_t value) |
cs_error_t | icmap_set_int32 (const char *key_name, int32_t value) |
cs_error_t | icmap_set_uint32 (const char *key_name, uint32_t value) |
cs_error_t | icmap_set_int64 (const char *key_name, int64_t value) |
cs_error_t | icmap_set_uint64 (const char *key_name, uint64_t value) |
cs_error_t | icmap_set_float (const char *key_name, float value) |
cs_error_t | icmap_set_double (const char *key_name, double value) |
cs_error_t | icmap_set_string (const char *key_name, const char *value) |
cs_error_t | icmap_set_int8_r (const icmap_map_t map, const char *key_name, int8_t value) |
cs_error_t | icmap_set_uint8_r (const icmap_map_t map, const char *key_name, uint8_t value) |
cs_error_t | icmap_set_int16_r (const icmap_map_t map, const char *key_name, int16_t value) |
cs_error_t | icmap_set_uint16_r (const icmap_map_t map, const char *key_name, uint16_t value) |
cs_error_t | icmap_set_int32_r (const icmap_map_t map, const char *key_name, int32_t value) |
cs_error_t | icmap_set_uint32_r (const icmap_map_t map, const char *key_name, uint32_t value) |
cs_error_t | icmap_set_int64_r (const icmap_map_t map, const char *key_name, int64_t value) |
cs_error_t | icmap_set_uint64_r (const icmap_map_t map, const char *key_name, uint64_t value) |
cs_error_t | icmap_set_float_r (const icmap_map_t map, const char *key_name, float value) |
cs_error_t | icmap_set_double_r (const icmap_map_t map, const char *key_name, double value) |
cs_error_t | icmap_set_string_r (const icmap_map_t map, const char *key_name, const char *value) |
cs_error_t | icmap_delete (const char *key_name) |
Delete key from map. More... | |
cs_error_t | icmap_delete_r (const icmap_map_t map, const char *key_name) |
icmap_delete_r More... | |
cs_error_t | icmap_get (const char *key_name, void *value, size_t *value_len, icmap_value_types_t *type) |
Retrieve value of key key_name and store it in user preallocated value pointer. More... | |
cs_error_t | icmap_get_r (const icmap_map_t map, const char *key_name, void *value, size_t *value_len, icmap_value_types_t *type) |
Same as icmap_get but it's reentrant and operates on given icmap_map. More... | |
cs_error_t | icmap_get_int8 (const char *key_name, int8_t *i8) |
cs_error_t | icmap_get_uint8 (const char *key_name, uint8_t *u8) |
cs_error_t | icmap_get_int16 (const char *key_name, int16_t *i16) |
cs_error_t | icmap_get_uint16 (const char *key_name, uint16_t *u16) |
cs_error_t | icmap_get_int32 (const char *key_name, int32_t *i32) |
cs_error_t | icmap_get_uint32 (const char *key_name, uint32_t *u32) |
cs_error_t | icmap_get_int64 (const char *key_name, int64_t *i64) |
cs_error_t | icmap_get_uint64 (const char *key_name, uint64_t *u64) |
cs_error_t | icmap_get_float (const char *key_name, float *flt) |
cs_error_t | icmap_get_double (const char *key_name, double *dbl) |
cs_error_t | icmap_get_int8_r (const icmap_map_t map, const char *key_name, int8_t *i8) |
cs_error_t | icmap_get_uint8_r (const icmap_map_t map, const char *key_name, uint8_t *u8) |
cs_error_t | icmap_get_int16_r (const icmap_map_t map, const char *key_name, int16_t *i16) |
cs_error_t | icmap_get_uint16_r (const icmap_map_t map, const char *key_name, uint16_t *u16) |
cs_error_t | icmap_get_int32_r (const icmap_map_t map, const char *key_name, int32_t *i32) |
cs_error_t | icmap_get_uint32_r (const icmap_map_t map, const char *key_name, uint32_t *u32) |
cs_error_t | icmap_get_int64_r (const icmap_map_t map, const char *key_name, int64_t *i64) |
cs_error_t | icmap_get_uint64_r (const icmap_map_t map, const char *key_name, uint64_t *u64) |
cs_error_t | icmap_get_float_r (const icmap_map_t map, const char *key_name, float *flt) |
cs_error_t | icmap_get_double_r (const icmap_map_t map, const char *key_name, double *dbl) |
cs_error_t | icmap_get_string_r (const icmap_map_t map, const char *key_name, char **str) |
cs_error_t | icmap_get_string (const char *key_name, char **str) |
Shortcut for icmap_get for string type. More... | |
cs_error_t | icmap_adjust_int (const char *key_name, int32_t step) |
icmap_adjust_int More... | |
cs_error_t | icmap_adjust_int_r (const icmap_map_t map, const char *key_name, int32_t step) |
icmap_adjust_int_r More... | |
cs_error_t | icmap_fast_adjust_int (const char *key_name, int32_t step) |
icmap_fast_adjust_int More... | |
cs_error_t | icmap_fast_adjust_int_r (const icmap_map_t map, const char *key_name, int32_t step) |
icmap_fast_adjust_int_r More... | |
cs_error_t | icmap_inc (const char *key_name) |
Increase stored value by one. More... | |
cs_error_t | icmap_inc_r (const icmap_map_t map, const char *key_name) |
icmap_inc_r More... | |
cs_error_t | icmap_dec (const char *key_name) |
Decrease stored value by one. More... | |
cs_error_t | icmap_dec_r (const icmap_map_t map, const char *key_name) |
icmap_dec_r More... | |
cs_error_t | icmap_fast_inc (const char *key_name) |
Increase stored value by one. More... | |
cs_error_t | icmap_fast_inc_r (const icmap_map_t map, const char *key_name) |
icmap_fast_inc_r More... | |
cs_error_t | icmap_fast_dec (const char *key_name) |
Decrease stored value by one. More... | |
cs_error_t | icmap_fast_dec_r (const icmap_map_t map, const char *key_name) |
icmap_fast_dec_r More... | |
icmap_iter_t | icmap_iter_init (const char *prefix) |
Initialize iterator with given prefix. More... | |
icmap_iter_t | icmap_iter_init_r (const icmap_map_t map, const char *prefix) |
icmap_iter_init_r More... | |
const char * | icmap_iter_next (icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type) |
Return next item in iterator iter. More... | |
void | icmap_iter_finalize (icmap_iter_t iter) |
Finalize iterator. More... | |
cs_error_t | icmap_track_add (const char *key_name, int32_t track_type, icmap_notify_fn_t notify_fn, void *user_data, icmap_track_t *icmap_track) |
Add tracking function for given key_name. More... | |
void * | icmap_track_get_user_data (icmap_track_t icmap_track) |
Return user data associated with given track. More... | |
cs_error_t | icmap_track_delete (icmap_track_t icmap_track) |
Remove previously added track. More... | |
cs_error_t | icmap_set_ro_access (const char *key_name, int prefix, int ro_access) |
Set read-only access for given key (key_name) or prefix, If prefix is set. More... | |
int | icmap_is_key_ro (const char *key_name) |
Check in given key is read only. More... | |
void | icmap_convert_name_to_valid_name (char *key_name) |
Converts given key_name to valid key name (replacing all prohibited characters by _) More... | |
cs_error_t | icmap_copy_map (icmap_map_t dst_map, const icmap_map_t src_map) |
Copy content of src_map icmap to dst_map icmap. More... | |
size_t | icmap_get_valuetype_len (icmap_value_types_t type) |
int32_t | icmap_tt_to_qbtt (int32_t track_type) |
int32_t | icmap_qbtt_to_tt (int32_t track_type) |
#define ICMAP_KEYNAME_MAXLEN 255 |
Maximum length of key in icmap.
Definition at line 48 of file icmap.h.
Referenced by stats_add_schedmiss_event(), stats_ipcs_add_connection(), stats_ipcs_del_connection(), stats_knet_add_handle(), stats_knet_add_member(), stats_knet_del_member(), totem_config_read(), and totem_volatile_config_validate().
#define ICMAP_KEYNAME_MINLEN 3 |
#define ICMAP_TRACK_ADD 4 |
Definition at line 76 of file icmap.h.
Referenced by icmap_qbtt_to_tt(), icmap_track_add(), icmap_tt_to_qbtt(), stats_map_track_add(), and stats_map_track_delete().
#define ICMAP_TRACK_DELETE 1 |
Definition at line 77 of file icmap.h.
Referenced by icmap_qbtt_to_tt(), icmap_track_add(), icmap_tt_to_qbtt(), stats_map_track_add(), and stats_map_track_delete().
#define ICMAP_TRACK_MODIFY 2 |
Definition at line 78 of file icmap.h.
Referenced by icmap_qbtt_to_tt(), icmap_track_add(), icmap_tt_to_qbtt(), and stats_trigger_trackers().
#define ICMAP_TRACK_PREFIX 8 |
Whole prefix is tracked, instead of key only (so "totem." tracking means that "totem.nodeid", "totem.version", ...
applies). This value is also never returned inside of callback and is used only in adding track
Definition at line 85 of file icmap.h.
Referenced by icmap_qbtt_to_tt(), icmap_track_add(), icmap_tt_to_qbtt(), stats_map_track_add(), and stats_trigger_trackers().
typedef qb_map_iter_t* icmap_iter_t |
typedef struct icmap_map* icmap_map_t |
icmap type.
icmap.c contains global variable (icmap_global_map) of this type. This is used in every non-reentant call. Also only in this table are implemented operations like set_ro and tracking of values. Other tables (created by icmap_init_r) are simple map tables with get/set/iter operations.
typedef void(* icmap_notify_fn_t) (int32_t event, const char *key_name, struct icmap_notify_value new_value, struct icmap_notify_value old_value, void *user_data) |
Prototype for notify callback function.
Even is one of ICMAP_TRACK_* event, key_name is changed key, new and old_value contains values or are zeroed (in other words, type is non existing 0 type) if there were no old (creating of key) or new (deleting of key) value. user_data are passed when adding tracking.
typedef struct icmap_track* icmap_track_t |
enum icmap_value_types_t |
Possible types of value.
Binary is raw data without trailing zero with given length
cs_error_t icmap_adjust_int | ( | const char * | key_name, |
int32_t | step | ||
) |
icmap_adjust_int
Defined only for [u]int* values. It adds step to current value.
key_name | |
step |
Definition at line 979 of file icmap.c.
References icmap_adjust_int_r().
cs_error_t icmap_adjust_int_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int32_t | step | ||
) |
icmap_adjust_int_r
map | |
key_name | |
step |
Definition at line 922 of file icmap.c.
References CS_ERR_INVALID_PARAM, CS_ERR_NOT_EXIST, CS_OK, icmap_set(), ICMAP_VALUETYPE_BINARY, ICMAP_VALUETYPE_DOUBLE, ICMAP_VALUETYPE_FLOAT, ICMAP_VALUETYPE_INT16, ICMAP_VALUETYPE_INT32, ICMAP_VALUETYPE_INT64, ICMAP_VALUETYPE_INT8, ICMAP_VALUETYPE_STRING, ICMAP_VALUETYPE_UINT16, ICMAP_VALUETYPE_UINT32, ICMAP_VALUETYPE_UINT64, ICMAP_VALUETYPE_UINT8, icmap_map::qb_map, icmap_item::type, and icmap_item::value.
Referenced by icmap_adjust_int(), icmap_dec_r(), and icmap_inc_r().
void icmap_convert_name_to_valid_name | ( | char * | key_name | ) |
cs_error_t icmap_copy_map | ( | icmap_map_t | dst_map, |
const icmap_map_t | src_map | ||
) |
Copy content of src_map icmap to dst_map icmap.
dst_map | |
src_map |
Definition at line 1298 of file icmap.c.
References CS_ERR_NO_MEMORY, CS_OK, icmap_iter_init_r(), icmap_iter_next(), icmap_item::key_name, icmap_item::value, and icmap_item::value_len.
cs_error_t icmap_dec | ( | const char * | key_name | ) |
Decrease stored value by one.
key_name |
Definition at line 1059 of file icmap.c.
References icmap_dec_r().
cs_error_t icmap_dec_r | ( | const icmap_map_t | map, |
const char * | key_name | ||
) |
icmap_dec_r
map | |
key_name |
Definition at line 1054 of file icmap.c.
References icmap_adjust_int_r().
Referenced by icmap_dec().
cs_error_t icmap_delete | ( | const char * | key_name | ) |
Delete key from map.
key_name |
Definition at line 653 of file icmap.c.
References icmap_delete_r().
cs_error_t icmap_delete_r | ( | const icmap_map_t | map, |
const char * | key_name | ||
) |
icmap_delete_r
map | |
key_name |
Definition at line 633 of file icmap.c.
References CS_ERR_INVALID_PARAM, CS_ERR_NOT_EXIST, CS_OK, icmap_item::key_name, and icmap_map::qb_map.
Referenced by icmap_delete().
cs_error_t icmap_fast_adjust_int | ( | const char * | key_name, |
int32_t | step | ||
) |
icmap_fast_adjust_int
Defined only for [u]int* values. It adds step to current value. Difference between this function and icmap_adjust_int is given in fact, that in tracking callback, old value is undefined, but whole process is done without malloc/memcpy.
key_name | |
step |
Definition at line 1036 of file icmap.c.
References icmap_fast_adjust_int_r().
cs_error_t icmap_fast_adjust_int_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int32_t | step | ||
) |
icmap_fast_adjust_int_r
map | |
key_name | |
step |
Definition at line 987 of file icmap.c.
References CS_ERR_INVALID_PARAM, CS_ERR_NOT_EXIST, CS_OK, ICMAP_VALUETYPE_BINARY, ICMAP_VALUETYPE_DOUBLE, ICMAP_VALUETYPE_FLOAT, ICMAP_VALUETYPE_INT16, ICMAP_VALUETYPE_INT32, ICMAP_VALUETYPE_INT64, ICMAP_VALUETYPE_INT8, ICMAP_VALUETYPE_STRING, ICMAP_VALUETYPE_UINT16, ICMAP_VALUETYPE_UINT32, ICMAP_VALUETYPE_UINT64, ICMAP_VALUETYPE_UINT8, icmap_item::key_name, icmap_map::qb_map, icmap_item::type, and icmap_item::value.
Referenced by icmap_fast_adjust_int(), icmap_fast_dec_r(), and icmap_fast_inc_r().
cs_error_t icmap_fast_dec | ( | const char * | key_name | ) |
Decrease stored value by one.
Difference between this function and icmap_dec is same as between icmap_adjust_int and icmap_fast_adjust_int.
key_name |
Definition at line 1079 of file icmap.c.
References icmap_fast_dec_r().
cs_error_t icmap_fast_dec_r | ( | const icmap_map_t | map, |
const char * | key_name | ||
) |
icmap_fast_dec_r
map | |
key_name |
Definition at line 1074 of file icmap.c.
References icmap_fast_adjust_int_r().
Referenced by icmap_fast_dec().
cs_error_t icmap_fast_inc | ( | const char * | key_name | ) |
Increase stored value by one.
Difference between this function and icmap_inc is same as between icmap_adjust_int and icmap_fast_adjust_int.
key_name |
Definition at line 1069 of file icmap.c.
References icmap_fast_inc_r().
Referenced by main_mcast().
cs_error_t icmap_fast_inc_r | ( | const icmap_map_t | map, |
const char * | key_name | ||
) |
icmap_fast_inc_r
map | |
key_name |
Definition at line 1064 of file icmap.c.
References icmap_fast_adjust_int_r().
Referenced by icmap_fast_inc().
void icmap_fini_r | ( | const icmap_map_t | map | ) |
Finalize local, reentrant icmap.
map |
Definition at line 238 of file icmap.c.
References icmap_map::qb_map.
cs_error_t icmap_get | ( | const char * | key_name, |
void * | value, | ||
size_t * | value_len, | ||
icmap_value_types_t * | type | ||
) |
Retrieve value of key key_name and store it in user preallocated value pointer.
Value can be NULL, and then only value_len and/or type is returned (both of them can also be NULL). If value is not NULL, actual length of value in map is checked against value_len. If *value_len is shorter then length of value in map, error CS_ERR_INVALID_PARAM is returned. After successful copy of value, value_len is set to actual length of value in map.
key_name | |
value | |
value_len | |
type |
Definition at line 725 of file icmap.c.
References icmap_get_r().
cs_error_t icmap_get_double | ( | const char * | key_name, |
double * | dbl | ||
) |
Definition at line 916 of file icmap.c.
References icmap_get_double_r().
cs_error_t icmap_get_double_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
double * | dbl | ||
) |
Definition at line 850 of file icmap.c.
Referenced by icmap_get_double().
cs_error_t icmap_get_float | ( | const char * | key_name, |
float * | flt | ||
) |
Definition at line 910 of file icmap.c.
References icmap_get_float_r().
cs_error_t icmap_get_float_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
float * | flt | ||
) |
Definition at line 844 of file icmap.c.
Referenced by icmap_get_float().
icmap_map_t icmap_get_global_map | ( | void | ) |
Return global icmap.
Definition at line 264 of file icmap.c.
Referenced by main_iface_change_fn(), and totem_config_validate().
cs_error_t icmap_get_int16 | ( | const char * | key_name, |
int16_t * | i16 | ||
) |
Definition at line 874 of file icmap.c.
References icmap_get_int16_r().
cs_error_t icmap_get_int16_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int16_t * | i16 | ||
) |
Definition at line 808 of file icmap.c.
Referenced by icmap_get_int16().
cs_error_t icmap_get_int32 | ( | const char * | key_name, |
int32_t * | i32 | ||
) |
Definition at line 886 of file icmap.c.
References icmap_get_int32_r().
cs_error_t icmap_get_int32_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int32_t * | i32 | ||
) |
Definition at line 820 of file icmap.c.
Referenced by icmap_get_int32().
cs_error_t icmap_get_int64 | ( | const char * | key_name, |
int64_t * | i64 | ||
) |
Definition at line 898 of file icmap.c.
References icmap_get_int64_r().
cs_error_t icmap_get_int64_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int64_t * | i64 | ||
) |
Definition at line 832 of file icmap.c.
Referenced by icmap_get_int64().
cs_error_t icmap_get_int8 | ( | const char * | key_name, |
int8_t * | i8 | ||
) |
Definition at line 862 of file icmap.c.
References icmap_get_int8_r().
cs_error_t icmap_get_int8_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int8_t * | i8 | ||
) |
Definition at line 796 of file icmap.c.
Referenced by icmap_get_int8().
cs_error_t icmap_get_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
void * | value, | ||
size_t * | value_len, | ||
icmap_value_types_t * | type | ||
) |
Same as icmap_get but it's reentrant and operates on given icmap_map.
map | |
key_name | |
value | |
value_len | |
type |
Definition at line 692 of file icmap.c.
Referenced by icmap_get(), and icmap_get_string_r().
cs_error_t icmap_get_string | ( | const char * | key_name, |
char ** | str | ||
) |
Shortcut for icmap_get for string type.
Returned string is newly allocated and caller is responsible for freeing memory
key_name | |
str |
Definition at line 856 of file icmap.c.
References icmap_get_string_r().
Referenced by get_state_dir(), and totem_config_read().
cs_error_t icmap_get_string_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
char ** | str | ||
) |
Definition at line 735 of file icmap.c.
References CS_ERR_INVALID_PARAM, CS_ERR_NO_MEMORY, CS_OK, icmap_get_r(), ICMAP_VALUETYPE_STRING, and icmap_item::type.
Referenced by icmap_get_string(), totem_config_keyread(), and totem_volatile_config_validate().
cs_error_t icmap_get_uint16 | ( | const char * | key_name, |
uint16_t * | u16 | ||
) |
Definition at line 880 of file icmap.c.
References icmap_get_uint16_r().
cs_error_t icmap_get_uint16_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint16_t * | u16 | ||
) |
Definition at line 814 of file icmap.c.
Referenced by icmap_get_uint16().
cs_error_t icmap_get_uint32 | ( | const char * | key_name, |
uint32_t * | u32 | ||
) |
Definition at line 892 of file icmap.c.
References icmap_get_uint32_r().
Referenced by totem_config_read(), and totem_config_validate().
cs_error_t icmap_get_uint32_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint32_t * | u32 | ||
) |
Definition at line 826 of file icmap.c.
Referenced by icmap_get_uint32(), and totem_volatile_config_validate().
cs_error_t icmap_get_uint64 | ( | const char * | key_name, |
uint64_t * | u64 | ||
) |
Definition at line 904 of file icmap.c.
References icmap_get_uint64_r().
cs_error_t icmap_get_uint64_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint64_t * | u64 | ||
) |
Definition at line 838 of file icmap.c.
Referenced by icmap_get_uint64().
cs_error_t icmap_get_uint8 | ( | const char * | key_name, |
uint8_t * | u8 | ||
) |
Definition at line 868 of file icmap.c.
References icmap_get_uint8_r().
cs_error_t icmap_get_uint8_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint8_t * | u8 | ||
) |
Definition at line 802 of file icmap.c.
Referenced by icmap_get_uint8().
size_t icmap_get_valuetype_len | ( | icmap_value_types_t | type | ) |
Definition at line 306 of file icmap.c.
References ICMAP_VALUETYPE_BINARY, ICMAP_VALUETYPE_DOUBLE, ICMAP_VALUETYPE_FLOAT, ICMAP_VALUETYPE_INT16, ICMAP_VALUETYPE_INT32, ICMAP_VALUETYPE_INT64, ICMAP_VALUETYPE_INT8, ICMAP_VALUETYPE_STRING, ICMAP_VALUETYPE_UINT16, ICMAP_VALUETYPE_UINT32, ICMAP_VALUETYPE_UINT64, and ICMAP_VALUETYPE_UINT8.
cs_error_t icmap_inc | ( | const char * | key_name | ) |
Increase stored value by one.
key_name |
Definition at line 1049 of file icmap.c.
References icmap_inc_r().
cs_error_t icmap_inc_r | ( | const icmap_map_t | map, |
const char * | key_name | ||
) |
icmap_inc_r
map | |
key_name |
Definition at line 1044 of file icmap.c.
References icmap_adjust_int_r().
Referenced by icmap_inc().
cs_error_t icmap_init | ( | void | ) |
cs_error_t icmap_init_r | ( | icmap_map_t * | result | ) |
Initialize additional (local, reentrant) icmap_map.
Content of variable result is undefined if return code is not CS_OK.
result |
Definition at line 188 of file icmap.c.
References CS_ERR_INIT, and CS_ERR_NO_MEMORY.
Referenced by icmap_init().
int icmap_is_key_ro | ( | const char * | key_name | ) |
Check in given key is read only.
Returns !0 if so, otherwise (key is rw) 0.
key_name |
Definition at line 1272 of file icmap.c.
References CS_FALSE, CS_TRUE, icmap_ro_access_item::key_name, icmap_ro_access_item::list, and icmap_ro_access_item::prefix.
void icmap_iter_finalize | ( | icmap_iter_t | iter | ) |
icmap_iter_t icmap_iter_init | ( | const char * | prefix | ) |
Initialize iterator with given prefix.
prefix |
Definition at line 1089 of file icmap.c.
References icmap_iter_init_r().
icmap_iter_t icmap_iter_init_r | ( | const icmap_map_t | map, |
const char * | prefix | ||
) |
icmap_iter_init_r
map | |
prefix |
Definition at line 1084 of file icmap.c.
References icmap_map::qb_map.
Referenced by icmap_copy_map(), and icmap_iter_init().
const char* icmap_iter_next | ( | icmap_iter_t | iter, |
size_t * | value_len, | ||
icmap_value_types_t * | type | ||
) |
Return next item in iterator iter.
value_len and type are optional (= can be NULL), but if set, length of returned value and/or type is returned. Function returns following key_name or NULL if iteration is over.
iter | |
value_len | |
type |
Definition at line 1095 of file icmap.c.
Referenced by icmap_copy_map().
int icmap_key_value_eq | ( | const icmap_map_t | map1, |
const char * | key_name1, | ||
const icmap_map_t | map2, | ||
const char * | key_name2 | ||
) |
Compare value of key with name key_name1 in map1 with key with name key_name2 in map2.
Two values must have same type, length and value to be considered equal. Function returns 0 when any of map1, key_name1, map2, key_name2 are NULL, or key_name is not found in map, or keys are not equal. != 0 is returned when values are equal.
map1 | |
key_name1 | |
map2 | |
key_name2 |
Definition at line 385 of file icmap.c.
References icmap_map::qb_map.
int32_t icmap_qbtt_to_tt | ( | int32_t | track_type | ) |
Definition at line 150 of file icmap.c.
References ICMAP_TRACK_ADD, ICMAP_TRACK_DELETE, ICMAP_TRACK_MODIFY, and ICMAP_TRACK_PREFIX.
cs_error_t icmap_set | ( | const char * | key_name, |
const void * | value, | ||
size_t | value_len, | ||
icmap_value_types_t | type | ||
) |
Store value with value_len length and type as key_name name in global icmap.
key_name | |
value | |
value_len | |
type |
Definition at line 487 of file icmap.c.
References icmap_set_r().
Referenced by icmap_adjust_int_r().
cs_error_t icmap_set_double | ( | const char * | key_name, |
double | value | ||
) |
Definition at line 621 of file icmap.c.
References icmap_set_double_r().
cs_error_t icmap_set_double_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
double | value | ||
) |
Definition at line 551 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_DOUBLE.
Referenced by icmap_set_double().
cs_error_t icmap_set_float | ( | const char * | key_name, |
float | value | ||
) |
Definition at line 615 of file icmap.c.
References icmap_set_float_r().
cs_error_t icmap_set_float_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
float | value | ||
) |
Definition at line 545 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_FLOAT.
Referenced by icmap_set_float().
cs_error_t icmap_set_int16 | ( | const char * | key_name, |
int16_t | value | ||
) |
Definition at line 579 of file icmap.c.
References icmap_set_int16_r().
cs_error_t icmap_set_int16_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int16_t | value | ||
) |
Definition at line 509 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_INT16.
Referenced by icmap_set_int16().
cs_error_t icmap_set_int32 | ( | const char * | key_name, |
int32_t | value | ||
) |
Definition at line 591 of file icmap.c.
References icmap_set_int32_r().
cs_error_t icmap_set_int32_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int32_t | value | ||
) |
Definition at line 521 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_INT32.
Referenced by icmap_set_int32().
cs_error_t icmap_set_int64 | ( | const char * | key_name, |
int64_t | value | ||
) |
Definition at line 603 of file icmap.c.
References icmap_set_int64_r().
cs_error_t icmap_set_int64_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int64_t | value | ||
) |
Definition at line 533 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_INT64.
Referenced by icmap_set_int64().
cs_error_t icmap_set_int8 | ( | const char * | key_name, |
int8_t | value | ||
) |
Definition at line 567 of file icmap.c.
References icmap_set_int8_r().
cs_error_t icmap_set_int8_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
int8_t | value | ||
) |
Definition at line 497 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_INT8.
Referenced by icmap_set_int8().
cs_error_t icmap_set_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
const void * | value, | ||
size_t | value_len, | ||
icmap_value_types_t | type | ||
) |
Reentrant version of icmap_set.
map | |
key_name | |
value | |
value_len | |
type |
Definition at line 407 of file icmap.c.
References CS_ERR_INVALID_PARAM.
Referenced by icmap_set(), icmap_set_double_r(), icmap_set_float_r(), icmap_set_int16_r(), icmap_set_int32_r(), icmap_set_int64_r(), icmap_set_int8_r(), icmap_set_string_r(), icmap_set_uint16_r(), icmap_set_uint32_r(), icmap_set_uint64_r(), and icmap_set_uint8_r().
cs_error_t icmap_set_ro_access | ( | const char * | key_name, |
int | prefix, | ||
int | ro_access | ||
) |
Set read-only access for given key (key_name) or prefix, If prefix is set.
ro_access can be !0, which means, that old information about ro of this key is deleted. Read-only access is used only in CMAP service! (in other word it prevents users from deleting/changing key, but doesn't guarantee anything for internal icmap users.)
key_name | |
prefix | |
ro_access |
Definition at line 1225 of file icmap.c.
References CS_ERR_EXIST, CS_ERR_NO_MEMORY, CS_ERR_NOT_EXIST, CS_OK, icmap_ro_access_item::key_name, icmap_ro_access_item::list, and icmap_ro_access_item::prefix.
cs_error_t icmap_set_string | ( | const char * | key_name, |
const char * | value | ||
) |
Definition at line 627 of file icmap.c.
References icmap_set_string_r().
cs_error_t icmap_set_string_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
const char * | value | ||
) |
Definition at line 557 of file icmap.c.
References CS_ERR_INVALID_PARAM, icmap_set_r(), and ICMAP_VALUETYPE_STRING.
Referenced by icmap_set_string().
cs_error_t icmap_set_uint16 | ( | const char * | key_name, |
uint16_t | value | ||
) |
Definition at line 585 of file icmap.c.
References icmap_set_uint16_r().
cs_error_t icmap_set_uint16_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint16_t | value | ||
) |
Definition at line 515 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_UINT16.
Referenced by icmap_set_uint16().
cs_error_t icmap_set_uint32 | ( | const char * | key_name, |
uint32_t | value | ||
) |
Definition at line 597 of file icmap.c.
References icmap_set_uint32_r().
cs_error_t icmap_set_uint32_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint32_t | value | ||
) |
Definition at line 527 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_UINT32.
Referenced by icmap_set_uint32().
cs_error_t icmap_set_uint64 | ( | const char * | key_name, |
uint64_t | value | ||
) |
Definition at line 609 of file icmap.c.
References icmap_set_uint64_r().
cs_error_t icmap_set_uint64_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint64_t | value | ||
) |
Definition at line 539 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_UINT64.
Referenced by icmap_set_uint64().
cs_error_t icmap_set_uint8 | ( | const char * | key_name, |
uint8_t | value | ||
) |
Definition at line 573 of file icmap.c.
References icmap_set_uint8_r().
cs_error_t icmap_set_uint8_r | ( | const icmap_map_t | map, |
const char * | key_name, | ||
uint8_t | value | ||
) |
Definition at line 503 of file icmap.c.
References icmap_set_r(), and ICMAP_VALUETYPE_UINT8.
Referenced by icmap_set_uint8().
cs_error_t icmap_track_add | ( | const char * | key_name, |
int32_t | track_type, | ||
icmap_notify_fn_t | notify_fn, | ||
void * | user_data, | ||
icmap_track_t * | icmap_track | ||
) |
Add tracking function for given key_name.
Tracked changes (add|modify|delete) depend on track_type, which is bitwise or of ICMAP_TRACK_* values. notify_fn is called on change, where user_data pointer is passed (unchanged). Value which can be used to delete tracking is passed as icmap_track.
key_name | |
track_type | |
notify_fn | |
user_data | |
icmap_track |
Definition at line 1159 of file icmap.c.
References CS_ERR_INVALID_PARAM, CS_ERR_NO_MEMORY, ICMAP_TRACK_ADD, ICMAP_TRACK_DELETE, ICMAP_TRACK_MODIFY, ICMAP_TRACK_PREFIX, icmap_map::qb_map, and user_data.
cs_error_t icmap_track_delete | ( | icmap_track_t | icmap_track | ) |
Remove previously added track.
icmap_track |
Definition at line 1204 of file icmap.c.
References icmap_track::key_name, and icmap_map::qb_map.
void* icmap_track_get_user_data | ( | icmap_track_t | icmap_track | ) |
Return user data associated with given track.
icmap_track |
Definition at line 1220 of file icmap.c.
References icmap_track::user_data.
int32_t icmap_tt_to_qbtt | ( | int32_t | track_type | ) |
Definition at line 127 of file icmap.c.
References ICMAP_TRACK_ADD, ICMAP_TRACK_DELETE, ICMAP_TRACK_MODIFY, and ICMAP_TRACK_PREFIX.