int x1f4_type_??mini(void *, unsigned, unsigned)
setups the $3 bytes long $1 memory block for use as an associate array of $2 bytes long records. The number of available slots will be less than $3 / $2 since the array infrastructure requires some bytes reserved for each slot (about 4).
returns 0 for success, non zero for failure (the indicated memory block size is too small for the block to be usable)
int x1f4_port_??mini (void *, void *, int (*)(void *, void *), unsigned, void **)
looks for some $1 associative array item matching the $2 key according to the $3 comparison criterion, which when called is passed the $2 key and the start address of the data of the element being examined biased by $4 as arguments, in this order. Upon look up success, the start address of the found associative array element data is stored at $5. Upon look up failure, inserts a new element, corresponding the $2 key, and stores the start address of the new element data at $5.
$3 is expected to return a negative number if the key is less than the associative array element (as indicated by its second argument), 0 if the element is fine and a positive number if the key is greater than the associative array element.
or:
inserts a new item corresponding the $2 key if none present, retrieves the corresponding item otherwise.
arguments:
the associative array
the key
the comparison method, receives the $2 key and the start address of the data of the element being examined biased by $4 as arguments, in this order, returns a negative number if the key is less than the associative array element (as indicated by its second argument), 0 if the element is fine and a positive number if the key is greater than the associative array element.
some offset (expressed in bytes) to add the start address of the associative array elements data when passing to $3
the address where to store the address of the allocated item data if one is allocated
returns 0 if a new element was inserted, X1f4_??MINI_EVER_MATCH
if a
match was found, one of the defined errors for failure
int x1f4_find_??mini (void *, void *, unsigned, int (*)(void *, void *), void **)
looks for some $1 associative array item matching the $2 key according to the $4 comparison criterion, which when called is passed the $2 key and the start address of the data of the element being examined biased by $3 as arguments, in this order. Upon success, the start address of the found associative array element data is stored at $5.
$4 is expected to return a negative number if the key is less than the associative array element (as indicated by its second argument), 0 if the element is fine and a positive number if the key is greater than the associative array element.
returns 0 if no match was found, non zero otherwise