/*1* Copyright (c)1996-2002 by Hartmut Brandt2* All rights reserved.3*4* Author: Hartmut Brandt5*6* Redistribution of this software and documentation and use in source and7* binary forms, with or without modification, are permitted provided that8* the following conditions are met:9*10* 1. Redistributions of source code or documentation must retain the above11* copyright notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR17* AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,18* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND19* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL20* THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,21* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT22* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,23* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF24* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING25* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,26* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27*/28/*29* $Begemot: libbegemot/rpoll.h,v 1.5 2004/09/21 15:49:26 brandt Exp $30*/31# ifndef rpoll_h_32# define rpoll_h_3334# ifdef __cplusplus35extern "C" {36# endif3738typedef void (*poll_f)(int fd, int mask, void *arg);39typedef void (*timer_f)(int, void *);4041int poll_register(int fd, poll_f func, void *arg, int mask);42void poll_unregister(int);43void poll_dispatch(int wait);44int poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg);45int poll_start_utimer(unsigned long long usecs, int repeat, timer_f func,46void *arg);47void poll_stop_timer(int);4849enum {50RPOLL_IN = 1,51RPOLL_OUT = 2,52RPOLL_EXCEPT = 4,53};5455extern int rpoll_policy;56extern int rpoll_trace;5758# ifdef __cplusplus59}60# endif6162# endif636465