#ifndef EVENT_LINUX_H
#define EVENT_LINUX_H
#include "event.h"
#include <inttypes.h>
#include <cx/list.h>
#ifdef __cplusplus
extern "C" {
#endif
#define EV_QUEUE_RESERVE 8
typedef struct EventQueue EventQueue;
typedef struct EventHandlerLinux {
EventHandler base;
pthread_t thr;
int ep;
int event_fd;
EventQueue *queue_begin;
EventQueue *queue_end;
EventQueue *reserve_block[
EV_QUEUE_RESERVE];
size_t num_reserve;
pthread_mutex_t queue_lock;
} EventHandlerLinux;
struct EventQueue {
Event *events[
EV_MAX_EVENTS];
size_t numevents;
EventQueue *next;
};
void ev_handle_events(EventHandlerLinux *ev);
int ev_convert2sys_events(
int events);
void ev_queue_free(EventQueue *queue);
#ifdef __cplusplus
}
#endif
#endif