From 40e123db7713b188162cd94d935f7a395405567a Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 5 Jun 2017 18:53:41 +0200 Subject: Core select loop --- midimonster.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'midimonster.h') diff --git a/midimonster.h b/midimonster.h index b2af7a3..181f1da 100644 --- a/midimonster.h +++ b/midimonster.h @@ -3,6 +3,7 @@ #include #include #include +#define max(a,b) (((a) > (b)) ? (a) : (b)) #define DEFAULT_CFG "monster.cfg" @@ -54,6 +55,7 @@ typedef struct _backend_channel { } channel; //FIXME might be replaced by struct pollfd +//FIXME who frees impl typedef struct /*_mm_managed_fd*/ { int fd; backend* backend; @@ -97,6 +99,12 @@ instance* mm_instance(); * will receive a call to its channel_free function. */ channel* mm_channel(instance* i, uint64_t ident); +/* + * Register a file descriptor to be selected on. The backend + * will be notified via the mmbackend_process_fd call. + * This function may only be called from within the + * mmbackend_start procedure. + */ int mm_manage_fd(int fd, char* backend, int manage, void* impl); int mm_channel_event(channel* c, channel_value v); /* -- cgit v1.2.3