This helper returns true if the fd is bound to an eloop object, otherwise
false is returned.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
free(fd);
}
+bool ev_fd_is_bound(struct ev_fd *fd)
+{
+ return fd && fd->loop;
+}
+
int ev_eloop_new_fd(struct ev_eloop *loop, struct ev_fd **out, int rfd,
int mask, ev_fd_cb cb, void *data)
{
#define EV_ELOOP_H
#include <inttypes.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <sys/signalfd.h>
#include <time.h>
int ev_fd_new(struct ev_fd **out);
void ev_fd_ref(struct ev_fd *fd);
void ev_fd_unref(struct ev_fd *fd);
+bool ev_fd_is_bound(struct ev_fd *fd);
int ev_eloop_new_fd(struct ev_eloop *loop, struct ev_fd **out, int rfd,
int mask, ev_fd_cb cb, void *data);