Add Eduardo's email to copyright header files
[MonkeyD.git] / src / include / epoll.h
blobbc72be96a6633b5af103992ad7fa3d1e62efb56b
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /* Monkey HTTP Daemon
4 * ------------------
5 * Copyright (C) 2001-2010, Eduardo Silva P. <edsiper@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include <sys/epoll.h>
24 #define MK_EPOLL_READ 0
25 #define MK_EPOLL_WRITE 1
26 #define MK_EPOLL_RW 2
28 #define MK_EPOLL_WAIT_TIMEOUT 3000
30 #define MK_EPOLL_BEHAVIOR_DEFAULT 2
31 #define MK_EPOLL_BEHAVIOR_TRIGGERED 3
33 typedef struct
35 int (*read) (int);
36 int (*write) (int);
37 int (*error) (int);
38 int (*close) (int);
39 int (*timeout) (int);
40 } mk_epoll_handlers;
42 int mk_epoll_create(int max_events);
43 void *mk_epoll_init(int efd, mk_epoll_handlers * handler, int max_events);
45 mk_epoll_handlers *mk_epoll_set_handlers(void (*read) (int),
46 void (*write) (int),
47 void (*error) (int),
48 void (*close) (int),
49 void (*timeout) (int));
51 int mk_epoll_add_client(int efd, int socket, int mode, int behavior);
52 int mk_epoll_socket_change_mode(int efd, int socket, int mode);