add per type API defines

This commit is contained in:
Wim Taymans 2024-11-21 11:50:12 +01:00
parent b03f2f7afa
commit 31802d4994
85 changed files with 1137 additions and 509 deletions

View file

@ -15,6 +15,14 @@ extern "C" {
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#ifndef SPA_API_CPU
#ifdef SPA_API_IMPL
#define SPA_API_CPU SPA_API_IMPL
#else
#define SPA_API_CPU static inline
#endif
#endif
/** \defgroup spa_cpu CPU
* Querying CPU properties
*/
@ -91,7 +99,7 @@ struct spa_cpu { struct spa_interface iface; };
#define SPA_CPU_VM_ACRN (1 << 13)
#define SPA_CPU_VM_POWERVM (1 << 14)
SPA_API_IMPL const char *spa_cpu_vm_type_to_string(uint32_t vm_type)
SPA_API_CPU const char *spa_cpu_vm_type_to_string(uint32_t vm_type)
{
switch(vm_type) {
case SPA_CPU_VM_NONE:
@ -160,27 +168,27 @@ struct spa_cpu_methods {
int (*zero_denormals) (void *object, bool enable);
};
SPA_API_IMPL uint32_t spa_cpu_get_flags(struct spa_cpu *c)
SPA_API_CPU uint32_t spa_cpu_get_flags(struct spa_cpu *c)
{
return spa_api_method_r(uint32_t, 0, spa_cpu, &c->iface, get_flags, 0);
}
SPA_API_IMPL int spa_cpu_force_flags(struct spa_cpu *c, uint32_t flags)
SPA_API_CPU int spa_cpu_force_flags(struct spa_cpu *c, uint32_t flags)
{
return spa_api_method_r(int, -ENOTSUP, spa_cpu, &c->iface, force_flags, 0, flags);
}
SPA_API_IMPL uint32_t spa_cpu_get_count(struct spa_cpu *c)
SPA_API_CPU uint32_t spa_cpu_get_count(struct spa_cpu *c)
{
return spa_api_method_r(uint32_t, 0, spa_cpu, &c->iface, get_count, 0);
}
SPA_API_IMPL uint32_t spa_cpu_get_max_align(struct spa_cpu *c)
SPA_API_CPU uint32_t spa_cpu_get_max_align(struct spa_cpu *c)
{
return spa_api_method_r(uint32_t, 0, spa_cpu, &c->iface, get_max_align, 0);
}
SPA_API_IMPL uint32_t spa_cpu_get_vm_type(struct spa_cpu *c)
SPA_API_CPU uint32_t spa_cpu_get_vm_type(struct spa_cpu *c)
{
return spa_api_method_r(uint32_t, 0, spa_cpu, &c->iface, get_vm_type, 1);
}
SPA_API_IMPL int spa_cpu_zero_denormals(struct spa_cpu *c, bool enable)
SPA_API_CPU int spa_cpu_zero_denormals(struct spa_cpu *c, bool enable)
{
return spa_api_method_r(int, -ENOTSUP, spa_cpu, &c->iface, zero_denormals, 2, enable);
}

View file

@ -11,6 +11,14 @@ extern "C" {
#include <spa/support/loop.h>
#ifndef SPA_API_DBUS
#ifdef SPA_API_IMPL
#define SPA_API_DBUS SPA_API_IMPL
#else
#define SPA_API_DBUS static inline
#endif
#endif
/** \defgroup spa_dbus DBus
* DBus communication
*/
@ -81,19 +89,19 @@ struct spa_dbus_connection {
/** \copydoc spa_dbus_connection.get
* \sa spa_dbus_connection.get */
SPA_API_IMPL void *spa_dbus_connection_get(struct spa_dbus_connection *conn)
SPA_API_DBUS void *spa_dbus_connection_get(struct spa_dbus_connection *conn)
{
return spa_api_func_r(void *, NULL, conn, get, 0);
}
/** \copydoc spa_dbus_connection.destroy
* \sa spa_dbus_connection.destroy */
SPA_API_IMPL void spa_dbus_connection_destroy(struct spa_dbus_connection *conn)
SPA_API_DBUS void spa_dbus_connection_destroy(struct spa_dbus_connection *conn)
{
spa_api_func_v(conn, destroy, 0);
}
/** \copydoc spa_dbus_connection.add_listener
* \sa spa_dbus_connection.add_listener */
SPA_API_IMPL void spa_dbus_connection_add_listener(struct spa_dbus_connection *conn,
SPA_API_DBUS void spa_dbus_connection_add_listener(struct spa_dbus_connection *conn,
struct spa_hook *listener,
const struct spa_dbus_connection_events *events,
void *data)
@ -124,7 +132,7 @@ struct spa_dbus_methods {
/** \copydoc spa_dbus_methods.get_connection
* \sa spa_dbus_methods.get_connection
*/
SPA_API_IMPL struct spa_dbus_connection *
SPA_API_DBUS struct spa_dbus_connection *
spa_dbus_get_connection(struct spa_dbus *dbus, enum spa_dbus_type type)
{
return spa_api_method_r(struct spa_dbus_connection *, NULL,

View file

@ -12,6 +12,14 @@ extern "C" {
#include <spa/utils/hook.h>
#include <spa/utils/defs.h>
#ifndef SPA_API_I18N
#ifdef SPA_API_IMPL
#define SPA_API_I18N SPA_API_IMPL
#else
#define SPA_API_I18N static inline
#endif
#endif
/** \defgroup spa_i18n I18N
* Gettext interface
*/
@ -53,14 +61,14 @@ struct spa_i18n_methods {
};
SPA_FORMAT_ARG_FUNC(2)
SPA_API_IMPL const char *
SPA_API_I18N const char *
spa_i18n_text(struct spa_i18n *i18n, const char *msgid)
{
return spa_api_method_null_r(const char *, msgid, spa_i18n, &i18n->iface,
text, 0, msgid);
}
SPA_API_IMPL const char *
SPA_API_I18N const char *
spa_i18n_ntext(struct spa_i18n *i18n, const char *msgid,
const char *msgid_plural, unsigned long int n)
{

View file

@ -19,7 +19,7 @@ extern "C" {
* \{
*/
SPA_API_IMPL SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNUSED,
static inline SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNUSED,
enum spa_log_level level,
const struct spa_log_topic *topic,
const char *file,
@ -49,7 +49,7 @@ SPA_API_IMPL SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNUS
fputs(location, stderr);
}
SPA_API_IMPL SPA_PRINTF_FUNC(7,8) void spa_log_impl_logt(void *object,
static inline SPA_PRINTF_FUNC(7,8) void spa_log_impl_logt(void *object,
enum spa_log_level level,
const struct spa_log_topic *topic,
const char *file,
@ -63,7 +63,7 @@ SPA_API_IMPL SPA_PRINTF_FUNC(7,8) void spa_log_impl_logt(void *object,
va_end(args);
}
SPA_API_IMPL SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object,
static inline SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object,
enum spa_log_level level,
const char *file,
int line,
@ -75,7 +75,7 @@ SPA_API_IMPL SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object,
spa_log_impl_logtv(object, level, NULL, file, line, func, fmt, args);
}
SPA_API_IMPL SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object,
static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object,
enum spa_log_level level,
const char *file,
int line,
@ -88,7 +88,7 @@ SPA_API_IMPL SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object,
va_end(args);
}
SPA_API_IMPL void spa_log_impl_topic_init(void *object SPA_UNUSED, struct spa_log_topic *topic SPA_UNUSED)
static inline void spa_log_impl_topic_init(void *object SPA_UNUSED, struct spa_log_topic *topic SPA_UNUSED)
{
/* noop */
}

View file

@ -15,6 +15,14 @@ extern "C" {
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#ifndef SPA_API_LOG
#ifdef SPA_API_IMPL
#define SPA_API_LOG SPA_API_IMPL
#else
#define SPA_API_LOG static inline
#endif
#endif
/** \defgroup spa_log Log
* Logging interface
*/
@ -213,7 +221,7 @@ struct spa_log_methods {
#define SPA_LOG_TOPIC(v, t) \
(struct spa_log_topic){ .version = (v), .topic = (t)}
SPA_API_IMPL void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic)
SPA_API_LOG void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic)
{
if (SPA_UNLIKELY(!log))
return;
@ -221,7 +229,7 @@ SPA_API_IMPL void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *
spa_interface_call(&log->iface, struct spa_log_methods, topic_init, 1, topic);
}
SPA_API_IMPL bool spa_log_level_topic_enabled(const struct spa_log *log,
SPA_API_LOG bool spa_log_level_topic_enabled(const struct spa_log *log,
const struct spa_log_topic *topic,
enum spa_log_level level)
{
@ -256,7 +264,7 @@ SPA_API_IMPL bool spa_log_level_topic_enabled(const struct spa_log *log,
/* Transparently calls to version 0 logv if v1 is not supported */
SPA_PRINTF_FUNC(7, 0)
SPA_API_IMPL void spa_log_logtv(struct spa_log *l, enum spa_log_level level,
SPA_API_LOG void spa_log_logtv(struct spa_log *l, enum spa_log_level level,
const struct spa_log_topic *topic, const char *file, int line,
const char *func, const char *fmt, va_list args)
{

View file

@ -15,6 +15,14 @@ extern "C" {
#include <spa/utils/hook.h>
#include <spa/support/system.h>
#ifndef SPA_API_LOOP
#ifdef SPA_API_IMPL
#define SPA_API_LOOP SPA_API_IMPL
#else
#define SPA_API_LOOP static inline
#endif
#endif
/** \defgroup spa_loop Loop
* Event loop interface
*/
@ -127,22 +135,22 @@ struct spa_loop_methods {
void *user_data);
};
SPA_API_IMPL int spa_loop_add_source(struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int spa_loop_add_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, add_source, 0, source);
}
SPA_API_IMPL int spa_loop_update_source(struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int spa_loop_update_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, update_source, 0, source);
}
SPA_API_IMPL int spa_loop_remove_source(struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int spa_loop_remove_source(struct spa_loop *object, struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop, &object->iface, remove_source, 0, source);
}
SPA_API_IMPL int spa_loop_invoke(struct spa_loop *object,
SPA_API_LOOP int spa_loop_invoke(struct spa_loop *object,
spa_invoke_func_t func, uint32_t seq, const void *data,
size_t size, bool block, void *user_data)
{
@ -165,14 +173,14 @@ struct spa_loop_control_hooks {
void (*after) (void *data);
};
SPA_API_IMPL void spa_loop_control_hook_before(struct spa_hook_list *l)
SPA_API_LOOP void spa_loop_control_hook_before(struct spa_hook_list *l)
{
struct spa_hook *h;
spa_list_for_each_reverse(h, &l->list, link)
spa_callbacks_call_fast(&h->cb, struct spa_loop_control_hooks, before, 0);
}
SPA_API_IMPL void spa_loop_control_hook_after(struct spa_hook_list *l)
SPA_API_LOOP void spa_loop_control_hook_after(struct spa_hook_list *l)
{
struct spa_hook *h;
spa_list_for_each(h, &l->list, link)
@ -239,39 +247,39 @@ struct spa_loop_control_methods {
int (*check) (void *object);
};
SPA_API_IMPL int spa_loop_control_get_fd(struct spa_loop_control *object)
SPA_API_LOOP int spa_loop_control_get_fd(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, get_fd, 0);
}
SPA_API_IMPL void spa_loop_control_add_hook(struct spa_loop_control *object,
SPA_API_LOOP void spa_loop_control_add_hook(struct spa_loop_control *object,
struct spa_hook *hook, const struct spa_loop_control_hooks *hooks,
void *data)
{
spa_api_method_v(spa_loop_control, &object->iface, add_hook, 0,
hook, hooks, data);
}
SPA_API_IMPL void spa_loop_control_enter(struct spa_loop_control *object)
SPA_API_LOOP void spa_loop_control_enter(struct spa_loop_control *object)
{
spa_api_method_v(spa_loop_control, &object->iface, enter, 0);
}
SPA_API_IMPL void spa_loop_control_leave(struct spa_loop_control *object)
SPA_API_LOOP void spa_loop_control_leave(struct spa_loop_control *object)
{
spa_api_method_v(spa_loop_control, &object->iface, leave, 0);
}
SPA_API_IMPL int spa_loop_control_iterate(struct spa_loop_control *object,
SPA_API_LOOP int spa_loop_control_iterate(struct spa_loop_control *object,
int timeout)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, iterate, 0, timeout);
}
SPA_API_IMPL int spa_loop_control_iterate_fast(struct spa_loop_control *object,
SPA_API_LOOP int spa_loop_control_iterate_fast(struct spa_loop_control *object,
int timeout)
{
return spa_api_method_fast_r(int, -ENOTSUP,
spa_loop_control, &object->iface, iterate, 0, timeout);
}
SPA_API_IMPL int spa_loop_control_check(struct spa_loop_control *object)
SPA_API_LOOP int spa_loop_control_check(struct spa_loop_control *object)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_control, &object->iface, check, 1);
@ -326,51 +334,51 @@ struct spa_loop_utils_methods {
void (*destroy_source) (void *object, struct spa_source *source);
};
SPA_API_IMPL struct spa_source *
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_io(struct spa_loop_utils *object, int fd, uint32_t mask,
bool close, spa_source_io_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_io, 0, fd, mask, close, func, data);
}
SPA_API_IMPL int spa_loop_utils_update_io(struct spa_loop_utils *object,
SPA_API_LOOP int spa_loop_utils_update_io(struct spa_loop_utils *object,
struct spa_source *source, uint32_t mask)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, update_io, 0, source, mask);
}
SPA_API_IMPL struct spa_source *
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_idle(struct spa_loop_utils *object, bool enabled,
spa_source_idle_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_idle, 0, enabled, func, data);
}
SPA_API_IMPL int spa_loop_utils_enable_idle(struct spa_loop_utils *object,
SPA_API_LOOP int spa_loop_utils_enable_idle(struct spa_loop_utils *object,
struct spa_source *source, bool enabled)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, enable_idle, 0, source, enabled);
}
SPA_API_IMPL struct spa_source *
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_event(struct spa_loop_utils *object, spa_source_event_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_event, 0, func, data);
}
SPA_API_IMPL int spa_loop_utils_signal_event(struct spa_loop_utils *object,
SPA_API_LOOP int spa_loop_utils_signal_event(struct spa_loop_utils *object,
struct spa_source *source)
{
return spa_api_method_r(int, -ENOTSUP,
spa_loop_utils, &object->iface, signal_event, 0, source);
}
SPA_API_IMPL struct spa_source *
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_timer(struct spa_loop_utils *object, spa_source_timer_func_t func, void *data)
{
return spa_api_method_r(struct spa_source *, NULL,
spa_loop_utils, &object->iface, add_timer, 0, func, data);
}
SPA_API_IMPL int spa_loop_utils_update_timer(struct spa_loop_utils *object,
SPA_API_LOOP int spa_loop_utils_update_timer(struct spa_loop_utils *object,
struct spa_source *source, struct timespec *value,
struct timespec *interval, bool absolute)
{
@ -378,7 +386,7 @@ SPA_API_IMPL int spa_loop_utils_update_timer(struct spa_loop_utils *object,
spa_loop_utils, &object->iface, update_timer, 0, source,
value, interval, absolute);
}
SPA_API_IMPL struct spa_source *
SPA_API_LOOP struct spa_source *
spa_loop_utils_add_signal(struct spa_loop_utils *object, int signal_number,
spa_source_signal_func_t func, void *data)
{
@ -386,7 +394,7 @@ spa_loop_utils_add_signal(struct spa_loop_utils *object, int signal_number,
spa_loop_utils, &object->iface, add_signal, 0,
signal_number, func, data);
}
SPA_API_IMPL void spa_loop_utils_destroy_source(struct spa_loop_utils *object,
SPA_API_LOOP void spa_loop_utils_destroy_source(struct spa_loop_utils *object,
struct spa_source *source)
{
spa_api_method_v(spa_loop_utils, &object->iface, destroy_source, 0, source);

View file

@ -12,6 +12,14 @@ extern "C" {
#include <spa/utils/hook.h>
#include <spa/utils/dict.h>
#ifndef SPA_API_PLUGIN_LOADER
#ifdef SPA_API_IMPL
#define SPA_API_PLUGIN_LOADER SPA_API_IMPL
#else
#define SPA_API_PLUGIN_LOADER static inline
#endif
#endif
/** \defgroup spa_plugin_loader Plugin Loader
* SPA plugin loader
*/
@ -48,14 +56,14 @@ struct spa_plugin_loader_methods {
int (*unload)(void *object, struct spa_handle *handle);
};
SPA_API_IMPL struct spa_handle *
SPA_API_PLUGIN_LOADER struct spa_handle *
spa_plugin_loader_load(struct spa_plugin_loader *loader, const char *factory_name, const struct spa_dict *info)
{
return spa_api_method_null_r(struct spa_handle *, NULL, spa_plugin_loader, &loader->iface,
load, 0, factory_name, info);
}
SPA_API_IMPL int
SPA_API_PLUGIN_LOADER int
spa_plugin_loader_unload(struct spa_plugin_loader *loader, struct spa_handle *handle)
{
return spa_api_method_null_r(int, -1, spa_plugin_loader, &loader->iface,

View file

@ -15,6 +15,14 @@ extern "C" {
#include <spa/utils/hook.h>
#include <spa/utils/dict.h>
#ifndef SPA_API_PLUGIN
#ifdef SPA_API_IMPL
#define SPA_API_PLUGIN SPA_API_IMPL
#else
#define SPA_API_PLUGIN static inline
#endif
#endif
/**
* \defgroup spa_handle Plugin Handle
* SPA plugin handle and factory interfaces
@ -54,13 +62,13 @@ struct spa_handle {
int (*clear) (struct spa_handle *handle);
};
SPA_API_IMPL int
SPA_API_PLUGIN int
spa_handle_get_interface(struct spa_handle *object,
const char *type, void **iface)
{
return spa_api_func_r(int, -ENOTSUP, object, get_interface, 0, type, iface);
}
SPA_API_IMPL int
SPA_API_PLUGIN int
spa_handle_clear(struct spa_handle *object)
{
return spa_api_func_r(int, -ENOTSUP, object, clear, 0);
@ -85,7 +93,7 @@ struct spa_support {
};
/** Find a support item of the given type */
SPA_API_IMPL void *spa_support_find(const struct spa_support *support,
SPA_API_PLUGIN void *spa_support_find(const struct spa_support *support,
uint32_t n_support,
const char *type)
{
@ -170,13 +178,13 @@ struct spa_handle_factory {
uint32_t *index);
};
SPA_API_IMPL size_t
SPA_API_PLUGIN size_t
spa_handle_factory_get_size(const struct spa_handle_factory *object,
const struct spa_dict *params)
{
return spa_api_func_r(size_t, 0, object, get_size, 1, params);
}
SPA_API_IMPL int
SPA_API_PLUGIN int
spa_handle_factory_init(const struct spa_handle_factory *object,
struct spa_handle *handle, const struct spa_dict *info,
const struct spa_support *support, uint32_t n_support)
@ -184,7 +192,7 @@ spa_handle_factory_init(const struct spa_handle_factory *object,
return spa_api_func_r(int, -ENOTSUP, object, init, 1, handle, info,
support, n_support);
}
SPA_API_IMPL int
SPA_API_PLUGIN int
spa_handle_factory_enum_interface_info(const struct spa_handle_factory *object,
const struct spa_interface_info **info, uint32_t *index)
{

View file

@ -18,6 +18,14 @@ struct itimerspec;
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#ifndef SPA_API_SYSTEM
#ifdef SPA_API_IMPL
#define SPA_API_SYSTEM SPA_API_IMPL
#else
#define SPA_API_SYSTEM static inline
#endif
#endif
/** \defgroup spa_system System
* I/O, clock, polling, timer, and signal interfaces
*/
@ -98,60 +106,60 @@ struct spa_system_methods {
int (*signalfd_read) (void *object, int fd, int *signal);
};
SPA_API_IMPL ssize_t spa_system_read(struct spa_system *object, int fd, void *buf, size_t count)
SPA_API_SYSTEM ssize_t spa_system_read(struct spa_system *object, int fd, void *buf, size_t count)
{
return spa_api_method_fast_r(ssize_t, -ENOTSUP, spa_system, &object->iface, read, 0, fd, buf, count);
}
SPA_API_IMPL ssize_t spa_system_write(struct spa_system *object, int fd, const void *buf, size_t count)
SPA_API_SYSTEM ssize_t spa_system_write(struct spa_system *object, int fd, const void *buf, size_t count)
{
return spa_api_method_fast_r(ssize_t, -ENOTSUP, spa_system, &object->iface, write, 0, fd, buf, count);
}
#define spa_system_ioctl(object,fd,request,...) \
spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, ioctl, 0, fd, request, ##__VA_ARGS__)
SPA_API_IMPL int spa_system_close(struct spa_system *object, int fd)
SPA_API_SYSTEM int spa_system_close(struct spa_system *object, int fd)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, close, 0, fd);
}
SPA_API_IMPL int spa_system_clock_gettime(struct spa_system *object,
SPA_API_SYSTEM int spa_system_clock_gettime(struct spa_system *object,
int clockid, struct timespec *value)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, clock_gettime, 0, clockid, value);
}
SPA_API_IMPL int spa_system_clock_getres(struct spa_system *object,
SPA_API_SYSTEM int spa_system_clock_getres(struct spa_system *object,
int clockid, struct timespec *res)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, clock_getres, 0, clockid, res);
}
SPA_API_IMPL int spa_system_pollfd_create(struct spa_system *object, int flags)
SPA_API_SYSTEM int spa_system_pollfd_create(struct spa_system *object, int flags)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, pollfd_create, 0, flags);
}
SPA_API_IMPL int spa_system_pollfd_add(struct spa_system *object, int pfd, int fd, uint32_t events, void *data)
SPA_API_SYSTEM int spa_system_pollfd_add(struct spa_system *object, int pfd, int fd, uint32_t events, void *data)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, pollfd_add, 0, pfd, fd, events, data);
}
SPA_API_IMPL int spa_system_pollfd_mod(struct spa_system *object, int pfd, int fd, uint32_t events, void *data)
SPA_API_SYSTEM int spa_system_pollfd_mod(struct spa_system *object, int pfd, int fd, uint32_t events, void *data)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, pollfd_mod, 0, pfd, fd, events, data);
}
SPA_API_IMPL int spa_system_pollfd_del(struct spa_system *object, int pfd, int fd)
SPA_API_SYSTEM int spa_system_pollfd_del(struct spa_system *object, int pfd, int fd)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, pollfd_del, 0, pfd, fd);
}
SPA_API_IMPL int spa_system_pollfd_wait(struct spa_system *object, int pfd,
SPA_API_SYSTEM int spa_system_pollfd_wait(struct spa_system *object, int pfd,
struct spa_poll_event *ev, int n_ev, int timeout)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, pollfd_wait, 0, pfd, ev, n_ev, timeout);
}
SPA_API_IMPL int spa_system_timerfd_create(struct spa_system *object, int clockid, int flags)
SPA_API_SYSTEM int spa_system_timerfd_create(struct spa_system *object, int clockid, int flags)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, timerfd_create, 0, clockid, flags);
}
SPA_API_IMPL int spa_system_timerfd_settime(struct spa_system *object,
SPA_API_SYSTEM int spa_system_timerfd_settime(struct spa_system *object,
int fd, int flags,
const struct itimerspec *new_value,
struct itimerspec *old_value)
@ -160,40 +168,40 @@ SPA_API_IMPL int spa_system_timerfd_settime(struct spa_system *object,
fd, flags, new_value, old_value);
}
SPA_API_IMPL int spa_system_timerfd_gettime(struct spa_system *object,
SPA_API_SYSTEM int spa_system_timerfd_gettime(struct spa_system *object,
int fd, struct itimerspec *curr_value)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, timerfd_gettime, 0,
fd, curr_value);
}
SPA_API_IMPL int spa_system_timerfd_read(struct spa_system *object, int fd, uint64_t *expirations)
SPA_API_SYSTEM int spa_system_timerfd_read(struct spa_system *object, int fd, uint64_t *expirations)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, timerfd_read, 0,
fd, expirations);
}
SPA_API_IMPL int spa_system_eventfd_create(struct spa_system *object, int flags)
SPA_API_SYSTEM int spa_system_eventfd_create(struct spa_system *object, int flags)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, eventfd_create, 0, flags);
}
SPA_API_IMPL int spa_system_eventfd_write(struct spa_system *object, int fd, uint64_t count)
SPA_API_SYSTEM int spa_system_eventfd_write(struct spa_system *object, int fd, uint64_t count)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, eventfd_write, 0,
fd, count);
}
SPA_API_IMPL int spa_system_eventfd_read(struct spa_system *object, int fd, uint64_t *count)
SPA_API_SYSTEM int spa_system_eventfd_read(struct spa_system *object, int fd, uint64_t *count)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, eventfd_read, 0,
fd, count);
}
SPA_API_IMPL int spa_system_signalfd_create(struct spa_system *object, int signal, int flags)
SPA_API_SYSTEM int spa_system_signalfd_create(struct spa_system *object, int signal, int flags)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, signalfd_create, 0,
signal, flags);
}
SPA_API_IMPL int spa_system_signalfd_read(struct spa_system *object, int fd, int *signal)
SPA_API_SYSTEM int spa_system_signalfd_read(struct spa_system *object, int fd, int *signal)
{
return spa_api_method_fast_r(int, -ENOTSUP, spa_system, &object->iface, signalfd_read, 0,
fd, signal);

View file

@ -16,6 +16,14 @@ extern "C" {
#include <spa/utils/hook.h>
#include <spa/utils/dict.h>
#ifndef SPA_API_THREAD
#ifdef SPA_API_IMPL
#define SPA_API_THREAD SPA_API_IMPL
#else
#define SPA_API_THREAD static inline
#endif
#endif
/** \defgroup spa_thread Thread
* Threading utility interfaces
*/
@ -58,7 +66,7 @@ struct spa_thread_utils_methods {
/** \copydoc spa_thread_utils_methods.create
* \sa spa_thread_utils_methods.create */
SPA_API_IMPL struct spa_thread *spa_thread_utils_create(struct spa_thread_utils *o,
SPA_API_THREAD struct spa_thread *spa_thread_utils_create(struct spa_thread_utils *o,
const struct spa_dict *props, void *(*start_routine)(void*), void *arg)
{
return spa_api_method_r(struct spa_thread *, NULL,
@ -68,7 +76,7 @@ SPA_API_IMPL struct spa_thread *spa_thread_utils_create(struct spa_thread_utils
/** \copydoc spa_thread_utils_methods.join
* \sa spa_thread_utils_methods.join */
SPA_API_IMPL int spa_thread_utils_join(struct spa_thread_utils *o,
SPA_API_THREAD int spa_thread_utils_join(struct spa_thread_utils *o,
struct spa_thread *thread, void **retval)
{
return spa_api_method_r(int, -ENOTSUP,
@ -78,7 +86,7 @@ SPA_API_IMPL int spa_thread_utils_join(struct spa_thread_utils *o,
/** \copydoc spa_thread_utils_methods.get_rt_range
* \sa spa_thread_utils_methods.get_rt_range */
SPA_API_IMPL int spa_thread_utils_get_rt_range(struct spa_thread_utils *o,
SPA_API_THREAD int spa_thread_utils_get_rt_range(struct spa_thread_utils *o,
const struct spa_dict *props, int *min, int *max)
{
return spa_api_method_r(int, -ENOTSUP,
@ -88,7 +96,7 @@ SPA_API_IMPL int spa_thread_utils_get_rt_range(struct spa_thread_utils *o,
/** \copydoc spa_thread_utils_methods.acquire_rt
* \sa spa_thread_utils_methods.acquire_rt */
SPA_API_IMPL int spa_thread_utils_acquire_rt(struct spa_thread_utils *o,
SPA_API_THREAD int spa_thread_utils_acquire_rt(struct spa_thread_utils *o,
struct spa_thread *thread, int priority)
{
return spa_api_method_r(int, -ENOTSUP,
@ -98,7 +106,7 @@ SPA_API_IMPL int spa_thread_utils_acquire_rt(struct spa_thread_utils *o,
/** \copydoc spa_thread_utils_methods.drop_rt
* \sa spa_thread_utils_methods.drop_rt */
SPA_API_IMPL int spa_thread_utils_drop_rt(struct spa_thread_utils *o,
SPA_API_THREAD int spa_thread_utils_drop_rt(struct spa_thread_utils *o,
struct spa_thread *thread)
{
return spa_api_method_r(int, -ENOTSUP,