summaryrefslogtreecommitdiffstats
path: root/include/common.h
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:22 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:55 -0700
commitec8a252cd492a7a409d6912aebeff34bb9e1e1e1 (patch)
tree346bb7bedd1dfe13f531725e7e0edaa2d80df1a8 /include/common.h
parent7afcf3a55b5f484b3d3442053fae8186a3fb92d7 (diff)
downloadtalos-obmc-uboot-ec8a252cd492a7a409d6912aebeff34bb9e1e1e1.tar.gz
talos-obmc-uboot-ec8a252cd492a7a409d6912aebeff34bb9e1e1e1.zip
env: Use getenv_yesno() more generally
Move the getenv_yesno() to env_common.c and change most checks for 'y' or 'n' to use this helper. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index 5e3c5eeee1..d0bf1e8ab2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -340,6 +340,11 @@ int envmatch (uchar *, int);
char *getenv (const char *);
int getenv_f (const char *name, char *buf, unsigned len);
ulong getenv_ulong(const char *name, int base, ulong default_val);
+/*
+ * Read an environment variable as a boolean
+ * Return -1 if variable does not exist (default to true)
+ */
+int getenv_yesno(const char *var);
int saveenv (void);
int setenv (const char *, const char *);
int setenv_ulong(const char *varname, ulong value);
OpenPOWER on IntegriCloud