libkdenetwork Library API Documentation

wait.h

00001 /* wait.h - Definitions for the wait queue interface.
00002    Copyright (C) 2000 Werner Koch (dd9jn)
00003    Copyright (C) 2001, 2002, 2003 g10 Code GmbH
00004  
00005    This file is part of GPGME.
00006  
00007    GPGME is free software; you can redistribute it and/or modify it
00008    under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011  
00012    GPGME is distributed in the hope that it will be useful, but
00013    WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    General Public License for more details.
00016  
00017    You should have received a copy of the GNU General Public License
00018    along with GPGME; if not, write to the Free Software Foundation,
00019    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00020 
00021 #ifndef WAIT_H
00022 #define WAIT_H
00023 
00024 #include "gpgme.h"
00025 #include "sema.h"
00026 
00027 struct fd_table
00028 {
00029   struct io_select_fd_s *fds;
00030   size_t size;
00031 };
00032 typedef struct fd_table *fd_table_t;
00033 
00034 /* Wait items are hooked into the io_select_fd_s to connect an fd with
00035    a callback handler.  */
00036 struct wait_item_s
00037 {
00038   gpgme_ctx_t ctx;
00039   gpgme_io_cb_t handler;
00040   void *handler_value;
00041   int dir;
00042 };
00043 
00044 /* A registered fd handler is removed later using the tag that
00045    identifies it.  */
00046 struct tag
00047 {
00048   /* The context for which the fd was registered.  */
00049   gpgme_ctx_t ctx;
00050 
00051   /* The index into the fd table for this context.  */
00052   int idx;
00053 
00054   /* This is used by the wrappers for the user event loop.  */
00055   void *user_tag;
00056 };
00057 
00058 
00059 void _gpgme_fd_table_init (fd_table_t fdt);
00060 void _gpgme_fd_table_deinit (fd_table_t fdt);
00061 
00062 gpgme_error_t _gpgme_add_io_cb (void *data, int fd, int dir,
00063                  gpgme_io_cb_t fnc, void *fnc_data, void **r_tag);
00064 void _gpgme_remove_io_cb (void *tag);
00065 void _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type,
00066                    void *type_data);
00067 void _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type,
00068                   void *type_data);
00069 
00070 gpgme_error_t _gpgme_wait_user_add_io_cb (void *data, int fd, int dir,
00071                       gpgme_io_cb_t fnc, void *fnc_data,
00072                       void **r_tag);
00073 void _gpgme_wait_user_remove_io_cb (void *tag);
00074 void _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t type,
00075                 void *type_data);
00076 
00077 gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);
00078 
00079 #endif  /* WAIT_H */
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:39:11 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003