1 #ifndef ACL_EVENTS_H_INCLUDED 2 #define ACL_EVENTS_H_INCLUDED 8 #include "../stdlib/acl_define.h" 10 #include "../stdlib/acl_vstream.h" 15 #define ACL_EVENT_READ (1 << 0) 16 #define ACL_EVENT_ACCEPT (1 << 1) 17 #define ACL_EVENT_WRITE (1 << 2) 18 #define ACL_EVENT_CONNECT (1 << 3) 19 #define ACL_EVENT_XCPT (1 << 4) 20 #define ACL_EVENT_TIME (1 << 5) 21 #define ACL_EVENT_RW_TIMEOUT (1 << 6) 22 #define ACL_EVENT_TIMEOUT ACL_EVENT_RW_TIMEOUT 24 #define ACL_EVENT_FD_IDLE 0 25 #define ACL_EVENT_FD_BUSY 1 27 #define ACL_EVENT_ERROR ACL_EVENT_XCPT 29 #define ACL_EVENT_SELECT 0 30 #define ACL_EVENT_POLL 1 31 #define ACL_EVENT_KERNEL 2 32 #define ACL_EVENT_WMSG 3 37 #define ACL_EVENT_NULL_TYPE 0 38 #define ACL_EVENT_NULL_CONTEXT ((char *) 0) 50 typedef void (*ACL_EVENT_NOTIFY_FN) (
int event_type,
void *context);
74 int delay_sec,
int delay_usec);
132 #if defined (_WIN32) || defined(_WIN64) 133 ACL_API HWND acl_event_wmsg_hwnd(
ACL_EVENT *eventp);
295 void *context,
int onoff);
ACL_API int acl_event_isset(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API void acl_event_set_delay_sec(ACL_EVENT *eventp, int sec)
ACL_API acl_int64 acl_event_cancel_timer(ACL_EVENT *eventp, ACL_EVENT_NOTIFY_TIME callback, void *context)
ACL_API int acl_event_last_nready(ACL_EVENT *eventp)
ACL_API acl_int64 acl_event_time(ACL_EVENT *eventp)
ACL_API ACL_EVENT * acl_event_new_poll_thr(int delay_sec, int delay_usec)
ACL_API int acl_event_use_thread(ACL_EVENT *eventp)
ACL_API void acl_event_enable_listen(ACL_EVENT *eventp, ACL_VSTREAM *stream, int read_timeout, ACL_EVENT_NOTIFY_RDWR callback, void *context)
ACL_API void acl_event_set_fire_hook(ACL_EVENT *eventp, void(*fire_begin)(ACL_EVENT *, void *), void(*fire_end)(ACL_EVENT *, void *), void *ctx)
ACL_API void acl_event_set_delay_usec(ACL_EVENT *eventp, int usec)
ACL_API void acl_event_disable_readwrite(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API acl_int64 acl_event_request_timer(ACL_EVENT *eventp, ACL_EVENT_NOTIFY_TIME callback, void *context, acl_int64 delay, int keep)
ACL_API ACL_EVENT * acl_event_new_kernel(int delay_sec, int delay_usec)
ACL_API int acl_event_timer_ifkeep(ACL_EVENT *eventp, ACL_EVENT_NOTIFY_TIME callback, void *context)
ACL_API ACL_EVENT * acl_event_new_select_thr(int delay_sec, int delay_usec)
ACL_API void acl_event_enable_read(ACL_EVENT *eventp, ACL_VSTREAM *stream, int read_timeout, ACL_EVENT_NOTIFY_RDWR callback, void *context)
ACL_API int acl_event_isxset(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API void acl_event_drain(ACL_EVENT *eventp)
ACL_API int acl_event_isrset(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API void acl_event_enable_write(ACL_EVENT *eventp, ACL_VSTREAM *stream, int write_timeout, ACL_EVENT_NOTIFY_RDWR callback, void *context)
ACL_API int acl_event_get_delay_sec(ACL_EVENT *eventp)
ACL_API ACL_EVENT * acl_event_new_kernel_thr(int delay_sec, int delay_usec)
ACL_API int acl_event_mode(ACL_EVENT *eventp)
ACL_API ACL_EVENT * acl_event_new_wmsg(unsigned int nMsg)
ACL_API int acl_event_get_delay_usec(ACL_EVENT *eventp)
struct ACL_EVENT ACL_EVENT
ACL_API int acl_event_iswset(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API void acl_event_set_check_inter(ACL_EVENT *eventp, int n)
ACL_API void acl_event_loop(ACL_EVENT *eventp)
ACL_API void acl_event_free(ACL_EVENT *eventp)
ACL_API void acl_event_disable_write(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API void acl_event_disable_read(ACL_EVENT *eventp, ACL_VSTREAM *stream)
ACL_API ACL_EVENT * acl_event_new_poll(int delay_sec, int delay_usec)
ACL_API void acl_event_keep_timer(ACL_EVENT *eventp, ACL_EVENT_NOTIFY_TIME callback, void *context, int onoff)
void(* ACL_EVENT_NOTIFY_RDWR)(int event_type, ACL_EVENT *event, ACL_VSTREAM *stream, void *context)
struct ACL_EVENT_FDTABLE ACL_EVENT_FDTABLE
ACL_API ACL_EVENT * acl_event_new(int event_mode, int use_thr, int delay_sec, int delay_usec)
ACL_API ACL_EVENT * acl_event_new_select(int delay_sec, int delay_usec)
void(* ACL_EVENT_NOTIFY_TIME)(int event_type, ACL_EVENT *event, void *context)
ACL_API void acl_event_add_dog(ACL_EVENT *eventp)