1 /* g13.h - Global definitions for G13.
2 * Copyright (C) 2009 Free Software Foundation, Inc.
3 * Copyright (C) 2009, 2015 Werner Koch.
5 * This file is part of GnuPG.
7 * GnuPG is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuPG is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <https://www.gnu.org/licenses/>.
24 #ifdef GPG_ERR_SOURCE_DEFAULT
25 #error GPG_ERR_SOURCE_DEFAULT already defined
27 #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_G13
28 #include <gpg-error.h>
30 #include "../common/util.h"
31 #include "../common/status.h"
32 #include "../common/session-env.h"
33 #include "../common/strlist.h"
36 /* Debug values and macros. */
37 #define DBG_MOUNT_VALUE 1 /* Debug mount or device stuff. */
38 #define DBG_CRYPTO_VALUE 4 /* Debug low level crypto. */
39 #define DBG_MEMORY_VALUE 32 /* Debug memory allocation stuff. */
40 #define DBG_MEMSTAT_VALUE 128 /* Show memory statistics. */
41 #define DBG_IPC_VALUE 1024 /* Debug assuan communication. */
43 #define DBG_MOUNT (opt.debug & DBG_MOUNT_VALUE)
44 #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE)
45 #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE)
46 #define DBG_IPC (opt.debug & DBG_IPC_VALUE)
48 /* A large struct named "opt" to keep global flags. Note that this
49 struct is used by g13 and g13-syshelp and thus some fields may only
50 make sense for one of them. */
53 unsigned int debug; /* Debug flags (DBG_foo_VALUE). */
54 int verbose; /* Verbosity level. */
55 int quiet; /* Be as quiet as possible. */
56 int dry_run; /* Don't change any persistent data. */
58 const char *config_filename; /* Name of the used config file. */
60 /* Filename of the AGENT program. */
61 const char *agent_program;
63 /* Filename of the GPG program. Unless set via an program option it
64 is initialzed at the first engine startup to the standard gpg
66 const char *gpg_program;
68 /* GPG arguments. XXX: Currently it is not possible to set them. */
69 strlist_t gpg_arguments;
71 /* Environment variables passed along to the engine. */
78 char *pinentry_user_data;
79 session_env_t session_env;
81 /* Name of the output file - FIXME: what is this? */
87 /*-- g13-common.c --*/
88 void g13_init_signals (void);
89 void g13_install_emergency_cleanup (void);
90 void g13_exit (int rc);
92 /*-- server.c and g13-sh-cmd.c --*/
93 gpg_error_t g13_status (ctrl_t ctrl, int no, ...) GPGRT_ATTR_SENTINEL(0);
96 #endif /*G13_COMMON_H*/