2 * Copyright (C) 2000 Werner Koch (dd9jn)
3 * Copyright (C) 2001, 2002 g10 Code GmbH
5 * This file is part of GPGME.
7 * GPGME 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 * GPGME 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
29 struct key_queue_item_s {
30 struct key_queue_item_s *next;
33 struct trust_queue_item_s {
34 struct trust_queue_item_s *next;
39 /* Currently we need it at several places, so we put the definition
40 * into this header file */
41 struct gpgme_context_s
44 /* A gpg request is still pending. */
49 /* At some points we need to remember an error which we can't report
52 /* Cancel operation requested. */
55 /* The running engine process. */
58 /* Level of verbosity to use. */
65 /* The number of keys in signers. */
67 /* Size of the following array. */
74 DecryptResult decrypt;
76 EncryptResult encrypt;
77 PassphraseResult passphrase;
83 /* Last signature notation. */
85 /* Last operation info. */
88 /* Used by keylist.c. */
90 /* Something new is available. */
91 volatile int key_cond;
92 struct key_queue_item_s *key_queue;
93 struct trust_queue_item_s *trust_queue;
95 GpgmePassphraseCb passphrase_cb;
96 void *passphrase_cb_value;
98 GpgmeProgressCb progress_cb;
99 void *progress_cb_value;
101 GpgmeData help_data_1;
105 struct gpgme_data_s {
110 GpgmeDataEncoding encoding;
112 int (*read_cb)( void *, char *, size_t, size_t *);
119 char *private_buffer;
123 struct user_id_s *next;
124 unsigned int revoked:1;
125 unsigned int invalid:1;
126 GpgmeValidity validity;
127 const char *name_part; /* all 3 point into strings behind name */
128 const char *email_part; /* or to read-only strings */
129 const char *comment_part;
133 struct gpgme_recipients_s {
134 struct user_id_s *list;
135 int checked; /* wether the recipients are all valid */
139 #define fail_on_pending_request(c) \
141 if (!(c)) return GPGME_Invalid_Value; \
142 if ((c)->pending) return GPGME_Busy; \
145 #define wait_on_request_or_fail(c) \
147 if (!(c)) return GPGME_Invalid_Value;\
148 if (!(c)->pending) return GPGME_No_Request; \
149 gpgme_wait ((c), 1); \
152 #endif /* CONTEXT_H */