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

Function print_key

tools/corosync-cmapctl.c:178–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178static void print_key(cmap_handle_t handle,
179 const char *key_name,
180 size_t value_len,
181 const void *value,
182 cmap_value_types_t type)
183{
184 char *str;
185 char *bin_value = NULL;
186 cs_error_t err;
187 int8_t i8;
188 uint8_t u8;
189 int16_t i16;
190 uint16_t u16;
191 int32_t i32;
192 uint32_t u32;
193 int64_t i64;
194 uint64_t u64;
195 float flt;
196 double dbl;
197 int end_loop;
198 int no_retries;
199 size_t bin_value_len;
200
201 end_loop = 0;
202 no_retries = 0;
203
204 err = CS_OK;
205
206 while (!end_loop) {
207 switch (type) {
208 case CMAP_VALUETYPE_INT8:
209 if (value == NULL) {
210 err = cmap_get_int8(handle, key_name, &i8);
211 } else {
212 i8 = *((int8_t *)value);
213 }
214 break;
215 case CMAP_VALUETYPE_INT16:
216 if (value == NULL) {
217 err = cmap_get_int16(handle, key_name, &i16);
218 } else {
219 i16 = *((int16_t *)value);
220 }
221 break;
222 case CMAP_VALUETYPE_INT32:
223 if (value == NULL) {
224 err = cmap_get_int32(handle, key_name, &i32);
225 } else {
226 i32 = *((int32_t *)value);
227 }
228 break;
229 case CMAP_VALUETYPE_INT64:
230 if (value == NULL) {
231 err = cmap_get_int64(handle, key_name, &i64);
232 } else {
233 i64 = *((int64_t *)value);
234 }
235 break;

Callers 3

print_iterFunction · 0.85
cmap_notify_fnFunction · 0.85
mainFunction · 0.85

Calls 14

cmap_get_int8Function · 0.85
cmap_get_int16Function · 0.85
cmap_get_int32Function · 0.85
cmap_get_int64Function · 0.85
cmap_get_uint8Function · 0.85
cmap_get_uint16Function · 0.85
cmap_get_uint32Function · 0.85
cmap_get_uint64Function · 0.85
cmap_get_floatFunction · 0.85
cmap_get_doubleFunction · 0.85
cmap_get_stringFunction · 0.85
cmap_getFunction · 0.85

Tested by

no test coverage detected