2005-04-15 Marcus Brinkmann <marcus@g10code.de>
[gnupg.git] / g10 / options.h
bloba4cbc38341f9b561b8d8c99137b997dffb6dc25b
1 /* options.h
2 * Copyright (C) 1998, 1999, 2000, 2001, 2002,
3 * 2003 Free Software Foundation, Inc.
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 2 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, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 #ifndef G10_OPTIONS_H
22 #define G10_OPTIONS_H
24 #include <types.h>
25 #include "main.h"
26 #include "packet.h"
28 #undef ENABLE_COMMENT_PACKETS /* don't create comment packets */
30 #ifndef EXTERN_UNLESS_MAIN_MODULE
31 /* Norcraft can't cope with common symbols */
32 #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
33 #define EXTERN_UNLESS_MAIN_MODULE extern
34 #else
35 #define EXTERN_UNLESS_MAIN_MODULE
36 #endif
37 #endif
39 EXTERN_UNLESS_MAIN_MODULE
40 struct {
41 int verbose;
42 int quiet;
43 unsigned debug;
44 int armor;
45 int compress;
46 char *outfile;
47 int dry_run;
48 int list_only;
49 int textmode;
50 int expert;
51 int ask_sig_expire;
52 int ask_cert_expire;
53 int batch; /* run in batch mode */
54 int answer_yes; /* answer yes on most questions */
55 int answer_no; /* answer no on most questions */
56 int check_sigs; /* check key signatures */
57 int with_colons;
58 int with_key_data;
59 int with_fingerprint; /* opt --with-fingerprint active */
60 int fingerprint; /* list fingerprints */
61 int list_sigs; /* list signatures */
62 int no_armor;
63 int list_packets; /* list-packets mode: 1=normal, 2=invoked by command*/
64 int def_cipher_algo;
65 int force_v3_sigs;
66 int force_v4_certs;
67 int force_mdc;
68 int disable_mdc;
69 int def_digest_algo;
70 int cert_digest_algo;
71 int def_compress_algo;
72 const char *def_secret_key;
73 char *def_recipient;
74 int def_recipient_self;
75 int def_cert_check_level;
76 int sk_comments;
77 int no_version;
78 int marginals_needed;
79 int completes_needed;
80 int max_cert_depth;
81 const char *homedir;
82 const char *agent_program;
83 char *display; /* 5 options to be passed to the gpg-agent */
84 char *ttyname;
85 char *ttytype;
86 char *lc_ctype;
87 char *lc_messages;
89 int skip_verify;
90 int compress_keys;
91 int compress_sigs;
92 /* TM_CLASSIC must be zero to accomodate trustdbs generated before
93 we started storing the trust model inside the trustdb. */
94 enum {TM_CLASSIC=0, TM_PGP=1, TM_ALWAYS, TM_AUTO} trust_model;
95 unsigned int force_ownertrust;
96 enum
98 CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
99 } compliance;
100 int pgp2_workarounds;
101 unsigned int emulate_bugs; /* bug emulation flags EMUBUG_xxxx */
102 int shm_coprocess;
103 const char *set_filename;
104 STRLIST comments;
105 int throw_keyid;
106 const char *photo_viewer;
107 int s2k_mode;
108 int s2k_digest_algo;
109 int s2k_cipher_algo;
110 int simple_sk_checksum; /* create the deprecated rfc2440 secret
111 key protection*/
112 int not_dash_escaped;
113 int escape_from;
114 int lock_once;
115 char *keyserver_uri;
116 char *keyserver_scheme;
117 char *keyserver_host;
118 char *keyserver_port;
119 char *keyserver_opaque;
120 struct
122 int verbose;
123 int include_revoked;
124 int include_disabled;
125 int include_subkeys;
126 int honor_http_proxy;
127 int broken_http_proxy;
128 int use_temp_files;
129 int keep_temp_files;
130 int fake_v3_keyids;
131 int auto_key_retrieve;
132 int try_dns_srv;
133 unsigned int import_options;
134 unsigned int export_options;
135 STRLIST other;
136 } keyserver_options;
137 int exec_disable;
138 int exec_path_set;
139 unsigned int import_options;
140 unsigned int export_options;
141 unsigned int list_options;
142 unsigned int verify_options;
143 char *def_preference_list;
144 prefitem_t *personal_cipher_prefs;
145 prefitem_t *personal_digest_prefs;
146 prefitem_t *personal_compress_prefs;
147 int no_perm_warn;
148 int no_mdc_warn;
149 char *temp_dir;
150 int no_encrypt_to;
151 int interactive;
152 STRLIST sig_notation_data;
153 STRLIST cert_notation_data;
154 STRLIST sig_policy_url;
155 STRLIST cert_policy_url;
156 STRLIST sig_keyserver_url;
157 int use_embedded_filename;
158 int allow_non_selfsigned_uid;
159 int allow_freeform_uid;
160 int no_literal;
161 ulong set_filesize;
162 int fast_list_mode;
163 int fixed_list_mode;
164 int ignore_time_conflict;
165 int ignore_valid_from;
166 int ignore_crc_error;
167 int ignore_mdc_error;
168 int command_fd;
169 const char *override_session_key;
170 int show_session_key;
171 int use_agent;
172 const char *gpg_agent_info;
173 int merge_only;
174 int try_all_secrets;
175 int no_expensive_trust_checks;
176 int no_sig_cache;
177 int no_sig_create_check;
178 int no_auto_check_trustdb;
179 int preserve_permissions;
180 int no_homedir_creation;
181 struct groupitem *grouplist;
182 int strict;
183 int mangle_dos_filenames;
184 int enable_progress_filter;
185 } opt;
188 #define EMUBUG_MDENCODE 4
190 #define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
191 #define DBG_MPI_VALUE 2 /* debug mpi details */
192 #define DBG_CIPHER_VALUE 4 /* debug cipher handling */
193 /* (may reveal sensitive data) */
194 #define DBG_FILTER_VALUE 8 /* debug internal filter handling */
195 #define DBG_IOBUF_VALUE 16 /* debug iobuf stuff */
196 #define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */
197 #define DBG_CACHE_VALUE 64 /* debug the cacheing */
198 #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */
199 #define DBG_TRUST_VALUE 256 /* debug the trustdb */
200 #define DBG_HASHING_VALUE 512 /* debug hashing operations */
201 #define DBG_EXTPROG_VALUE 1024 /* debug external program calls */
204 #define DBG_PACKET (opt.debug & DBG_PACKET_VALUE)
205 #define DBG_CIPHER (opt.debug & DBG_CIPHER_VALUE)
206 #define DBG_FILTER (opt.debug & DBG_FILTER_VALUE)
207 #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)
208 #define DBG_TRUST (opt.debug & DBG_TRUST_VALUE)
209 #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE)
210 #define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
212 #define GNUPG (opt.compliance==CO_GNUPG)
213 #define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
214 #define RFC2440 (opt.compliance==CO_RFC2440)
215 #define PGP2 (opt.compliance==CO_PGP2)
216 #define PGP6 (opt.compliance==CO_PGP6)
217 #define PGP7 (opt.compliance==CO_PGP7)
218 #define PGP8 (opt.compliance==CO_PGP8)
220 /* Various option flags */
222 #define IMPORT_ALLOW_LOCAL_SIGS 1
223 #define IMPORT_REPAIR_PKS_SUBKEY_BUG 2
224 #define IMPORT_FAST_IMPORT 4
225 #define IMPORT_SK2PK 8
227 #define EXPORT_INCLUDE_NON_RFC 1
228 #define EXPORT_INCLUDE_LOCAL_SIGS 2
229 #define EXPORT_INCLUDE_ATTRIBUTES 4
230 #define EXPORT_INCLUDE_SENSITIVE_REVKEYS 8
231 #define EXPORT_SEXP_FORMAT 16
234 #define LIST_SHOW_PHOTOS 1
235 #define LIST_SHOW_POLICY 2
236 #define LIST_SHOW_NOTATION 4
237 #define LIST_SHOW_KEYSERVER 8
238 #define LIST_SHOW_VALIDITY 16
239 #define LIST_SHOW_LONG_KEYID 32
240 #define LIST_SHOW_KEYRING 64
241 #define LIST_SHOW_SIG_EXPIRE 128
244 #define VERIFY_SHOW_PHOTOS 1
245 #define VERIFY_SHOW_POLICY 2
246 #define VERIFY_SHOW_NOTATION 4
247 #define VERIFY_SHOW_KEYSERVER 8
248 #define VERIFY_SHOW_VALIDITY 16
249 #define VERIFY_SHOW_LONG_KEYID 32
251 #endif /*G10_OPTIONS_H*/