next up previous contents index
Next: 16.8.16 amm_modify: Modify the Up: 16.8 API reference Previous: 16.8.14 amm_iterate_gen: Call a

16.8.15 amm_join_func: Join two adjacent map entries (user-provided callout)

 

SYNOPSIS

#include <oskit/amm.h>

int amm_join_func(amm_t *amm, amm_entry_t *head, amm_entry_t *tail, [out] amm_entry_t **new);

DESCRIPTION

User-provided function called whenever the AMM thinks that two map entries for the map amm can be joined, based on comparison of the their flag words. The join function for an AMM is set at initialization time by passing a pointer to it as a parameter to amm_init_gen.

Head and tail are the two entries to join. If the join is successful, a pointer to the joined entry is returned in new. The returned entry may be one of the two entries passed in or it may be an entirely new entry. The AMM will call the entry free function for any ``left-over'' entries on return from a successful join call.

This routine is responsible for merging the map-private attributes of the two entries if they can be joined.

If the map-private attributes of the two entries are incompatible, the call should return non-zero to prevent the caller from reflecting the join in the map. Failure to join two entries is not an error, and the return code will not be propagated up through the call chain.

amm_join_func is only called by amm_modify.

PARAMETERS

amm
A pointer to the amm_t structure representing the address map.
head,tail
The two entries to be joined.
new
A pointer to the new, joined entry.

RETURNS

Returns zero if the join was successful, non-zero if not.

RELATED INFORMATION

amm_init_gen, amm_modify



University of Utah Flux Research Group