summaryrefslogtreecommitdiff
path: root/include/search.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-01 09:47:09 -0600
committerTom Rini <trini@konsulko.com>2019-08-11 16:43:41 -0400
commit3f0d6807459bb22431e5bc19e597c1786b3d1ce6 (patch)
tree4d24e8d74ccea7c9577566d45d94635518a1195a /include/search.h
parentd3716dd64bb8bb4c4ba2d19bac164d24ada72a68 (diff)
env: Drop the ACTION typedef
Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to both the enum and its members to make it clear that these are related to the environment. Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/search.h')
-rw-r--r--include/search.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/search.h b/include/search.h
index c99648f80b..84fc5fd3fd 100644
--- a/include/search.h
+++ b/include/search.h
@@ -19,11 +19,11 @@
#define __set_errno(val) do { errno = val; } while (0)
-/* Action which shall be performed in the call to hsearch. */
-typedef enum {
- FIND,
- ENTER
-} ACTION;
+/* enum env_action: action which shall be performed in the call to hsearch */
+enum env_action {
+ ENV_FIND,
+ ENV_ENTER,
+};
/** struct env_entry - An entry in the environment hashtable */
struct env_entry {
@@ -64,11 +64,11 @@ extern void hdestroy_r(struct hsearch_data *__htab);
/*
* Search for entry matching __item.key in internal hash table. If
- * ACTION is `FIND' return found entry or signal error by returning
- * NULL. If ACTION is `ENTER' replace existing data (if any) with
+ * __action is `ENV_FIND' return found entry or signal error by returning
+ * NULL. If __action is `ENV_ENTER' replace existing data (if any) with
* __item.data.
* */
-extern int hsearch_r(struct env_entry __item, ACTION __action,
+extern int hsearch_r(struct env_entry __item, enum env_action __action,
struct env_entry **__retval, struct hsearch_data *__htab,
int __flag);