MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_array_delete_idx

Function acl_array_delete_idx

lib_acl/src/stdlib/common/acl_array.c:292–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292int acl_array_delete_idx(ACL_ARRAY *a, int position, void (*free_fn)(void *))
293{
294 int idx;
295
296 if (position < 0 || position >= a->count)
297 return -1;
298 if (free_fn != NULL && a->items[position] != NULL)
299 free_fn(a->items[position]);
300 a->items[position] = NULL; /* sanity set to be null */
301
302 for (idx = position; idx < a->count - 1; idx++)
303 a->items[idx] = a->items[idx + 1];
304 a->count--;
305 return 0;
306}
307
308int acl_array_delete(ACL_ARRAY *a, int idx, void (*free_fn)(void*))
309{

Callers 9

acl_vstream_freeFunction · 0.85
acl_vstream_closeFunction · 0.85
acl_dlink_deleteFunction · 0.85
acl_dlink_delete_rangeFunction · 0.85
acl_array_delete_objFunction · 0.85
acl_cfg_parser_deleteFunction · 0.85

Calls 1

free_fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…