commit ea82e7618dd551b4b3eecb6b0b325314dee6da29
parent 606dec8fc3d5dfee1265f7a48fb2d0f4535d91fb
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sun, 26 Dec 2021 17:50:40 +0100
Merge branch 'next' into ev-rework
Diffstat:
2 files changed, 46 insertions(+), 53 deletions(-)
diff --git a/include/clap/ext/fd-support.h b/include/clap/ext/fd-support.h
@@ -1,52 +0,0 @@
-#pragma once
-
-#include "../plugin.h"
-
-static CLAP_CONSTEXPR const char CLAP_EXT_FD_SUPPORT[] = "clap.fd-support";
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#pragma pack(push, CLAP_ALIGN)
-
-#ifdef _WIN32
-typedef void *clap_fd;
-#else
-typedef int clap_fd;
-#endif
-
-enum {
- // IO events
- CLAP_FD_READ = 1 << 0,
- CLAP_FD_WRITE = 1 << 1,
- CLAP_FD_ERROR = 1 << 2,
-};
-typedef uint32_t clap_fd_flags;
-
-typedef struct clap_plugin_fd_support {
- // This callback is "level-triggered".
- // It means that a writable fd will continuously produce "on_fd()" events;
- // don't forget using modify_fd() to remove the write notification once you're
- // done writting.
- //
- // [main-thread]
- void (*on_fd)(const clap_plugin_t *plugin, clap_fd fd, clap_fd_flags flags);
-} clap_plugin_fd_support_t;
-
-typedef struct clap_host_fd_support {
- // [main-thread]
- bool (*register_fd)(const clap_host_t *host, clap_fd fd, clap_fd_flags flags);
-
- // [main-thread]
- bool (*modify_fd)(const clap_host_t *host, clap_fd fd, clap_fd_flags flags);
-
- // [main-thread]
- bool (*unregister_fd)(const clap_host_t *host, clap_fd fd);
-} clap_host_fd_support_t;
-
-#pragma pack(pop)
-
-#ifdef __cplusplus
-}
-#endif
-\ No newline at end of file
diff --git a/include/clap/ext/posix-fd-support.h b/include/clap/ext/posix-fd-support.h
@@ -0,0 +1,45 @@
+#pragma once
+
+#include "../plugin.h"
+
+static CLAP_CONSTEXPR const char CLAP_EXT_POSIX_FD_SUPPORT[] = "clap.posix-fd-support";
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(push, CLAP_ALIGN)
+
+enum {
+ // IO events flags
+ CLAP_POSIX_FD_READ = 1 << 0,
+ CLAP_POSIX_FD_WRITE = 1 << 1,
+ CLAP_POSIX_FD_ERROR = 1 << 2,
+};
+
+typedef struct clap_plugin_posix_fd_support {
+ // This callback is "level-triggered".
+ // It means that a writable fd will continuously produce "on_fd()" events;
+ // don't forget using modify_fd() to remove the write notification once you're
+ // done writting.
+ //
+ // [main-thread]
+ void (*on_fd)(const clap_plugin_t *plugin, int fd, int flags);
+} clap_plugin_fd_support_t;
+
+typedef struct clap_host_posix_fd_support {
+ // [main-thread]
+ bool (*register_fd)(const clap_host_t *host, int fd, int flags);
+
+ // [main-thread]
+ bool (*modify_fd)(const clap_host_t *host, int fd, int flags);
+
+ // [main-thread]
+ bool (*unregister_fd)(const clap_host_t *host, int fd);
+} clap_host_posix_fd_support_t;
+
+#pragma pack(pop)
+
+#ifdef __cplusplus
+}
+#endif
+\ No newline at end of file