1 |
/* rungpg.h - gpg calling functions |
2 |
* Copyright (C) 2000, 2001 Werner Koch (dd9jn), g10 Code GmbH |
3 |
* Copyright (C) 2003, 2004, 2005 Timo Schulz |
4 |
* |
5 |
* This file is part of MyGPGME. |
6 |
* |
7 |
* MyGPGME 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. |
11 |
* |
12 |
* MyGPGME 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. |
16 |
* |
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 |
20 |
*/ |
21 |
|
22 |
#ifndef GPGME_RUNGPG_H |
23 |
#define GPGME_RUNGPG_H |
24 |
|
25 |
#include "types.h" |
26 |
|
27 |
|
28 |
typedef enum { |
29 |
STATUS_EOF, |
30 |
/* mkstatus starts here */ |
31 |
STATUS_ENTER , |
32 |
STATUS_LEAVE , |
33 |
STATUS_ABORT , |
34 |
|
35 |
STATUS_GOODSIG , |
36 |
STATUS_BADSIG , |
37 |
STATUS_ERRSIG , |
38 |
|
39 |
STATUS_BADARMOR , |
40 |
|
41 |
STATUS_RSA_OR_IDEA , |
42 |
STATUS_KEYEXPIRED , |
43 |
STATUS_KEYREVOKED , |
44 |
|
45 |
STATUS_TRUST_UNDEFINED , |
46 |
STATUS_TRUST_NEVER , |
47 |
STATUS_TRUST_MARGINAL , |
48 |
STATUS_TRUST_FULLY , |
49 |
STATUS_TRUST_ULTIMATE , |
50 |
|
51 |
STATUS_SHM_INFO , |
52 |
STATUS_SHM_GET , |
53 |
STATUS_SHM_GET_BOOL , |
54 |
STATUS_SHM_GET_HIDDEN , |
55 |
|
56 |
STATUS_NEED_PASSPHRASE , |
57 |
STATUS_VALIDSIG , |
58 |
STATUS_SIG_ID , |
59 |
STATUS_ENC_TO , |
60 |
STATUS_NODATA , |
61 |
STATUS_BAD_PASSPHRASE , |
62 |
STATUS_NO_PUBKEY , |
63 |
STATUS_NO_SECKEY , |
64 |
STATUS_NEED_PASSPHRASE_PIN, |
65 |
STATUS_NEED_PASSPHRASE_SYM, |
66 |
STATUS_DECRYPTION_FAILED , |
67 |
STATUS_DECRYPTION_OKAY , |
68 |
STATUS_MISSING_PASSPHRASE , |
69 |
STATUS_GOOD_PASSPHRASE , |
70 |
STATUS_GOODMDC , |
71 |
STATUS_BADMDC , |
72 |
STATUS_ERRMDC , |
73 |
STATUS_IMPORTED , |
74 |
STATUS_IMPORT_RES , |
75 |
STATUS_IMPORT_CHECK , |
76 |
STATUS_FILE_START , |
77 |
STATUS_FILE_DONE , |
78 |
STATUS_FILE_ERROR , |
79 |
|
80 |
STATUS_BEGIN_DECRYPTION , |
81 |
STATUS_END_DECRYPTION , |
82 |
STATUS_BEGIN_ENCRYPTION , |
83 |
STATUS_END_ENCRYPTION , |
84 |
|
85 |
STATUS_DELETE_PROBLEM , |
86 |
STATUS_GET_BOOL , |
87 |
STATUS_GET_LINE , |
88 |
STATUS_GET_HIDDEN , |
89 |
STATUS_GOT_IT , |
90 |
STATUS_PROGRESS , |
91 |
STATUS_SIG_CREATED , |
92 |
STATUS_SESSION_KEY , |
93 |
STATUS_NOTATION_NAME , |
94 |
STATUS_NOTATION_DATA , |
95 |
STATUS_POLICY_URL , |
96 |
STATUS_BEGIN_STREAM , |
97 |
STATUS_END_STREAM , |
98 |
STATUS_KEY_CREATED , |
99 |
STATUS_USERID_HINT , |
100 |
STATUS_UNEXPECTED , |
101 |
STATUS_INV_RECP , |
102 |
STATUS_NO_RECP , |
103 |
STATUS_ALREADY_SIGNED , |
104 |
STATUS_SIGEXPIRED , |
105 |
STATUS_EXPSIG , |
106 |
STATUS_EXPKEYSIG , |
107 |
STATUS_TRUNCATED , |
108 |
STATUS_REVKEYSIG , |
109 |
STATUS_ERROR , |
110 |
STATUS_CARDCTRL, |
111 |
STATUS_SIG_SUBPACKET, |
112 |
STATUS_SC_OP_SUCCESS, |
113 |
STATUS_SC_OP_FAILURE, |
114 |
STATUS_PLAINTEXT, |
115 |
STATUS_PLAINTEXT_LENGTH, |
116 |
STATUS_IMPORT_OK, |
117 |
} gpg_status_code_t; |
118 |
typedef gpg_status_code_t gpg_statcode_t; |
119 |
|
120 |
typedef void (*gpg_status_handler_t)( gpgme_ctx_t, gpg_status_code_t code, char *args ); |
121 |
typedef void (*gpg_logging_handler_t)( gpgme_ctx_t, char * line ); |
122 |
typedef void (*gpg_colon_line_handler_t)( gpgme_ctx_t, char * line ); |
123 |
typedef const char *(*gpg_command_handler_t)(void*, gpg_status_code_t code, |
124 |
const char * keyword); |
125 |
|
126 |
|
127 |
gpgme_error_t _gpgme_gpg_new ( _gpg_object_t *r_gpg ); |
128 |
void _gpgme_gpg_release( _gpg_object_t *r_gpg ); |
129 |
void _gpgme_gpg_housecleaning (void); |
130 |
gpgme_error_t _gpgme_gpg_add_arg ( _gpg_object_t gpg, const char *arg ); |
131 |
gpgme_error_t _gpgme_gpg_add_arg_concat (_gpg_object_t gpg, const char *arg1, const char *arg2); |
132 |
gpgme_error_t _gpgme_gpg_add_data ( _gpg_object_t gpg, gpgme_data_t data, int dup_to ); |
133 |
void _gpgme_gpg_set_status_handler ( _gpg_object_t gpg, |
134 |
gpg_status_handler_t fnc, |
135 |
void *fnc_value ); |
136 |
gpgme_error_t _gpgme_gpg_set_colon_line_handler ( _gpg_object_t gpg, |
137 |
gpg_colon_line_handler_t fnc, |
138 |
void *fnc_value ); |
139 |
gpgme_error_t _gpgme_gpg_set_simple_line_handler ( _gpg_object_t gpg, |
140 |
gpg_colon_line_handler_t fnc, |
141 |
void *fnc_value ); |
142 |
gpgme_error_t _gpgme_gpg_set_command_handler ( _gpg_object_t gpg, |
143 |
gpg_command_handler_t fnc, |
144 |
void *fnc_value ); |
145 |
void _gpgme_gpg_set_logging_handler( _gpg_object_t gpg, void * cb_val ); |
146 |
gpgme_error_t _gpgme_gpg_spawn ( _gpg_object_t gpg, void *opaque ); |
147 |
ulong _gpgme_gpg_getpid (_gpg_object_t gpg); |
148 |
gpgme_error_t _gpgme_gpg_set_list_options (_gpg_object_t gpg, int opts); |
149 |
|
150 |
#endif /* GPGME_RUNGPG_H */ |