37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
#pragma once
|
|
|
|
typedef struct fdwatch FDWATCH;
|
|
typedef struct fdwatch * LPFDWATCH;
|
|
|
|
enum EFdwatch
|
|
{
|
|
FDW_NONE = 0,
|
|
FDW_READ = 1,
|
|
FDW_WRITE = 2,
|
|
FDW_WRITE_ONESHOT = 4,
|
|
FDW_EOF = 8,
|
|
};
|
|
|
|
enum EFdwatchBackend
|
|
{
|
|
FDWATCH_BACKEND_KQUEUE = 0,
|
|
FDWATCH_BACKEND_SELECT = 1,
|
|
FDWATCH_BACKEND_EPOLL = 2,
|
|
};
|
|
|
|
LPFDWATCH fdwatch_new(int nfiles);
|
|
void fdwatch_clear_fd(LPFDWATCH fdw, socket_t fd);
|
|
void fdwatch_delete(LPFDWATCH fdw);
|
|
int fdwatch_check_fd(LPFDWATCH fdw, socket_t fd);
|
|
int fdwatch_check_event(LPFDWATCH fdw, socket_t fd, unsigned int event_idx);
|
|
void fdwatch_clear_event(LPFDWATCH fdw, socket_t fd, unsigned int event_idx);
|
|
void fdwatch_add_fd(LPFDWATCH fdw, socket_t fd, void* client_data, int rw, int oneshot);
|
|
int fdwatch(LPFDWATCH fdw, struct timeval *timeout);
|
|
void * fdwatch_get_client_data(LPFDWATCH fdw, unsigned int event_idx);
|
|
void fdwatch_del_fd(LPFDWATCH fdw, socket_t fd);
|
|
int fdwatch_get_buffer_size(LPFDWATCH fdw, socket_t fd);
|
|
int fdwatch_get_ident(LPFDWATCH fdw, unsigned int event_idx);
|
|
EFdwatchBackend fdwatch_get_backend(LPFDWATCH fdw);
|
|
const char * fdwatch_backend_name(EFdwatchBackend backend);
|
|
int fdwatch_get_descriptor_limit(LPFDWATCH fdw);
|