diff options
author | axel <axel@liljencrantz.se> | 2006-06-05 06:14:51 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-06-05 06:14:51 +1000 |
commit | 04b142208d6a62a24cc067df437e0af4b8a1f4ca (patch) | |
tree | b7af8ff58df2acc3587dc4fb665ca082373108fe /env.h | |
parent | cf35a8e3a5ee724f12f13175d81d89b8d74c997c (diff) |
Make it possible to specify scope of a variable to be erased or tested. Also make sure set exits with a non-zero exit status when erasing fails.
darcs-hash:20060604201451-ac50b-4ea0212c513b33be40559dfe8d65c1446c53f682.gz
Diffstat (limited to 'env.h')
-rw-r--r-- | env.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -91,16 +91,21 @@ wchar_t *env_get( const wchar_t *key ); /** Returns 1 if the specified key exists. This can't be reliable done using env_get, since env_get returns null for 0-element arrays + + \param key The name of the variable to remove + \param mode the scope to search in. All scopes are searched if unset */ -int env_exist( const wchar_t *key ); +int env_exist( const wchar_t *key, int mode ); /** Remove environemnt variable \param key The name of the variable to remove - \param mode should be ENV_USER if this is a remove request from the user, 0 otherwise. If this is a user request, read-only variables can not be removed. + \param mode should be ENV_USER if this is a remove request from the user, 0 otherwise. If this is a user request, read-only variables can not be removed. The mode may also specify the scope of the variable that should be erased. + + \return zero if the variable existed, and non-zero if the variable did not exist */ -void env_remove( const wchar_t *key, int mode ); +int env_remove( const wchar_t *key, int mode ); /** Push the variable stack. Used for implementing local variables for functions and for-loops. |