#ifndef EVENT_H
#define EVENT_H
#include "../public/nsapi.h"
#include <ucx/string.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct EVHandler {
EventHandler **instances;
uint32_t numins;
uint32_t current;
} EVHandler;
typedef struct event_handler_conf {
sstr_t name;
int nthreads;
int isdefault;
} EventHandlerConfig;
int create_event_handler(EventHandlerConfig *cfg);
int check_event_handler_cfg();
EVHandler* get_default_event_handler();
EVHandler* get_event_handler(
char *name);
EventHandler* ev_instance(EVHandler *ev);
EVHandler* evhandler_create(EventHandlerConfig *cfg);
int ev_pollin(EventHandler *h,
int fd, Event *event);
int ev_pollout(EventHandler *h,
int fd, Event *event);
int ev_remove_poll(EventHandler *h,
int fd);
int ev_send(EventHandler *h, Event *event);
int ev_aioread(
int fd, aiocb_s *cb);
int ev_aiowrite(
int fd, aiocb_s *cb);
#ifdef __cplusplus
}
#endif
#endif