1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/**
* Copyright (C) Hiroyuki Sato. 2019. ALL RIGHTS RESERVED.
*
* See file LICENSE for terms.
*/
/**
* ucs_sys_event_set_t structure used in ucs_event_set_XXX functions.
*
*/
typedef struct ucs_sys_event_set ucs_sys_event_set_t;
/**
* Bit set composed using the available event types
*/
typedef uint8_t ucs_event_set_types_t;
/**
* ucs_event_set_handler call this handler for notifying event
*
* @param [in] callback_data User data which set in ucs_event_set_add().
* @param [in] events Detection event. Sets of ucs_event_set_types_t.
* @param [in] arg User data which set in ucs_event_set_wait().
*
*/
typedef void ;
/**
* Event types that could be requested to notify
*/
typedef enum ucs_event_set_type_t;
/* The maximum possible number of events based on system constraints */
extern const unsigned ucs_sys_event_set_max_wait_events;
/**
* Allocate ucs_sys_event_set_t structure and assign provided file
* descriptor to wait for events on.
*
* @param [out] event_set_p Event set pointer to initialize.
* @param [in] event_fd File descriptor to wait for events on.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;
/**
* Allocate ucs_sys_event_set_t structure.
*
* @param [out] event_set_p Event set pointer to initialize.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;
/**
* Register the target event.
*
* @param [in] event_set_p Event set pointer to initialize.
* @param [in] fd Register the target file descriptor fd.
* @param [in] events Operation events.
* @param [in] callback_data ucs_event_set_handler_t accepts this data.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;
/**
* Modify the target event.
*
* @param [in] event_set Event set created by ucs_event_set_create.
* @param [in] fd Register the target file descriptor fd.
* @param [in] events Operation events.
* @param [in] callback_data ucs_event_set_handler_t accepts this data.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;
/**
* Remove the target event.
*
* @param [in] event_set Event set created by ucs_event_set_create.
* @param [in] fd Register the target file descriptor fd.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;
/**
* Wait for an I/O events
*
* @param [in] event_set Event set created by ucs_event_set_create.
* @param [in/out] num_events Number of expected/read events.
* @param [in] timeout_ms Timeout period in ms.
* @param [in] event_set_handler Callback functions.
* @param [in] arg User data variables.
*
* @return return UCS_OK on success, UCS_INPROGRESS - call was interrupted by a
* signal handler, UCS_ERR_IO_ERROR - an error occurred during waiting
* for I/O events.
*/
ucs_status_t ;
/**
* Cleanup event set
*
* @param [in] event_set Event set created by ucs_event_set_create.
*
*/
void ;
/**
* Get file descriptor for watching events.
*
* @param [in] event_set Event set created by ucs_event_set_create.
* @param [out] event_fd_p File descriptor that is used by Event set to wait
* for events on.
*
* @return UCS_OK on success or an error code on failure.
*/
ucs_status_t ;