Makes the connection between posix_fd flags and its usage more obvious
@@ -17,6 +17,7 @@ enum {
CLAP_POSIX_FD_WRITE = 1 << 1,
CLAP_POSIX_FD_ERROR = 1 << 2,
};
+typedef uint32_t clap_posix_fd_flags_t;
typedef struct clap_plugin_posix_fd_support {
// This callback is "level-triggered".
@@ -25,15 +26,15 @@ typedef struct clap_plugin_posix_fd_support {
// done writting.
//
// [main-thread]
- void (*on_fd)(const clap_plugin_t *plugin, int fd, int flags);
+ void (*on_fd)(const clap_plugin_t *plugin, int fd, clap_posix_fd_flags_t flags);
} clap_plugin_posix_fd_support_t;
typedef struct clap_host_posix_fd_support {
// [main-thread]
- bool (*register_fd)(const clap_host_t *host, int fd, int flags);
+ bool (*register_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
// [main-thread]
- bool (*modify_fd)(const clap_host_t *host, int fd, int flags);
+ bool (*modify_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
// [main-thread]
bool (*unregister_fd)(const clap_host_t *host, int fd);
