1search.h(0P)               POSIX Programmer's Manual              search.h(0P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       search.h — search tables
13

SYNOPSIS

15       #include <search.h>
16

DESCRIPTION

18       The <search.h> header shall define the ENTRY type for  structure  entry
19       which shall include the following members:
20
21
22           char    *key
23           void    *data
24
25       and  shall  define  ACTION  and VISIT as enumeration data types through
26       type definitions as follows:
27
28
29           enum { FIND, ENTER } ACTION;
30           enum { preorder, postorder, endorder, leaf } VISIT;
31
32       The <search.h> header shall define the  size_t  type  as  described  in
33       <sys/types.h>.
34
35       The following shall be declared as functions and may also be defined as
36       macros. Function prototypes shall be provided.
37
38
39           int    hcreate(size_t);
40           void   hdestroy(void);
41           ENTRY *hsearch(ENTRY, ACTION);
42           void   insque(void *, void *);
43           void  *lfind(const void *, const void *, size_t *,
44                     size_t, int (*)(const void *, const void *));
45           void  *lsearch(const void *, void *, size_t *,
46                     size_t, int (*)(const void *, const void *));
47           void   remque(void *);
48           void  *tdelete(const void *restrict, void **restrict,
49                     int(*)(const void *, const void *));
50           void  *tfind(const void *, void *const *,
51                     int(*)(const void *, const void *));
52           void  *tsearch(const void *, void **,
53                     int(*)(const void *, const void *));
54           void   twalk(const void *,
55                     void (*)(const void *, VISIT, int ));
56
57       The following sections are informative.
58

APPLICATION USAGE

60       None.
61

RATIONALE

63       None.
64

FUTURE DIRECTIONS

66       None.
67

SEE ALSO

69       <sys_types.h>
70
71       The System Interfaces  volume  of  POSIX.1‐2017,  hcreate(),  insque(),
72       lsearch(), tdelete()
73
75       Portions  of  this text are reprinted and reproduced in electronic form
76       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
77       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
78       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
79       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
80       event of any discrepancy between this version and the original IEEE and
81       The  Open Group Standard, the original IEEE and The Open Group Standard
82       is the referee document. The original Standard can be  obtained  online
83       at http://www.opengroup.org/unix/online.html .
84
85       Any  typographical  or  formatting  errors that appear in this page are
86       most likely to have been introduced during the conversion of the source
87       files  to  man page format. To report such errors, see https://www.ker
88       nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group                  2017                         search.h(0P)
Impressum