diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-01 15:06:49 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-11 15:57:51 +0200 |
commit | 71a4899e18295995e0ea13438b4efe9b8ac16d5a (patch) | |
tree | f6a35e0c8431a2ed927baf53c1a83f0734cd56a6 /include | |
parent | 64cc568eda4c72d5e1fc05b5fc3a3792a8f7c22e (diff) | |
download | barebox-71a4899e18295995e0ea13438b4efe9b8ac16d5a.tar.gz barebox-71a4899e18295995e0ea13438b4efe9b8ac16d5a.tar.xz |
env: Make environment variable support optional
Environment variables are only useful in interactive environments.
Make it optional on our way to support a noninteractive barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/environment.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/environment.h b/include/environment.h index 21a7ffa0e2..1f22fcb812 100644 --- a/include/environment.h +++ b/include/environment.h @@ -44,8 +44,20 @@ struct env_context *get_current_context(void); char *var_val(struct variable_d *); char *var_name(struct variable_d *); +#ifdef CONFIG_ENVIRONMENT_VARIABLES const char *getenv(const char *); int setenv(const char *, const char *); +#else +static inline char *getenv(const char *var) +{ + return NULL; +} + +static inline int setenv(const char *var, const char *val) +{ + return 0; +} +#endif int env_pop_context(void); int env_push_context(void); |