hcreate()
QNX SDP8.0C Library ReferenceAPIDeveloper
Create a hash search table
Synopsis:
#include <search.h>
int hcreate( size_t nel );
Arguments:
- nel
- An estimate of the maximum number of entries that the table will contain. The algorithm might adjust this number upward in order to obtain certain mathematically favorable circumstances.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The hcreate() function allocates space for the hash search table. You must call this function before using hsearch().
The hsearch() and hcreate() functions use malloc() to allocate space.
Only one hash search table may be active at any given time. You can destroy the table by calling hdestroy().
See also The Art of Computer Programming, Volume 3, Sorting and Searching by Donald E. Knuth, published by Addison-Wesley Publishing Company, 1973.
Returns:
0 if there isn't enough space available to allocate the table.
Examples:
See hsearch().
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | No |
Page updated: