MCPcopy Create free account
hub / github.com/cesanta/mongoose / entry_append

Function entry_append

tutorials/device-dashboard/array/dashboard.c:25–32  ·  view source on GitHub ↗

Grow s_arr by one slot and append the staged entry. False on OOM

Source from the content-addressed store, hash-verified

23
24// Grow s_arr by one slot and append the staged entry. False on OOM
25static bool entry_append(void) {
26 struct entry *arr =
27 (struct entry *) realloc(s_arr, (s_count + 1) * sizeof(*arr));
28 if (arr == NULL) return false;
29 s_arr = arr;
30 s_arr[s_count++] = s_entry;
31 return true;
32}
33
34// Remove the entry at the given index, shifting the tail down and shrinking
35// s_arr by one slot. False if the index is out of range

Callers 2

arr_fnFunction · 0.85
mg_dash_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected