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

Function stats_map_set_value

exec/stats.c:235–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233static const struct corosync_api_v1 *api;
234
235static void stats_map_set_value(struct cs_stats_conv *conv,
236 void *stat_array,
237 void *value,
238 size_t *value_len,
239 icmap_value_types_t *type)
240{
241 if (value_len) {
242 *value_len = icmap_get_valuetype_len(conv->value_type);
243 }
244 if (type) {
245 *type = conv->value_type;
246 if ((*type == ICMAP_VALUETYPE_STRING) && value_len && stat_array) {
247 *value_len = strlen((char *)(stat_array) + conv->offset)+1;
248 }
249 }
250 if (value) {
251 assert(value_len != NULL);
252
253 memcpy(value, (char *)(stat_array) + conv->offset, *value_len);
254 }
255}
256
257static void stats_add_entry(const char *key, struct cs_stats_conv *cs_conv)
258{

Callers 2

stats_map_getFunction · 0.85
stats_map_iter_nextFunction · 0.85

Calls 1

icmap_get_valuetype_lenFunction · 0.85

Tested by

no test coverage detected