#ifndef _SEARCH_H
#define _SEARCH_H
#include <sys/feature_tests.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { FIND, ENTER } ACTION;
#if defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE)
struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
};
#endif
typedef struct entry { char *key, *data; } ENTRY;
int hcreate(size_t);
void hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION);
#if defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) || defined(_XPG4_2)
void insque(void *, void *);
void remque(void *);
#endif
typedef enum { preorder, postorder, endorder, leaf } VISIT;
void *tdelete(const void *_RESTRICT_KYWD, void **_RESTRICT_KYWD,
int (*)(const void *, const void *));
void *tfind(const void *, void *const *, int (*)(const void *, const void *));
void *tsearch(const void *, void **, int (*)(const void *, const void *));
void twalk(const void *, void (*)(const void *, VISIT, int));
#if defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE)
void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
#endif
void *lfind(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *));
void *lsearch(const void *, void *, size_t *, size_t,
int (*)(const void *, const void *));
#ifdef __cplusplus
}
#endif
#endif