1 /*******************************************************************
2 uLan Utilities Library - C library of basic reusable constructions
4 ul_evpollint.h - monitoring of open file handles
6 (C) Copyright 2006 by Pavel Pisa - Originator
8 The uLan utilities library can be used, copied and modified under
10 - GPL - GNU General Public License
11 - LGPL - GNU Lesser General Public License
12 - MPL - Mozilla Public License
13 - and other licenses added by project originators
14 Code can be modified and re-distributed under any combination
15 of the above listed licenses. If contributor does not agree with
16 some of the licenses, he/she can delete appropriate line.
17 Warning, if you delete all lines, you are not allowed to
18 distribute source code and/or binaries utilizing code.
20 See files COPYING and README for details.
22 *******************************************************************/
24 #ifndef _UL_EVPOLLINT_H
25 #define _UL_EVPOLLINT_H
27 #include "ul_utdefs.h"
31 #include "ul_evpoll.h"
33 #include <ul_htimer.h>
39 #define UL_EVPSIMPLE_ARMED 0x01
40 #define UL_EVPSIMPLE_ONCE 0x02
41 #define UL_EVPSIMPLE_TIMED 0x04
42 #define UL_EVPSIMPLE_TIMEOUT 0x08
43 #define UL_EVPSIMPLE_PERIODIC 0x10
45 typedef struct ul_evptrig_data_t {
52 ul_htim_diff_t timeout;
55 ul_list_node_t list_node;
57 ul_evptrig_t *trig_ptr;
59 } ul_evptrig_simple_t;
61 typedef struct ul_evpbase_simple_t {
64 ul_evptrig_simple_t **trig_array;
65 struct pollfd *pollfd_array;
70 int time_next_expire_fl:1;
74 ul_list_head_t active_list;
75 ul_list_head_t idle_list;
77 ul_htim_time_t time_act;
78 ul_htim_time_t time_next_expire;
79 ul_htim_queue_t htim_queue;
81 } ul_evpbase_simple_t;
84 UL_LIST_CUST_DEC(ul_evpsimple_active, ul_evpbase_simple_t, ul_evptrig_simple_t,
85 active_list, list_node)
87 UL_LIST_CUST_DEC(ul_evpsimple_idle, ul_evpbase_simple_t, ul_evptrig_simple_t,
90 extern const ul_evpoll_ops_t ul_evpoll_ops_simple;
96 #endif /* _UL_EVPOLLINT_H */