2002-07-28 Marcus Brinkmann <marcus@g10code.de>
[gpgme.git] / gpgme / engine.h
1 /* engine.h -  GPGME engine calling functions
2  *      Copyright (C) 2000 Werner Koch (dd9jn)
3  *      Copyright (C) 2001, 2002 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 ENGINE_H
23 #define ENGINE_H
24
25 #include "types.h"
26 #include "rungpg.h"
27
28 const char *_gpgme_engine_get_path (GpgmeProtocol proto);
29 const char *_gpgme_engine_get_version (GpgmeProtocol proto);
30 const char * _gpgme_engine_get_info (GpgmeProtocol proto);
31 GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine);
32 void _gpgme_engine_release (EngineObject engine);
33 void _gpgme_engine_set_status_handler (EngineObject engine,
34                                        GpgStatusHandler fnc, void *fnc_value);
35 GpgmeError _gpgme_engine_set_command_handler (EngineObject engine,
36                                               GpgCommandHandler fnc,
37                                               void *fnc_value,
38                                               GpgmeData data);
39 GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject gpg,
40                                                  GpgColonLineHandler fnc,
41                                                  void *fnc_value);
42 void _gpgme_engine_set_verbosity (EngineObject engine, int verbosity);
43 GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph,
44                                      GpgmeData plain);
45 GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key,
46                                     int allow_secret);
47 GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key,
48                                   GpgmeData out);
49 GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp,
50                                      GpgmeData plain, GpgmeData ciph,
51                                      int use_armor);
52 GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine,
53                                           GpgmeRecipients recp,
54                                           GpgmeData plain, GpgmeData ciph,
55                                           int use_armor,
56                                           GpgmeCtx ctx /* FIXME */);
57 GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp,
58                                     GpgmeData keydata, int use_armor);
59 GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data,
60                                     int use_armor, GpgmeData pubkey,
61                                     GpgmeData seckey);
62 GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata);
63 GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
64                                      int secret_only,
65                                      int keylist_mode);
66 GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine,
67                                          const char *pattern[],
68                                          int secret_only,
69                                          int reserved,
70                                          int keylist_mode);
71 GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in,
72                                   GpgmeData out, GpgmeSigMode mode,
73                                   int use_armor, int use_textmode,
74                                   int include_certs,
75                                   GpgmeCtx ctx /* FIXME */);
76 GpgmeError _gpgme_engine_op_trustlist (EngineObject engine,
77                                        const char *pattern);
78 GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
79                                     GpgmeData text);
80 GpgmeError _gpgme_engine_start (EngineObject engine, void *opaque);
81
82 void _gpgme_engine_set_io_cbs (EngineObject engine,
83                                struct GpgmeIOCbs *io_cbs);
84 void _gpgme_engine_io_event (EngineObject engine,
85                              GpgmeEventIO type, void *type_data);
86
87 void _gpgme_engine_add_child_to_reap_list (void *buf, int buflen, pid_t pid);
88 void _gpgme_engine_housecleaning (void);
89
90 #endif /* ENGINE_H */