Name
ap_table_do — apply a function to each element of a table
Synopsis
void ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const table *t,...)
If the NULL
-terminated vararg
list is empty, traverses the whole table and runs the function
comp(rec,key,value)
on each key/value pair. If the
vararg
list is nonempty, traverses the matching
keys (strcasecmp()
is used to determine a match)
and runs the same function. Each traversal is terminated if the
function comp returns the value 0
.
In either case it may happen that the comp()
function is called multiple times for the same key. The table may
again contain various entries of the same key; if the
vararg
list is nonempty, the traversal is repeated
for any vararg
item, even if they are equal.
Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.