Moep Library  2.0-nc
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
system.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013, 2014 Maurice Leclaire <leclaire@in.tum.de>
3  * Stephan M. Guenther <moepi@moepi.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * See COPYING for more details.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
27 #ifndef __MOEP80211_SYSTEM_H
28 #define __MOEP80211_SYSTEM_H
29 
30 #include <sys/epoll.h>
31 #include <sys/signalfd.h>
32 
33 #include <moep/types.h>
34 
35 
36 struct moep_callback;
37 
43 typedef struct moep_callback *moep_callback_t;
44 
58 typedef int (*cb_handler)(int, u32, void *);
59 
75 moep_callback_t moep_callback_create(int fd, cb_handler handler, void *data,
76  u32 events);
77 
88 int moep_callback_change(moep_callback_t callback, u32 events);
89 
98 
113 void moep_set_custom_wait(int (*wait)(int, struct epoll_event *, int, int,
114  const sigset_t *));
115 
143 int moep_wait(int epfd, struct epoll_event *events, int maxevents, int timeout,
144  const sigset_t *sigmask);
145 
162 typedef int (*sig_handler)(struct signalfd_siginfo *siginfo, void *);
163 
192 int moep_run(sig_handler sigh, void *data);
193 
195 #endif /* __MOEP80211_SYSTEM_H */
void moep_set_custom_wait(int(*wait)(int, struct epoll_event *, int, int, const sigset_t *))
set a custom wait call
int moep_callback_delete(moep_callback_t callback)
delete a moep callback
moep_callback_t moep_callback_create(int fd, cb_handler handler, void *data, u32 events)
create a new moep callback
int(* sig_handler)(struct signalfd_siginfo *siginfo, void *)
a signal handler
Definition: system.h:162
int moep_run(sig_handler sigh, void *data)
run the moep multiplexer
int moep_wait(int epfd, struct epoll_event *events, int maxevents, int timeout, const sigset_t *sigmask)
wait for an I/O event on an epoll file descriptor
int(* cb_handler)(int, u32, void *)
a callback handler
Definition: system.h:58
struct moep_callback * moep_callback_t
a moep callback
Definition: system.h:43
int moep_callback_change(moep_callback_t callback, u32 events)
change a moep callback