MCPcopy Create free account
hub / github.com/corosync/corosync / icmap_get_string_r

Function icmap_get_string_r

exec/icmap.c:739–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739cs_error_t icmap_get_string_r(icmap_map_t map, const char *key_name, char **str)
740{
741 cs_error_t res;
742 size_t str_len;
743 icmap_value_types_t type;
744
745 res = icmap_get_r(map, key_name, NULL, &str_len, &type);
746 if (res != CS_OK || type != ICMAP_VALUETYPE_STRING) {
747 if (res == CS_OK) {
748 res = CS_ERR_INVALID_PARAM;
749 }
750
751 goto return_error;
752 }
753
754 *str = malloc(str_len);
755 if (*str == NULL) {
756 res = CS_ERR_NO_MEMORY;
757
758 goto return_error;
759 }
760
761 res = icmap_get_r(map, key_name, *str, &str_len, &type);
762 if (res != CS_OK) {
763 free(*str);
764 goto return_error;
765 }
766
767 return (CS_OK);
768
769return_error:
770 return (res);
771}
772
773static cs_error_t icmap_get_int_r(
774 const icmap_map_t map,

Callers 13

icmap_get_stringFunction · 0.85
totem_get_cryptoFunction · 0.85
nodelist_bynameFunction · 0.85
find_local_nodeFunction · 0.85
configure_link_paramsFunction · 0.85
get_interface_paramsFunction · 0.85
totem_config_keyreadFunction · 0.85

Calls 1

icmap_get_rFunction · 0.85

Tested by

no test coverage detected