X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/c6e0eaf00cd09a4e5237e70d8351049ec91d7653..e3afa470a387e2726de5541e9871ccb2e9915a83:/sel.h diff --git a/sel.h b/sel.h index 9749a7a..58dab4f 100644 --- a/sel.h +++ b/sel.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: sel.h,v 1.7 1999/12/10 23:42:04 mdw Exp $ + * $Id: sel.h,v 1.10 2004/04/08 01:36:13 mdw Exp $ * * I/O multiplexing support * * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the mLib utilities library. * @@ -15,46 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * mLib 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 Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with mLib; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: sel.h,v $ - * Revision 1.7 1999/12/10 23:42:04 mdw - * Change header file guard names. - * - * Revision 1.6 1999/08/31 17:42:22 mdw - * New function `sel_force' to force a descriptor to be `selected'. - * - * Revision 1.5 1999/08/19 18:30:26 mdw - * Implement hooks for foreign select-using systems (currently not well - * tested). - * - * Revision 1.4 1999/05/22 13:39:15 mdw - * Change spelling of `multiplexor'. ;-) - * - * Revision 1.3 1999/05/17 20:36:36 mdw - * Make the selector type symbols an enumeration rather than a bunch of - * #defines. - * - * Revision 1.2 1999/05/15 10:33:32 mdw - * Fix copyright notices. - * - * Revision 1.1 1999/05/14 21:01:15 mdw - * Integrated `select' handling bits from the background resolver project. - * - */ - #ifndef MLIB_SEL_H #define MLIB_SEL_H @@ -131,22 +103,24 @@ typedef struct sel_state { typedef struct sel_file { struct sel_file *next; /* Next file in the list */ - struct sel_file *prev; /* Previous file in the list */ + struct sel_file **prev; /* Previous file in the list */ struct sel_state *s; /* Pointer to select multiplexor */ int fd; /* File descriptor */ unsigned mode; /* Interesting event for file */ void (*func)(int /*fd*/, unsigned /*mode*/, void */*p*/); /* Handler */ void *p; /* Argument for the handler */ + struct sel_pendfile *pend; /* Pending file information */ } sel_file; /* --- Waiting for a timeout --- */ typedef struct sel_timer { struct sel_timer *next; /* Next timer in the list */ - struct sel_timer *prev; /* Previous timer in the list */ + struct sel_timer **prev; /* Previous timer in the list */ struct timeval tv; /* Real time when timer should go */ void (*func)(struct timeval */*tv*/, void */*p*/); /* Handler function */ void *p; /* Argument for the handler */ + struct sel_pendtimer *pend; /* Pending timer information */ } sel_timer; /* --- A select argument block --- */ @@ -169,7 +143,7 @@ typedef void (*sel_hookfn)(sel_state */*s*/, typedef struct sel_hook { struct sel_hook *next; /* Next hook in the list */ - struct sel_hook *prev; /* Previous hook in the list */ + struct sel_hook **prev; /* Previous hook in the list */ sel_hookfn before, after; /* Hook functions */ void *p; /* Argument for the hook functions */ } sel_hook;