gpgme/gpgme/engine.h

87 lines
3.4 KiB
C
Raw Normal View History

2002-10-10 Marcus Brinkmann <marcus@g10code.de> * rungpg.h, engine-gpgsm.h: File removed. * engine-backend.h: New file. * Makefile.am (gpgsm_components): New variable, set depending on automake conditional HAVE_GPGSM. (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}. (status-table.h): Depend on gpgme.h, not rungpg.h. * conversion.c: Include <stdlib.h>. * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include "engine-backend.h" instead "engine-gpgsm.h". Reorder some functions and remove all function prototypes. (_gpgme_gpgsm_get_version): Make static and rename to ... (gpgsm_get_version): ... this. (_gpgme_gpgsm_check_version): Make static and rename to ... (gpgsm_check_version): ... this. (_gpgme_gpgsm_new): Make static. Change argument type from GpgsmObject * to void **. Call gpgsm_release instead _gpgme_gpgsm_release. (_gpgme_gpgsm_op_decrypt): Make static and rename to ... (gpgsm_check_decrypt): ... this. (_gpgme_gpgsm_op_delete): Make static and rename to ... (gpgsm_check_delete): ... this. (_gpgme_gpgsm_set_recipients): Make static and rename to ... (gpgsm_check_set_recipients): ... this. (_gpgme_gpgsm_op_encrypt): Make static and rename to ... (gpgsm_encrypt): ... this. (_gpgme_gpgsm_op_export): Make static and rename to ... (gpgsm_export): ... this. (_gpgme_gpgsm_op_genkey): Make static and rename to ... (gpgsm_genkey): ... this. (_gpgme_gpgsm_op_import): Make static and rename to ... (gpgsm_import): ... this. (_gpgme_gpgsm_op_keylist): Make static and rename to ... (gpgsm_keylist): ... this. (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ... (gpgsm_keylist_ext): ... this. (_gpgme_gpgsm_op_sign): Make static and rename to ... (gpgsm_sign): ... this. (_gpgme_gpgsm_op_trustlist): Make static and rename to ... (gpgsm_trustlist): ... this. (_gpgme_gpgsm_op_verify): Make static and rename to ... (gpgsm_verify): ... this. (gpgsm_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpgsm_set_status_handler): Make static and rename to ... (gpgsm_set_status_handler): ... this. (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ... (gpgsm_set_colon_line_handler): ... this. (_gpgme_gpgsm_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpgsm_start): Make static and rename to ... (gpgsm_start): ... this. (_gpgme_gpgsm_set_io_cb): Make static and rename to ... (gpgsm_set_io_cb): ... this. (_gpgme_gpgsm_io_event): Make static and rename to ... (gpgsm_io_event): ... this. (struct _gpgme_engine_ops_gpgsm): New variable. [!ENABLE_GPGSM]: Removed. * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>, <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include <stdlib.h> and "engine-backend.h". (struct engine_object_s): Rewritten. (engine_ops): New variable. * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version, _gpgme_engine_check_version, _gpgme_engine_new, _gpgme_engine_release, _gpgme_engine_set_verbosity, _gpgme_engine_set_status_handler, _gpgme_engine_set_command_handler, _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt, _gpgme_engine_op_delete, _gpgme_engine_op_edit, _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign, _gpgme_engine_op_export, _gpgme_engine_op_genkey, _gpgme_engine_op_import, _gpgme_engine_op_keylist, _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign, _gpgme_engine_op_trustlist, _gpgme_engine_op_verify, _gpgme_engine_start, _gpgme_engine_set_io_cbs, _gpgme_engine_io_event): Reimplement. * engine.h: Fix a few comments and a variable name in a prototype. * ops.h: Do not include "rungpg.h". * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not include "rungpg.h". * recipient.c: Likewise. * signers.c: Likewise. * version.c: Likewise. * rungpg.c: Likewise. Include "engine-backend.h". Reorder functions and remove prototypes. (_gpgme_gpg_get_version): Make static and rename to ... (gpg_get_version): ... this. (_gpgme_gpg_check_version): Make static and rename to ... (gpg_check_version): ... this. (_gpgme_gpg_new): Make static. Change argument type from GpgObject * to void **. Call gpg_release instead _gpgme_gpg_release. (_gpgme_gpg_op_decrypt): Make static and rename to ... (gpg_check_decrypt): ... this. (_gpgme_gpg_op_delete): Make static and rename to ... (gpg_check_delete): ... this. (_gpgme_gpg_set_recipients): Make static and rename to ... (gpg_check_set_recipients): ... this. (_gpgme_gpg_op_encrypt): Make static and rename to ... (gpg_encrypt): ... this. (_gpgme_gpg_op_export): Make static and rename to ... (gpg_export): ... this. (_gpgme_gpg_op_genkey): Make static and rename to ... (gpg_genkey): ... this. (_gpgme_gpg_op_import): Make static and rename to ... (gpg_import): ... this. (_gpgme_gpg_op_keylist): Make static and rename to ... (gpg_keylist): ... this. (_gpgme_gpg_op_keylist_ext): Make static and rename to ... (gpg_keylist_ext): ... this. (_gpgme_gpg_op_sign): Make static and rename to ... (gpg_sign): ... this. (_gpgme_gpg_op_trustlist): Make static and rename to ... (gpg_trustlist): ... this. (_gpgme_gpg_op_verify): Make static and rename to ... (gpg_verify): ... this. (gpg_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpg_set_status_handler): Make static and rename to ... (gpg_set_status_handler): ... this. (_gpgme_gpg_set_colon_line_handler): Make static and rename to ... (gpg_set_colon_line_handler): ... this. (gpgme_gpg_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpg_start): Make static and rename to ... (gpg_start): ... this. (_gpgme_gpg_set_io_cb): Make static and rename to ... (gpg_set_io_cb): ... this. (_gpgme_gpg_io_event): Make static and rename to ... (gpg_io_event): ... this. (struct _gpgme_engine_ops_gpg): New variable.
2002-10-12 00:33:05 +00:00
/* engine.h - GPGME engine interface.
Copyright (C) 2000 Werner Koch (dd9jn)
2003-01-29 20:03:24 +00:00
Copyright (C) 2001, 2002, 2003 g10 Code GmbH
2002-10-10 Marcus Brinkmann <marcus@g10code.de> * rungpg.h, engine-gpgsm.h: File removed. * engine-backend.h: New file. * Makefile.am (gpgsm_components): New variable, set depending on automake conditional HAVE_GPGSM. (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}. (status-table.h): Depend on gpgme.h, not rungpg.h. * conversion.c: Include <stdlib.h>. * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include "engine-backend.h" instead "engine-gpgsm.h". Reorder some functions and remove all function prototypes. (_gpgme_gpgsm_get_version): Make static and rename to ... (gpgsm_get_version): ... this. (_gpgme_gpgsm_check_version): Make static and rename to ... (gpgsm_check_version): ... this. (_gpgme_gpgsm_new): Make static. Change argument type from GpgsmObject * to void **. Call gpgsm_release instead _gpgme_gpgsm_release. (_gpgme_gpgsm_op_decrypt): Make static and rename to ... (gpgsm_check_decrypt): ... this. (_gpgme_gpgsm_op_delete): Make static and rename to ... (gpgsm_check_delete): ... this. (_gpgme_gpgsm_set_recipients): Make static and rename to ... (gpgsm_check_set_recipients): ... this. (_gpgme_gpgsm_op_encrypt): Make static and rename to ... (gpgsm_encrypt): ... this. (_gpgme_gpgsm_op_export): Make static and rename to ... (gpgsm_export): ... this. (_gpgme_gpgsm_op_genkey): Make static and rename to ... (gpgsm_genkey): ... this. (_gpgme_gpgsm_op_import): Make static and rename to ... (gpgsm_import): ... this. (_gpgme_gpgsm_op_keylist): Make static and rename to ... (gpgsm_keylist): ... this. (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ... (gpgsm_keylist_ext): ... this. (_gpgme_gpgsm_op_sign): Make static and rename to ... (gpgsm_sign): ... this. (_gpgme_gpgsm_op_trustlist): Make static and rename to ... (gpgsm_trustlist): ... this. (_gpgme_gpgsm_op_verify): Make static and rename to ... (gpgsm_verify): ... this. (gpgsm_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpgsm_set_status_handler): Make static and rename to ... (gpgsm_set_status_handler): ... this. (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ... (gpgsm_set_colon_line_handler): ... this. (_gpgme_gpgsm_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpgsm_start): Make static and rename to ... (gpgsm_start): ... this. (_gpgme_gpgsm_set_io_cb): Make static and rename to ... (gpgsm_set_io_cb): ... this. (_gpgme_gpgsm_io_event): Make static and rename to ... (gpgsm_io_event): ... this. (struct _gpgme_engine_ops_gpgsm): New variable. [!ENABLE_GPGSM]: Removed. * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>, <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include <stdlib.h> and "engine-backend.h". (struct engine_object_s): Rewritten. (engine_ops): New variable. * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version, _gpgme_engine_check_version, _gpgme_engine_new, _gpgme_engine_release, _gpgme_engine_set_verbosity, _gpgme_engine_set_status_handler, _gpgme_engine_set_command_handler, _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt, _gpgme_engine_op_delete, _gpgme_engine_op_edit, _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign, _gpgme_engine_op_export, _gpgme_engine_op_genkey, _gpgme_engine_op_import, _gpgme_engine_op_keylist, _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign, _gpgme_engine_op_trustlist, _gpgme_engine_op_verify, _gpgme_engine_start, _gpgme_engine_set_io_cbs, _gpgme_engine_io_event): Reimplement. * engine.h: Fix a few comments and a variable name in a prototype. * ops.h: Do not include "rungpg.h". * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not include "rungpg.h". * recipient.c: Likewise. * signers.c: Likewise. * version.c: Likewise. * rungpg.c: Likewise. Include "engine-backend.h". Reorder functions and remove prototypes. (_gpgme_gpg_get_version): Make static and rename to ... (gpg_get_version): ... this. (_gpgme_gpg_check_version): Make static and rename to ... (gpg_check_version): ... this. (_gpgme_gpg_new): Make static. Change argument type from GpgObject * to void **. Call gpg_release instead _gpgme_gpg_release. (_gpgme_gpg_op_decrypt): Make static and rename to ... (gpg_check_decrypt): ... this. (_gpgme_gpg_op_delete): Make static and rename to ... (gpg_check_delete): ... this. (_gpgme_gpg_set_recipients): Make static and rename to ... (gpg_check_set_recipients): ... this. (_gpgme_gpg_op_encrypt): Make static and rename to ... (gpg_encrypt): ... this. (_gpgme_gpg_op_export): Make static and rename to ... (gpg_export): ... this. (_gpgme_gpg_op_genkey): Make static and rename to ... (gpg_genkey): ... this. (_gpgme_gpg_op_import): Make static and rename to ... (gpg_import): ... this. (_gpgme_gpg_op_keylist): Make static and rename to ... (gpg_keylist): ... this. (_gpgme_gpg_op_keylist_ext): Make static and rename to ... (gpg_keylist_ext): ... this. (_gpgme_gpg_op_sign): Make static and rename to ... (gpg_sign): ... this. (_gpgme_gpg_op_trustlist): Make static and rename to ... (gpg_trustlist): ... this. (_gpgme_gpg_op_verify): Make static and rename to ... (gpg_verify): ... this. (gpg_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpg_set_status_handler): Make static and rename to ... (gpg_set_status_handler): ... this. (_gpgme_gpg_set_colon_line_handler): Make static and rename to ... (gpg_set_colon_line_handler): ... this. (gpgme_gpg_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpg_start): Make static and rename to ... (gpg_start): ... this. (_gpgme_gpg_set_io_cb): Make static and rename to ... (gpg_set_io_cb): ... this. (_gpgme_gpg_io_event): Make static and rename to ... (gpg_io_event): ... this. (struct _gpgme_engine_ops_gpg): New variable.
2002-10-12 00:33:05 +00:00
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 GPGME; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef ENGINE_H
#define ENGINE_H
#include "types.h"
2002-10-09 Marcus Brinkmann <marcus@g10code.de> * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler and move to ... * types.h (GpgmeStatusHandler): ... here. * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler. and move to ... * types.h (GpgmeColonLineHandler): ... here. * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler. and move to ... * types.h (GpgmeCommandHandler): ... here. * engine.h: Don't include "rungpg.h". (_gpgme_engine_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * engine-gpgsm.h: Don't include "rungpg.h". (_gpgme_gpgsm_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * engine-gpgsm.c: Do not include "rungpg.h". (struct gpgsm_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. (gpgsm_assuan_simple_command): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_status_handler): Likewise. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * rungpg.h (_gpgme_gpg_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * rungpg.c (struct gpg_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. Change type of cmd.fnc to GpgmeCommandLineHandler. (_gpgme_gpg_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument FNC to GpgmeCommandHandler. * engine.c (_gpgme_engine_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument FNC to GpgmeCommandHandler.
2002-10-09 12:23:33 +00:00
struct engine_object_s;
typedef struct engine_object_s *EngineObject;
GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine);
void _gpgme_engine_release (EngineObject engine);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
void _gpgme_engine_set_status_handler (EngineObject engine,
doc/ 2003-01-29 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (I/O Callback Interface): Document new even GPGME_EVENT_START. (Waiting For Completion): Document new possible return values. (I/O Callback Interface): Document return type of GpgmeIOCb. gpgme/ 2003-01-29 Marcus Brinkmann <marcus@g10code.de> * context.h (gpgme_context_s): Remove member ERROR. * types.h (GpgmeStatusHandler): Change return type to GpgmeError. (GpgmeCommandHandler): Change return type to GpgmeError and add new argument RESULT. * gpgme.h (GpgmeIOCb): Change return type to GpgmeError. (GpgmeEventIO): New event GPGME_EVENT_START. (GpgmeIdleFunc): Remove type. (gpgme_register_idle): Remove prototype. * data.c: Include <assert.h>. (_gpgme_data_inbound_handler): Change return type to GpgmeError. Return any error instead ignoring it, don't close file descriptor on error. (_gpgme_data_outbound_handler): Likewise. * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>. (_gpgme_decrypt_status_handler): Change return type to GpgmeError. Return error instead setting ctx->error. Return success at end of function. (gpgme_op_decrypt): Don't work around the old kludge anymore. * decrypt-verify.c (decrypt_verify_status_handler): Change return type to GpgmeError. Return possible errors. * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and <assert.h>. (delete_status_handler): Change return type to GpgmeError. Return error instead setting ctx->error. Return success at end of function. * edit.c: Do not include <stdio.h> and <string.h>. (_gpgme_edit_status_handler): Change type to GpgmeError, make static and rename to ... (edit_status_handler): ... this. Return error directly. (command_handler): Change return type to GpgmeError, add result argument. Return error directly. * encrypt.c (status_handler_finish): Remove function. (_gpgme_encrypt_status_handler): Change return type to GpgmeError. Return error directly. (_gpgme_encrypt_sym_status_handler): Likewise. * encrypt-sign.c (encrypt_sign_status_handler): Likewise. * engine-gpgsm.c (close_notify_handler): Do not signal done event anymore. (status_handler): Change return type to GpgmeError. Diddle things around a bit to return errors directly. (start): Send start event. * export.c: Do not include <stdio.h>, <string.h> and <assert.h>. (export_status_handler): Change return type to GpgmeError. Don't check ctx->error. * genkey.c: Do not include <stdio.h> and <assert.h>. (genkey_status_handler): Change return type to GpgmeError. Don't check ctx->error. Return errors directly. * gpgme.c (_gpgme_release_result): Do not initialize ctx->error. (_gpgme_op_event_cb): Function removed. (_gpgme_op_event_cb_user): Likewise. * import.c: Do not include <stdio.h>, <string.h> and <assert.h>. (import_status_handler): Change return type to GpgmeError. Don't check ctx->error. * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key): Change return type to GpgmeError, return error directly. * Makefile (libgpgme_la_SOURCES): Add wait-global.c, wait-private.c and wait-user.c * ops.h (test_and_allocate_result): Return error instead setting ctx->error. (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler, _gpgme_verify_status_handler, _gpgme_decrypt_status_handler, _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler, _gpgme_passphrase_status_handler, _gpgme_progress_status_handler): Change return type to GpgmeError. (_gpgme_passphease_command_handler): Change return type to GpgmeError and add new argument RESULT. * op-support.c: Use new callback functions, and change private data to ctx everywhere. * passphrase.c (_gpgme_passphrase_status_handler): Change return type to GpgmeError, return error directly. (_gpgme_passphrase_command_handler): Change return type to GpgmeError, add result argument. Return results accordingly. * progress.c (_gpgme_progress_status_handler): Change return type to GpgmeError, return errors directly. * rungpg.c (status_handler): Change return type to GpgmeError. Return error directly. (close_notify_handler): Don't send done event. (colon_line_handler): Change return type to GpgmeError, return errors directly. * rungpg.c (start): Send start event. * sign.c (_gpgme_sign_status_handler): Change return type to GpgmeError, return errors directly. * trustlist.c (trustlist_status_handler): Change return type to GpgmeError. Return 0. (trustlist_colon_handler): Change return type GpgmeError. Return errors directly. * verify.c (add_notation): Change return type to GpgmeError, return errors directly. (_gpgme_verify_status_handler): Likewise. * wait.h (struct fd_table): Remove lock member. (struct wait_item_s): Moved here from wait.c. (struct tag): New structure. (_gpgme_wait_event_cb): Remove prototype. (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb, _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb, _gpgme_wait_user_event_io_cb): New prototypes. * wait.c: Don't include <stdio.h>. (ftd_global, ctx_done_list, ctx_done_list_size, ctx_done_list_length, ctx_done_list_lock, idle_function): Remove global variable. (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove function. (gpgme_wait): Move to file wait-global.c. (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx member in wait item and tag. (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock. (_gpgme_wait_one, _gpgme_wait_on_condition): Move to wait-private.c. (gpgme_fd_table_init): Don't initialize FDT->lock. (gpgme_fd_table_deinit): Don't destroy FDT->lock. (_gpgme_fd_table_put): Make static and rename to ... (fd_table_put): ... this function. Don't use FDT->lock. (struct wait_item_s): Move to wait.h. * wait-global.c: New file. * wait-private.c: New file. * wait-user.c: New file.
2003-01-29 15:20:58 +00:00
GpgmeStatusHandler fnc,
void *fnc_value);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeError _gpgme_engine_set_command_handler (EngineObject engine,
2002-10-09 Marcus Brinkmann <marcus@g10code.de> * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler and move to ... * types.h (GpgmeStatusHandler): ... here. * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler. and move to ... * types.h (GpgmeColonLineHandler): ... here. * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler. and move to ... * types.h (GpgmeCommandHandler): ... here. * engine.h: Don't include "rungpg.h". (_gpgme_engine_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * engine-gpgsm.h: Don't include "rungpg.h". (_gpgme_gpgsm_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * engine-gpgsm.c: Do not include "rungpg.h". (struct gpgsm_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. (gpgsm_assuan_simple_command): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_status_handler): Likewise. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * rungpg.h (_gpgme_gpg_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * rungpg.c (struct gpg_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. Change type of cmd.fnc to GpgmeCommandLineHandler. (_gpgme_gpg_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument FNC to GpgmeCommandHandler. * engine.c (_gpgme_engine_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument FNC to GpgmeCommandHandler.
2002-10-09 12:23:33 +00:00
GpgmeCommandHandler fnc,
2002-07-28 Marcus Brinkmann <marcus@g10code.de> * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF instead an error. The following changes make it possible to flush an inbound data pipe before invoking a command handler: * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to _gpgme_io_select. Set timeout of 0 if this is set. * w32-io.c (_gpgme_io_select): Likewise. * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype. * wait.c (do_select): Add new argument to _gpgme_io_select invocation. * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument linked_data to prototype. * engine.h (_gpgme_engine_set_command_handler): Likewise. * engine.c (_gpgme_engine_set_command_handler): Likewise. * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data argument to _gpgme_engine_set_command_handler. * rungpg.c (struct gpg_object_s): New members linked_data and linked_idx in CMD. (_gpgme_gpg_new): Initialize those new members. (_gpgme_gpg_set_command_handler): Accept new argument linked_data. (build_argv): Handle linked_data in the same hack as cb_data. (read_status): If linked_data is in use, flush the pipe before activating the command handler. * gpgme.h: Add prototypes for gpgme_op_edit_start and gpgme_op_edit. The next changes export the status codes to the user: * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix all STATUS_ with GPGME_. * delete.c (delete_status_handler): Likewise. * decrypt-verify.c (decrypt_verify_status_handler): Likewise. * encrypt.c (_gpgme_encrypt_status_handler): Likewise. (_gpgme_encrypt_sym_status_handler): Likewise. * encrypt-sign.c (encrypt_sign_status_handler): Likewise. * engine-gpgsm.c (parse_status): Likewise. (gpgsm_status_handler): Likewise. (gpgsm_set_recipients): Likewise. * export.c (export_status_handler): Likewise. * genkey.c (genkey_status_handler): Likewise. * import.c (append_xml_impinfo): Likewise. (import_status_handler): Likewise. * keylist.c (keylist_status_handler): Likewise. * passphrase.c (_gpgme_passphrase_status_handler): Likewise. (command_handler): Likewise. * progress.c (_gpgme_progress_status_handler): Likewise. * sign.c (_gpgme_sign_status_handler): Likewise. * trustlist.c (trustlist_status_handler): Likewise. * verify.c (_gpgme_verify_status_handler): Likewise. * gpgme.h (GpgmeEditCb): New type. * rungpg.h (GpgStatusCode): Rename and move to ... * gpgme.h (GpgmeStatusCode): ... this and here. * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h. * mkstatus: Prefix STATUS with GPGME_. * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type accordingly. * ops.h (_gpgme_verify_status_handler, _gpgme_decrypt_status_handler, _gpgme_sign_status_handler, _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler, _gpgme_progress_status_handler): Likewise. * rungpg.c (struct gpg_object_s): Likewise for CMD.code. These changes add an edit operation to GPGME: * context.h (struct gpgme_context_s): New member RESULT.edit. * ops.h: Add prototype for _gpgme_release_edit_result and _gpgme_passphrase_command_handler. * passphrase.c (command_handler): Make non-static and rename to ... (_gpgme_passphrase_command_handler): ... this. (_gpgme_passphrase_start): Use new name for command handler. * types.h: Add EditResult type. * gpgme.c (_gpgme_release_result): Release EDIT result. * edit.c: New file. * Makefile.am (libgpgme_la_SOURCES): Add edit.c. (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include assuan_libobjs. (assuan_libobjs): New variable, set this instead libgpgme_la_LIBADD. * engine.h (_gpgme_engine_op_edit): New prototype. * engine.c (_gpgme_engine_op_edit): New function. * rungpg.h (_gpgme_gpg_op_edit): New prototype. * rungpg.c (_gpgme_gpg_op_edit): New function.
2002-07-28 18:41:02 +00:00
void *fnc_value,
GpgmeData data);
2002-10-10 Marcus Brinkmann <marcus@g10code.de> * rungpg.h, engine-gpgsm.h: File removed. * engine-backend.h: New file. * Makefile.am (gpgsm_components): New variable, set depending on automake conditional HAVE_GPGSM. (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and engine-gpgsm.h. Replace engine-gpgsm.c with ${gpgsm_components}. (status-table.h): Depend on gpgme.h, not rungpg.h. * conversion.c: Include <stdlib.h>. * engine-gpgsm.c: Do not set ENABLE_GPGSM here. Include "engine-backend.h" instead "engine-gpgsm.h". Reorder some functions and remove all function prototypes. (_gpgme_gpgsm_get_version): Make static and rename to ... (gpgsm_get_version): ... this. (_gpgme_gpgsm_check_version): Make static and rename to ... (gpgsm_check_version): ... this. (_gpgme_gpgsm_new): Make static. Change argument type from GpgsmObject * to void **. Call gpgsm_release instead _gpgme_gpgsm_release. (_gpgme_gpgsm_op_decrypt): Make static and rename to ... (gpgsm_check_decrypt): ... this. (_gpgme_gpgsm_op_delete): Make static and rename to ... (gpgsm_check_delete): ... this. (_gpgme_gpgsm_set_recipients): Make static and rename to ... (gpgsm_check_set_recipients): ... this. (_gpgme_gpgsm_op_encrypt): Make static and rename to ... (gpgsm_encrypt): ... this. (_gpgme_gpgsm_op_export): Make static and rename to ... (gpgsm_export): ... this. (_gpgme_gpgsm_op_genkey): Make static and rename to ... (gpgsm_genkey): ... this. (_gpgme_gpgsm_op_import): Make static and rename to ... (gpgsm_import): ... this. (_gpgme_gpgsm_op_keylist): Make static and rename to ... (gpgsm_keylist): ... this. (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ... (gpgsm_keylist_ext): ... this. (_gpgme_gpgsm_op_sign): Make static and rename to ... (gpgsm_sign): ... this. (_gpgme_gpgsm_op_trustlist): Make static and rename to ... (gpgsm_trustlist): ... this. (_gpgme_gpgsm_op_verify): Make static and rename to ... (gpgsm_verify): ... this. (gpgsm_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpgsm_set_status_handler): Make static and rename to ... (gpgsm_set_status_handler): ... this. (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ... (gpgsm_set_colon_line_handler): ... this. (_gpgme_gpgsm_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpgsm_start): Make static and rename to ... (gpgsm_start): ... this. (_gpgme_gpgsm_set_io_cb): Make static and rename to ... (gpgsm_set_io_cb): ... this. (_gpgme_gpgsm_io_event): Make static and rename to ... (gpgsm_io_event): ... this. (struct _gpgme_engine_ops_gpgsm): New variable. [!ENABLE_GPGSM]: Removed. * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>, <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h". Include <stdlib.h> and "engine-backend.h". (struct engine_object_s): Rewritten. (engine_ops): New variable. * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version, _gpgme_engine_check_version, _gpgme_engine_new, _gpgme_engine_release, _gpgme_engine_set_verbosity, _gpgme_engine_set_status_handler, _gpgme_engine_set_command_handler, _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt, _gpgme_engine_op_delete, _gpgme_engine_op_edit, _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign, _gpgme_engine_op_export, _gpgme_engine_op_genkey, _gpgme_engine_op_import, _gpgme_engine_op_keylist, _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign, _gpgme_engine_op_trustlist, _gpgme_engine_op_verify, _gpgme_engine_start, _gpgme_engine_set_io_cbs, _gpgme_engine_io_event): Reimplement. * engine.h: Fix a few comments and a variable name in a prototype. * ops.h: Do not include "rungpg.h". * passphrase.c: Include config.h only if [HAVE_CONFIG_H]. Do not include "rungpg.h". * recipient.c: Likewise. * signers.c: Likewise. * version.c: Likewise. * rungpg.c: Likewise. Include "engine-backend.h". Reorder functions and remove prototypes. (_gpgme_gpg_get_version): Make static and rename to ... (gpg_get_version): ... this. (_gpgme_gpg_check_version): Make static and rename to ... (gpg_check_version): ... this. (_gpgme_gpg_new): Make static. Change argument type from GpgObject * to void **. Call gpg_release instead _gpgme_gpg_release. (_gpgme_gpg_op_decrypt): Make static and rename to ... (gpg_check_decrypt): ... this. (_gpgme_gpg_op_delete): Make static and rename to ... (gpg_check_delete): ... this. (_gpgme_gpg_set_recipients): Make static and rename to ... (gpg_check_set_recipients): ... this. (_gpgme_gpg_op_encrypt): Make static and rename to ... (gpg_encrypt): ... this. (_gpgme_gpg_op_export): Make static and rename to ... (gpg_export): ... this. (_gpgme_gpg_op_genkey): Make static and rename to ... (gpg_genkey): ... this. (_gpgme_gpg_op_import): Make static and rename to ... (gpg_import): ... this. (_gpgme_gpg_op_keylist): Make static and rename to ... (gpg_keylist): ... this. (_gpgme_gpg_op_keylist_ext): Make static and rename to ... (gpg_keylist_ext): ... this. (_gpgme_gpg_op_sign): Make static and rename to ... (gpg_sign): ... this. (_gpgme_gpg_op_trustlist): Make static and rename to ... (gpg_trustlist): ... this. (_gpgme_gpg_op_verify): Make static and rename to ... (gpg_verify): ... this. (gpg_status_handler): Rename to ... (status_handler): ... this. (_gpgme_gpg_set_status_handler): Make static and rename to ... (gpg_set_status_handler): ... this. (_gpgme_gpg_set_colon_line_handler): Make static and rename to ... (gpg_set_colon_line_handler): ... this. (gpgme_gpg_add_io_cb): Rename to ... (add_io_cb): ... this. (_gpgme_gpg_start): Make static and rename to ... (gpg_start): ... this. (_gpgme_gpg_set_io_cb): Make static and rename to ... (gpg_set_io_cb): ... this. (_gpgme_gpg_io_event): Make static and rename to ... (gpg_io_event): ... this. (struct _gpgme_engine_ops_gpg): New variable.
2002-10-12 00:33:05 +00:00
GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
2002-10-09 Marcus Brinkmann <marcus@g10code.de> * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler and move to ... * types.h (GpgmeStatusHandler): ... here. * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler. and move to ... * types.h (GpgmeColonLineHandler): ... here. * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler. and move to ... * types.h (GpgmeCommandHandler): ... here. * engine.h: Don't include "rungpg.h". (_gpgme_engine_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * engine-gpgsm.h: Don't include "rungpg.h". (_gpgme_gpgsm_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * engine-gpgsm.c: Do not include "rungpg.h". (struct gpgsm_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. (gpgsm_assuan_simple_command): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpgsm_set_status_handler): Likewise. (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. * rungpg.h (_gpgme_gpg_set_status_handler): Change type of argument from GpgStatusHandler to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument from GpgColonLineHandler to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument from GpgCommandHandler to GpgmeCommandHandler. * rungpg.c (struct gpg_object_s): Change type of status.fnc to GpgmeStatusHandler. Change type of colon.fnc to GpgmeColonLineHandler. Change type of cmd.fnc to GpgmeCommandLineHandler. (_gpgme_gpg_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_gpg_set_command_handler): Change type of argument FNC to GpgmeCommandHandler. * engine.c (_gpgme_engine_set_status_handler): Change type of argument FNC to GpgmeStatusHandler. (_gpgme_engine_set_colon_line_handler): Change type of argument FNC to GpgmeColonLineHandler. (_gpgme_engine_set_command_handler): Change type of argument FNC to GpgmeCommandHandler.
2002-10-09 12:23:33 +00:00
GpgmeColonLineHandler fnc,
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
void *fnc_value);
void _gpgme_engine_set_verbosity (EngineObject engine, int verbosity);
GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph,
GpgmeData plain);
GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key,
int allow_secret);
2002-07-28 Marcus Brinkmann <marcus@g10code.de> * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF instead an error. The following changes make it possible to flush an inbound data pipe before invoking a command handler: * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to _gpgme_io_select. Set timeout of 0 if this is set. * w32-io.c (_gpgme_io_select): Likewise. * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype. * wait.c (do_select): Add new argument to _gpgme_io_select invocation. * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument linked_data to prototype. * engine.h (_gpgme_engine_set_command_handler): Likewise. * engine.c (_gpgme_engine_set_command_handler): Likewise. * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data argument to _gpgme_engine_set_command_handler. * rungpg.c (struct gpg_object_s): New members linked_data and linked_idx in CMD. (_gpgme_gpg_new): Initialize those new members. (_gpgme_gpg_set_command_handler): Accept new argument linked_data. (build_argv): Handle linked_data in the same hack as cb_data. (read_status): If linked_data is in use, flush the pipe before activating the command handler. * gpgme.h: Add prototypes for gpgme_op_edit_start and gpgme_op_edit. The next changes export the status codes to the user: * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix all STATUS_ with GPGME_. * delete.c (delete_status_handler): Likewise. * decrypt-verify.c (decrypt_verify_status_handler): Likewise. * encrypt.c (_gpgme_encrypt_status_handler): Likewise. (_gpgme_encrypt_sym_status_handler): Likewise. * encrypt-sign.c (encrypt_sign_status_handler): Likewise. * engine-gpgsm.c (parse_status): Likewise. (gpgsm_status_handler): Likewise. (gpgsm_set_recipients): Likewise. * export.c (export_status_handler): Likewise. * genkey.c (genkey_status_handler): Likewise. * import.c (append_xml_impinfo): Likewise. (import_status_handler): Likewise. * keylist.c (keylist_status_handler): Likewise. * passphrase.c (_gpgme_passphrase_status_handler): Likewise. (command_handler): Likewise. * progress.c (_gpgme_progress_status_handler): Likewise. * sign.c (_gpgme_sign_status_handler): Likewise. * trustlist.c (trustlist_status_handler): Likewise. * verify.c (_gpgme_verify_status_handler): Likewise. * gpgme.h (GpgmeEditCb): New type. * rungpg.h (GpgStatusCode): Rename and move to ... * gpgme.h (GpgmeStatusCode): ... this and here. * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h. * mkstatus: Prefix STATUS with GPGME_. * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type accordingly. * ops.h (_gpgme_verify_status_handler, _gpgme_decrypt_status_handler, _gpgme_sign_status_handler, _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler, _gpgme_progress_status_handler): Likewise. * rungpg.c (struct gpg_object_s): Likewise for CMD.code. These changes add an edit operation to GPGME: * context.h (struct gpgme_context_s): New member RESULT.edit. * ops.h: Add prototype for _gpgme_release_edit_result and _gpgme_passphrase_command_handler. * passphrase.c (command_handler): Make non-static and rename to ... (_gpgme_passphrase_command_handler): ... this. (_gpgme_passphrase_start): Use new name for command handler. * types.h: Add EditResult type. * gpgme.c (_gpgme_release_result): Release EDIT result. * edit.c: New file. * Makefile.am (libgpgme_la_SOURCES): Add edit.c. (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include assuan_libobjs. (assuan_libobjs): New variable, set this instead libgpgme_la_LIBADD. * engine.h (_gpgme_engine_op_edit): New prototype. * engine.c (_gpgme_engine_op_edit): New function. * rungpg.h (_gpgme_gpg_op_edit): New prototype. * rungpg.c (_gpgme_gpg_op_edit): New function.
2002-07-28 18:41:02 +00:00
GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key,
GpgmeData out, GpgmeCtx ctx /* FIXME */);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp,
GpgmeData plain, GpgmeData ciph,
int use_armor);
GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine,
GpgmeRecipients recp,
GpgmeData plain, GpgmeData ciph,
int use_armor,
GpgmeCtx ctx /* FIXME */);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp,
GpgmeData keydata, int use_armor);
GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data,
int use_armor, GpgmeData pubkey,
GpgmeData seckey);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata);
GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
int secret_only,
int keylist_mode);
GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine,
const char *pattern[],
int secret_only,
int reserved,
int keylist_mode);
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in,
GpgmeData out, GpgmeSigMode mode,
int use_armor, int use_textmode,
int include_certs,
2001-11-21 Marcus Brinkmann <marcus@g10code.de> * 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.
2001-11-21 03:40:17 +00:00
GpgmeCtx ctx /* FIXME */);
GpgmeError _gpgme_engine_op_trustlist (EngineObject engine,
const char *pattern);
GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
doc/ 2003-01-29 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (I/O Callback Interface): Document new even GPGME_EVENT_START. (Waiting For Completion): Document new possible return values. (I/O Callback Interface): Document return type of GpgmeIOCb. gpgme/ 2003-01-29 Marcus Brinkmann <marcus@g10code.de> * context.h (gpgme_context_s): Remove member ERROR. * types.h (GpgmeStatusHandler): Change return type to GpgmeError. (GpgmeCommandHandler): Change return type to GpgmeError and add new argument RESULT. * gpgme.h (GpgmeIOCb): Change return type to GpgmeError. (GpgmeEventIO): New event GPGME_EVENT_START. (GpgmeIdleFunc): Remove type. (gpgme_register_idle): Remove prototype. * data.c: Include <assert.h>. (_gpgme_data_inbound_handler): Change return type to GpgmeError. Return any error instead ignoring it, don't close file descriptor on error. (_gpgme_data_outbound_handler): Likewise. * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>. (_gpgme_decrypt_status_handler): Change return type to GpgmeError. Return error instead setting ctx->error. Return success at end of function. (gpgme_op_decrypt): Don't work around the old kludge anymore. * decrypt-verify.c (decrypt_verify_status_handler): Change return type to GpgmeError. Return possible errors. * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and <assert.h>. (delete_status_handler): Change return type to GpgmeError. Return error instead setting ctx->error. Return success at end of function. * edit.c: Do not include <stdio.h> and <string.h>. (_gpgme_edit_status_handler): Change type to GpgmeError, make static and rename to ... (edit_status_handler): ... this. Return error directly. (command_handler): Change return type to GpgmeError, add result argument. Return error directly. * encrypt.c (status_handler_finish): Remove function. (_gpgme_encrypt_status_handler): Change return type to GpgmeError. Return error directly. (_gpgme_encrypt_sym_status_handler): Likewise. * encrypt-sign.c (encrypt_sign_status_handler): Likewise. * engine-gpgsm.c (close_notify_handler): Do not signal done event anymore. (status_handler): Change return type to GpgmeError. Diddle things around a bit to return errors directly. (start): Send start event. * export.c: Do not include <stdio.h>, <string.h> and <assert.h>. (export_status_handler): Change return type to GpgmeError. Don't check ctx->error. * genkey.c: Do not include <stdio.h> and <assert.h>. (genkey_status_handler): Change return type to GpgmeError. Don't check ctx->error. Return errors directly. * gpgme.c (_gpgme_release_result): Do not initialize ctx->error. (_gpgme_op_event_cb): Function removed. (_gpgme_op_event_cb_user): Likewise. * import.c: Do not include <stdio.h>, <string.h> and <assert.h>. (import_status_handler): Change return type to GpgmeError. Don't check ctx->error. * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key): Change return type to GpgmeError, return error directly. * Makefile (libgpgme_la_SOURCES): Add wait-global.c, wait-private.c and wait-user.c * ops.h (test_and_allocate_result): Return error instead setting ctx->error. (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler, _gpgme_verify_status_handler, _gpgme_decrypt_status_handler, _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler, _gpgme_passphrase_status_handler, _gpgme_progress_status_handler): Change return type to GpgmeError. (_gpgme_passphease_command_handler): Change return type to GpgmeError and add new argument RESULT. * op-support.c: Use new callback functions, and change private data to ctx everywhere. * passphrase.c (_gpgme_passphrase_status_handler): Change return type to GpgmeError, return error directly. (_gpgme_passphrase_command_handler): Change return type to GpgmeError, add result argument. Return results accordingly. * progress.c (_gpgme_progress_status_handler): Change return type to GpgmeError, return errors directly. * rungpg.c (status_handler): Change return type to GpgmeError. Return error directly. (close_notify_handler): Don't send done event. (colon_line_handler): Change return type to GpgmeError, return errors directly. * rungpg.c (start): Send start event. * sign.c (_gpgme_sign_status_handler): Change return type to GpgmeError, return errors directly. * trustlist.c (trustlist_status_handler): Change return type to GpgmeError. Return 0. (trustlist_colon_handler): Change return type GpgmeError. Return errors directly. * verify.c (add_notation): Change return type to GpgmeError, return errors directly. (_gpgme_verify_status_handler): Likewise. * wait.h (struct fd_table): Remove lock member. (struct wait_item_s): Moved here from wait.c. (struct tag): New structure. (_gpgme_wait_event_cb): Remove prototype. (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb, _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb, _gpgme_wait_user_event_io_cb): New prototypes. * wait.c: Don't include <stdio.h>. (ftd_global, ctx_done_list, ctx_done_list_size, ctx_done_list_length, ctx_done_list_lock, idle_function): Remove global variable. (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove function. (gpgme_wait): Move to file wait-global.c. (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx member in wait item and tag. (_gpgme_remove_io_cb): Take ctx from tag. Don't use FDT lock. (_gpgme_wait_one, _gpgme_wait_on_condition): Move to wait-private.c. (gpgme_fd_table_init): Don't initialize FDT->lock. (gpgme_fd_table_deinit): Don't destroy FDT->lock. (_gpgme_fd_table_put): Make static and rename to ... (fd_table_put): ... this function. Don't use FDT->lock. (struct wait_item_s): Move to wait.h. * wait-global.c: New file. * wait-private.c: New file. * wait-user.c: New file.
2003-01-29 15:20:58 +00:00
GpgmeData signed_text,
GpgmeData plaintext);
2002-06-10 Marcus Brinkmann <marcus@g10code.de> * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the close notification for the status fd to ... (_gpgme_gpgsm_new): ... here. * wait.h: Include "sema.h". Remove prototypes of _gpgme_remove_proc_from_wait_queue and _gpgme_register_pipe_handler. Add prototypes of _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put, _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and _gpgme_wait_one.. * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK, FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE, CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct proc_s. Replace struct wait_item_s. (_gpgme_fd_table_init): New function. (_gpgme_fd_table_deinit): Likewise. (_gpgme_fd_table_put): Likewise. (set_process_done): Remove function. (do_select): Take argument FDT. Use that to decide which fds to select on. (_gpgme_remove_proc_from_wait_queue): Remove function. (_gpgme_wait_event_cb): New function. (_gpgme_wait_one): Likewise. (_gpgme_register_pipe_hanldler): Remove function. (_gpgme_add_io_cb): New function. (_gpgme_remove_io_cb): Likewise. (_gpgme_freeze_fd): Remove function. (_gpgme_thaw_fd): Remove function. * rungpg.c (struct fd_data_map_s): Add new member TAG. (struct gpg_object_s): Likewise for STATUS and COLON. Add member IDX to CMD. Add new member IO_CBS. (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE. For each I/O callback, check if it should be unregistered. If all callbacks have been unregistered, trigger GPGME_EVENT_DONE. Remove member RUNNING. (_gpgme_gpg_new): Initialize new members. (_gpgme_gpg_release): Check PID not RUNNING. Don't call _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set. (build_argv): Store away the index instead the file descriptor for CMD. (_gpgme_gpg_add_io_cb): New function. (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO callbacks. (gpg_status_handler): Change return type to void, remove PID argument, close filedescriptor if EOF or error occurs. (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd. Use IO_CBS->remove instead _gpgme_freeze_fd. (gpg_colon_line_handler): Change return type to void, remove PID argument, close filedescriptor if EOF or error occurs. (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd. (_gpgme_gpg_set_io_cbs): New function. * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for _gpgme_gpg_set_io_cbs. * gpgme.h (GpgmeIOCb): New type. (GpgmeRegisterIOCb): Likewise. (GpgmeRemoveIOCb): Likewise. (GpgmeEventIO): Likewise. (GpgmeEventIOCb): Likewise. (struct GpgmeIOCbs): New structure to hold I/O callbacks. (gpgme_set_op_io_cbs): New prototype. (gpgme_get_op_io_cbs): Likewise. * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from _gpgme_data_inbound_handler and _gpgme_data_outbound_handler prototype. Add prototype for _gpgme_op_reset. Add synchronous argument to _gpgme_decrypt_start prototype. * io.h: Beautification. * gpgme.c: Include "wait.h". (gpgme_new): Initialize FDT. (gpgme_set_io_cbs): New function. (gpgme_get_io_cbs): Likewise. (_gpgme_op_event_cb): Likewise. * data.c (_gpgme_data_inbound_handler): Change return type to void. Drop PID argument. Close FD on error and EOF. (write_mem_data): Don't close FD here ... (write_cb_data): ... or here ... (_gpgme_data_outbound_handler): ... but here. Change return type to void. Drop PID argument. * context.h: Include "wait.h". (struct gpgme_context_s): New members FDT and IO_CBS. * op-support.c: New file. * Makefile.am (libgpgme_la_SOURCES): Add op-support.c. * ops.h: Add prototype for _gpgme_op_reset(). * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use _gpgme_op_reset. (gpgme_op_decrypt_start): Add synchronous argument. (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead gpgme_wait. * delete.c (gpgme_op_delete_start): Rename to ... (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_delete_start): Just a wrapper around _gpgme_op_delete_start now. (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * encrypt.c: Include "wait.h". (ggpgme_op_encrypt_start): Rename to ... (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_encrypt_start): Just a wrapper around _gpgme_op_encrypt_start now. (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ... (_gpgme_op_encrypt_sign_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_encrypt_sign_start): Just a wrapper around _gpgme_op_encrypt_sign_start now. (gpgme_op_encrypt_sign): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * export.c (gpgme_op_export_start): Rename to ... (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_export_start): Just a wrapper around _gpgme_op_export_start now. (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * genkey.c (gpgme_op_genkey_start): Rename to ... (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_genkey_start): Just a wrapper around _gpgme_op_genkey_start now. (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * import.c (gpgme_op_import_start): Rename to ... (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_import_start): Just a wrapper around _gpgme_op_import_start now. (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset. (gpgme_op_keylist_ext_start): Likewise. * sign.c (gpgme_op_sign_start): Rename to ... (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start now. (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset. * verify.c (gpgme_op_verify_start): Rename to ... (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_verify_start): Just a wrapper around _gpgme_op_verify_start now. (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * engine-gpgsm.c (iocb_data_t): New type. (struct gpgsm_object_s): New member status_cb. Replace input_fd and input_data with input_cb. Replace output_fd and output_data with output_cb. Replace message_fd and message_data with message_cb. New member io_cbs. (_gpgme_gpgsm_new): Initialize all new members (and drop the old ones). (close_notify_handler): New variable POSSIBLY_DONE. For each I/O callback, check if it should be unregistered. If all callbacks have been unregistered, trigger GPGME_EVENT_DONE. (_gpgme_gpgsm_release): Remove variable PID. Use new variable names to close the file descriptors. (_gpgme_gpgsm_op_decrypt): Use new variable names, (_gpgme_gpgsm_op_encrypt): Likewise. (_gpgme_gpgsm_op_genkey): Likewise. (_gpgme_gpgsm_op_import): Likewise. (_gpgme_gpgsm_op_keylist): Likewise. (_gpgme_gpgsm_op_keylist_ext): Likewise. (_gpgme_gpgsm_op_sign): Likewise. (_gpgme_gpgsm_op_verify): Likewise. (gpgsm_status_handler): Drop argument PID. Change return type to void. Close status pipe before returning because of EOF or error. (_gpgme_gpgsm_add_io_cb): New function. (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register callback function. (_gpgme_gpgsm_set_io_cbs): New function. * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs. * engine.c (_gpgme_engine_set_io_cbs): New function. * engine.h: New prototype for _gpgme_engine_set_io_cbs.
2002-06-10 14:13:55 +00:00
void _gpgme_engine_set_io_cbs (EngineObject engine,
struct GpgmeIOCbs *io_cbs);
2002-07-03 Marcus Brinkmann <marcus@g10code.de> * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL. * gpgme.c (_gpgme_op_event_cb_user): New function. * op-support.c (_gpgme_op_reset): Support a new mode of operation for private or user event loop. Use new user event callback wrapper. * trustlist.c (gpgme_op_trustlist_start): Use this new mode. * keylist.c (gpgme_op_keylist_start): Likewise. * rungpg.c (_gpgme_gpg_io_event): New function. * rungpg.h (_gpgme_gpg_io_event): New prototype. * engine-gpgsm.c (_gpgme_gpg_io_event): New function. * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype. * engine.c (_gpgme_engine_io_event): New function. * engine.h (_gpgme_engine_io_event): New prototype. * keylist.c (finish_key): Call _gpgme_engine_io_event, and move the real work for the default IO callback routines to ... (_gpgme_op_keylist_event_cb): ... here. New function. * trustlist.c (trustlist_colon_handler): Signal GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ... (_gpgme_op_trustlist_event_cb): ... here. New function. * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb and _gpgme_op_trustlist_event_cb when appropriate. * ops.h (_gpgme_op_keylist_event_cb): New prototype. (_gpgme_op_trustlist_event_cb): Likewise. * op-support.c (_gpgme_op_reset): Add comment why we don't use the user provided event handler directly. * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in a pointer argument. * wait.c (_gpgme_add_io_cb): Likewise. * wait.h (_gpgme_add_io_cb): Likewise for prototype. * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new argument. Fix up error handling. * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with new argument, fix up error handling.
2002-07-03 01:57:03 +00:00
void _gpgme_engine_io_event (EngineObject engine,
GpgmeEventIO type, void *type_data);
2002-06-10 Marcus Brinkmann <marcus@g10code.de> * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the close notification for the status fd to ... (_gpgme_gpgsm_new): ... here. * wait.h: Include "sema.h". Remove prototypes of _gpgme_remove_proc_from_wait_queue and _gpgme_register_pipe_handler. Add prototypes of _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put, _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and _gpgme_wait_one.. * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK, FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK. New global variables FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE, CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK. Remove struct proc_s. Replace struct wait_item_s. (_gpgme_fd_table_init): New function. (_gpgme_fd_table_deinit): Likewise. (_gpgme_fd_table_put): Likewise. (set_process_done): Remove function. (do_select): Take argument FDT. Use that to decide which fds to select on. (_gpgme_remove_proc_from_wait_queue): Remove function. (_gpgme_wait_event_cb): New function. (_gpgme_wait_one): Likewise. (_gpgme_register_pipe_hanldler): Remove function. (_gpgme_add_io_cb): New function. (_gpgme_remove_io_cb): Likewise. (_gpgme_freeze_fd): Remove function. (_gpgme_thaw_fd): Remove function. * rungpg.c (struct fd_data_map_s): Add new member TAG. (struct gpg_object_s): Likewise for STATUS and COLON. Add member IDX to CMD. Add new member IO_CBS. (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE. For each I/O callback, check if it should be unregistered. If all callbacks have been unregistered, trigger GPGME_EVENT_DONE. Remove member RUNNING. (_gpgme_gpg_new): Initialize new members. (_gpgme_gpg_release): Check PID not RUNNING. Don't call _gpgme_remove_proc_from_wait_queue. Close GPG->CMD.FD if set. (build_argv): Store away the index instead the file descriptor for CMD. (_gpgme_gpg_add_io_cb): New function. (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO callbacks. (gpg_status_handler): Change return type to void, remove PID argument, close filedescriptor if EOF or error occurs. (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd. Use IO_CBS->remove instead _gpgme_freeze_fd. (gpg_colon_line_handler): Change return type to void, remove PID argument, close filedescriptor if EOF or error occurs. (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd. (_gpgme_gpg_set_io_cbs): New function. * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for _gpgme_gpg_set_io_cbs. * gpgme.h (GpgmeIOCb): New type. (GpgmeRegisterIOCb): Likewise. (GpgmeRemoveIOCb): Likewise. (GpgmeEventIO): Likewise. (GpgmeEventIOCb): Likewise. (struct GpgmeIOCbs): New structure to hold I/O callbacks. (gpgme_set_op_io_cbs): New prototype. (gpgme_get_op_io_cbs): Likewise. * ops.h: New prototype for _gpgme_op_event_cb. Remove prototypes for _gpgme_freeze_fd and _gpgme_thaw_fd. Remove PID argument from _gpgme_data_inbound_handler and _gpgme_data_outbound_handler prototype. Add prototype for _gpgme_op_reset. Add synchronous argument to _gpgme_decrypt_start prototype. * io.h: Beautification. * gpgme.c: Include "wait.h". (gpgme_new): Initialize FDT. (gpgme_set_io_cbs): New function. (gpgme_get_io_cbs): Likewise. (_gpgme_op_event_cb): Likewise. * data.c (_gpgme_data_inbound_handler): Change return type to void. Drop PID argument. Close FD on error and EOF. (write_mem_data): Don't close FD here ... (write_cb_data): ... or here ... (_gpgme_data_outbound_handler): ... but here. Change return type to void. Drop PID argument. * context.h: Include "wait.h". (struct gpgme_context_s): New members FDT and IO_CBS. * op-support.c: New file. * Makefile.am (libgpgme_la_SOURCES): Add op-support.c. * ops.h: Add prototype for _gpgme_op_reset(). * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS. Use _gpgme_op_reset. (gpgme_op_decrypt_start): Add synchronous argument. (gpgme_op_decrypt): Likewise. Use _gpgme_wait_one instead gpgme_wait. * delete.c (gpgme_op_delete_start): Rename to ... (_gpgme_op_delete_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_delete_start): Just a wrapper around _gpgme_op_delete_start now. (gpgme_op_delete): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * encrypt.c: Include "wait.h". (ggpgme_op_encrypt_start): Rename to ... (_gpgme_op_encrypt_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_encrypt_start): Just a wrapper around _gpgme_op_encrypt_start now. (gpgme_op_encrypt): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ... (_gpgme_op_encrypt_sign_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_encrypt_sign_start): Just a wrapper around _gpgme_op_encrypt_sign_start now. (gpgme_op_encrypt_sign): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * export.c (gpgme_op_export_start): Rename to ... (_gpgme_op_export_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_export_start): Just a wrapper around _gpgme_op_export_start now. (gpgme_op_export): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * genkey.c (gpgme_op_genkey_start): Rename to ... (_gpgme_op_genkey_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_genkey_start): Just a wrapper around _gpgme_op_genkey_start now. (gpgme_op_genkey): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * import.c (gpgme_op_import_start): Rename to ... (_gpgme_op_import_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_import_start): Just a wrapper around _gpgme_op_import_start now. (gpgme_op_import): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset. (gpgme_op_keylist_ext_start): Likewise. * sign.c (gpgme_op_sign_start): Rename to ... (_gpgme_op_sign_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start now. (gpgme_op_sign): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset. * verify.c (gpgme_op_verify_start): Rename to ... (_gpgme_op_verify_start): ... this. New argument SYNCHRONOUS. Use _gpgme_op_reset. Make function static. (gpgme_op_verify_start): Just a wrapper around _gpgme_op_verify_start now. (gpgme_op_verify): Add synchronous argument. Use _gpgme_wait_one instead gpgme_wait. * engine-gpgsm.c (iocb_data_t): New type. (struct gpgsm_object_s): New member status_cb. Replace input_fd and input_data with input_cb. Replace output_fd and output_data with output_cb. Replace message_fd and message_data with message_cb. New member io_cbs. (_gpgme_gpgsm_new): Initialize all new members (and drop the old ones). (close_notify_handler): New variable POSSIBLY_DONE. For each I/O callback, check if it should be unregistered. If all callbacks have been unregistered, trigger GPGME_EVENT_DONE. (_gpgme_gpgsm_release): Remove variable PID. Use new variable names to close the file descriptors. (_gpgme_gpgsm_op_decrypt): Use new variable names, (_gpgme_gpgsm_op_encrypt): Likewise. (_gpgme_gpgsm_op_genkey): Likewise. (_gpgme_gpgsm_op_import): Likewise. (_gpgme_gpgsm_op_keylist): Likewise. (_gpgme_gpgsm_op_keylist_ext): Likewise. (_gpgme_gpgsm_op_sign): Likewise. (_gpgme_gpgsm_op_verify): Likewise. (gpgsm_status_handler): Drop argument PID. Change return type to void. Close status pipe before returning because of EOF or error. (_gpgme_gpgsm_add_io_cb): New function. (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register callback function. (_gpgme_gpgsm_set_io_cbs): New function. * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs. * engine.c (_gpgme_engine_set_io_cbs): New function. * engine.h: New prototype for _gpgme_engine_set_io_cbs.
2002-06-10 14:13:55 +00:00
#endif /* ENGINE_H */