00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 struct tevent_req {
00037 struct {
00042 tevent_req_fn fn;
00046 void *private_data;
00047 } async;
00048
00056 void *data;
00057
00065 tevent_req_print_fn private_print;
00066
00074 tevent_req_cancel_fn private_cancel;
00075
00081 struct {
00089 const char *private_type;
00090
00099 const char *create_location;
00100
00109 const char *finish_location;
00110
00119 const char *cancel_location;
00120
00128 enum tevent_req_state state;
00129
00136 uint64_t error;
00137
00142 struct tevent_immediate *trigger;
00143
00148 struct tevent_timer *timer;
00149 } internal;
00150 };
00151
00152 struct tevent_fd {
00153 struct tevent_fd *prev, *next;
00154 struct tevent_context *event_ctx;
00155 int fd;
00156 uint16_t flags;
00157 tevent_fd_handler_t handler;
00158 tevent_fd_close_fn_t close_fn;
00159
00160 void *private_data;
00161
00162 const char *handler_name;
00163 const char *location;
00164
00165 uint16_t additional_flags;
00166 void *additional_data;
00167 };
00168
00169 struct tevent_timer {
00170 struct tevent_timer *prev, *next;
00171 struct tevent_context *event_ctx;
00172 struct timeval next_event;
00173 tevent_timer_handler_t handler;
00174
00175 void *private_data;
00176
00177 const char *handler_name;
00178 const char *location;
00179
00180 void *additional_data;
00181 };
00182
00183 struct tevent_immediate {
00184 struct tevent_immediate *prev, *next;
00185 struct tevent_context *event_ctx;
00186 tevent_immediate_handler_t handler;
00187
00188 void *private_data;
00189
00190 const char *handler_name;
00191 const char *create_location;
00192 const char *schedule_location;
00193
00194 void (*cancel_fn)(struct tevent_immediate *im);
00195 void *additional_data;
00196 };
00197
00198 struct tevent_signal {
00199 struct tevent_signal *prev, *next;
00200 struct tevent_context *event_ctx;
00201 int signum;
00202 int sa_flags;
00203 tevent_signal_handler_t handler;
00204
00205 void *private_data;
00206
00207 const char *handler_name;
00208 const char *location;
00209
00210 void *additional_data;
00211 };
00212
00213 struct tevent_debug_ops {
00214 void (*debug)(void *context, enum tevent_debug_level level,
00215 const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
00216 void *context;
00217 };
00218
00219 void tevent_debug(struct tevent_context *ev, enum tevent_debug_level level,
00220 const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
00221
00222 struct tevent_context {
00223
00224 const struct tevent_ops *ops;
00225
00226
00227 struct tevent_fd *fd_events;
00228
00229
00230 struct tevent_timer *timer_events;
00231
00232
00233 struct tevent_immediate *immediate_events;
00234
00235
00236 struct tevent_signal *signal_events;
00237
00238
00239 void *additional_data;
00240
00241
00242 struct tevent_fd *pipe_fde;
00243 int pipe_fds[2];
00244
00245
00246 struct tevent_debug_ops debug_ops;
00247
00248
00249 struct {
00250 bool allowed;
00251 uint32_t level;
00252 tevent_nesting_hook hook_fn;
00253 void *hook_private;
00254 } nesting;
00255 };
00256
00257
00258 int tevent_common_context_destructor(struct tevent_context *ev);
00259 int tevent_common_loop_wait(struct tevent_context *ev,
00260 const char *location);
00261
00262 int tevent_common_fd_destructor(struct tevent_fd *fde);
00263 struct tevent_fd *tevent_common_add_fd(struct tevent_context *ev,
00264 TALLOC_CTX *mem_ctx,
00265 int fd,
00266 uint16_t flags,
00267 tevent_fd_handler_t handler,
00268 void *private_data,
00269 const char *handler_name,
00270 const char *location);
00271 void tevent_common_fd_set_close_fn(struct tevent_fd *fde,
00272 tevent_fd_close_fn_t close_fn);
00273 uint16_t tevent_common_fd_get_flags(struct tevent_fd *fde);
00274 void tevent_common_fd_set_flags(struct tevent_fd *fde, uint16_t flags);
00275
00276 struct tevent_timer *tevent_common_add_timer(struct tevent_context *ev,
00277 TALLOC_CTX *mem_ctx,
00278 struct timeval next_event,
00279 tevent_timer_handler_t handler,
00280 void *private_data,
00281 const char *handler_name,
00282 const char *location);
00283 struct timeval tevent_common_loop_timer_delay(struct tevent_context *);
00284
00285 void tevent_common_schedule_immediate(struct tevent_immediate *im,
00286 struct tevent_context *ev,
00287 tevent_immediate_handler_t handler,
00288 void *private_data,
00289 const char *handler_name,
00290 const char *location);
00291 bool tevent_common_loop_immediate(struct tevent_context *ev);
00292
00293 struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
00294 TALLOC_CTX *mem_ctx,
00295 int signum,
00296 int sa_flags,
00297 tevent_signal_handler_t handler,
00298 void *private_data,
00299 const char *handler_name,
00300 const char *location);
00301 int tevent_common_check_signal(struct tevent_context *ev);
00302
00303 bool tevent_standard_init(void);
00304 bool tevent_select_init(void);
00305 #ifdef HAVE_EPOLL
00306 bool tevent_epoll_init(void);
00307 #endif