Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2013-09-08 11:11:33 +0400
committerYaakov Selkowitz <yselkowi@redhat.com>2013-09-08 11:11:33 +0400
commit45070312d433402354951f6965aea48262faec02 (patch)
tree0c5b6498c4d8af8bc8e763b86cb4945c98f00f1c /newlib/libc/include/search.h
parent3c654cd48ad636775e915d99e6c316fbbe8d221d (diff)
* libc/include/search.h (__compar_fn_t): Add typedef.
(tdelete, tfind, tsearch): Use it. * libc/include/stdlib.h (__compar_fn_t): Add typedef. (bsearch, qsort): Use it.
Diffstat (limited to 'newlib/libc/include/search.h')
-rw-r--r--newlib/libc/include/search.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/newlib/libc/include/search.h b/newlib/libc/include/search.h
index c78ce1841..db2c48f5b 100644
--- a/newlib/libc/include/search.h
+++ b/newlib/libc/include/search.h
@@ -42,6 +42,11 @@ struct hsearch_data
size_t htablesize;
};
+#ifndef __compar_fn_t_defined
+#define __compar_fn_t_defined
+typedef int (*__compar_fn_t) (const void *, const void *);
+#endif
+
__BEGIN_DECLS
int hcreate(size_t);
void hdestroy(void);
@@ -49,10 +54,10 @@ ENTRY *hsearch(ENTRY, ACTION);
int hcreate_r(size_t, struct hsearch_data *);
void hdestroy_r(struct hsearch_data *);
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
-void *tdelete(const void *, void **, int (*)(const void *, const void *));
+void *tdelete(const void *, void **, __compar_fn_t);
void tdestroy (void *, void (*)(void *));
-void *tfind(const void *, void **, int (*)(const void *, const void *));
-void *tsearch(const void *, void **, int (*)(const void *, const void *));
+void *tfind(const void *, void **, __compar_fn_t);
+void *tsearch(const void *, void **, __compar_fn_t);
void twalk(const void *, void (*)(const void *, VISIT, int));
__END_DECLS