Module Name:    src
Committed By:   christos
Date:           Wed Sep 14 23:34:27 UTC 2011

Modified Files:
        src/include: search.h

Log Message:
add re-entrant versions of the hash api based on the GNU extensions.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/include/search.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/search.h
diff -u src/include/search.h:1.18 src/include/search.h:1.19
--- src/include/search.h:1.18	Wed Jul  6 11:47:15 2005
+++ src/include/search.h	Wed Sep 14 19:34:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $	*/
+/*	$NetBSD: search.h,v 1.19 2011/09/14 23:34:26 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin <[email protected]>
@@ -21,6 +21,15 @@
 	void *data;
 } ENTRY;
 
+#ifdef _NETBSD_SOURCE
+struct _ENTRY;
+struct hsearch_data {
+	struct _ENTRY *table;
+	size_t size;
+	size_t filled;
+};
+#endif
+
 typedef enum {
 	FIND, ENTER
 } ACTION;
@@ -46,10 +55,17 @@
 void	*bsearch(const void *, const void *, size_t, size_t,
 		      int (*)(const void *, const void *));
 #endif /* __BSEARCH_DECLARED */
+
 int	 hcreate(size_t);
 void	 hdestroy(void);
 ENTRY	*hsearch(ENTRY, ACTION);
 
+#ifdef _NETBSD_SOURCE
+int	 hcreate_r(size_t, struct hsearch_data *);
+void	 hdestroy_r(struct hsearch_data *);
+int	 hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
+#endif /* _NETBSD_SOURCE */
+
 void	*lfind(const void *, const void *, size_t *, size_t,
 		      int (*)(const void *, const void *));
 void	*lsearch(const void *, void *, size_t *, size_t,

Reply via email to