printf core: fix gratuitous integer formatting buffer size
[musl] / include / search.h
index 3fa41ad..02e407e 100644 (file)
@@ -5,13 +5,15 @@
 extern "C" {
 #endif
 
+#include <features.h>
+
 #define __NEED_size_t
 #include <bits/alltypes.h>
 
 typedef enum { FIND, ENTER } ACTION;
 typedef enum { preorder, postorder, endorder, leaf } VISIT;
 
-typedef struct {
+typedef struct entry {
        char *key;
        void *data;
 } ENTRY;
@@ -20,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 *);
 
@@ -28,7 +42,7 @@ void *lsearch(const void *, void *, size_t *, size_t,
 void *lfind(const void *, const void *, size_t *, size_t,
        int (*)(const void *, const void *));
 
-void *tdelete(const void *, void **, int(*)(const void *, const void *));
+void *tdelete(const void *__restrict, void **__restrict, 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));
@@ -38,6 +52,8 @@ struct qelem {
        struct qelem *q_forw, *q_back;
        char q_data[1];
 };
+
+void tdestroy(void *, void (*)(void *));
 #endif
 
 #ifdef __cplusplus