mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
make static inline -> SPA_API_IMPL
So that we can export the symbols as well.
This commit is contained in:
parent
84bd4b7ea9
commit
90b0e45037
91 changed files with 563 additions and 552 deletions
|
|
@ -71,7 +71,7 @@ struct pw_array {
|
|||
|
||||
/** Initialize the array with given extend. Extend needs to be > 0 or else
|
||||
* the array will not be able to expand. */
|
||||
static inline void pw_array_init(struct pw_array *arr, size_t extend)
|
||||
SPA_API_IMPL void pw_array_init(struct pw_array *arr, size_t extend)
|
||||
{
|
||||
arr->data = NULL;
|
||||
arr->size = arr->alloc = 0;
|
||||
|
|
@ -79,7 +79,7 @@ static inline void pw_array_init(struct pw_array *arr, size_t extend)
|
|||
}
|
||||
|
||||
/** Clear the array. This should be called when pw_array_init() was called. */
|
||||
static inline void pw_array_clear(struct pw_array *arr)
|
||||
SPA_API_IMPL void pw_array_clear(struct pw_array *arr)
|
||||
{
|
||||
if (arr->extend > 0)
|
||||
free(arr->data);
|
||||
|
|
@ -87,7 +87,7 @@ static inline void pw_array_clear(struct pw_array *arr)
|
|||
}
|
||||
|
||||
/** Initialize a static array. */
|
||||
static inline void pw_array_init_static(struct pw_array *arr, void *data, size_t size)
|
||||
SPA_API_IMPL void pw_array_init_static(struct pw_array *arr, void *data, size_t size)
|
||||
{
|
||||
arr->data = data;
|
||||
arr->alloc = size;
|
||||
|
|
@ -95,13 +95,13 @@ static inline void pw_array_init_static(struct pw_array *arr, void *data, size_t
|
|||
}
|
||||
|
||||
/** Reset the array */
|
||||
static inline void pw_array_reset(struct pw_array *arr)
|
||||
SPA_API_IMPL void pw_array_reset(struct pw_array *arr)
|
||||
{
|
||||
arr->size = 0;
|
||||
}
|
||||
|
||||
/** Make sure \a size bytes can be added to the array */
|
||||
static inline int pw_array_ensure_size(struct pw_array *arr, size_t size)
|
||||
SPA_API_IMPL int pw_array_ensure_size(struct pw_array *arr, size_t size)
|
||||
{
|
||||
size_t alloc, need;
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ static inline int pw_array_ensure_size(struct pw_array *arr, size_t size)
|
|||
/** Add \a ref size bytes to \a arr. A pointer to memory that can
|
||||
* hold at least \a size bytes is returned or NULL when an error occurred
|
||||
* and errno will be set.*/
|
||||
static inline void *pw_array_add(struct pw_array *arr, size_t size)
|
||||
SPA_API_IMPL void *pw_array_add(struct pw_array *arr, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ static inline void *pw_array_add(struct pw_array *arr, size_t size)
|
|||
|
||||
/** Add a pointer to array. Returns 0 on success and a negative errno style
|
||||
* error on failure. */
|
||||
static inline int pw_array_add_ptr(struct pw_array *arr, void *ptr)
|
||||
SPA_API_IMPL int pw_array_add_ptr(struct pw_array *arr, void *ptr)
|
||||
{
|
||||
void **p = (void **)pw_array_add(arr, sizeof(void*));
|
||||
if (p == NULL)
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ struct pw_client_methods {
|
|||
const struct pw_permission *permissions);
|
||||
};
|
||||
|
||||
static inline int pw_client_add_listener(struct pw_client *object,
|
||||
SPA_API_IMPL int pw_client_add_listener(struct pw_client *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_client_events *events,
|
||||
void *data)
|
||||
|
|
@ -158,22 +158,22 @@ static inline int pw_client_add_listener(struct pw_client *object,
|
|||
return spa_api_method_r(int, -ENOTSUP, pw_client, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_client_error(struct pw_client *object, uint32_t id, int res, const char *message)
|
||||
SPA_API_IMPL int pw_client_error(struct pw_client *object, uint32_t id, int res, const char *message)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client, (struct spa_interface*)object, error, 0,
|
||||
id, res, message);
|
||||
}
|
||||
static inline int pw_client_update_properties(struct pw_client *object, const struct spa_dict *props)
|
||||
SPA_API_IMPL int pw_client_update_properties(struct pw_client *object, const struct spa_dict *props)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client, (struct spa_interface*)object, update_properties, 0,
|
||||
props);
|
||||
}
|
||||
static inline int pw_client_get_permissions(struct pw_client *object, uint32_t index, uint32_t num)
|
||||
SPA_API_IMPL int pw_client_get_permissions(struct pw_client *object, uint32_t index, uint32_t num)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client, (struct spa_interface*)object, get_permissions, 0,
|
||||
index, num);
|
||||
}
|
||||
static inline int pw_client_update_permissions(struct pw_client *object, uint32_t n_permissions,
|
||||
SPA_API_IMPL int pw_client_update_permissions(struct pw_client *object, uint32_t n_permissions,
|
||||
const struct pw_permission *permissions)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client, (struct spa_interface*)object, update_permissions, 0,
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ struct pw_core_methods {
|
|||
};
|
||||
|
||||
|
||||
static inline int pw_core_add_listener(struct pw_core *object,
|
||||
SPA_API_IMPL int pw_core_add_listener(struct pw_core *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_core_events *events,
|
||||
void *data)
|
||||
|
|
@ -344,31 +344,31 @@ static inline int pw_core_add_listener(struct pw_core *object,
|
|||
pw_core, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_core_hello(struct pw_core *object, uint32_t version)
|
||||
SPA_API_IMPL int pw_core_hello(struct pw_core *object, uint32_t version)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_core, (struct spa_interface*)object, hello, 0,
|
||||
version);
|
||||
}
|
||||
static inline int pw_core_sync(struct pw_core *object, uint32_t id, int seq)
|
||||
SPA_API_IMPL int pw_core_sync(struct pw_core *object, uint32_t id, int seq)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_core, (struct spa_interface*)object, sync, 0,
|
||||
id, seq);
|
||||
}
|
||||
static inline int pw_core_pong(struct pw_core *object, uint32_t id, int seq)
|
||||
SPA_API_IMPL int pw_core_pong(struct pw_core *object, uint32_t id, int seq)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_core, (struct spa_interface*)object, pong, 0,
|
||||
id, seq);
|
||||
}
|
||||
static inline int pw_core_error(struct pw_core *object, uint32_t id, int seq, int res, const char *message)
|
||||
SPA_API_IMPL int pw_core_error(struct pw_core *object, uint32_t id, int seq, int res, const char *message)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_core, (struct spa_interface*)object, error, 0,
|
||||
id, seq, res, message);
|
||||
}
|
||||
static inline
|
||||
SPA_API_IMPL
|
||||
SPA_PRINTF_FUNC(5, 0) int
|
||||
pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
|
||||
int res, const char *message, va_list args)
|
||||
|
|
@ -379,7 +379,7 @@ pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
|
|||
return pw_core_error(core, id, seq, res, buffer);
|
||||
}
|
||||
|
||||
static inline
|
||||
SPA_API_IMPL
|
||||
SPA_PRINTF_FUNC(5, 6) int
|
||||
pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
|
||||
int res, const char *message, ...)
|
||||
|
|
@ -392,14 +392,14 @@ pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
|
|||
return r;
|
||||
}
|
||||
|
||||
static inline struct pw_registry *
|
||||
SPA_API_IMPL struct pw_registry *
|
||||
pw_core_get_registry(struct pw_core *core, uint32_t version, size_t user_data_size)
|
||||
{
|
||||
return spa_api_method_r(struct pw_registry*, NULL,
|
||||
pw_core, (struct spa_interface*)core, get_registry, 0,
|
||||
version, user_data_size);
|
||||
}
|
||||
static inline void *
|
||||
SPA_API_IMPL void *
|
||||
pw_core_create_object(struct pw_core *core,
|
||||
const char *factory_name,
|
||||
const char *type,
|
||||
|
|
@ -411,7 +411,7 @@ pw_core_create_object(struct pw_core *core,
|
|||
pw_core, (struct spa_interface*)core, create_object, 0,
|
||||
factory_name, type, version, props, user_data_size);
|
||||
}
|
||||
static inline void
|
||||
SPA_API_IMPL void
|
||||
pw_core_destroy(struct pw_core *core, void *proxy)
|
||||
{
|
||||
spa_api_method_v(pw_core, (struct spa_interface*)core, destroy, 0,
|
||||
|
|
@ -533,7 +533,7 @@ struct pw_registry_methods {
|
|||
};
|
||||
|
||||
/** Registry */
|
||||
static inline int pw_registry_add_listener(struct pw_registry *registry,
|
||||
SPA_API_IMPL int pw_registry_add_listener(struct pw_registry *registry,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_registry_events *events,
|
||||
void *data)
|
||||
|
|
@ -542,7 +542,7 @@ static inline int pw_registry_add_listener(struct pw_registry *registry,
|
|||
pw_registry, (struct spa_interface*)registry, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline void *
|
||||
SPA_API_IMPL void *
|
||||
pw_registry_bind(struct pw_registry *registry,
|
||||
uint32_t id, const char *type, uint32_t version,
|
||||
size_t user_data_size)
|
||||
|
|
@ -551,7 +551,7 @@ pw_registry_bind(struct pw_registry *registry,
|
|||
pw_registry, (struct spa_interface*)registry, bind, 0,
|
||||
id, type, version, user_data_size);
|
||||
}
|
||||
static inline int
|
||||
SPA_API_IMPL int
|
||||
pw_registry_destroy(struct pw_registry *registry, uint32_t id)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ struct pw_device_methods {
|
|||
const struct spa_pod *param);
|
||||
};
|
||||
|
||||
static inline int pw_device_add_listener(struct pw_device *object,
|
||||
SPA_API_IMPL int pw_device_add_listener(struct pw_device *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_device_events *events,
|
||||
void *data)
|
||||
|
|
@ -150,13 +150,13 @@ static inline int pw_device_add_listener(struct pw_device *object,
|
|||
pw_device, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_device_subscribe_params(struct pw_device *object, uint32_t *ids, uint32_t n_ids)
|
||||
SPA_API_IMPL int pw_device_subscribe_params(struct pw_device *object, uint32_t *ids, uint32_t n_ids)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_device, (struct spa_interface*)object, subscribe_params, 0,
|
||||
ids, n_ids);
|
||||
}
|
||||
static inline int pw_device_enum_params(struct pw_device *object,
|
||||
SPA_API_IMPL int pw_device_enum_params(struct pw_device *object,
|
||||
int seq, uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter)
|
||||
{
|
||||
|
|
@ -164,7 +164,7 @@ static inline int pw_device_enum_params(struct pw_device *object,
|
|||
pw_device, (struct spa_interface*)object, enum_params, 0,
|
||||
seq, id, start, num, filter);
|
||||
}
|
||||
static inline int pw_device_set_param(struct pw_device *object, uint32_t id, uint32_t flags,
|
||||
SPA_API_IMPL int pw_device_set_param(struct pw_device *object, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ struct pw_client_node_methods {
|
|||
struct spa_buffer **buffers);
|
||||
};
|
||||
|
||||
static inline int pw_client_node_add_listener(struct pw_client_node *object,
|
||||
SPA_API_IMPL int pw_client_node_add_listener(struct pw_client_node *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_client_node_events *events,
|
||||
void *data)
|
||||
|
|
@ -311,13 +311,13 @@ static inline int pw_client_node_add_listener(struct pw_client_node *object,
|
|||
return spa_api_method_r(int, -ENOTSUP, pw_client_node, (struct spa_interface*)object,
|
||||
add_listener, 0, listener, events, data);
|
||||
}
|
||||
static inline struct pw_node *
|
||||
SPA_API_IMPL struct pw_node *
|
||||
pw_client_node_get_node(struct pw_client_node *p, uint32_t version, size_t user_data_size)
|
||||
{
|
||||
return spa_api_method_r(struct pw_node*, NULL, pw_client_node, (struct spa_interface*)p,
|
||||
get_node, 0, version, user_data_size);
|
||||
}
|
||||
static inline int pw_client_node_update(struct pw_client_node *object,
|
||||
SPA_API_IMPL int pw_client_node_update(struct pw_client_node *object,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params, const struct spa_pod **params,
|
||||
const struct spa_node_info *info)
|
||||
|
|
@ -325,7 +325,7 @@ static inline int pw_client_node_update(struct pw_client_node *object,
|
|||
return spa_api_method_r(int, -ENOTSUP, pw_client_node, (struct spa_interface*)object,
|
||||
update, 0, change_mask, n_params, params, info);
|
||||
}
|
||||
static inline int pw_client_node_port_update(struct pw_client_node *object,
|
||||
SPA_API_IMPL int pw_client_node_port_update(struct pw_client_node *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params, const struct spa_pod **params,
|
||||
|
|
@ -334,17 +334,17 @@ static inline int pw_client_node_port_update(struct pw_client_node *object,
|
|||
return spa_api_method_r(int, -ENOTSUP, pw_client_node, (struct spa_interface*)object,
|
||||
port_update, 0, direction, port_id, change_mask, n_params, params, info);
|
||||
}
|
||||
static inline int pw_client_node_set_active(struct pw_client_node *object, bool active)
|
||||
SPA_API_IMPL int pw_client_node_set_active(struct pw_client_node *object, bool active)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client_node, (struct spa_interface*)object,
|
||||
set_active, 0, active);
|
||||
}
|
||||
static inline int pw_client_node_event(struct pw_client_node *object, const struct spa_event *event)
|
||||
SPA_API_IMPL int pw_client_node_event(struct pw_client_node *object, const struct spa_event *event)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP, pw_client_node, (struct spa_interface*)object,
|
||||
event, 0, event);
|
||||
}
|
||||
static inline int pw_client_node_port_buffers(struct pw_client_node *object,
|
||||
SPA_API_IMPL int pw_client_node_port_buffers(struct pw_client_node *object,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t mix_id, uint32_t n_buffers, struct spa_buffer **buffers)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ struct pw_metadata_methods {
|
|||
int (*clear) (void *object);
|
||||
};
|
||||
|
||||
static inline int pw_metadata_add_listener(struct pw_metadata *object,
|
||||
SPA_API_IMPL int pw_metadata_add_listener(struct pw_metadata *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_metadata_events *events,
|
||||
void *data)
|
||||
|
|
@ -98,7 +98,7 @@ static inline int pw_metadata_add_listener(struct pw_metadata *object,
|
|||
pw_metadata, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_metadata_set_property(struct pw_metadata *object,
|
||||
SPA_API_IMPL int pw_metadata_set_property(struct pw_metadata *object,
|
||||
uint32_t subject,
|
||||
const char *key,
|
||||
const char *type,
|
||||
|
|
@ -108,7 +108,7 @@ static inline int pw_metadata_set_property(struct pw_metadata *object,
|
|||
pw_metadata, (struct spa_interface*)object, set_property, 0,
|
||||
subject, key, type, value);
|
||||
}
|
||||
static inline int pw_metadata_clear(struct pw_metadata *object)
|
||||
SPA_API_IMPL int pw_metadata_clear(struct pw_metadata *object)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_metadata, (struct spa_interface*)object, clear, 0);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ struct pw_profiler_methods {
|
|||
void *data);
|
||||
};
|
||||
|
||||
static inline int pw_profiler_add_listener(struct pw_profiler *object,
|
||||
SPA_API_IMPL int pw_profiler_add_listener(struct pw_profiler *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_profiler_events *events,
|
||||
void *data)
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ struct pw_security_context_methods {
|
|||
const struct spa_dict *props);
|
||||
};
|
||||
|
||||
static inline int pw_security_context_add_listener(struct pw_security_context *object,
|
||||
SPA_API_IMPL int pw_security_context_add_listener(struct pw_security_context *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_security_context_events *events,
|
||||
void *data)
|
||||
|
|
@ -104,7 +104,7 @@ static inline int pw_security_context_add_listener(struct pw_security_context *o
|
|||
listener, events, data);
|
||||
}
|
||||
|
||||
static inline int pw_security_context_create(struct pw_security_context *object,
|
||||
SPA_API_IMPL int pw_security_context_create(struct pw_security_context *object,
|
||||
int listen_fd, int close_fd, const struct spa_dict *props)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ struct pw_factory_methods {
|
|||
void *data);
|
||||
};
|
||||
|
||||
static inline int pw_factory_add_listener(struct pw_factory *object,
|
||||
SPA_API_IMPL int pw_factory_add_listener(struct pw_factory *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_factory_events *events,
|
||||
void *data)
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ struct pw_link_methods {
|
|||
void *data);
|
||||
};
|
||||
|
||||
static inline int pw_link_add_listener(struct pw_link *object,
|
||||
SPA_API_IMPL int pw_link_add_listener(struct pw_link *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_link_events *events,
|
||||
void *data)
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ struct pw_map {
|
|||
* \param size the initial size of the map
|
||||
* \param extend the amount to bytes to grow the map with when needed
|
||||
*/
|
||||
static inline void pw_map_init(struct pw_map *map, size_t size, size_t extend)
|
||||
SPA_API_IMPL void pw_map_init(struct pw_map *map, size_t size, size_t extend)
|
||||
{
|
||||
pw_array_init(&map->items, extend * sizeof(union pw_map_item));
|
||||
pw_array_ensure_size(&map->items, size * sizeof(union pw_map_item));
|
||||
|
|
@ -103,7 +103,7 @@ static inline void pw_map_init(struct pw_map *map, size_t size, size_t extend)
|
|||
/** Clear a map and free the data storage. All previously returned ids
|
||||
* must be treated as invalid.
|
||||
*/
|
||||
static inline void pw_map_clear(struct pw_map *map)
|
||||
SPA_API_IMPL void pw_map_clear(struct pw_map *map)
|
||||
{
|
||||
pw_array_clear(&map->items);
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ static inline void pw_map_clear(struct pw_map *map)
|
|||
/** Reset a map but keep previously allocated storage. All previously
|
||||
* returned ids must be treated as invalid.
|
||||
*/
|
||||
static inline void pw_map_reset(struct pw_map *map)
|
||||
SPA_API_IMPL void pw_map_reset(struct pw_map *map)
|
||||
{
|
||||
pw_array_reset(&map->items);
|
||||
map->free_list = SPA_ID_INVALID;
|
||||
|
|
@ -123,7 +123,7 @@ static inline void pw_map_reset(struct pw_map *map)
|
|||
* \return the id where the item was inserted or SPA_ID_INVALID when the
|
||||
* item can not be inserted.
|
||||
*/
|
||||
static inline uint32_t pw_map_insert_new(struct pw_map *map, void *data)
|
||||
SPA_API_IMPL uint32_t pw_map_insert_new(struct pw_map *map, void *data)
|
||||
{
|
||||
union pw_map_item *start, *item;
|
||||
uint32_t id;
|
||||
|
|
@ -150,7 +150,7 @@ static inline uint32_t pw_map_insert_new(struct pw_map *map, void *data)
|
|||
* \param data the data to insert
|
||||
* \return 0 on success, -ENOSPC value when the index is invalid or a negative errno
|
||||
*/
|
||||
static inline int pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
|
||||
SPA_API_IMPL int pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
|
||||
{
|
||||
size_t size = pw_map_get_size(map);
|
||||
union pw_map_item *item;
|
||||
|
|
@ -175,7 +175,7 @@ static inline int pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
|
|||
* \param map the map to remove from
|
||||
* \param id the index to remove
|
||||
*/
|
||||
static inline void pw_map_remove(struct pw_map *map, uint32_t id)
|
||||
SPA_API_IMPL void pw_map_remove(struct pw_map *map, uint32_t id)
|
||||
{
|
||||
if (pw_map_id_is_free(map, id))
|
||||
return;
|
||||
|
|
@ -189,7 +189,7 @@ static inline void pw_map_remove(struct pw_map *map, uint32_t id)
|
|||
* \param id the index to look at
|
||||
* \return the item at \a id or NULL when no such item exists
|
||||
*/
|
||||
static inline void *pw_map_lookup(const struct pw_map *map, uint32_t id)
|
||||
SPA_API_IMPL void *pw_map_lookup(const struct pw_map *map, uint32_t id)
|
||||
{
|
||||
if (SPA_LIKELY(pw_map_check_id(map, id))) {
|
||||
union pw_map_item *item = pw_map_get_item(map, id);
|
||||
|
|
@ -207,7 +207,7 @@ static inline void *pw_map_lookup(const struct pw_map *map, uint32_t id)
|
|||
* \param data data to pass to \a func
|
||||
* \return the result of the last call to \a func or 0 when all callbacks returned 0.
|
||||
*/
|
||||
static inline int pw_map_for_each(const struct pw_map *map,
|
||||
SPA_API_IMPL int pw_map_for_each(const struct pw_map *map,
|
||||
int (*func) (void *item_data, void *data), void *data)
|
||||
{
|
||||
union pw_map_item *item;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ struct pw_memblock * pw_mempool_import(struct pw_mempool *pool,
|
|||
void pw_memblock_free(struct pw_memblock *mem);
|
||||
|
||||
/** Unref a memblock */
|
||||
static inline void pw_memblock_unref(struct pw_memblock *mem)
|
||||
SPA_API_IMPL void pw_memblock_unref(struct pw_memblock *mem)
|
||||
{
|
||||
if (--mem->ref == 0)
|
||||
pw_memblock_free(mem);
|
||||
|
|
@ -173,7 +173,7 @@ struct pw_map_range {
|
|||
|
||||
/** Calculate parameters to mmap() memory into \a range so that
|
||||
* \a size bytes at \a offset can be mapped with mmap(). */
|
||||
static inline void pw_map_range_init(struct pw_map_range *range,
|
||||
SPA_API_IMPL void pw_map_range_init(struct pw_map_range *range,
|
||||
uint32_t offset, uint32_t size,
|
||||
uint32_t page_size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ struct pw_module_methods {
|
|||
void *data);
|
||||
};
|
||||
|
||||
static inline int pw_module_add_listener(struct pw_module *object,
|
||||
SPA_API_IMPL int pw_module_add_listener(struct pw_module *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_module_events *events,
|
||||
void *data)
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ struct pw_node_methods {
|
|||
};
|
||||
|
||||
|
||||
static inline int pw_node_add_listener(struct pw_node *object,
|
||||
SPA_API_IMPL int pw_node_add_listener(struct pw_node *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_node_events *events,
|
||||
void *data)
|
||||
|
|
@ -189,13 +189,13 @@ static inline int pw_node_add_listener(struct pw_node *object,
|
|||
pw_node, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_node_subscribe_params(struct pw_node *object, uint32_t *ids, uint32_t n_ids)
|
||||
SPA_API_IMPL int pw_node_subscribe_params(struct pw_node *object, uint32_t *ids, uint32_t n_ids)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_node, (struct spa_interface*)object, subscribe_params, 0,
|
||||
ids, n_ids);
|
||||
}
|
||||
static inline int pw_node_enum_params(struct pw_node *object,
|
||||
SPA_API_IMPL int pw_node_enum_params(struct pw_node *object,
|
||||
int seq, uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter)
|
||||
{
|
||||
|
|
@ -203,14 +203,14 @@ static inline int pw_node_enum_params(struct pw_node *object,
|
|||
pw_node, (struct spa_interface*)object, enum_params, 0,
|
||||
seq, id, start, num, filter);
|
||||
}
|
||||
static inline int pw_node_set_param(struct pw_node *object, uint32_t id, uint32_t flags,
|
||||
SPA_API_IMPL int pw_node_set_param(struct pw_node *object, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_node, (struct spa_interface*)object, set_param, 0,
|
||||
id, flags, param);
|
||||
}
|
||||
static inline int pw_node_send_command(struct pw_node *object, const struct spa_command *command)
|
||||
SPA_API_IMPL int pw_node_send_command(struct pw_node *object, const struct spa_command *command)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_node, (struct spa_interface*)object, send_command, 0, command);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ struct pw_port_methods {
|
|||
const struct spa_pod *filter);
|
||||
};
|
||||
|
||||
static inline int pw_port_add_listener(struct pw_port *object,
|
||||
SPA_API_IMPL int pw_port_add_listener(struct pw_port *object,
|
||||
struct spa_hook *listener,
|
||||
const struct pw_port_events *events,
|
||||
void *data)
|
||||
|
|
@ -150,13 +150,13 @@ static inline int pw_port_add_listener(struct pw_port *object,
|
|||
pw_port, (struct spa_interface*)object, add_listener, 0,
|
||||
listener, events, data);
|
||||
}
|
||||
static inline int pw_port_subscribe_params(struct pw_port *object, uint32_t *ids, uint32_t n_ids)
|
||||
SPA_API_IMPL int pw_port_subscribe_params(struct pw_port *object, uint32_t *ids, uint32_t n_ids)
|
||||
{
|
||||
return spa_api_method_r(int, -ENOTSUP,
|
||||
pw_port, (struct spa_interface*)object, subscribe_params, 0,
|
||||
ids, n_ids);
|
||||
}
|
||||
static inline int pw_port_enum_params(struct pw_port *object,
|
||||
SPA_API_IMPL int pw_port_enum_params(struct pw_port *object,
|
||||
int seq, uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ pw_properties_fetch_int64(const struct pw_properties *properties, const char *ke
|
|||
int
|
||||
pw_properties_fetch_bool(const struct pw_properties *properties, const char *key, bool *value);
|
||||
|
||||
static inline uint32_t
|
||||
SPA_API_IMPL uint32_t
|
||||
pw_properties_get_uint32(const struct pw_properties *properties, const char *key, uint32_t deflt)
|
||||
{
|
||||
uint32_t val = deflt;
|
||||
|
|
@ -109,7 +109,7 @@ pw_properties_get_uint32(const struct pw_properties *properties, const char *key
|
|||
return val;
|
||||
}
|
||||
|
||||
static inline int32_t
|
||||
SPA_API_IMPL int32_t
|
||||
pw_properties_get_int32(const struct pw_properties *properties, const char *key, int32_t deflt)
|
||||
{
|
||||
int32_t val = deflt;
|
||||
|
|
@ -117,7 +117,7 @@ pw_properties_get_int32(const struct pw_properties *properties, const char *key,
|
|||
return val;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
SPA_API_IMPL uint64_t
|
||||
pw_properties_get_uint64(const struct pw_properties *properties, const char *key, uint64_t deflt)
|
||||
{
|
||||
uint64_t val = deflt;
|
||||
|
|
@ -125,7 +125,7 @@ pw_properties_get_uint64(const struct pw_properties *properties, const char *key
|
|||
return val;
|
||||
}
|
||||
|
||||
static inline int64_t
|
||||
SPA_API_IMPL int64_t
|
||||
pw_properties_get_int64(const struct pw_properties *properties, const char *key, int64_t deflt)
|
||||
{
|
||||
int64_t val = deflt;
|
||||
|
|
@ -134,7 +134,7 @@ pw_properties_get_int64(const struct pw_properties *properties, const char *key,
|
|||
}
|
||||
|
||||
|
||||
static inline bool
|
||||
SPA_API_IMPL bool
|
||||
pw_properties_get_bool(const struct pw_properties *properties, const char *key, bool deflt)
|
||||
{
|
||||
bool val = deflt;
|
||||
|
|
@ -152,31 +152,31 @@ pw_properties_iterate(const struct pw_properties *properties, void **state);
|
|||
#define PW_PROPERTIES_FLAG_COLORS (1<<4)
|
||||
int pw_properties_serialize_dict(FILE *f, const struct spa_dict *dict, uint32_t flags);
|
||||
|
||||
static inline bool pw_properties_parse_bool(const char *value) {
|
||||
SPA_API_IMPL bool pw_properties_parse_bool(const char *value) {
|
||||
return spa_atob(value);
|
||||
}
|
||||
|
||||
static inline int pw_properties_parse_int(const char *value) {
|
||||
SPA_API_IMPL int pw_properties_parse_int(const char *value) {
|
||||
int v;
|
||||
return spa_atoi32(value, &v, 0) ? v: 0;
|
||||
}
|
||||
|
||||
static inline int64_t pw_properties_parse_int64(const char *value) {
|
||||
SPA_API_IMPL int64_t pw_properties_parse_int64(const char *value) {
|
||||
int64_t v;
|
||||
return spa_atoi64(value, &v, 0) ? v : 0;
|
||||
}
|
||||
|
||||
static inline uint64_t pw_properties_parse_uint64(const char *value) {
|
||||
SPA_API_IMPL uint64_t pw_properties_parse_uint64(const char *value) {
|
||||
uint64_t v;
|
||||
return spa_atou64(value, &v, 0) ? v : 0;
|
||||
}
|
||||
|
||||
static inline float pw_properties_parse_float(const char *value) {
|
||||
SPA_API_IMPL float pw_properties_parse_float(const char *value) {
|
||||
float v;
|
||||
return spa_atof(value, &v) ? v : 0.0f;
|
||||
}
|
||||
|
||||
static inline double pw_properties_parse_double(const char *value) {
|
||||
SPA_API_IMPL double pw_properties_parse_double(const char *value) {
|
||||
double v;
|
||||
return spa_atod(value, &v) ? v : 0.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue