aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-11-09 11:11:04 +0100
committerFabian Groffen <grobian@gentoo.org>2019-11-09 11:11:04 +0100
commit57e49de5c210c8def6f4957a6f94a62c60f98e52 (patch)
treea1b62afa190043d947e343ac153dff09f5d93d42 /main.h
parentqlop: allow forcing non-proc running mode using -rr for testing (diff)
downloadportage-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.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/main.h b/main.h
index 88412a8..ad1467b 100644
--- a/main.h
+++ b/main.h
@@ -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