summaryrefslogtreecommitdiffstats
path: root/include/search.h
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-10-03 06:31:16 +0000
committermike <mike@FreeBSD.org>2002-10-03 06:31:16 +0000
commit607bcfa63afdf8a99d2232f78123af8c1819c962 (patch)
tree57375697570517123b52d74306627d99b78aebf2 /include/search.h
parent097ed50cd59d2fb3e467494e3b5227fa10dcda32 (diff)
downloadFreeBSD-src-607bcfa63afdf8a99d2232f78123af8c1819c962.zip
FreeBSD-src-607bcfa63afdf8a99d2232f78123af8c1819c962.tar.gz
Fix various style(9) bugs:
o Source ID's in wrong location. o Space used, instead of tab, after typedef. o Unaligned function prototype for twalk(). Other changes: o Add missing const qualifier in tfind(). o Add comment about missing functions.
Diffstat (limited to 'include/search.h')
-rw-r--r--include/search.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/include/search.h b/include/search.h
index e89b0c4..a62f772 100644
--- a/include/search.h
+++ b/include/search.h
@@ -1,9 +1,9 @@
-/* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ */
-/* $FreeBSD$ */
-
-/*
+/*-
* Written by J.T. Conklin <jtc@netbsd.org>
* Public domain.
+ *
+ * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
+ * $FreeBSD$
*/
#ifndef _SEARCH_H_
@@ -17,16 +17,16 @@ typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
-typedef struct entry {
- char *key;
- void *data;
+typedef struct entry {
+ char *key;
+ void *data;
} ENTRY;
-typedef enum {
+typedef enum {
FIND, ENTER
} ACTION;
-typedef enum {
+typedef enum {
preorder,
postorder,
endorder,
@@ -34,7 +34,7 @@ typedef enum {
} VISIT;
#ifdef _SEARCH_PRIVATE
-typedef struct node {
+typedef struct node {
char *key;
struct node *llink, *rlink;
} node_t;
@@ -46,9 +46,13 @@ void hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION);
void *tdelete(const void * __restrict, void ** __restrict,
int (*)(const void *, const void *));
-void *tfind(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));
+void twalk(const void *, void (*)(const void *, VISIT, int));
+/*
+ * XXX missing insque(), lsearch(), remque().
+ */
__END_DECLS
#endif /* !_SEARCH_H_ */
OpenPOWER on IntegriCloud