Findsorteddata

void *Findsorteddata(t_sorted *sd,ulong addr,ulong subaddr);

Searches for the item of sorted data containing specified address. Returns pointer to the item or NULL if there is no such item. This function is very fast. Note that returned pointer is volatile, any access to sd other than plain search may reorder or move data. That is, you may make as many calls to Findsorted...() or Getsortedbyindex() as you want, but any call to Addsorteddata(), Deletesorteddata() etc. on the same sorted data descriptor invalidates all obtained data pointers!


Parameters:

sd
(in) Pointer to the structure of type t_sorted, descriptor of sorted data
addr
(in) Address of the searched item
subaddr
(in) 8 low-order bits of the item's extended address, used only if sorted data was created with flag TY_EXTADDR set. Note that when extended addressing is used, size of the item is assumed to be 1 and address of the found item, if any, is always equal to (addr, subaddr)


Return values:

On success, returns pointer to the found item. On error or if there is no matching item, returns NULL.


See also:
Sorted data, t_sorted, Createsorteddata(), Findsorteddatarange(), Findsortedindexrange(), Getsortedbyindex(), Getsortedbyselection(), Sortsorteddata()