Merge commit 'brent/master'
[freebsd-src/fkvm-freebsd.git] / contrib / libbegemot / rpoll.h
blob497a41ef5eaf1771419e8721cdeb35c46e337bef
1 /*
2 * Copyright (c)1996-2002 by Hartmut Brandt
3 * All rights reserved.
5 * Author: Hartmut Brandt
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that
9 * the following conditions are met:
11 * 1. Redistributions of source code or documentation must retain the above
12 * copyright notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR
18 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21 * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $Begemot: libbegemot/rpoll.h,v 1.5 2004/09/21 15:49:26 brandt Exp $
32 # ifndef rpoll_h_
33 # define rpoll_h_
35 # ifdef __cplusplus
36 extern "C" {
37 # endif
39 typedef void (*poll_f)(int fd, int mask, void *arg);
40 typedef void (*timer_f)(int, void *);
42 int poll_register(int fd, poll_f func, void *arg, int mask);
43 void poll_unregister(int);
44 void poll_dispatch(int wait);
45 int poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg);
46 int poll_start_utimer(unsigned long long usecs, int repeat, timer_f func,
47 void *arg);
48 void poll_stop_timer(int);
50 # if defined(POLL_IN)
51 # undef POLL_IN
52 # endif
53 # if defined(POLL_OUT)
54 # undef POLL_OUT
55 # endif
57 # define POLL_IN 1
58 # define POLL_OUT 2
59 # define POLL_EXCEPT 4
61 extern int rpoll_policy;
62 extern int rpoll_trace;
64 # ifdef __cplusplus
66 # endif
68 # endif