| N F O _ S C A N T U R B O ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English AMIGA - NFO_#?
----------------------------------------------------------------------------
NAME
nfo_scanturbo() - Iterates an array of doubly linked
lists in a fast way.
SYNOPSIS
res = nfo_scanturbo(list, udata, ucode);
LONG nfo_scanturbo(
LONG, void *, void (*)(struct nfo_stu_cb *));
FUNCTION
This func. does the delta scan of a list by accessing
both ends at a time and passing them (nodes) to the CB.
INPUTS
list - An array(table) of pointers to (struct List *)
pointers.
udata - User data pointer (NULL if no data).
ucode - Callback function pointer.
RETURNS
Returns 0 if no stu_ures CB struct. member was altered
by the user.
BASES
None.
NOTES
This func. indeed is faster than regular iteration even
on entry miss since it only needs to do the (LIST / 2)!
In worst case when the entry is located in the middle
of the list it will be as slow as regular iteration but
way faster when the entry is somewhere near bottom and
the top of course.
Processing speed also depends on what will be done in
the CB. Simple address matching may turn out turbo, but
string comparision not necessarily since you will have
to compare two times in a row for head and tail nodes.
Use the QDEV_NFO_STURBO_MATCH() macro to quickly check
given address against both nodes. This macro returns
the node which matches the address.
Use QDEV_NFO_STURBO_BREAK() macro after the successful
match to stop iterator.
Visit 'examples' directory to learn how to properly use
this routine.
SEE ALSO
nfo_scanlist()
EXAMPLE
None.
BUGS
None known.
----------------------------------------------------------------------------
| |
| |