summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Dörfler <axeld@pinc-software.de>2008-06-06 07:42:58 (GMT)
committerAxel Dörfler <axeld@pinc-software.de>2008-06-06 07:42:58 (GMT)
commit3b2c863f1cc3d306755dd62bd8d2526c4bb46265 (patch)
tree8b06c9d7d091e81319f2840a3ebc9c0a18c765f8
parent4284d925c6e776f4e1c63f5e223bd34834da15f4 (diff)
The "search.h" header had a couple of issues:hrev25818
* It was not self containing, as it used size_t without defining it. * It was not C++ safe. * It used the restrict keyword that is not recognized in GCC2. This fixes bug #2262. * It did not contain parameter names as demanded by our coding style. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25818 a95241bf-73f2-0310-859d-f6bbb57e9c96
-rw-r--r--headers/posix/search.h47
1 files changed, 29 insertions, 18 deletions
diff --git a/headers/posix/search.h b/headers/posix/search.h
index 9680a48..2b286e3 100644
--- a/headers/posix/search.h
+++ b/headers/posix/search.h
@@ -5,6 +5,10 @@
#ifndef _SEARCH_H_
#define _SEARCH_H_
+
+#include <sys/types.h>
+
+
typedef enum {
FIND,
ENTER
@@ -23,23 +27,30 @@ typedef enum {
} VISIT;
-extern int hcreate(size_t);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int hcreate(size_t elementCount);
extern void hdestroy(void);
-extern ENTRY *hsearch(ENTRY, ACTION);
-extern void insque(void *, void *);
-extern void *lfind(const void *, const void *, size_t *,
- size_t, int (*)(const void *, const void *));
-extern void *lsearch(const void *, void *, size_t *,
- size_t, int (*)(const void *, const void *));
-extern void remque(void *);
-extern void *tdelete(const void *restrict, void **restrict,
- int(*)(const void *, const void *));
-extern void *tfind(const void *, void *const *,
- int(*)(const void *, const void *));
-extern void *tsearch(const void *, void **,
- int(*)(const void *, const void *));
-extern void twalk(const void *,
- void (*)(const void *, VISIT, int ));
-
-#endif /* _SEARCH_H_ */
+extern ENTRY *hsearch(ENTRY iteam, ACTION action);
+extern void insque(void *element, void *insertAfter);
+extern void *lfind(const void *key, const void *base, size_t *_elementCount,
+ size_t width, int (*compareFunction)(const void *, const void *));
+extern void *lsearch(const void *key, void *base, size_t *_elementCount,
+ size_t width, int (*compareFunction)(const void *, const void *));
+extern void remque(void *element);
+extern void *tdelete(const void *key, void **_root,
+ int (*compare)(const void *, const void *));
+extern void *tfind(const void *key, void *const *root,
+ int (*compare)(const void *, const void *));
+extern void *tsearch(const void *key, void **_root,
+ int (*compare)(const void *, const void *));
+extern void twalk(const void *root,
+ void (*action)(const void *, VISIT, int ));
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _SEARCH_H_ */