summaryrefslogtreecommitdiff
path: root/include/search.h
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-03-25 16:37:51 +0000
committerRich Felker <dalias@aerifal.cx>2014-04-02 18:37:45 -0400
commitfe1ba7dbf187e34985896b40d469d84a7a4a98d0 (patch)
tree5a42ee06c3f98d6a150e3294699a32cd02ce0dd2 /include/search.h
parent5446303328adf4b4e36d9fba21848e6feb55fab4 (diff)
downloadmusl-fe1ba7dbf187e34985896b40d469d84a7a4a98d0.tar.gz
musl-fe1ba7dbf187e34985896b40d469d84a7a4a98d0.tar.bz2
musl-fe1ba7dbf187e34985896b40d469d84a7a4a98d0.tar.xz
musl-fe1ba7dbf187e34985896b40d469d84a7a4a98d0.zip
implement hcreate_r, hdestroy_r and hsearch_r
the size and alignment of struct hsearch_data are matched to the glibc definition for binary compatibility. the members of the structure do not match, which should not be a problem as long as applications correctly treat the structure as opaque. unlike the glibc implementation, this version of hcreate_r does not require the caller to zero-fill the structure before use.
Diffstat (limited to 'include/search.h')
-rw-r--r--include/search.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/search.h b/include/search.h
index 27f61072..02e407e3 100644
--- a/include/search.h
+++ b/include/search.h
@@ -22,6 +22,18 @@ int hcreate(size_t);
void hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION);
+#ifdef _GNU_SOURCE
+struct hsearch_data {
+ struct __tab *__tab;
+ unsigned int __unused1;
+ unsigned int __unused2;
+};
+
+int hcreate_r(size_t, struct hsearch_data *);
+void hdestroy_r(struct hsearch_data *);
+int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
+#endif
+
void insque(void *, void *);
void remque(void *);