The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

search.h - search tables

 SYNOPSIS



#include <search.h>

 DESCRIPTION

The <search.h> header provides a type definition, ENTRY, for structure entry which includes the following members:

char    *key
void    *data

and defines ACTION and VISIT as enumeration data types through type definitions as follows:


enum { FIND, ENTER } ACTION;
enum { preorder, postorder, endorder, leaf } VISIT;

The size_t type is defined as described in <sys/types.h>.

Each of the following is declared as a function, or defined as a macro, or both. Function prototypes must be provided for use with an ISO C compiler.


int    hcreate(size_t);
void   hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION);
void   insque(void *, void *);
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 *));
void   remque(void *);
void  *tdelete(const void *, void **,
          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 ));

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

hsearch(), insque(), lsearch(), remque(), tsearch(), <sys/types.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]