fdm: use the FDM's poll loop

This commit is contained in:
Daniel Eklöf 2019-10-27 11:46:18 +01:00
parent 293adbb295
commit 5fefb950b3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 409 additions and 202 deletions

15
fdm.h Normal file
View file

@ -0,0 +1,15 @@
#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_poll(struct fdm *fdm);