summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-12-08 06:26:04 -0500
committerWolfgang Denk <wd@denx.de>2010-12-17 21:07:14 +0100
commit2eb1573f01710832bbe60a4ece89cb301727612a (patch)
treeec940c57d350c16c567a8c2a865860e4a5ff4bb2 /include
parentc22a711d249b2b9ee39fe11bcee15ee4dbe3bf09 (diff)
downloadu-boot-imx-2eb1573f01710832bbe60a4ece89cb301727612a.zip
u-boot-imx-2eb1573f01710832bbe60a4ece89cb301727612a.tar.gz
u-boot-imx-2eb1573f01710832bbe60a4ece89cb301727612a.tar.bz2
hashtable: drop all non-reentrant versions
The non-reentrant versions of the hashtable functions operate on a single shared hashtable. So if two different people try using these funcs for two different purposes, they'll cause problems for the other. Avoid this by converting all existing hashtable consumers over to the reentrant versions and then punting the non-reentrant ones. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include')
-rw-r--r--include/environment.h8
-rw-r--r--include/search.h18
2 files changed, 9 insertions, 17 deletions
diff --git a/include/environment.h b/include/environment.h
index bedbc54..082b3e1 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -149,6 +149,12 @@ typedef struct environment_s {
unsigned char data[ENV_SIZE]; /* Environment data */
} env_t;
+#ifndef DO_DEPS_ONLY
+
+#include <search.h>
+
+extern struct hsearch_data env_htab;
+
/* Function that returns a character from the environment */
unsigned char env_get_char (int);
@@ -165,4 +171,6 @@ void set_default_env(const char *s);
/* Import from binary representation into hash table */
int env_import(const char *buf, int check);
+#endif
+
#endif /* _ENVIRONMENT_H_ */
diff --git a/include/search.h b/include/search.h
index fccc757..81ced7f 100644
--- a/include/search.h
+++ b/include/search.h
@@ -32,15 +32,6 @@
#define __set_errno(val) do { errno = val; } while (0)
-/*
- * Prototype structure for a linked-list data structure.
- * This is the type used by the `insque' and `remque' functions.
- */
-
-/* For use with hsearch(3). */
-typedef int (*__compar_fn_t) (__const void *, __const void *);
-typedef __compar_fn_t comparison_fn_t;
-
/* Action which shall be performed in the call the hsearch. */
typedef enum {
FIND,
@@ -69,11 +60,9 @@ struct hsearch_data {
};
/* Create a new hashing table which will at most contain NEL elements. */
-extern int hcreate(size_t __nel);
extern int hcreate_r(size_t __nel, struct hsearch_data *__htab);
/* Destroy current internal hashing table. */
-extern void hdestroy(void);
extern void hdestroy_r(struct hsearch_data *__htab);
/*
@@ -82,25 +71,20 @@ extern void hdestroy_r(struct hsearch_data *__htab);
* NULL. If ACTION is `ENTER' replace existing data (if any) with
* ITEM.data.
* */
-extern ENTRY *hsearch(ENTRY __item, ACTION __action);
extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY ** __retval,
struct hsearch_data *__htab);
/* Search and delete entry matching ITEM.key in internal hash table. */
-extern int hdelete(const char *__key);
extern int hdelete_r(const char *__key, struct hsearch_data *__htab);
-extern ssize_t hexport(const char __sep, char **__resp, size_t __size);
extern ssize_t hexport_r(struct hsearch_data *__htab,
const char __sep, char **__resp, size_t __size);
-extern int himport(const char *__env, size_t __size, const char __sep,
- int __flag);
extern int himport_r(struct hsearch_data *__htab,
const char *__env, size_t __size, const char __sep,
int __flag);
-/* Flags for himport() / himport_r() */
+/* Flags for himport_r() */
#define H_NOCLEAR 1 /* do not clear hash table before importing */
#endif /* search.h */