summaryrefslogtreecommitdiff
path: root/include/util/env.h
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2023-12-30 11:25:16 +0100
committerErik Reider <[email protected]>2024-01-02 11:21:58 +0100
commit0b52aa9d137b03017313e028accc92dc5d536440 (patch)
tree06649993526e0a339fff34f0ae8b4c8ec2fa4d13 /include/util/env.h
parentb929a2bbadf467864796ad4ec90882ce86cfebff (diff)
Initial rebase without effects
Diffstat (limited to 'include/util/env.h')
-rw-r--r--include/util/env.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/util/env.h b/include/util/env.h
index 6720fa8..e271f4b 100644
--- a/include/util/env.h
+++ b/include/util/env.h
@@ -4,8 +4,20 @@
#include <stdbool.h>
#include <unistd.h>
+/**
+ * Parse a bool from an environment variable.
+ *
+ * On success, the parsed value is returned. On error, false is returned.
+ */
bool env_parse_bool(const char *option);
-ssize_t env_parse_switch(const char *option, const char **switches);
+/**
+ * Pick a choice from an environment variable.
+ *
+ * On success, the choice index is returned. On error, zero is returned.
+ *
+ * switches is a NULL-terminated array.
+ */
+size_t env_parse_switch(const char *option, const char **switches);
#endif