aboutsummaryrefslogtreecommitdiff
path: root/fdm.h
blob: fb12bffbeb0de8e8e9265a37c5ca7e5fdf1a1567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#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_poll(struct fdm *fdm);