vfs: check userland buffers before reading them.
[haiku.git] / headers / posix / search.h
blob459d558fab99038ff42c6c00148d06040ff5d7d8
1 /*
2 * Copyright 2008-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _SEARCH_H_
6 #define _SEARCH_H_
9 #include <sys/types.h>
12 typedef enum {
13 FIND,
14 ENTER
15 } ACTION;
17 typedef struct entry {
18 char *key;
19 void *data;
20 } ENTRY;
22 typedef enum {
23 preorder,
24 postorder,
25 endorder,
26 leaf
27 } VISIT;
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 extern int hcreate(size_t elementCount);
35 extern void hdestroy(void);
36 extern ENTRY *hsearch(ENTRY iteam, ACTION action);
37 extern void insque(void *element, void *insertAfter);
38 extern void *lfind(const void *key, const void *base, size_t *_elementCount,
39 size_t width, int (*compareFunction)(const void *, const void *));
40 extern void *lsearch(const void *key, void *base, size_t *_elementCount,
41 size_t width, int (*compareFunction)(const void *, const void *));
42 extern void remque(void *element);
43 extern void *tdelete(const void *key, void **_root,
44 int (*compare)(const void *, const void *));
45 extern void *tfind(const void *key, void *const *root,
46 int (*compare)(const void *, const void *));
47 extern void *tsearch(const void *key, void **_root,
48 int (*compare)(const void *, const void *));
49 extern void twalk(const void *root,
50 void (*action)(const void *, VISIT, int ));
52 #ifdef __cplusplus
54 #endif
56 #endif /* _SEARCH_H_ */