diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-23 12:49:04 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-30 10:28:52 +0200 |
commit | 5ee4ad2229b676ff521a1da9b8b32f474450f56c (patch) | |
tree | 2d5526505b47363b78c1b4fb301d9ef08ebc8067 /commands | |
parent | 28141f9e5a465571cf79505b2fd4b9ae207b9ce3 (diff) | |
download | barebox-5ee4ad2229b676ff521a1da9b8b32f474450f56c.tar.gz barebox-5ee4ad2229b676ff521a1da9b8b32f474450f56c.tar.xz |
environment variables: introduce new helpers
This introduces some new environment variable helpers and updates
the existing ones. Newly introduced are:
getenv_bool: read a bool variable
getenv_ul: read an unsigned long variable
getenev_uint: read an unsigned int variable
getenv_nonempty: like normal getenv, but does return NULL instead of an
empty string
All new helpers take a pointer to the value. This value is only modified
when the variable exists. This allows the following programming scheme:
unsigned int myvalue = sanedefault;
getenv_uint("myvalue", &myvalue);
So without checking the return value myvalue contains the best possible
value.
getenv_ull is updated to this scheme.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
0 files changed, 0 insertions, 0 deletions