aboutsummaryrefslogtreecommitdiffstats
path: root/g13/g13.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-09-14 16:49:32 +0000
committerWerner Koch <[email protected]>2015-09-16 17:03:09 +0000
commit9e65bbd255c43f0e59f35b0003052234d69042be (patch)
treea293935c8200394d7c2871d1cbbcc6dad74c5c7d /g13/g13.h
parentgpg: Fix skip function dummy parameter. (diff)
downloadgnupg-9e65bbd255c43f0e59f35b0003052234d69042be.tar.gz
gnupg-9e65bbd255c43f0e59f35b0003052234d69042be.zip
g13: Move some code to a separate module.
* g13/g13-common.c, g13/g13-common.h: New. * g13/Makefile.am (g13_SOURCES): Add new files. * g13/g13.c (g13_errors_seen): Move to g13-common.c. (cmdline_conttype): New. (main): Use g13_init_signals and g13_install_emergency_cleanup. (emergency_cleanup, g13_exit): Move to g13-common.c. * g13/g13.h: Move OPT and some other code to g13-common.h. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g13/g13.h')
-rw-r--r--g13/g13.h62
1 files changed, 1 insertions, 61 deletions
diff --git a/g13/g13.h b/g13/g13.h
index c7668132d..303c84bd0 100644
--- a/g13/g13.h
+++ b/g13/g13.h
@@ -20,62 +20,8 @@
#ifndef G13_H
#define G13_H
-#ifdef GPG_ERR_SOURCE_DEFAULT
-#error GPG_ERR_SOURCE_DEFAULT already defined
-#endif
-#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_G13
-#include <gpg-error.h>
+#include "g13-common.h"
-#include "../common/util.h"
-#include "../common/status.h"
-#include "../common/session-env.h"
-
-/* A large struct named "opt" to keep global flags. */
-struct
-{
- unsigned int debug; /* Debug flags (DBG_foo_VALUE). */
- int verbose; /* Verbosity level. */
- int quiet; /* Be as quiet as possible. */
- int dry_run; /* Don't change any persistent data. */
-
- const char *homedir; /* Configuration directory name. */
- const char *config_filename; /* Name of the used config file. */
-
- /* Filename of the AGENT program. */
- const char *agent_program;
-
- /* Filename of the GPG program. Unless set via an program option it
- is initialzed at the first engine startup to the standard gpg
- filename. */
- const char *gpg_program;
-
- /* Environment variables passed along to the engine. */
- char *display;
- char *ttyname;
- char *ttytype;
- char *lc_ctype;
- char *lc_messages;
- char *xauthority;
- char *pinentry_user_data;
- session_env_t session_env;
-
- /* Name of the output file - FIXME: what is this? */
- const char *outfile;
-
-} opt;
-
-
-/* Debug values and macros. */
-#define DBG_MOUNT_VALUE 1 /* Debug mount or device stuff. */
-#define DBG_CRYPTO_VALUE 4 /* Debug low level crypto. */
-#define DBG_MEMORY_VALUE 32 /* Debug memory allocation stuff. */
-#define DBG_MEMSTAT_VALUE 128 /* Show memory statistics. */
-#define DBG_IPC_VALUE 1024 /* Debug assuan communication. */
-
-#define DBG_MOUNT (opt.debug & DBG_MOUNT_VALUE)
-#define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE)
-#define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE)
-#define DBG_IPC (opt.debug & DBG_IPC_VALUE)
/* Forward declaration for an object defined in server.c. */
struct server_local_s;
@@ -100,13 +46,7 @@ struct server_control_s
};
-
/*-- g13.c --*/
-void g13_exit (int rc);
void g13_init_default_ctrl (struct server_control_s *ctrl);
-/*-- server.c (commonly used, thus declared here) --*/
-gpg_error_t g13_status (ctrl_t ctrl, int no, ...) GPGRT_ATTR_SENTINEL(0);
-
-
#endif /*G13_H*/