da95ecfc2c
* context.h: Do not include rungpg.h, but engine.h. (struct gpgme_context_s): Replace member gpg with engine. * gpgme.c (gpgme_release): Release engine, not gpg. * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function moved ... * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here. Make static, change order of arguments, and return an error value. * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype. * rungpg.h (_gpgme_gpg_op_verify): Add prototype. (_gpgme_gpg_op_encrypt): Likewise. (_gpgme_gpg_op_decrypt): Likewise. (_gpgme_gpg_op_delete): Likewise. (_gpgme_gpg_op_export): Likewise. (_gpgme_gpg_op_genkey): Likewise. (_gpgme_gpg_op_import): Likewise. (_gpgme_gpg_op_keylist): Likewise. (_gpgme_gpg_op_sign): Likewise. (_gpgme_gpg_op_trustlist): Likewise. * rungpg.c (_gpgme_gpg_op_verify): New function. (_gpgme_gpg_op_encrypt): Likewise. (_gpgme_gpg_op_decrypt): Likewise. (_gpgme_gpg_op_delete): Likewise. (_gpgme_gpg_op_export): Likewise. (_gpgme_gpg_op_genkey): Likewise. (_gpgme_gpg_op_import): Likewise. (_gpgme_gpg_op_keylist): Likewise. (_gpgme_gpg_op_sign): Likewise. (_gpgme_gpg_op_trustlist): Likewise. * engine.h (_gpgme_engine_set_status_handler): Add prototype. (_gpgme_engine_set_command_handler): Likewise. (_gpgme_engine_set_colon_line_handler): Likewise. (_gpgme_engine_op_decrypt): Likewise. (_gpgme_engine_op_delete): Likewise. (_gpgme_engine_op_encrypt): Likewise. (_gpgme_engine_op_export): Likewise. (_gpgme_engine_op_genkey): Likewise. (_gpgme_engine_op_import): Likewise. (_gpgme_engine_op_keylist): Likewise. (_gpgme_engine_op_sign): Likewise. (_gpgme_engine_op_trustlist): Likewise. (_gpgme_engine_op_verify): Likewise. (_gpgme_engine_start): Likewise. * engine.c (_gpgme_engine_set_status_handler): New function. (_gpgme_engine_set_command_handler): Likewise. (_gpgme_engine_set_colon_line_handler): Likewise. (_gpgme_engine_op_decrypt): Likewise. (_gpgme_engine_op_delete): Likewise. (_gpgme_engine_op_encrypt): Likewise. (_gpgme_engine_op_export): Likewise. (_gpgme_engine_op_genkey): Likewise. (_gpgme_engine_op_import): Likewise. (_gpgme_engine_op_keylist): Likewise. (_gpgme_engine_op_sign): Likewise. (_gpgme_engine_op_trustlist): Likewise. (_gpgme_engine_op_verify): Likewise. (_gpgme_engine_start): Likewise. * verify.c (gpgme_op_verify_start): Reimplement in terms of above functions. * encrypt.c (gpgme_op_encrypt_start): Likewise. * decrypt.c (_gpgme_decrypt_start): Likewise. * passphrase.c (_gpgme_passphrase_start): Likewise. * keylist.c (gpgme_op_keylist_start): Likewise.
143 lines
5.4 KiB
C
143 lines
5.4 KiB
C
/* rungpg.h - gpg calling functions
|
|
* Copyright (C) 2000 Werner Koch (dd9jn)
|
|
* Copyright (C) 2001 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 General Public License as published by
|
|
* the Free Software Foundation; either version 2 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 General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
*/
|
|
|
|
#ifndef RUNGPG_H
|
|
#define RUNGPG_H
|
|
|
|
#include "types.h"
|
|
|
|
|
|
typedef enum {
|
|
STATUS_EOF ,
|
|
/* mkstatus starts here */
|
|
STATUS_ENTER ,
|
|
STATUS_LEAVE ,
|
|
STATUS_ABORT ,
|
|
STATUS_GOODSIG ,
|
|
STATUS_BADSIG ,
|
|
STATUS_ERRSIG ,
|
|
STATUS_BADARMOR ,
|
|
STATUS_RSA_OR_IDEA ,
|
|
STATUS_SIGEXPIRED ,
|
|
STATUS_KEYREVOKED ,
|
|
STATUS_TRUST_UNDEFINED ,
|
|
STATUS_TRUST_NEVER ,
|
|
STATUS_TRUST_MARGINAL ,
|
|
STATUS_TRUST_FULLY ,
|
|
STATUS_TRUST_ULTIMATE ,
|
|
STATUS_SHM_INFO ,
|
|
STATUS_SHM_GET ,
|
|
STATUS_SHM_GET_BOOL ,
|
|
STATUS_SHM_GET_HIDDEN ,
|
|
STATUS_NEED_PASSPHRASE ,
|
|
STATUS_USERID_HINT ,
|
|
STATUS_UNEXPECTED ,
|
|
STATUS_VALIDSIG ,
|
|
STATUS_SIG_ID ,
|
|
STATUS_ENC_TO ,
|
|
STATUS_NODATA ,
|
|
STATUS_BAD_PASSPHRASE ,
|
|
STATUS_NO_PUBKEY ,
|
|
STATUS_NO_SECKEY ,
|
|
STATUS_NEED_PASSPHRASE_SYM,
|
|
STATUS_DECRYPTION_FAILED ,
|
|
STATUS_DECRYPTION_OKAY ,
|
|
STATUS_MISSING_PASSPHRASE ,
|
|
STATUS_GOOD_PASSPHRASE ,
|
|
STATUS_GOODMDC ,
|
|
STATUS_BADMDC ,
|
|
STATUS_ERRMDC ,
|
|
STATUS_IMPORTED ,
|
|
STATUS_IMPORT_RES ,
|
|
STATUS_FILE_START ,
|
|
STATUS_FILE_DONE ,
|
|
STATUS_FILE_ERROR ,
|
|
STATUS_BEGIN_DECRYPTION ,
|
|
STATUS_END_DECRYPTION ,
|
|
STATUS_BEGIN_ENCRYPTION ,
|
|
STATUS_END_ENCRYPTION ,
|
|
STATUS_DELETE_PROBLEM ,
|
|
STATUS_GET_BOOL ,
|
|
STATUS_GET_LINE ,
|
|
STATUS_GET_HIDDEN ,
|
|
STATUS_GOT_IT ,
|
|
STATUS_PROGRESS ,
|
|
STATUS_SIG_CREATED ,
|
|
STATUS_SESSION_KEY ,
|
|
STATUS_NOTATION_NAME ,
|
|
STATUS_NOTATION_DATA ,
|
|
STATUS_POLICY_URL ,
|
|
STATUS_BEGIN_STREAM ,
|
|
STATUS_END_STREAM ,
|
|
STATUS_INV_RECP ,
|
|
STATUS_NO_RECP
|
|
} GpgStatusCode;
|
|
|
|
typedef void (*GpgStatusHandler)( GpgmeCtx, GpgStatusCode code, char *args );
|
|
typedef void (*GpgColonLineHandler)( GpgmeCtx, char *line );
|
|
typedef const char *(*GpgCommandHandler)(void*, GpgStatusCode code,
|
|
const char *keyword);
|
|
|
|
const char *_gpgme_gpg_get_version (void);
|
|
GpgmeError _gpgme_gpg_check_version (void);
|
|
|
|
GpgmeError _gpgme_gpg_new ( GpgObject *r_gpg );
|
|
void _gpgme_gpg_release ( GpgObject gpg );
|
|
void _gpgme_gpg_housecleaning (void);
|
|
void _gpgme_gpg_enable_pipemode ( GpgObject gpg );
|
|
GpgmeError _gpgme_gpg_add_arg ( GpgObject gpg, const char *arg );
|
|
GpgmeError _gpgme_gpg_add_data ( GpgObject gpg, GpgmeData data, int dup_to );
|
|
GpgmeError _gpgme_gpg_add_pm_data ( GpgObject gpg, GpgmeData data, int what );
|
|
void _gpgme_gpg_set_status_handler ( GpgObject gpg,
|
|
GpgStatusHandler fnc,
|
|
void *fnc_value );
|
|
GpgmeError _gpgme_gpg_set_colon_line_handler ( GpgObject gpg,
|
|
GpgColonLineHandler fnc,
|
|
void *fnc_value );
|
|
GpgmeError _gpgme_gpg_set_simple_line_handler ( GpgObject gpg,
|
|
GpgColonLineHandler fnc,
|
|
void *fnc_value );
|
|
GpgmeError _gpgme_gpg_set_command_handler ( GpgObject gpg,
|
|
GpgCommandHandler fnc,
|
|
void *fnc_value );
|
|
|
|
GpgmeError _gpgme_gpg_op_decrypt (GpgObject gpg, GpgmeData ciph,
|
|
GpgmeData plain);
|
|
GpgmeError _gpgme_gpg_op_delete (GpgObject gpg, GpgmeKey key, int allow_secret);
|
|
GpgmeError _gpgme_gpg_op_encrypt (GpgObject gpg, GpgmeRecipients recp,
|
|
GpgmeData plain, GpgmeData ciph,
|
|
int use_armor);
|
|
GpgmeError _gpgme_gpg_op_export (GpgObject gpg, GpgmeRecipients recp,
|
|
GpgmeData keydata, int use_armor);
|
|
GpgmeError _gpgme_gpg_op_genkey (GpgObject gpg, GpgmeData help_data,
|
|
int use_armor);
|
|
GpgmeError _gpgme_gpg_op_import (GpgObject gpg, GpgmeData keydata);
|
|
GpgmeError _gpgme_gpg_op_keylist (GpgObject gpg, const char *pattern,
|
|
int secret_only, int keylist_mode);
|
|
GpgmeError _gpgme_gpg_op_sign (GpgObject gpg, GpgmeData in, GpgmeData out,
|
|
GpgmeSigMode mode, int use_armor,
|
|
int use_textmode, GpgmeCtx ctx /* FIXME */);
|
|
GpgmeError _gpgme_gpg_op_trustlist (GpgObject gpg, const char *pattern);
|
|
GpgmeError _gpgme_gpg_op_verify (GpgObject gpg, GpgmeData sig, GpgmeData text);
|
|
GpgmeError _gpgme_gpg_spawn (GpgObject gpg, void *opaque);
|
|
|
|
#endif /* RUNGPG_H */
|