diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-11-09 11:11:04 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-11-09 11:11:04 +0100 |
commit | 57e49de5c210c8def6f4957a6f94a62c60f98e52 (patch) | |
tree | a1b62afa190043d947e343ac153dff09f5d93d42 /main.h | |
parent | qlop: allow forcing non-proc running mode using -rr for testing (diff) | |
download | portage-utils-57e49de5c210c8def6f4957a6f94a62c60f98e52.tar.gz portage-utils-57e49de5c210c8def6f4957a6f94a62c60f98e52.tar.bz2 portage-utils-57e49de5c210c8def6f4957a6f94a62c60f98e52.zip |
q: add option to print envvars, much like portageq envvar
Option -e to q will dump the env variables used by portage-utils.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -14,15 +14,16 @@ # include "config.h" /* make sure we have EPREFIX, if set */ #endif +#include <errno.h> +#include <limits.h> +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <errno.h> -#include <stdint.h> -#include <limits.h> -#include "i18n.h" #include "colors.h" +#include "i18n.h" extern const char *argv0; @@ -134,4 +135,18 @@ extern FILE *warnout; #define errp(fmt, args...) _err(warnp, fmt , ## args) #define errfp(fmt, args...) _err(warnfp, fmt, ## args) +typedef enum { _Q_BOOL, _Q_STR, _Q_ISTR } var_types; +typedef struct { + const char *name; + const size_t name_len; + const var_types type; + union { + char **s; + bool *b; + } value; + size_t value_len; + const char *default_value; +} env_vars; +extern env_vars vars_to_read[]; + #endif |