1 /* ops.h - Internal operation support.
2 Copyright (C) 2000 Werner Koch (dd9jn)
3 Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
5 This file is part of GPGME.
7 GPGME is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of
10 the License, or (at your option) any later version.
12 GPGME is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
30 gpgme_error_t _gpgme_cancel_with_err (gpgme_ctx_t ctx, gpg_error_t ctx_err,
32 /* Clear all notation data from the context. */
33 void _gpgme_sig_notation_clear (gpgme_ctx_t ctx);
35 void _gpgme_release_result (gpgme_ctx_t ctx);
39 gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);
40 gpgme_error_t _gpgme_wait_one_ext (gpgme_ctx_t ctx, gpgme_error_t *op_err);
41 gpgme_error_t _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond,
42 gpgme_error_t *op_err);
46 gpgme_error_t _gpgme_data_inbound_handler (void *opaque, int fd);
47 gpgme_error_t _gpgme_data_outbound_handler (void *opaque, int fd);
50 /* From op-support.c. */
52 /* Find or create the op data object of type TYPE. */
53 gpgme_error_t _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type,
54 void **hook, int size,
55 void (*cleanup) (void *));
57 /* Prepare a new operation on CTX. */
58 gpgme_error_t _gpgme_op_reset (gpgme_ctx_t ctx, int synchronous);
60 /* Parse the INV_RECP status line in ARGS and return the result in
62 gpgme_error_t _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key);
64 /* Parse the PLAINTEXT status line in ARGS and return the result in
66 gpgme_error_t _gpgme_parse_plaintext (char *args, char **filenamep);
71 gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx);
72 gpgme_error_t _gpgme_verify_status_handler (void *priv,
73 gpgme_status_code_t code,
78 gpgme_error_t _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx);
79 gpgme_error_t _gpgme_decrypt_status_handler (void *priv,
80 gpgme_status_code_t code,
85 void _gpgme_signers_clear (gpgme_ctx_t ctx);
89 /* Create an initial op data object for signing. Needs to be called
90 once before calling _gpgme_sign_status_handler. */
91 gpgme_error_t _gpgme_op_sign_init_result (gpgme_ctx_t ctx);
93 /* Process a status line for signing operations. */
94 gpgme_error_t _gpgme_sign_status_handler (void *priv,
95 gpgme_status_code_t code,
101 /* Create an initial op data object for encrypt. Needs to be called
102 once before calling _gpgme_encrypt_status_handler. */
103 gpgme_error_t _gpgme_op_encrypt_init_result (gpgme_ctx_t ctx);
105 /* Process a status line for encryption operations. */
106 gpgme_error_t _gpgme_encrypt_status_handler (void *priv,
107 gpgme_status_code_t code,
111 /* From passphrase.c. */
112 gpgme_error_t _gpgme_passphrase_status_handler (void *priv,
113 gpgme_status_code_t code,
115 gpgme_error_t _gpgme_passphrase_command_handler (void *opaque,
116 gpgme_status_code_t code,
117 const char *key, int fd,
121 /* From progress.c. */
122 gpgme_error_t _gpgme_progress_status_handler (void *priv,
123 gpgme_status_code_t code,
128 gpgme_error_t _gpgme_key_new (gpgme_key_t *r_key);
129 gpgme_error_t _gpgme_key_add_subkey (gpgme_key_t key,
130 gpgme_subkey_t *r_subkey);
131 gpgme_error_t _gpgme_key_append_name (gpgme_key_t key, const char *src, int convert);
132 gpgme_key_sig_t _gpgme_key_add_sig (gpgme_key_t key, char *src);
135 /* From keylist.c. */
136 void _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type,
140 /* From trust-item.c. */
142 /* Create a new trust item. */
143 gpgme_error_t _gpgme_trust_item_new (gpgme_trust_item_t *r_item);
146 /* From trustlist.c. */
147 void _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type,
151 /* From version.c. */
153 /* Return true if MY_VERSION is at least REQ_VERSION, and false
155 int _gpgme_compare_versions (const char *my_version,
156 const char *req_version);
157 char *_gpgme_get_program_version (const char *const path);
160 /* From sig-notation.c. */
162 /* Create a new, empty signature notation data object. */
163 gpgme_error_t _gpgme_sig_notation_create (gpgme_sig_notation_t *notationp,
164 const char *name, int name_len,
165 const char *value, int value_len,
166 gpgme_sig_notation_flags_t flags);
168 /* Free the signature notation object and all associated resources.
169 The object must already be removed from any linked list as the next
170 pointer is ignored. */
171 void _gpgme_sig_notation_free (gpgme_sig_notation_t notation);
173 /* Parse a notation or policy URL subpacket. If the packet type is
174 not known, return no error but NULL in NOTATION. */
175 gpgme_error_t _gpgme_parse_notation (gpgme_sig_notation_t *notationp,
176 int type, int pkflags, int len,