diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-01 14:53:14 -0400 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-01 14:53:14 -0400 |
| commit | ddcf611815c145b1fadca042e65648a7a81cc497 (patch) | |
| tree | 9e11e5a372f2df528d162d17050eada50ad1db56 /include/variables.h | |
| parent | 406889ed5c780f0e28703b143c72bbf035280b25 (diff) | |
| download | hush-ddcf611815c145b1fadca042e65648a7a81cc497.tar.gz | |
Added variable support
Diffstat (limited to 'include/variables.h')
| -rw-r--r-- | include/variables.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/variables.h b/include/variables.h new file mode 100644 index 0000000..7511690 --- /dev/null +++ b/include/variables.h @@ -0,0 +1,29 @@ +/* + * + */ +#ifndef H_HUSH_VARIABLES +#define H_HUSH_VARIABLES + +#include <stdbool.h> +#include <stdlib.h> +#include <stdio.h> + +#include "strmap.h" +#include "hashfuncs.h" + +static inline bool is_variable(const char *token) { + return (token) ? token[0] == '$' : false; +} + +bool init_variable_store(void); + +bool add_variable(const char *key, const char *val); + +const char *get_variable(const char *key); + +bool promote_variable_to_env(const char *key); + +void destroy_variable_store(); + + +#endif |