June 2001
Intermediate to advanced
688 pages
19h 18m
English
#define DB_DBM_HSEARCH 1 #include <db.h> typedef enum { FIND, ENTER } ACTION; typedef struct entry { char *key; void *data; } ENTRY; ENTRY * hsearch(ENTRY item, ACTION action); int hcreate(size_t nelem); void hdestroy(void);
The hsearch interface to the Berkeley DB library is intended to provide a high-performance implementation and source code compatibility for applications written to the historic hsearch interface. It is not recommended for any other purpose.
To compile hsearch applications, replace the application’s #include of the hsearch include file (for example, #include <search.h>) with the following two lines:
#define DB_DBM_HSEARCH 1 #include <db.h>
and recompile.
The hcreate function creates an in-memory database. ...