| 1 | /* |
| 2 | * Abstraction API/layer for the various ways PvPGN can inspect sockets state |
| 3 | * 2003 (C) |
| 4 | * |
| 5 | * Code is based on the ideas found in thttpd project. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version 2 |
| 10 | * of the License, or (at your option) any later version. |
| 11 | * |
| 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 General Public License for more details. |
| 16 | * |
| 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef __FDWATCH_INCLUDED__ |
| 23 | #define __FDWATCH_INCLUDED__cxx . . $ `src/common/fdwatch.h:23:9`! |
| 24 | |
| 25 | #include "common/elist.h"cxx . . $ `<file>/src/common/elist.h`/ |
| 26 | |
| 27 | namespace pvpgncxx . . $ pvpgn/ |
| 28 | { |
| 29 | |
| 30 | typedef enumcxx . . $ pvpgn/$anonymous_type_28c4ef72e77b9b5a_0# { |
| 31 | fdwatch_type_nonecxx . . $ pvpgn/fdwatch_type_none. = 0, |
| 32 | fdwatch_type_readcxx . . $ pvpgn/fdwatch_type_read. = 1, |
| 33 | fdwatch_type_writecxx . . $ pvpgn/fdwatch_type_write. = 2 |
| 34 | } t_fdwatch_typecxx . . $ pvpgn/t_fdwatch_type#; |
| 35 | |
| 36 | typedef int(*fdwatch_handlercxx . . $ pvpgn/fdwatch_handler#)(void *data, t_fdwatch_typecxx . . $ pvpgn/t_fdwatch_type#); |
| 37 | |
| 38 | struct t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd# { |
| 39 | int fdcxx . . $ pvpgn/t_fdwatch_fd#fd.; |
| 40 | int rwcxx . . $ pvpgn/t_fdwatch_fd#rw.; |
| 41 | fdwatch_handlercxx . . $ pvpgn/fdwatch_handler# hndcxx . . $ pvpgn/t_fdwatch_fd#hnd.; |
| 42 | void *datacxx . . $ pvpgn/t_fdwatch_fd#data.; |
| 43 | |
| 44 | elist_nodecxx . . $ pvpgn/elist_node#<t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd#> uselistcxx . . $ pvpgn/t_fdwatch_fd#uselist.; |
| 45 | elist_nodecxx . . $ pvpgn/elist_node#<t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd#> freelistcxx . . $ pvpgn/t_fdwatch_fd#freelist.; |
| 46 | |
| 47 | t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd#t_fdwatch_fd(49f6e7a06ebc5aa8).() :fdcxx . . $ pvpgn/t_fdwatch_fd#fd.(0), rwcxx . . $ pvpgn/t_fdwatch_fd#rw.(0), hndcxx . . $ pvpgn/t_fdwatch_fd#hnd.(0), datacxx . . $ pvpgn/t_fdwatch_fd#data.(0), uselistcxx . . $ pvpgn/elist_node#elist_node(49f6e7a06ebc5aa8).(), freelistcxx . . $ pvpgn/elist_node#elist_node(49f6e7a06ebc5aa8).() {} |
| 48 | }; |
| 49 | |
| 50 | typedef int(*t_fdw_cbcxx . . $ pvpgn/t_fdw_cb#)(t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd# *cfd, void *data); |
| 51 | |
| 52 | extern unsigned fdw_maxconscxx . . $ pvpgn/fdw_maxcons.; |
| 53 | extern t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd# *fdw_fdscxx . . $ pvpgn/fdw_fds.; |
| 54 | |
| 55 | #define fdw_idxcxx . . $ `src/common/fdwatch.h:55:9`!(ptr) ((ptr) - fdw_fds) |
| 56 | #define fdw_fdcxx . . $ `src/common/fdwatch.h:56:9`!(ptr) ((ptr)->fd) |
| 57 | #define fdw_rwcxx . . $ `src/common/fdwatch.h:57:9`!(ptr) ((ptr)->rw) |
| 58 | #define fdw_datacxx . . $ `src/common/fdwatch.h:58:9`!(ptr) ((ptr)->data) |
| 59 | #define fdw_hndcxx . . $ `src/common/fdwatch.h:59:9`!(ptr) ((ptr)->hnd) |
| 60 | extern int fdwatch_initcxx . . $ pvpgn/fdwatch_init(7864480464b09eea).(int maxcons); |
| 61 | extern int fdwatch_closecxx . . $ pvpgn/fdwatch_close(b126dc7c1de90089).(void); |
| 62 | extern int fdwatch_add_fdcxx . . $ pvpgn/fdwatch_add_fd(559ef48a7724bde6).(int fd, unsigned rw, fdwatch_handlercxx . . $ pvpgn/fdwatch_handler# h, void *data); |
| 63 | extern int fdwatch_update_fdcxx . . $ pvpgn/fdwatch_update_fd(b223e862534b1804).(int idx, unsigned rw); |
| 64 | extern int fdwatch_del_fdcxx . . $ pvpgn/fdwatch_del_fd(7864480464b09eea).(int idx); |
| 65 | extern int fdwatchcxx . . $ pvpgn/fdwatch(a9e4e82268fd7bfa).(long timeout_msecs); |
| 66 | extern void fdwatch_handlecxx . . $ pvpgn/fdwatch_handle(49f6e7a06ebc5aa8).(void); |
| 67 | extern void fdwatch_traversecxx . . $ pvpgn/fdwatch_traverse(8b1391bcbb30f1df).(t_fdw_cbcxx . . $ pvpgn/t_fdw_cb# cb, void *data); |
| 68 | |
| 69 | } |
| 70 | |
| 71 | #endif /* __FDWATCH_INCLUDED__ */ |