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

Function acl_array_delete_obj

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

Source from the content-addressed store, hash-verified

318}
319
320int acl_array_delete_obj(ACL_ARRAY *a, void *obj, void (*free_fn)(void *))
321{
322 int idx, position, ret;
323
324 position = -1;
325 for (idx = 0; idx < a->count; idx++) {
326 if (a->items[idx] == obj) {
327 position = idx;
328 break;
329 }
330 }
331
332 if (free_fn != NULL && obj != NULL)
333 free_fn(obj);
334 if (position == -1) /* not found */
335 return -1;
336
337 /* don't need to free the obj in acl_array_delete_idx */
338 a->items[idx] = NULL;
339 ret = acl_array_delete_idx(a, position, NULL);
340 if (ret < 0)
341 return -1;
342 return ret;
343}
344
345int acl_array_delete_range(ACL_ARRAY *a, int ibegin, int iend,
346 void (*free_fn)(void*))

Callers 6

proctl_service_freeFunction · 0.85
acl_dlink_delete_by_itemFunction · 0.85
http_hdr_entry_replaceFunction · 0.85

Calls 2

acl_array_delete_idxFunction · 0.85
free_fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…