Next: Variable Size Data Array Null Terminated String Library, Previous: Variable Size Data Array Long Unsigned Library, Up: Variable Size Data Array Interface [Index]
int x1f4_find_??fine
(void *, unsigned, unsigned, void **)
looks for some $1 associative array item matching the integral $2 key. The key is compared with some integral record in the data of examined associative array element, record to be found $3 bytes after to the start of element data. Upon success, the start address of the found associative array element data is stored at $4.
x1f4_find_??fine(a1, a2, a3, a4)
is equivalent with:
x1f4_find_??line(a1, &a2, a3, compare, a4)
where compare is:
int
compare(void *looked_for_key, void *associative_array_stored_key)
{
int e;
unsigned b, k;
b = *(unsigned *) associative_array_stored_key;
k = *(unsigned *) looked_for_key;
if (k < b) {
e = -1;
} else {
if (b < k) {
e = 1;
} else {
e = 0;
}
}
return e;
}
returns 0 if no match was found, non zero otherwise