b92c8f057c
* gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL. * gpgme.c (_gpgme_op_event_cb_user): New function. * op-support.c (_gpgme_op_reset): Support a new mode of operation for private or user event loop. Use new user event callback wrapper. * trustlist.c (gpgme_op_trustlist_start): Use this new mode. * keylist.c (gpgme_op_keylist_start): Likewise. * rungpg.c (_gpgme_gpg_io_event): New function. * rungpg.h (_gpgme_gpg_io_event): New prototype. * engine-gpgsm.c (_gpgme_gpg_io_event): New function. * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype. * engine.c (_gpgme_engine_io_event): New function. * engine.h (_gpgme_engine_io_event): New prototype. * keylist.c (finish_key): Call _gpgme_engine_io_event, and move the real work for the default IO callback routines to ... (_gpgme_op_keylist_event_cb): ... here. New function. * trustlist.c (trustlist_colon_handler): Signal GPGME_EVENT_NEXT_TRUSTITEM. Move queue manipulation to ... (_gpgme_op_trustlist_event_cb): ... here. New function. * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb and _gpgme_op_trustlist_event_cb when appropriate. * ops.h (_gpgme_op_keylist_event_cb): New prototype. (_gpgme_op_trustlist_event_cb): Likewise. * op-support.c (_gpgme_op_reset): Add comment why we don't use the user provided event handler directly. * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in a pointer argument. * wait.c (_gpgme_add_io_cb): Likewise. * wait.h (_gpgme_add_io_cb): Likewise for prototype. * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new argument. Fix up error handling. * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with new argument, fix up error handling.
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
/* wait.h - Definitions for the wait queue interface.
|
|
* Copyright (C) 2000 Werner Koch (dd9jn)
|
|
* Copyright (C) 2001, 2002 g10 Code GmbH
|
|
*
|
|
* This file is part of GPGME.
|
|
*
|
|
* GPGME is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* GPGME is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
*/
|
|
|
|
#ifndef WAIT_H
|
|
#define WAIT_H
|
|
|
|
#include "gpgme.h"
|
|
#include "sema.h"
|
|
|
|
struct fd_table
|
|
{
|
|
DECLARE_LOCK (lock);
|
|
struct io_select_fd_s *fds;
|
|
size_t size;
|
|
};
|
|
typedef struct fd_table *fd_table_t;
|
|
|
|
void _gpgme_fd_table_init (fd_table_t fdt);
|
|
void _gpgme_fd_table_deinit (fd_table_t fdt);
|
|
|
|
GpgmeError _gpgme_add_io_cb (void *data, int fd, int dir,
|
|
GpgmeIOCb fnc, void *fnc_data, void **r_tag);
|
|
void _gpgme_remove_io_cb (void *tag);
|
|
void _gpgme_wait_event_cb (void *data, GpgmeEventIO type, void *type_data);
|
|
|
|
GpgmeError _gpgme_wait_one (GpgmeCtx ctx);
|
|
|
|
#endif /* WAIT_H */
|