aboutsummaryrefslogtreecommitdiffhomepage
path: root/env_universal_common.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-06-13 15:15:11 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-06-13 15:15:11 -0700
commit735195e8ea99d747e92a71b9b0233948e5de60fa (patch)
treee4229b05ee3596bd6ed50747889228398e5b18ba /env_universal_common.h
parent17c2d76c5ec935ab320badee834260bd3a5a4340 (diff)
Teach env_universal_remove to directly report whether the variable was
successfully removed.
Diffstat (limited to 'env_universal_common.h')
-rw-r--r--env_universal_common.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/env_universal_common.h b/env_universal_common.h
index a802f81f..ced45994 100644
--- a/env_universal_common.h
+++ b/env_universal_common.h
@@ -60,15 +60,9 @@ void env_universal_common_get_names(wcstring_list_t &lst,
void env_universal_common_set(const wchar_t *key, const wchar_t *val, bool exportv);
/**
- Remove the specified variable.
-
- This function operate agains the local copy of all universal
- variables, it does not communicate with any other process.
-
- Do not call this function. Create a message to do it. This function
- is only to be used when fishd is dead.
+ Remove the specified variable. Returns true if it was removed, false if it was not found.
*/
-void env_universal_common_remove(const wcstring &key);
+bool env_universal_common_remove(const wcstring &key);
/**
Get the value of the variable with the specified name
@@ -113,7 +107,7 @@ class env_universal_t
void parse_message_internal(wchar_t *msg, callback_data_list_t *callbacks);
void set_internal(const wcstring &key, const wcstring &val, bool exportv, bool overwrite);
- void remove_internal(const wcstring &name, bool overwrite);
+ bool remove_internal(const wcstring &name);
/* Functions concerned with saving */
bool open_and_acquire_lock(const wcstring &path, int *out_fd);
@@ -139,8 +133,8 @@ public:
/* Sets a variable */
void set(const wcstring &key, const wcstring &val, bool exportv);
- /* Removes a variable */
- void remove(const wcstring &name);
+ /* Removes a variable. Returns true if it was found, false if not. */
+ bool remove(const wcstring &name);
/* Gets variable names */
wcstring_list_t get_names(bool show_exported, bool show_unexported) const;