libzmq
external
wepoll
wepoll.h
Go to the documentation of this file.
1
/*
2
* wepoll - epoll for Windows
3
* https://github.com/piscisaureus/wepoll
4
*
5
* Copyright 2012-2020, Bert Belder <bertbelder@gmail.com>
6
* All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are
10
* met:
11
*
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
*
15
* * Redistributions in binary form must reproduce the above copyright
16
* notice, this list of conditions and the following disclaimer in the
17
* documentation and/or other materials provided with the distribution.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
*/
31
32
#ifndef WEPOLL_H_
33
#define WEPOLL_H_
34
35
#ifndef WEPOLL_EXPORT
36
#define WEPOLL_EXPORT
37
#endif
38
39
#include <stdint.h>
40
41
enum
EPOLL_EVENTS
{
42
EPOLLIN
= (int) (1U << 0),
43
EPOLLPRI
= (int) (1U << 1),
44
EPOLLOUT
= (int) (1U << 2),
45
EPOLLERR
= (int) (1U << 3),
46
EPOLLHUP
= (int) (1U << 4),
47
EPOLLRDNORM
= (int) (1U << 6),
48
EPOLLRDBAND
= (int) (1U << 7),
49
EPOLLWRNORM
= (int) (1U << 8),
50
EPOLLWRBAND
= (int) (1U << 9),
51
EPOLLMSG
= (int) (1U << 10),
/* Never reported. */
52
EPOLLRDHUP
= (int) (1U << 13),
53
EPOLLONESHOT
= (int) (1U << 31)
54
};
55
56
#define EPOLLIN (1U << 0)
57
#define EPOLLPRI (1U << 1)
58
#define EPOLLOUT (1U << 2)
59
#define EPOLLERR (1U << 3)
60
#define EPOLLHUP (1U << 4)
61
#define EPOLLRDNORM (1U << 6)
62
#define EPOLLRDBAND (1U << 7)
63
#define EPOLLWRNORM (1U << 8)
64
#define EPOLLWRBAND (1U << 9)
65
#define EPOLLMSG (1U << 10)
66
#define EPOLLRDHUP (1U << 13)
67
#define EPOLLONESHOT (1U << 31)
68
69
#define EPOLL_CTL_ADD 1
70
#define EPOLL_CTL_MOD 2
71
#define EPOLL_CTL_DEL 3
72
73
typedef
void
*
HANDLE
;
74
typedef
uintptr_t
SOCKET
;
75
76
typedef
union
epoll_data
{
77
void
*
ptr
;
78
int
fd
;
79
uint32_t
u32
;
80
uint64_t
u64
;
81
SOCKET
sock
;
/* Windows specific */
82
HANDLE
hnd
;
/* Windows specific */
83
}
epoll_data_t
;
84
85
struct
epoll_event
{
86
uint32_t
events
;
/* Epoll events and flags */
87
epoll_data_t
data
;
/* User data variable */
88
};
89
90
#ifdef __cplusplus
91
extern
"C"
{
92
#endif
93
94
WEPOLL_EXPORT
HANDLE
epoll_create
(
int
size
);
95
WEPOLL_EXPORT
HANDLE
epoll_create1
(
int
flags
);
96
97
WEPOLL_EXPORT
int
epoll_close
(
HANDLE
ephnd);
98
99
WEPOLL_EXPORT
int
epoll_ctl
(
HANDLE
ephnd,
100
int
op,
101
SOCKET
sock
,
102
struct
epoll_event
*
event
);
103
104
WEPOLL_EXPORT
int
epoll_wait
(
HANDLE
ephnd,
105
struct
epoll_event
* events,
106
int
maxevents,
107
int
timeout
);
108
109
#ifdef __cplusplus
110
}
/* extern "C" */
111
#endif
112
113
#endif
/* WEPOLL_H_ */
EPOLLRDHUP
#define EPOLLRDHUP
Definition:
wepoll.h:66
HANDLE
void * HANDLE
Definition:
wepoll.h:73
EPOLL_EVENTS
EPOLL_EVENTS
Definition:
wepoll.c:38
epoll_create
WEPOLL_EXPORT HANDLE epoll_create(int size)
Definition:
wepoll.c:577
sock
void * sock
Definition:
test_connect_resolve.cpp:9
EPOLLONESHOT
#define EPOLLONESHOT
Definition:
wepoll.h:67
EPOLLRDBAND
#define EPOLLRDBAND
Definition:
wepoll.h:62
epoll_event::data
epoll_data_t data
Definition:
wepoll.c:84
epoll_data::ptr
void * ptr
Definition:
wepoll.c:74
flags
GLbitfield flags
Definition:
glcorearb.h:3585
EPOLLWRBAND
#define EPOLLWRBAND
Definition:
wepoll.h:64
epoll_ctl
WEPOLL_EXPORT int epoll_ctl(HANDLE ephnd, int op, SOCKET sock, struct epoll_event *event)
Definition:
wepoll.c:616
EPOLLRDNORM
#define EPOLLRDNORM
Definition:
wepoll.h:61
EPOLLMSG
#define EPOLLMSG
Definition:
wepoll.h:65
event
struct _cl_event * event
Definition:
glcorearb.h:4163
epoll_data::hnd
HANDLE hnd
Definition:
wepoll.c:79
EPOLLPRI
#define EPOLLPRI
Definition:
wepoll.h:57
epoll_create1
WEPOLL_EXPORT HANDLE epoll_create1(int flags)
Definition:
wepoll.c:584
timeout
GLbitfield GLuint64 timeout
Definition:
glcorearb.h:3588
epoll_wait
WEPOLL_EXPORT int epoll_wait(HANDLE ephnd, struct epoll_event *events, int maxevents, int timeout)
Definition:
wepoll.c:648
epoll_close
WEPOLL_EXPORT int epoll_close(HANDLE ephnd)
Definition:
wepoll.c:591
EPOLLHUP
#define EPOLLHUP
Definition:
wepoll.h:60
EPOLLIN
#define EPOLLIN
Definition:
wepoll.h:56
epoll_event
Definition:
wepoll.c:82
epoll_data::sock
SOCKET sock
Definition:
wepoll.c:78
EPOLLWRNORM
#define EPOLLWRNORM
Definition:
wepoll.h:63
size
GLsizeiptr size
Definition:
glcorearb.h:2943
EPOLLERR
#define EPOLLERR
Definition:
wepoll.h:59
epoll_data::u32
uint32_t u32
Definition:
wepoll.c:76
HANDLE
void * HANDLE
Definition:
wepoll.c:70
epoll_data
Definition:
wepoll.c:73
epoll_data_t
union epoll_data epoll_data_t
SOCKET
uintptr_t SOCKET
Definition:
wepoll.c:71
SOCKET
uintptr_t SOCKET
Definition:
wepoll.h:74
epoll_data::u64
uint64_t u64
Definition:
wepoll.c:77
epoll_event::events
uint32_t events
Definition:
wepoll.c:83
EPOLLOUT
#define EPOLLOUT
Definition:
wepoll.h:58
WEPOLL_EXPORT
#define WEPOLL_EXPORT
Definition:
wepoll.h:36
epoll_data::fd
int fd
Definition:
wepoll.c:75
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:01