#include <oskit/amm.h>int amm_iterate(amm_t *amm, int (*amm_iterate_func)(), void *arg);
Calls a user-provided function amm_iterate_func for every entry of amm.Arg is an opaque value which is passed to every instance of amm_iterate_func along with amm and the entry itself.
amm_iterate continues until the function has been called for all entries in the AMM or until one instance of the function returns non-zero. In the latter case, that non-zero value will be returned from amm_iterate.
Since the iteration function may modify or even destroy the entry passed in, amm_iterate uses the following technique for locating the ``next'' entry. At the beginning of each iteration, amm_iterate records the last address covered by the current entry. After the specified iteration function returns, amm_find_addr is called with this address to ``relocate'' the current entry. From this entry, amm_iterate derives the next entry.
- amm
- A pointer to the amm_t structure representing the address map.
- amm_iterate_func
- Function to be called for every entry.
- arg
- Argument to be passed to every instance of the iteration function.
Returns zero if amm_iterate_func returned zero for all entries. Returns the first non-zero value returned from any amm_iterate_func call.
amm_iterate_func