aboutsummaryrefslogtreecommitdiff
path: root/cmd
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 /cmd
parentd3716dd64bb8bb4c4ba2d19bac164d24ada72a68 (diff)
downloadu-boot-3f0d6807459bb22431e5bc19e597c1786b3d1ce6.zip
u-boot-3f0d6807459bb22431e5bc19e597c1786b3d1ce6.tar.gz
u-boot-3f0d6807459bb22431e5bc19e597c1786b3d1ce6.tar.bz2
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 'cmd')
-rw-r--r--cmd/nvedit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 995b6b3..8e85722 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -98,7 +98,7 @@ static int env_print(char *name, int flag)
e.key = name;
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, flag);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, flag);
if (ep == NULL)
return 0;
len = printf("%s=%s\n", ep->key, ep->data);
@@ -288,7 +288,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
e.key = name;
e.data = value;
- hsearch_r(e, ENTER, &ep, &env_htab, env_flag);
+ hsearch_r(e, ENV_ENTER, &ep, &env_htab, env_flag);
free(value);
if (!ep) {
printf("## Error inserting \"%s\" variable, errno=%d\n",
@@ -668,7 +668,7 @@ char *env_get(const char *name)
e.key = name;
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, 0);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, 0);
return ep ? ep->data : NULL;
}
@@ -1269,7 +1269,7 @@ static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
e.key = argv[1];
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, 0);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, 0);
return (ep == NULL) ? 1 : 0;
}