StdcSearch extension
Extension providing <search.h> functionality.
- on
Properties
- ENTER → int
-
Available on Stdc, provided by the StdcSearch extension
Enter an entry into the table.no setter - FIND → int
-
Available on Stdc, provided by the StdcSearch extension
Find an entry in the table.no setter
Methods
-
hcreate(
int nel) → int -
Available on Stdc, provided by the StdcSearch extension
Creates a hash table with at leastnelelements. Returns 0 on error, non-zero on success. -
hdestroy(
) → void -
Available on Stdc, provided by the StdcSearch extension
Destroys the hash table. -
hsearch(
ENTRY item, int action) → ENTRY? -
Available on Stdc, provided by the StdcSearch extension
Searches the hash table for an item with the same key asitem. IfactionisFIND, it returns the item or null if not found. IfactionisENTER, it inserts the item and returns it. -
lfind(
dynamic key, List base, int compar(dynamic, dynamic)) → dynamic -
Available on Stdc, provided by the StdcSearch extension
Performs a linear search forkeyinbase. Returns null if not found. -
lsearch(
dynamic key, List base, int compar(dynamic, dynamic)) → dynamic -
Available on Stdc, provided by the StdcSearch extension
Performs a linear search forkeyinbase. If not found, it appendskeytobase. -
tfind(
dynamic key, List rootp, int compar(dynamic, dynamic)) → dynamic -
Available on Stdc, provided by the StdcSearch extension
Binary tree find. -
tsearch(
dynamic key, List rootp, int compar(dynamic, dynamic)) → dynamic -
Available on Stdc, provided by the StdcSearch extension
Binary tree search.rootpshould be a single-element list holding the root node, or null if empty. Ifkeyis found, it is returned. Otherwise, it is inserted and returned.