summaryrefslogtreecommitdiffstats
path: root/libtdenetwork/libgpgme-copy/gpgme/ops.h
blob: 869496f12e861b2d5b3d04724af36a841d22cf92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/* ops.h - Internal operation support.
   Copyright (C) 2000 Werner Koch (dd9jn)
   Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
 
   This file is part of GPGME.
 
   GPGME is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.
   
   GPGME is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
   
   You should have received a copy of the GNU Lesser General Public
   License along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   02110-1301, USA.  */

#ifndef OPS_H
#define OPS_H

#include "gpgme.h"
#include "context.h"


/* From gpgme.c.  */
void _gpgme_release_result (gpgme_ctx_t ctx);


/* From wait.c.  */
gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);
gpgme_error_t _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond);


/* From data.c.  */
gpgme_error_t _gpgme_data_inbound_handler (void *opaque, int fd);
gpgme_error_t _gpgme_data_outbound_handler (void *opaque, int fd);


/* From op-support.c.  */

/* Find or create the op data object of type TYPE.  */
gpgme_error_t _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type,
				     void **hook, int size,
				     void (*cleanup) (void *));

/* Prepare a new operation on CTX.  */
gpgme_error_t _gpgme_op_reset (gpgme_ctx_t ctx, int synchronous);

/* Parse the INV_RECP status line in ARGS and return the result in
   KEY.  */
gpgme_error_t _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key);

/* Parse the PLAINTEXT status line in ARGS and return the result in
   FILENAMEP.  */
gpgme_error_t _gpgme_parse_plaintext (char *args, char **filenamep);



/* From verify.c.  */
gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx);
gpgme_error_t _gpgme_verify_status_handler (void *priv,
					    gpgme_status_code_t code,
					    char *args);


/* From decrypt.c.  */
gpgme_error_t _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx);
gpgme_error_t _gpgme_decrypt_status_handler (void *priv,
					     gpgme_status_code_t code,
					     char *args);


/* From sign.c.  */

/* Create an initial op data object for signing.  Needs to be called
   once before calling _gpgme_sign_status_handler.  */
gpgme_error_t _gpgme_op_sign_init_result (gpgme_ctx_t ctx);

/* Process a status line for signing operations.  */
gpgme_error_t _gpgme_sign_status_handler (void *priv,
					  gpgme_status_code_t code,
					  char *args);


/* From encrypt.c.  */

/* Create an initial op data object for encrypt.  Needs to be called
   once before calling _gpgme_encrypt_status_handler.  */
gpgme_error_t _gpgme_op_encrypt_init_result (gpgme_ctx_t ctx);

/* Process a status line for encryption operations.  */
gpgme_error_t _gpgme_encrypt_status_handler (void *priv,
					     gpgme_status_code_t code,
					     char *args);


/* From passphrase.c.  */
gpgme_error_t _gpgme_passphrase_status_handler (void *priv,
						gpgme_status_code_t code,
						char *args);
gpgme_error_t _gpgme_passphrase_command_handler (void *opaque,
						 gpgme_status_code_t code,
						 const char *key, int fd,
						 int *processed);


/* From progress.c.  */
gpgme_error_t _gpgme_progress_status_handler (void *priv,
					      gpgme_status_code_t code,
					      char *args);


/* From key.c.  */
gpgme_error_t _gpgme_key_new (gpgme_key_t *r_key);
gpgme_error_t _gpgme_key_add_subkey (gpgme_key_t key,
				     gpgme_subkey_t *r_subkey);
gpgme_error_t _gpgme_key_append_name (gpgme_key_t key, char *src);
gpgme_key_sig_t _gpgme_key_add_sig (gpgme_key_t key, char *src);


/* From keylist.c.  */
void _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type,
				 void *type_data);


/* From trust-item.c.  */

/* Create a new trust item.  */
gpgme_error_t _gpgme_trust_item_new (gpgme_trust_item_t *r_item);


/* From trustlist.c.  */
void _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type,
				   void *type_data);


/* From version.c.  */

/* Return true if MY_VERSION is at least REQ_VERSION, and false
   otherwise.  */
int _gpgme_compare_versions (const char *my_version,
			     const char *req_version);
char *_gpgme_get_program_version (const char *const path);


/* From sig-notation.c.  */

/* Create a new, empty signature notation data object.  */
gpgme_error_t _gpgme_sig_notation_create (gpgme_sig_notation_t *notationp,
					  const char *name, int name_len,
					  const char *value, int value_len,
					  gpgme_sig_notation_flags_t flags);

/* Free the signature notation object and all associated resources.
   The object must already be removed from any linked list as the next
   pointer is ignored.  */
void _gpgme_sig_notation_free (gpgme_sig_notation_t notation);

/* Parse a notation or policy URL subpacket.  If the packet type is
   not known, return no error but NULL in NOTATION.  */
gpgme_error_t _gpgme_parse_notation (gpgme_sig_notation_t *notationp,
				     int type, int pkflags, int len,
				     char *data);

#endif /* OPS_H */