Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/include add re-entrant versions of the hash api based on the...
details: https://anonhg.NetBSD.org/src/rev/4c68a576a8db
branches: trunk
changeset: 769574:4c68a576a8db
user: christos <christos%NetBSD.org@localhost>
date: Wed Sep 14 23:34:26 2011 +0000
description:
add re-entrant versions of the hash api based on the GNU extensions.
diffstat:
include/search.h | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diffs (43 lines):
diff -r ed1c32dd4cbc -r 4c68a576a8db include/search.h
--- a/include/search.h Wed Sep 14 23:33:51 2011 +0000
+++ b/include/search.h Wed Sep 14 23:34:26 2011 +0000
@@ -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 <jtc%NetBSD.org@localhost>
@@ -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,
Home |
Main Index |
Thread Index |
Old Index