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 least nel elements. 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 as item. If action is FIND, it returns the item or null if not found. If action is ENTER, 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 for key in base. 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 for key in base. If not found, it appends key to base.
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. rootp should be a single-element list holding the root node, or null if empty. If key is found, it is returned. Otherwise, it is inserted and returned.