gpgme/src/wait.h

97 lines
2.9 KiB
C
Raw Normal View History

/* wait.h - Definitions for the wait queue interface.
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
Copyright (C) 2000 Werner Koch (dd9jn)
2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README: Refer to COPYING.LESSER and "each file" instead of COPYING. * COPYING.LESSER: New file. * gpgme.spec.in (%doc): Add COPYING.LESSER. * acinclude.m4, configure.ac, Makefile.am: Change license to LGPL 2.1 or later. * TODO: Add copyright notice. * README.CVS: Likewise. assuan/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README.1st: Add copyright notice. doc/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * Makefile.am: Change license to LGPL. (gpgme_TEXINFOS): Replace gpl.texi with lesser.texi. * gpgme.texi: Change license to LGPL (also for documentation of GPGME's license). * lesser.texi: New file. * gpl.texi: File removed. gpgme/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * putc_unlocked.c, funopen.c: I just claim copyright on these files and change their license to LGPL, because they are totally trivial wrapper functions. * isascii.c: Change copyright notice to the one from ctype/ctype.h in the GNU C Library (CVS Head 2004-10-10), where isascii is defined as a macro doing exactly the same as the function in this file. * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06). * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10). * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c, ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c, data.c, data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c, data-user.c, debug.c, debug.h, decrypt.c, decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c, engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c, export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h, key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c, passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c, rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c, util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c, wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change license to LGPL. tests/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * gpg/mkdemodirs: Add copyright notice. * gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c, gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c, gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c, gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c, gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c, gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c, gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c, gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c, gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c, gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c, t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
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
This file is part of GPGME.
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
GPGME is free software; you can redistribute it and/or modify it
2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README: Refer to COPYING.LESSER and "each file" instead of COPYING. * COPYING.LESSER: New file. * gpgme.spec.in (%doc): Add COPYING.LESSER. * acinclude.m4, configure.ac, Makefile.am: Change license to LGPL 2.1 or later. * TODO: Add copyright notice. * README.CVS: Likewise. assuan/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README.1st: Add copyright notice. doc/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * Makefile.am: Change license to LGPL. (gpgme_TEXINFOS): Replace gpl.texi with lesser.texi. * gpgme.texi: Change license to LGPL (also for documentation of GPGME's license). * lesser.texi: New file. * gpl.texi: File removed. gpgme/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * putc_unlocked.c, funopen.c: I just claim copyright on these files and change their license to LGPL, because they are totally trivial wrapper functions. * isascii.c: Change copyright notice to the one from ctype/ctype.h in the GNU C Library (CVS Head 2004-10-10), where isascii is defined as a macro doing exactly the same as the function in this file. * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06). * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10). * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c, ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c, data.c, data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c, data-user.c, debug.c, debug.h, decrypt.c, decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c, engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c, export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h, key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c, passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c, rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c, util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c, wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change license to LGPL. tests/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * gpg/mkdemodirs: Add copyright notice. * gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c, gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c, gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c, gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c, gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c, gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c, gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c, gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c, gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c, gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c, t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
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
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
2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README: Refer to COPYING.LESSER and "each file" instead of COPYING. * COPYING.LESSER: New file. * gpgme.spec.in (%doc): Add COPYING.LESSER. * acinclude.m4, configure.ac, Makefile.am: Change license to LGPL 2.1 or later. * TODO: Add copyright notice. * README.CVS: Likewise. assuan/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README.1st: Add copyright notice. doc/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * Makefile.am: Change license to LGPL. (gpgme_TEXINFOS): Replace gpl.texi with lesser.texi. * gpgme.texi: Change license to LGPL (also for documentation of GPGME's license). * lesser.texi: New file. * gpl.texi: File removed. gpgme/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * putc_unlocked.c, funopen.c: I just claim copyright on these files and change their license to LGPL, because they are totally trivial wrapper functions. * isascii.c: Change copyright notice to the one from ctype/ctype.h in the GNU C Library (CVS Head 2004-10-10), where isascii is defined as a macro doing exactly the same as the function in this file. * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06). * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10). * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c, ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c, data.c, data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c, data-user.c, debug.c, debug.h, decrypt.c, decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c, engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c, export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h, key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c, passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c, rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c, util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c, wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change license to LGPL. tests/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * gpg/mkdemodirs: Add copyright notice. * gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c, gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c, gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c, gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c, gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c, gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c, gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c, gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c, gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c, gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c, t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
Lesser General Public License for more details.
2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README: Refer to COPYING.LESSER and "each file" instead of COPYING. * COPYING.LESSER: New file. * gpgme.spec.in (%doc): Add COPYING.LESSER. * acinclude.m4, configure.ac, Makefile.am: Change license to LGPL 2.1 or later. * TODO: Add copyright notice. * README.CVS: Likewise. assuan/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * README.1st: Add copyright notice. doc/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * Makefile.am: Change license to LGPL. (gpgme_TEXINFOS): Replace gpl.texi with lesser.texi. * gpgme.texi: Change license to LGPL (also for documentation of GPGME's license). * lesser.texi: New file. * gpl.texi: File removed. gpgme/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * putc_unlocked.c, funopen.c: I just claim copyright on these files and change their license to LGPL, because they are totally trivial wrapper functions. * isascii.c: Change copyright notice to the one from ctype/ctype.h in the GNU C Library (CVS Head 2004-10-10), where isascii is defined as a macro doing exactly the same as the function in this file. * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06). * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10). * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c, ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c, data.c, data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c, data-user.c, debug.c, debug.h, decrypt.c, decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c, engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c, export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h, key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c, passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c, rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c, util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c, wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change license to LGPL. tests/ 2004-12-07 Marcus Brinkmann <marcus@g10code.de> * gpg/mkdemodirs: Add copyright notice. * gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c, gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c, gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c, gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c, gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c, gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c, gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c, gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c, gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c, gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c, t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
You should have received a copy of the GNU Lesser 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. */
2000-11-07 13:32:38 +00:00
#ifndef WAIT_H
#define WAIT_H
#include "gpgme.h"
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
#include "sema.h"
2000-11-07 13:32:38 +00:00
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
struct fd_table
{
struct io_select_fd_s *fds;
size_t size;
};
typedef struct fd_table *fd_table_t;
2000-11-07 13:32:38 +00:00
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
/* Wait items are hooked into the io_select_fd_s to connect an fd with
a callback handler. */
struct wait_item_s
{
2003-05-18 Marcus Brinkmann <marcus@g10code.de> In all files, replace the Gpgme* type names with the new gpgme_* type names. doc/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (Header): Remove Gpgme as namespace prefix. Add _GPGME to namespace prefix. * gpgme.texi (Multi Threading): Add note about link order. gpgme/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.h: The following types are renamed. The old name is kept as a deprecated typedef. (GpgmeCtx): Rename to gpgme_ctx_t. (GpgmeData): Rename to gpgme_data_t. (GpgmeRecipients): Rename to gpgme_recipients_t. (GpgmeError): Rename to gpgme_error_t. (GpgmeDataEncoding): Rename to gpgme_data_encoding_t. (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t. (GpgmeHashAlgo): Rename to gpgme_hash_algo_t. (GpgmeSigStat): Rename to gpgme_sig_stat_t. (GpgmeSigMode): Rename to gpgme_sig_mode_t. (GpgmeAttr): Rename to gpgme_attr_t. (GpgmeValidity): Rename to gpgme_validity_t. (GpgmeProtocol): Rename to gpgme_protocol_t. (GpgmeStatusCode): Rename to gpgme_status_code_t. (GpgmeEngineInfo): Rename to gpgme_engine_info_t. (GpgmeSubkey): Rename to gpgme_subkey_t. (GpgmeKeySig): Rename to gpgme_keysig_t. (GpgmeUserID): Rename to gpgme_user_id_t. (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t. (GpgmeProgressCb): Rename to gpgme_progress_cb_t. (GpgmeEditCb): Rename to gpgme_edit_cb_t. (GpgmeIOCb): Rename to gpgme_io_cb_t. (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t. (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t. (GpgmeEventIO): Rename to gpgme_event_io_t. (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t. (GpgmeIOCbs): Rename to gpgme_io_cbs. (gpgme_io_cbs_t): New type. (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t. (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t. (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t. (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t. (GpgmeDataCbs): Rename to gpgme_data_cbs. (gpgme_data_cbs_t): New type. (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t. (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t. (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t. (GpgmeNewSignature): Rename to gpgme_new_signature_t. (GpgmeSignResult): Rename to gpgme_sign_result_t. (GpgmeSigNotation): Rename to gpgme_sig_notation_t. (GpgmeSignature): Rename to gpgme_signature_t. (GpgmeVerifyResult): Rename to gpgme_verify_result_t. (GpgmeImportStatus): Rename to gpgme_import_status_t. (GpgmeImportResult): Rename to gpgme_import_result_t. (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t. (GpgmeKeyListResult): Rename to gpgme_keylist_result_t. (GpgmeTrustItem): Rename to gpgme_trust_item_t. * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros GPGME_No_Recipients, GPGME_Invalid_Recipient and GPGME_No_Passphrase. * data.h (struct gpgme_data_s): Rename to struct gpgme_data. * context.h (struct gpgme_context_s): Rename to struct gpgme_context. (struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
gpgme_ctx_t ctx;
gpgme_io_cb_t handler;
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
void *handler_value;
int dir;
};
/* A registered fd handler is removed later using the tag that
identifies it. */
struct tag
{
/* The context for which the fd was registered. */
2003-05-18 Marcus Brinkmann <marcus@g10code.de> In all files, replace the Gpgme* type names with the new gpgme_* type names. doc/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (Header): Remove Gpgme as namespace prefix. Add _GPGME to namespace prefix. * gpgme.texi (Multi Threading): Add note about link order. gpgme/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.h: The following types are renamed. The old name is kept as a deprecated typedef. (GpgmeCtx): Rename to gpgme_ctx_t. (GpgmeData): Rename to gpgme_data_t. (GpgmeRecipients): Rename to gpgme_recipients_t. (GpgmeError): Rename to gpgme_error_t. (GpgmeDataEncoding): Rename to gpgme_data_encoding_t. (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t. (GpgmeHashAlgo): Rename to gpgme_hash_algo_t. (GpgmeSigStat): Rename to gpgme_sig_stat_t. (GpgmeSigMode): Rename to gpgme_sig_mode_t. (GpgmeAttr): Rename to gpgme_attr_t. (GpgmeValidity): Rename to gpgme_validity_t. (GpgmeProtocol): Rename to gpgme_protocol_t. (GpgmeStatusCode): Rename to gpgme_status_code_t. (GpgmeEngineInfo): Rename to gpgme_engine_info_t. (GpgmeSubkey): Rename to gpgme_subkey_t. (GpgmeKeySig): Rename to gpgme_keysig_t. (GpgmeUserID): Rename to gpgme_user_id_t. (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t. (GpgmeProgressCb): Rename to gpgme_progress_cb_t. (GpgmeEditCb): Rename to gpgme_edit_cb_t. (GpgmeIOCb): Rename to gpgme_io_cb_t. (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t. (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t. (GpgmeEventIO): Rename to gpgme_event_io_t. (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t. (GpgmeIOCbs): Rename to gpgme_io_cbs. (gpgme_io_cbs_t): New type. (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t. (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t. (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t. (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t. (GpgmeDataCbs): Rename to gpgme_data_cbs. (gpgme_data_cbs_t): New type. (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t. (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t. (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t. (GpgmeNewSignature): Rename to gpgme_new_signature_t. (GpgmeSignResult): Rename to gpgme_sign_result_t. (GpgmeSigNotation): Rename to gpgme_sig_notation_t. (GpgmeSignature): Rename to gpgme_signature_t. (GpgmeVerifyResult): Rename to gpgme_verify_result_t. (GpgmeImportStatus): Rename to gpgme_import_status_t. (GpgmeImportResult): Rename to gpgme_import_result_t. (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t. (GpgmeKeyListResult): Rename to gpgme_keylist_result_t. (GpgmeTrustItem): Rename to gpgme_trust_item_t. * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros GPGME_No_Recipients, GPGME_Invalid_Recipient and GPGME_No_Passphrase. * data.h (struct gpgme_data_s): Rename to struct gpgme_data. * context.h (struct gpgme_context_s): Rename to struct gpgme_context. (struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
gpgme_ctx_t ctx;
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
/* The index into the fd table for this context. */
int idx;
/* This is used by the wrappers for the user event loop. */
void *user_tag;
};
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_fd_table_init (fd_table_t fdt);
void _gpgme_fd_table_deinit (fd_table_t fdt);
2003-05-18 Marcus Brinkmann <marcus@g10code.de> In all files, replace the Gpgme* type names with the new gpgme_* type names. doc/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (Header): Remove Gpgme as namespace prefix. Add _GPGME to namespace prefix. * gpgme.texi (Multi Threading): Add note about link order. gpgme/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.h: The following types are renamed. The old name is kept as a deprecated typedef. (GpgmeCtx): Rename to gpgme_ctx_t. (GpgmeData): Rename to gpgme_data_t. (GpgmeRecipients): Rename to gpgme_recipients_t. (GpgmeError): Rename to gpgme_error_t. (GpgmeDataEncoding): Rename to gpgme_data_encoding_t. (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t. (GpgmeHashAlgo): Rename to gpgme_hash_algo_t. (GpgmeSigStat): Rename to gpgme_sig_stat_t. (GpgmeSigMode): Rename to gpgme_sig_mode_t. (GpgmeAttr): Rename to gpgme_attr_t. (GpgmeValidity): Rename to gpgme_validity_t. (GpgmeProtocol): Rename to gpgme_protocol_t. (GpgmeStatusCode): Rename to gpgme_status_code_t. (GpgmeEngineInfo): Rename to gpgme_engine_info_t. (GpgmeSubkey): Rename to gpgme_subkey_t. (GpgmeKeySig): Rename to gpgme_keysig_t. (GpgmeUserID): Rename to gpgme_user_id_t. (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t. (GpgmeProgressCb): Rename to gpgme_progress_cb_t. (GpgmeEditCb): Rename to gpgme_edit_cb_t. (GpgmeIOCb): Rename to gpgme_io_cb_t. (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t. (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t. (GpgmeEventIO): Rename to gpgme_event_io_t. (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t. (GpgmeIOCbs): Rename to gpgme_io_cbs. (gpgme_io_cbs_t): New type. (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t. (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t. (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t. (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t. (GpgmeDataCbs): Rename to gpgme_data_cbs. (gpgme_data_cbs_t): New type. (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t. (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t. (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t. (GpgmeNewSignature): Rename to gpgme_new_signature_t. (GpgmeSignResult): Rename to gpgme_sign_result_t. (GpgmeSigNotation): Rename to gpgme_sig_notation_t. (GpgmeSignature): Rename to gpgme_signature_t. (GpgmeVerifyResult): Rename to gpgme_verify_result_t. (GpgmeImportStatus): Rename to gpgme_import_status_t. (GpgmeImportResult): Rename to gpgme_import_result_t. (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t. (GpgmeKeyListResult): Rename to gpgme_keylist_result_t. (GpgmeTrustItem): Rename to gpgme_trust_item_t. * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros GPGME_No_Recipients, GPGME_Invalid_Recipient and GPGME_No_Passphrase. * data.h (struct gpgme_data_s): Rename to struct gpgme_data. * context.h (struct gpgme_context_s): Rename to struct gpgme_context. (struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
gpgme_error_t _gpgme_add_io_cb (void *data, int fd, int dir,
gpgme_io_cb_t fnc, void *fnc_data, void **r_tag);
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_remove_io_cb (void *tag);
2003-05-18 21:08:43 +00:00
void _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type,
void *type_data);
void _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type,
void *type_data);
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
2003-05-18 Marcus Brinkmann <marcus@g10code.de> In all files, replace the Gpgme* type names with the new gpgme_* type names. doc/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (Header): Remove Gpgme as namespace prefix. Add _GPGME to namespace prefix. * gpgme.texi (Multi Threading): Add note about link order. gpgme/ 2003-05-18 Marcus Brinkmann <marcus@g10code.de> * gpgme.h: The following types are renamed. The old name is kept as a deprecated typedef. (GpgmeCtx): Rename to gpgme_ctx_t. (GpgmeData): Rename to gpgme_data_t. (GpgmeRecipients): Rename to gpgme_recipients_t. (GpgmeError): Rename to gpgme_error_t. (GpgmeDataEncoding): Rename to gpgme_data_encoding_t. (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t. (GpgmeHashAlgo): Rename to gpgme_hash_algo_t. (GpgmeSigStat): Rename to gpgme_sig_stat_t. (GpgmeSigMode): Rename to gpgme_sig_mode_t. (GpgmeAttr): Rename to gpgme_attr_t. (GpgmeValidity): Rename to gpgme_validity_t. (GpgmeProtocol): Rename to gpgme_protocol_t. (GpgmeStatusCode): Rename to gpgme_status_code_t. (GpgmeEngineInfo): Rename to gpgme_engine_info_t. (GpgmeSubkey): Rename to gpgme_subkey_t. (GpgmeKeySig): Rename to gpgme_keysig_t. (GpgmeUserID): Rename to gpgme_user_id_t. (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t. (GpgmeProgressCb): Rename to gpgme_progress_cb_t. (GpgmeEditCb): Rename to gpgme_edit_cb_t. (GpgmeIOCb): Rename to gpgme_io_cb_t. (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t. (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t. (GpgmeEventIO): Rename to gpgme_event_io_t. (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t. (GpgmeIOCbs): Rename to gpgme_io_cbs. (gpgme_io_cbs_t): New type. (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t. (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t. (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t. (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t. (GpgmeDataCbs): Rename to gpgme_data_cbs. (gpgme_data_cbs_t): New type. (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t. (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t. (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t. (GpgmeNewSignature): Rename to gpgme_new_signature_t. (GpgmeSignResult): Rename to gpgme_sign_result_t. (GpgmeSigNotation): Rename to gpgme_sig_notation_t. (GpgmeSignature): Rename to gpgme_signature_t. (GpgmeVerifyResult): Rename to gpgme_verify_result_t. (GpgmeImportStatus): Rename to gpgme_import_status_t. (GpgmeImportResult): Rename to gpgme_import_result_t. (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t. (GpgmeKeyListResult): Rename to gpgme_keylist_result_t. (GpgmeTrustItem): Rename to gpgme_trust_item_t. * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros GPGME_No_Recipients, GPGME_Invalid_Recipient and GPGME_No_Passphrase. * data.h (struct gpgme_data_s): Rename to struct gpgme_data. * context.h (struct gpgme_context_s): Rename to struct gpgme_context. (struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
gpgme_error_t _gpgme_wait_user_add_io_cb (void *data, int fd, int dir,
gpgme_io_cb_t fnc, void *fnc_data,
void **r_tag);
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
void _gpgme_wait_user_remove_io_cb (void *tag);
2003-05-18 21:08:43 +00:00
void _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t 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
2009-10-26 Marcus Brinkmann <marcus@g10code.de> * configure.ac (NEED_GPG_VERSION_DEFAULT): Bump to 1.4.0 as 1.3.0 was development versions only. tests/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * opassuan/t-command.c: Update to new interface. src/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * gpgme.h.in (struct gpgme_io_event_done_data) (gpgme_io_event_done_data_t): New types. (struct _gpgme_op_assuan_result): Deprecate the err member. (gpgme_op_assuan_result): Deprecate (for now). (gpgme_op_assuan_transact_ext): New prototype. (gpgme_op_assuan_transact): Deprecate. (struct _gpgme_op_g13_result): Replace with ... (struct _gpgme_op_vfs_mount_result): ... this. (gpgme_op_g13_mount): Replace with ... (gpgme_op_vfs_mount): ... this. * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext) (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New. (gpgme_op_g13_mount): Remove. * libgpgme.vers: Likewise. * engine-backend.h (struct engine_ops): Remove RESULT_CB and RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP member. * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add OP_ERR argument. (_gpgme_wait_one_ext): New prototype. * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT. * engine-g13.c (g13_cancel_op): New function. (parse_status): Remove declaration. (g13_assuan_simple_command): Do nothing with status lines for now. (status_handler): Update opaque value access. (_gpgme_engine_ops_g13): Add new cancel_op member. * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR. Handle operational errors. (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output. * data.c (_gpgme_data_inbound_handler) (_gpgme_data_outbound_handler): Adjust opaque value access. * engine-gpg.c (command_handler, status_handler) (colon_line_handler): Likewise. * engine-gpgsm.c (status_handler): Likewise. * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member. * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise. * g13.c: Rewritten (and will be rewritten again). * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameters from prototype. (_gpgme_engine_cancel_op): New prototype. * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma. (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameter. (_gpgme_engine_cancel_op): New function. * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR. (struct io_cb_data): New struct to pass opaque data and get a op_err return value. Needed because we can't modify I/O callback handler signature because it is exposed to the user. * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle operational errors. * wait-user.c (_gpgme_user_io_cb_handler): Handle operational errors. * wait-private.c (_gpgme_wait_on_condition): New argument to retrieve the operational result. Handle operational errors in session based protocols. (_gpgme_wait_one_ext): New function. (_gpgme_wait_one): Pass argument in invocation of _gpgme_wait_on_condition. * wait-global.c (struct ctx_list_item): Add member OP_ERR. (ctx_done): New argument OP_ERR. (ctx_wait): New argument OP_ERR. (gpgme_wait_ext): New function based on gpgme_wait but handling operational errors. (gpgme_wait): Implement in term of gpgme_wait_ext. * keylist.c (gpgme_op_keylist_next): Pass argument in invocation of _gpgme_wait_on_condition. * trustlist.c (gpgme_op_trustlist_next): Pass argument in invocation of _gpgme_wait_on_condition. * engine-assuan.c (struct engine_llass): Replace members RESULT_CB and RESULT_CB_VALUE by LAST_OP_ERR. (_gpgme_engine_assuan_last_op_err): Add this hack function. (llass_cancel_op): New function. (_gpgme_engine_llass_ops): Add cancel_op member. (llass_status_handler): Update opaque value access. (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments. * opassuan.c: Move compat hacks to the end of file. (opassuan_start): Do not set OPD->result.err. Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact. (gpgme_op_assuan_transact_ext): New function.
2009-10-26 18:52:32 +00:00
gpgme_error_t _gpgme_run_io_cb (struct io_select_fd_s *an_fds, int checked,
gpgme_error_t *err);
2000-11-07 13:32:38 +00:00
2009-10-26 Marcus Brinkmann <marcus@g10code.de> * configure.ac (NEED_GPG_VERSION_DEFAULT): Bump to 1.4.0 as 1.3.0 was development versions only. tests/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * opassuan/t-command.c: Update to new interface. src/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * gpgme.h.in (struct gpgme_io_event_done_data) (gpgme_io_event_done_data_t): New types. (struct _gpgme_op_assuan_result): Deprecate the err member. (gpgme_op_assuan_result): Deprecate (for now). (gpgme_op_assuan_transact_ext): New prototype. (gpgme_op_assuan_transact): Deprecate. (struct _gpgme_op_g13_result): Replace with ... (struct _gpgme_op_vfs_mount_result): ... this. (gpgme_op_g13_mount): Replace with ... (gpgme_op_vfs_mount): ... this. * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext) (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New. (gpgme_op_g13_mount): Remove. * libgpgme.vers: Likewise. * engine-backend.h (struct engine_ops): Remove RESULT_CB and RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP member. * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add OP_ERR argument. (_gpgme_wait_one_ext): New prototype. * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT. * engine-g13.c (g13_cancel_op): New function. (parse_status): Remove declaration. (g13_assuan_simple_command): Do nothing with status lines for now. (status_handler): Update opaque value access. (_gpgme_engine_ops_g13): Add new cancel_op member. * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR. Handle operational errors. (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output. * data.c (_gpgme_data_inbound_handler) (_gpgme_data_outbound_handler): Adjust opaque value access. * engine-gpg.c (command_handler, status_handler) (colon_line_handler): Likewise. * engine-gpgsm.c (status_handler): Likewise. * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member. * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise. * g13.c: Rewritten (and will be rewritten again). * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameters from prototype. (_gpgme_engine_cancel_op): New prototype. * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma. (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameter. (_gpgme_engine_cancel_op): New function. * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR. (struct io_cb_data): New struct to pass opaque data and get a op_err return value. Needed because we can't modify I/O callback handler signature because it is exposed to the user. * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle operational errors. * wait-user.c (_gpgme_user_io_cb_handler): Handle operational errors. * wait-private.c (_gpgme_wait_on_condition): New argument to retrieve the operational result. Handle operational errors in session based protocols. (_gpgme_wait_one_ext): New function. (_gpgme_wait_one): Pass argument in invocation of _gpgme_wait_on_condition. * wait-global.c (struct ctx_list_item): Add member OP_ERR. (ctx_done): New argument OP_ERR. (ctx_wait): New argument OP_ERR. (gpgme_wait_ext): New function based on gpgme_wait but handling operational errors. (gpgme_wait): Implement in term of gpgme_wait_ext. * keylist.c (gpgme_op_keylist_next): Pass argument in invocation of _gpgme_wait_on_condition. * trustlist.c (gpgme_op_trustlist_next): Pass argument in invocation of _gpgme_wait_on_condition. * engine-assuan.c (struct engine_llass): Replace members RESULT_CB and RESULT_CB_VALUE by LAST_OP_ERR. (_gpgme_engine_assuan_last_op_err): Add this hack function. (llass_cancel_op): New function. (_gpgme_engine_llass_ops): Add cancel_op member. (llass_status_handler): Update opaque value access. (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments. * opassuan.c: Move compat hacks to the end of file. (opassuan_start): Do not set OPD->result.err. Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact. (gpgme_op_assuan_transact_ext): New function.
2009-10-26 18:52:32 +00:00
/* Session based interfaces require to make a distinction between IPC
errors and operational errors. To glue this into the old
interface, I/O handlers (esp. the status handler) are called with a
struct as the opaque value that contains the handlers opaque value
but also a field for the operational error to be returned. */
struct io_cb_data
{
/* If this is the first field, the old internal code will still work. */
void *handler_value;
2009-10-26 Marcus Brinkmann <marcus@g10code.de> * configure.ac (NEED_GPG_VERSION_DEFAULT): Bump to 1.4.0 as 1.3.0 was development versions only. tests/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * opassuan/t-command.c: Update to new interface. src/ 2009-10-26 Marcus Brinkmann <marcus@g10code.de> * gpgme.h.in (struct gpgme_io_event_done_data) (gpgme_io_event_done_data_t): New types. (struct _gpgme_op_assuan_result): Deprecate the err member. (gpgme_op_assuan_result): Deprecate (for now). (gpgme_op_assuan_transact_ext): New prototype. (gpgme_op_assuan_transact): Deprecate. (struct _gpgme_op_g13_result): Replace with ... (struct _gpgme_op_vfs_mount_result): ... this. (gpgme_op_g13_mount): Replace with ... (gpgme_op_vfs_mount): ... this. * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext) (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New. (gpgme_op_g13_mount): Remove. * libgpgme.vers: Likewise. * engine-backend.h (struct engine_ops): Remove RESULT_CB and RESULT_CB_VALUE args in opassuan_transact member. Add CANCEL_OP member. * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add OP_ERR argument. (_gpgme_wait_one_ext): New prototype. * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT. * engine-g13.c (g13_cancel_op): New function. (parse_status): Remove declaration. (g13_assuan_simple_command): Do nothing with status lines for now. (status_handler): Update opaque value access. (_gpgme_engine_ops_g13): Add new cancel_op member. * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR. Handle operational errors. (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output. * data.c (_gpgme_data_inbound_handler) (_gpgme_data_outbound_handler): Adjust opaque value access. * engine-gpg.c (command_handler, status_handler) (colon_line_handler): Likewise. * engine-gpgsm.c (status_handler): Likewise. * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member. * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise. * g13.c: Rewritten (and will be rewritten again). * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameters from prototype. (_gpgme_engine_cancel_op): New prototype. * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma. (_gpgme_engine_op_assuan_transact): Remove result_cb and result_cb_value parameter. (_gpgme_engine_cancel_op): New function. * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR. (struct io_cb_data): New struct to pass opaque data and get a op_err return value. Needed because we can't modify I/O callback handler signature because it is exposed to the user. * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter. Handle operational errors. * wait-user.c (_gpgme_user_io_cb_handler): Handle operational errors. * wait-private.c (_gpgme_wait_on_condition): New argument to retrieve the operational result. Handle operational errors in session based protocols. (_gpgme_wait_one_ext): New function. (_gpgme_wait_one): Pass argument in invocation of _gpgme_wait_on_condition. * wait-global.c (struct ctx_list_item): Add member OP_ERR. (ctx_done): New argument OP_ERR. (ctx_wait): New argument OP_ERR. (gpgme_wait_ext): New function based on gpgme_wait but handling operational errors. (gpgme_wait): Implement in term of gpgme_wait_ext. * keylist.c (gpgme_op_keylist_next): Pass argument in invocation of _gpgme_wait_on_condition. * trustlist.c (gpgme_op_trustlist_next): Pass argument in invocation of _gpgme_wait_on_condition. * engine-assuan.c (struct engine_llass): Replace members RESULT_CB and RESULT_CB_VALUE by LAST_OP_ERR. (_gpgme_engine_assuan_last_op_err): Add this hack function. (llass_cancel_op): New function. (_gpgme_engine_llass_ops): Add cancel_op member. (llass_status_handler): Update opaque value access. (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments. * opassuan.c: Move compat hacks to the end of file. (opassuan_start): Do not set OPD->result.err. Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact. (gpgme_op_assuan_transact_ext): New function.
2009-10-26 18:52:32 +00:00
/* The I/O callback can pass an operational error here. */
gpgme_error_t op_err;
};
#endif /* WAIT_H */