X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fsearch.h;h=02e407e3c2aba21b6fe4d015c6430c3155c3db69;hb=4653b98711f280270fa049654460610f587ba7b4;hp=7c4fc583c762956e906f232ec429ad6ff52e03b9;hpb=d197d6421c317145e2aff89dd41de9d03eeaa00b;p=musl diff --git a/include/search.h b/include/search.h index 7c4fc583..02e407e3 100644 --- a/include/search.h +++ b/include/search.h @@ -5,13 +5,15 @@ extern "C" { #endif +#include + #define __NEED_size_t #include 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));