foot/fdm.h
Daniel Eklöf 89997b97a0
fdm: add fdm_event_add() and fdm_event_del()
These functions allow users to modify already registered FDs, to add
or remove events they are interested in.
2019-11-03 00:52:24 +01:00

19 lines
515 B
C

#pragma once
#include <stdbool.h>
struct fdm;
typedef bool (*fdm_handler_t)(struct fdm *fdm, int fd, int events, void *data);
struct fdm *fdm_init(void);
void fdm_destroy(struct fdm *fdm);
bool fdm_add(struct fdm *fdm, int fd, int events, fdm_handler_t handler, void *data);
bool fdm_del(struct fdm *fdm, int fd);
bool fdm_del_no_close(struct fdm *fdm, int fd);
bool fdm_event_add(struct fdm *fdm, int fd, int events);
bool fdm_event_del(struct fdm *fdm, int fd, int events);
bool fdm_poll(struct fdm *fdm);