aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/tsearch.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-09-06 16:01:56 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-09-06 16:01:56 +0000
commit8731a130e0eee35b2fb4e7db3c4f9c328ca1712c (patch)
treeac995f95bb8ba9950ace7b1f718555878f66d5eb /src/microhttpd/tsearch.h
parent9d25d25ed3eae4a58cdfca4ed80dcee30468f843 (diff)
downloadlibmicrohttpd-8731a130e0eee35b2fb4e7db3c4f9c328ca1712c.tar.gz
libmicrohttpd-8731a130e0eee35b2fb4e7db3c4f9c328ca1712c.zip
Update built-in tsearch replacement
Diffstat (limited to 'src/microhttpd/tsearch.h')
-rw-r--r--src/microhttpd/tsearch.h42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/microhttpd/tsearch.h b/src/microhttpd/tsearch.h
index ec9c92de..94884555 100644
--- a/src/microhttpd/tsearch.h
+++ b/src/microhttpd/tsearch.h
@@ -6,45 +6,19 @@
6 * $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $ 6 * $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $
7 */ 7 */
8 8
9#ifndef _SEARCH_H_ 9#ifndef _TSEARCH_H_
10#define _SEARCH_H_ 10#define _TSEARCH_H_
11 11
12#ifndef _MSC_FULL_VER
13#include <sys/cdefs.h>
14#endif /* _MSC_FULL_VER */
15#if !defined(__BEGIN_DECLS) || !defined(__END_DECLS)
16#if defined(__cplusplus) 12#if defined(__cplusplus)
17#define __BEGIN_DECLS extern "C" { 13extern "C" {
18#define __END_DECLS }; 14#endif /* __cplusplus */
19#else /* !__cplusplus */
20#define __BEGIN_DECLS
21#define __END_DECLS
22#endif /* !__cplusplus */
23#endif /* !__BEGIN_DECLS || !__END_DECLS */
24#include <sys/types.h>
25
26typedef enum {
27 preorder,
28 postorder,
29 endorder,
30 leaf
31} VISIT;
32
33#ifdef _SEARCH_PRIVATE
34typedef struct node {
35 char *key;
36 struct node *llink, *rlink;
37} node_t;
38#endif
39
40__BEGIN_DECLS
41void *tdelete(const void * __restrict, void ** __restrict, 15void *tdelete(const void * __restrict, void ** __restrict,
42 int (*)(const void *, const void *)); 16 int (*)(const void *, const void *));
43void *tfind(const void *, void * const *, 17void *tfind(const void *, void * const *,
44 int (*)(const void *, const void *)); 18 int (*)(const void *, const void *));
45void *tsearch(const void *, void **, int (*)(const void *, const void *)); 19void *tsearch(const void *, void **, int (*)(const void *, const void *));
46void twalk(const void *, void (*)(const void *, VISIT, int)); 20#if defined(__cplusplus)
47void tdestroy(void *, void (*)(void *)); 21};
48__END_DECLS 22#endif /* __cplusplus */
49 23
50#endif /* !_SEARCH_H_ */ 24#endif /* !_TSEARCH_H_ */