LMMS
Loading...
Searching...
No Matches
posix-fd-support.h
Go to the documentation of this file.
1#pragma once
2
3#include "../plugin.h"
4
5// This extension let your plugin hook itself into the host select/poll/epoll/kqueue reactor.
6// This is useful to handle asynchronous I/O on the main thread.
7static CLAP_CONSTEXPR const char CLAP_EXT_POSIX_FD_SUPPORT[] = "clap.posix-fd-support";
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13enum {
14 // IO events flags, they can be used to form a mask which describes:
15 // - which events you are interested in (register_fd/modify_fd)
16 // - which events happened (on_fd)
20};
22
24 // This callback is "level-triggered".
25 // It means that a writable fd will continuously produce "on_fd()" events;
26 // don't forget using modify_fd() to remove the write notification once you're
27 // done writting.
28 //
29 // [main-thread]
32
34 // [main-thread]
35 bool(CLAP_ABI *register_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
36
37 // [main-thread]
38 bool(CLAP_ABI *modify_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
39
40 // [main-thread]
41 bool(CLAP_ABI *unregister_fd)(const clap_host_t *host, int fd);
43
44#ifdef __cplusplus
45}
46#endif
struct clap_host clap_host_t
#define CLAP_ABI
Definition macros.h:24
#define CLAP_CONSTEXPR
Definition macros.h:32
unsigned int uint32_t
Definition mid.cpp:100
struct clap_plugin clap_plugin_t
@ CLAP_POSIX_FD_WRITE
Definition posix-fd-support.h:18
@ CLAP_POSIX_FD_ERROR
Definition posix-fd-support.h:19
@ CLAP_POSIX_FD_READ
Definition posix-fd-support.h:17
struct clap_plugin_posix_fd_support clap_plugin_posix_fd_support_t
uint32_t clap_posix_fd_flags_t
Definition posix-fd-support.h:21
static CLAP_CONSTEXPR const char CLAP_EXT_POSIX_FD_SUPPORT[]
Definition posix-fd-support.h:7
struct clap_host_posix_fd_support clap_host_posix_fd_support_t
Definition posix-fd-support.h:33
int fd
Definition posix-fd-support.h:35
int clap_posix_fd_flags_t flags
Definition posix-fd-support.h:35
bool(CLAP_ABI *modify_fd)(const clap_host_t *host
bool(CLAP_ABI *unregister_fd)(const clap_host_t *host
bool(CLAP_ABI *register_fd)(const clap_host_t *host
Definition posix-fd-support.h:23
int clap_posix_fd_flags_t flags
Definition posix-fd-support.h:30
int fd
Definition posix-fd-support.h:30
#define void
Definition unzip.h:396