2001-11-20 Marcus Brinkmann <marcus@g10code.de>
[gpgme.git] / gpgme / rungpg.h
1 /* rungpg.h -  gpg calling functions
2  *      Copyright (C) 2000 Werner Koch (dd9jn)
3  *      Copyright (C) 2001 g10 Code GmbH
4  *
5  * This file is part of GPGME.
6  *
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.
11  *
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.
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 RUNGPG_H
23 #define 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     STATUS_GOODSIG            ,
35     STATUS_BADSIG             ,
36     STATUS_ERRSIG             ,
37     STATUS_BADARMOR           ,
38     STATUS_RSA_OR_IDEA        ,
39     STATUS_SIGEXPIRED         ,
40     STATUS_KEYREVOKED         ,
41     STATUS_TRUST_UNDEFINED    ,
42     STATUS_TRUST_NEVER        ,
43     STATUS_TRUST_MARGINAL     ,
44     STATUS_TRUST_FULLY        ,
45     STATUS_TRUST_ULTIMATE     ,
46     STATUS_SHM_INFO           ,
47     STATUS_SHM_GET            ,
48     STATUS_SHM_GET_BOOL       ,
49     STATUS_SHM_GET_HIDDEN     ,
50     STATUS_NEED_PASSPHRASE    ,
51     STATUS_USERID_HINT        ,
52     STATUS_UNEXPECTED         ,
53     STATUS_VALIDSIG           ,
54     STATUS_SIG_ID             ,
55     STATUS_ENC_TO             ,
56     STATUS_NODATA             ,
57     STATUS_BAD_PASSPHRASE     ,
58     STATUS_NO_PUBKEY          ,
59     STATUS_NO_SECKEY          ,
60     STATUS_NEED_PASSPHRASE_SYM,
61     STATUS_DECRYPTION_FAILED  ,
62     STATUS_DECRYPTION_OKAY    ,
63     STATUS_MISSING_PASSPHRASE ,
64     STATUS_GOOD_PASSPHRASE    ,
65     STATUS_GOODMDC            ,
66     STATUS_BADMDC             ,
67     STATUS_ERRMDC             ,
68     STATUS_IMPORTED           ,
69     STATUS_IMPORT_RES         ,
70     STATUS_FILE_START         ,
71     STATUS_FILE_DONE          ,
72     STATUS_FILE_ERROR         ,
73     STATUS_BEGIN_DECRYPTION   ,
74     STATUS_END_DECRYPTION     ,
75     STATUS_BEGIN_ENCRYPTION   ,
76     STATUS_END_ENCRYPTION     ,
77     STATUS_DELETE_PROBLEM     ,
78     STATUS_GET_BOOL           ,
79     STATUS_GET_LINE           ,
80     STATUS_GET_HIDDEN         ,
81     STATUS_GOT_IT             ,
82     STATUS_PROGRESS           ,
83     STATUS_SIG_CREATED        ,
84     STATUS_SESSION_KEY        ,
85     STATUS_NOTATION_NAME      ,
86     STATUS_NOTATION_DATA      ,
87     STATUS_POLICY_URL         ,
88     STATUS_BEGIN_STREAM       ,
89     STATUS_END_STREAM         ,
90     STATUS_INV_RECP           ,
91     STATUS_NO_RECP        
92 } GpgStatusCode;
93
94 typedef void (*GpgStatusHandler)( GpgmeCtx, GpgStatusCode code, char *args ); 
95 typedef void (*GpgColonLineHandler)( GpgmeCtx, char *line ); 
96 typedef const char *(*GpgCommandHandler)(void*, GpgStatusCode code,
97                                          const char *keyword);
98
99
100 GpgmeError _gpgme_gpg_new ( GpgObject *r_gpg );
101 void       _gpgme_gpg_release ( GpgObject gpg );
102 void       _gpgme_gpg_housecleaning (void);
103 void       _gpgme_gpg_enable_pipemode ( GpgObject gpg );
104 GpgmeError _gpgme_gpg_add_arg ( GpgObject gpg, const char *arg );
105 GpgmeError _gpgme_gpg_add_data ( GpgObject gpg, GpgmeData data, int dup_to );
106 GpgmeError _gpgme_gpg_add_pm_data ( GpgObject gpg, GpgmeData data, int what );
107 void       _gpgme_gpg_set_status_handler ( GpgObject gpg,
108                                            GpgStatusHandler fnc,
109                                            void *fnc_value );
110 GpgmeError _gpgme_gpg_set_colon_line_handler ( GpgObject gpg,
111                                                GpgColonLineHandler fnc,
112                                                void *fnc_value );
113 GpgmeError _gpgme_gpg_set_simple_line_handler ( GpgObject gpg,
114                                                 GpgColonLineHandler fnc,
115                                                 void *fnc_value );
116 GpgmeError _gpgme_gpg_set_command_handler ( GpgObject gpg,
117                                             GpgCommandHandler fnc,
118                                             void *fnc_value );
119
120 GpgmeError _gpgme_gpg_spawn ( GpgObject gpg, void *opaque );
121
122
123
124 #endif /* RUNGPG_H */
125
126
127
128
129
130