diff --git a/spa/include/spa/buffer/alloc.h b/spa/include/spa/buffer/alloc.h index 8b9e55e50..4800027d8 100644 --- a/spa/include/spa/buffer/alloc.h +++ b/spa/include/spa/buffer/alloc.h @@ -58,7 +58,7 @@ struct spa_buffer_alloc_info { * \param data_aligns \a n_datas alignments * \return 0 on success. * */ -static inline int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info, +SPA_API_IMPL int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info, uint32_t n_metas, struct spa_meta metas[], uint32_t n_datas, struct spa_data datas[], uint32_t data_aligns[]) @@ -179,7 +179,7 @@ static inline int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info, * \param data_mem memory to hold the meta, chunk and memory * \return a struct \ref spa_buffer in \a skel_mem */ -static inline struct spa_buffer * +SPA_API_IMPL struct spa_buffer * spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info, void *skel_mem, void *data_mem) { @@ -257,7 +257,7 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info, * \return 0 on success. * */ -static inline int +SPA_API_IMPL int spa_buffer_alloc_layout_array(struct spa_buffer_alloc_info *info, uint32_t n_buffers, struct spa_buffer *buffers[], void *skel_mem, void *data_mem) @@ -292,7 +292,7 @@ spa_buffer_alloc_layout_array(struct spa_buffer_alloc_info *info, * allocation failed. * */ -static inline struct spa_buffer ** +SPA_API_IMPL struct spa_buffer ** spa_buffer_alloc_array(uint32_t n_buffers, uint32_t flags, uint32_t n_metas, struct spa_meta metas[], uint32_t n_datas, struct spa_data datas[], diff --git a/spa/include/spa/buffer/buffer.h b/spa/include/spa/buffer/buffer.h index 7b3b7c00a..4f5119934 100644 --- a/spa/include/spa/buffer/buffer.h +++ b/spa/include/spa/buffer/buffer.h @@ -91,7 +91,7 @@ struct spa_buffer { }; /** Find metadata in a buffer */ -static inline struct spa_meta *spa_buffer_find_meta(const struct spa_buffer *b, uint32_t type) +SPA_API_IMPL struct spa_meta *spa_buffer_find_meta(const struct spa_buffer *b, uint32_t type) { uint32_t i; @@ -102,7 +102,7 @@ static inline struct spa_meta *spa_buffer_find_meta(const struct spa_buffer *b, return NULL; } -static inline void *spa_buffer_find_meta_data(const struct spa_buffer *b, uint32_t type, size_t size) +SPA_API_IMPL void *spa_buffer_find_meta_data(const struct spa_buffer *b, uint32_t type, size_t size) { struct spa_meta *m; if ((m = spa_buffer_find_meta(b, type)) && m->size >= size) diff --git a/spa/include/spa/buffer/meta.h b/spa/include/spa/buffer/meta.h index 2f77d8dd5..0fb9660fb 100644 --- a/spa/include/spa/buffer/meta.h +++ b/spa/include/spa/buffer/meta.h @@ -46,11 +46,11 @@ struct spa_meta { void *data; /**< pointer to metadata */ }; -static inline void *spa_meta_first(const struct spa_meta *m) { +SPA_API_IMPL void *spa_meta_first(const struct spa_meta *m) { return m->data; } #define spa_meta_first spa_meta_first -static inline void *spa_meta_end(const struct spa_meta *m) { +SPA_API_IMPL void *spa_meta_end(const struct spa_meta *m) { return SPA_PTROFF(m->data,m->size,void); } #define spa_meta_end spa_meta_end @@ -80,7 +80,7 @@ struct spa_meta_region { struct spa_region region; }; -static inline bool spa_meta_region_is_valid(const struct spa_meta_region *m) { +SPA_API_IMPL bool spa_meta_region_is_valid(const struct spa_meta_region *m) { return m->region.size.width != 0 && m->region.size.height != 0; } #define spa_meta_region_is_valid spa_meta_region_is_valid diff --git a/spa/include/spa/control/ump-utils.h b/spa/include/spa/control/ump-utils.h index b46cdd663..1ac389138 100644 --- a/spa/include/spa/control/ump-utils.h +++ b/spa/include/spa/control/ump-utils.h @@ -18,7 +18,7 @@ extern "C" { * \{ */ -static inline size_t spa_ump_message_size(uint8_t message_type) +SPA_API_IMPL size_t spa_ump_message_size(uint8_t message_type) { static const uint32_t ump_sizes[] = { [0x0] = 1, /* Utility messages */ @@ -41,7 +41,7 @@ static inline size_t spa_ump_message_size(uint8_t message_type) return ump_sizes[message_type & 0xf]; } -static inline int spa_ump_to_midi(uint32_t *ump, size_t ump_size, +SPA_API_IMPL int spa_ump_to_midi(uint32_t *ump, size_t ump_size, uint8_t *midi, size_t midi_maxsize) { int size = 0; @@ -102,7 +102,7 @@ static inline int spa_ump_to_midi(uint32_t *ump, size_t ump_size, return size; } -static inline int spa_ump_from_midi(uint8_t **midi, size_t *midi_size, +SPA_API_IMPL int spa_ump_from_midi(uint8_t **midi, size_t *midi_size, uint32_t *ump, size_t ump_maxsize, uint8_t group, uint64_t *state) { int size = 0; diff --git a/spa/include/spa/debug/buffer.h b/spa/include/spa/debug/buffer.h index 8efa411c3..5f26561c5 100644 --- a/spa/include/spa/debug/buffer.h +++ b/spa/include/spa/debug/buffer.h @@ -23,7 +23,7 @@ extern "C" { #include #include -static inline int spa_debugc_buffer(struct spa_debug_context *ctx, int indent, const struct spa_buffer *buffer) +SPA_API_IMPL int spa_debugc_buffer(struct spa_debug_context *ctx, int indent, const struct spa_buffer *buffer) { uint32_t i; @@ -98,7 +98,7 @@ static inline int spa_debugc_buffer(struct spa_debug_context *ctx, int indent, c return 0; } -static inline int spa_debug_buffer(int indent, const struct spa_buffer *buffer) +SPA_API_IMPL int spa_debug_buffer(int indent, const struct spa_buffer *buffer) { return spa_debugc_buffer(NULL, indent, buffer); } diff --git a/spa/include/spa/debug/context.h b/spa/include/spa/debug/context.h index bd0186b0f..16b5b2b27 100644 --- a/spa/include/spa/debug/context.h +++ b/spa/include/spa/debug/context.h @@ -32,7 +32,7 @@ struct spa_debug_context { #define spa_debugc(_c,_fmt,...) (_c)?((_c)->log((_c),_fmt, ## __VA_ARGS__)):(void)spa_debug(_fmt, ## __VA_ARGS__) -static inline void spa_debugc_error_location(struct spa_debug_context *c, +SPA_API_IMPL void spa_debugc_error_location(struct spa_debug_context *c, struct spa_error_location *loc) { int i, skip = loc->col > 80 ? loc->col - 40 : 0, lc = loc->col-skip-1; diff --git a/spa/include/spa/debug/dict.h b/spa/include/spa/debug/dict.h index 2eb3672ae..811e6cec6 100644 --- a/spa/include/spa/debug/dict.h +++ b/spa/include/spa/debug/dict.h @@ -17,7 +17,7 @@ extern "C" { #include #include -static inline int spa_debugc_dict(struct spa_debug_context *ctx, int indent, const struct spa_dict *dict) +SPA_API_IMPL int spa_debugc_dict(struct spa_debug_context *ctx, int indent, const struct spa_dict *dict) { const struct spa_dict_item *item; spa_debugc(ctx, "%*sflags:%08x n_items:%d", indent, "", dict->flags, dict->n_items); @@ -27,7 +27,7 @@ static inline int spa_debugc_dict(struct spa_debug_context *ctx, int indent, con return 0; } -static inline int spa_debug_dict(int indent, const struct spa_dict *dict) +SPA_API_IMPL int spa_debug_dict(int indent, const struct spa_dict *dict) { return spa_debugc_dict(NULL, indent, dict); } diff --git a/spa/include/spa/debug/file.h b/spa/include/spa/debug/file.h index 115264f92..9fc5e912c 100644 --- a/spa/include/spa/debug/file.h +++ b/spa/include/spa/debug/file.h @@ -32,7 +32,7 @@ struct spa_debug_file_ctx { }; SPA_PRINTF_FUNC(2,3) -static inline void spa_debug_file_log(struct spa_debug_context *ctx, const char *fmt, ...) +SPA_API_IMPL void spa_debug_file_log(struct spa_debug_context *ctx, const char *fmt, ...) { struct spa_debug_file_ctx *c = SPA_CONTAINER_OF(ctx, struct spa_debug_file_ctx, ctx); va_list args; diff --git a/spa/include/spa/debug/format.h b/spa/include/spa/debug/format.h index c92b43e7c..8b2792c6c 100644 --- a/spa/include/spa/debug/format.h +++ b/spa/include/spa/debug/format.h @@ -21,7 +21,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_debug_strbuf_format_value(struct spa_strbuf *buffer, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { @@ -96,7 +96,7 @@ spa_debug_strbuf_format_value(struct spa_strbuf *buffer, const struct spa_type_i return 0; } -static inline int +SPA_API_IMPL int spa_debug_format_value(const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { @@ -108,7 +108,7 @@ spa_debug_format_value(const struct spa_type_info *info, return 0; } -static inline int spa_debugc_format(struct spa_debug_context *ctx, int indent, +SPA_API_IMPL int spa_debugc_format(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, const struct spa_pod *format) { const char *media_type; @@ -198,7 +198,7 @@ static inline int spa_debugc_format(struct spa_debug_context *ctx, int indent, return 0; } -static inline int spa_debug_format(int indent, +SPA_API_IMPL int spa_debug_format(int indent, const struct spa_type_info *info, const struct spa_pod *format) { return spa_debugc_format(NULL, indent, info, format); diff --git a/spa/include/spa/debug/log.h b/spa/include/spa/debug/log.h index 89eaee102..34702fbc2 100644 --- a/spa/include/spa/debug/log.h +++ b/spa/include/spa/debug/log.h @@ -36,7 +36,7 @@ struct spa_debug_log_ctx { }; SPA_PRINTF_FUNC(2,3) -static inline void spa_debug_log_log(struct spa_debug_context *ctx, const char *fmt, ...) +SPA_API_IMPL void spa_debug_log_log(struct spa_debug_context *ctx, const char *fmt, ...) { struct spa_debug_log_ctx *c = SPA_CONTAINER_OF(ctx, struct spa_debug_log_ctx, ctx); va_list args; diff --git a/spa/include/spa/debug/mem.h b/spa/include/spa/debug/mem.h index 462a5f93b..709c66378 100644 --- a/spa/include/spa/debug/mem.h +++ b/spa/include/spa/debug/mem.h @@ -18,7 +18,7 @@ extern "C" { #include -static inline int spa_debugc_mem(struct spa_debug_context *ctx, int indent, const void *data, size_t size) +SPA_API_IMPL int spa_debugc_mem(struct spa_debug_context *ctx, int indent, const void *data, size_t size) { const uint8_t *t = (const uint8_t*)data; char buffer[512]; @@ -36,7 +36,7 @@ static inline int spa_debugc_mem(struct spa_debug_context *ctx, int indent, cons return 0; } -static inline int spa_debug_mem(int indent, const void *data, size_t size) +SPA_API_IMPL int spa_debug_mem(int indent, const void *data, size_t size) { return spa_debugc_mem(NULL, indent, data, size); } diff --git a/spa/include/spa/debug/node.h b/spa/include/spa/debug/node.h index 592d63465..833b56124 100644 --- a/spa/include/spa/debug/node.h +++ b/spa/include/spa/debug/node.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int spa_debugc_port_info(struct spa_debug_context *ctx, int indent, const struct spa_port_info *info) +SPA_API_IMPL int spa_debugc_port_info(struct spa_debug_context *ctx, int indent, const struct spa_port_info *info) { spa_debugc(ctx, "%*s" "struct spa_port_info %p:", indent, "", info); spa_debugc(ctx, "%*s" " flags: \t%08" PRIx64, indent, "", info->flags); @@ -31,7 +31,7 @@ static inline int spa_debugc_port_info(struct spa_debug_context *ctx, int indent return 0; } -static inline int spa_debug_port_info(int indent, const struct spa_port_info *info) +SPA_API_IMPL int spa_debug_port_info(int indent, const struct spa_port_info *info) { return spa_debugc_port_info(NULL, indent, info); } diff --git a/spa/include/spa/debug/pod.h b/spa/include/spa/debug/pod.h index a31b78e34..0fbe130f5 100644 --- a/spa/include/spa/debug/pod.h +++ b/spa/include/spa/debug/pod.h @@ -20,7 +20,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_debugc_pod_value(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { @@ -174,7 +174,7 @@ spa_debugc_pod_value(struct spa_debug_context *ctx, int indent, const struct spa return 0; } -static inline int spa_debugc_pod(struct spa_debug_context *ctx, int indent, +SPA_API_IMPL int spa_debugc_pod(struct spa_debug_context *ctx, int indent, const struct spa_type_info *info, const struct spa_pod *pod) { return spa_debugc_pod_value(ctx, indent, info ? info : SPA_TYPE_ROOT, @@ -183,14 +183,14 @@ static inline int spa_debugc_pod(struct spa_debug_context *ctx, int indent, SPA_POD_BODY_SIZE(pod)); } -static inline int +SPA_API_IMPL int spa_debug_pod_value(int indent, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { return spa_debugc_pod_value(NULL, indent, info, type, body, size); } -static inline int spa_debug_pod(int indent, +SPA_API_IMPL int spa_debug_pod(int indent, const struct spa_type_info *info, const struct spa_pod *pod) { return spa_debugc_pod(NULL, indent, info, pod); diff --git a/spa/include/spa/debug/types.h b/spa/include/spa/debug/types.h index 1c9ff51a2..797da6379 100644 --- a/spa/include/spa/debug/types.h +++ b/spa/include/spa/debug/types.h @@ -18,7 +18,7 @@ extern "C" { #include -static inline const struct spa_type_info *spa_debug_type_find(const struct spa_type_info *info, uint32_t type) +SPA_API_IMPL const struct spa_type_info *spa_debug_type_find(const struct spa_type_info *info, uint32_t type) { const struct spa_type_info *res; @@ -37,19 +37,19 @@ static inline const struct spa_type_info *spa_debug_type_find(const struct spa_t return NULL; } -static inline const char *spa_debug_type_short_name(const char *name) +SPA_API_IMPL const char *spa_debug_type_short_name(const char *name) { return spa_type_short_name(name); } -static inline const char *spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type) +SPA_API_IMPL const char *spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type) { if ((info = spa_debug_type_find(info, type)) == NULL) return NULL; return info->name; } -static inline const char *spa_debug_type_find_short_name(const struct spa_type_info *info, uint32_t type) +SPA_API_IMPL const char *spa_debug_type_find_short_name(const struct spa_type_info *info, uint32_t type) { const char *str; if ((str = spa_debug_type_find_name(info, type)) == NULL) @@ -57,7 +57,7 @@ static inline const char *spa_debug_type_find_short_name(const struct spa_type_i return spa_debug_type_short_name(str); } -static inline uint32_t spa_debug_type_find_type(const struct spa_type_info *info, const char *name) +SPA_API_IMPL uint32_t spa_debug_type_find_type(const struct spa_type_info *info, const char *name) { if (info == NULL) info = SPA_TYPE_ROOT; @@ -73,7 +73,7 @@ static inline uint32_t spa_debug_type_find_type(const struct spa_type_info *info return SPA_ID_INVALID; } -static inline const struct spa_type_info *spa_debug_type_find_short(const struct spa_type_info *info, const char *name) +SPA_API_IMPL const struct spa_type_info *spa_debug_type_find_short(const struct spa_type_info *info, const char *name) { while (info && info->name) { if (strcmp(spa_debug_type_short_name(info->name), name) == 0) @@ -87,7 +87,7 @@ static inline const struct spa_type_info *spa_debug_type_find_short(const struct return NULL; } -static inline uint32_t spa_debug_type_find_type_short(const struct spa_type_info *info, const char *name) +SPA_API_IMPL uint32_t spa_debug_type_find_type_short(const struct spa_type_info *info, const char *name) { if ((info = spa_debug_type_find_short(info, name)) == NULL) return SPA_ID_INVALID; diff --git a/spa/include/spa/filter-graph/filter-graph.h b/spa/include/spa/filter-graph/filter-graph.h index 4047993f1..f90778247 100644 --- a/spa/include/spa/filter-graph/filter-graph.h +++ b/spa/include/spa/filter-graph/filter-graph.h @@ -83,7 +83,7 @@ struct spa_filter_graph_methods { struct spa_filter_graph_chunk out[], uint32_t n_out); }; -static inline int spa_filter_graph_add_listener(struct spa_filter_graph *object, +SPA_API_IMPL int spa_filter_graph_add_listener(struct spa_filter_graph *object, struct spa_hook *listener, const struct spa_filter_graph_events *events, void *data) { @@ -92,44 +92,44 @@ static inline int spa_filter_graph_add_listener(struct spa_filter_graph *object, events, data); } -static inline int spa_filter_graph_enum_prop_info(struct spa_filter_graph *object, +SPA_API_IMPL int spa_filter_graph_enum_prop_info(struct spa_filter_graph *object, uint32_t idx, struct spa_pod_builder *b) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, enum_prop_info, 0, idx, b); } -static inline int spa_filter_graph_get_props(struct spa_filter_graph *object, +SPA_API_IMPL int spa_filter_graph_get_props(struct spa_filter_graph *object, struct spa_pod_builder *b, const struct spa_pod **props) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, get_props, 0, b, props); } -static inline int spa_filter_graph_set_props(struct spa_filter_graph *object, +SPA_API_IMPL int spa_filter_graph_set_props(struct spa_filter_graph *object, enum spa_direction direction, const struct spa_pod *props) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, set_props, 0, direction, props); } -static inline int spa_filter_graph_activate(struct spa_filter_graph *object, const struct spa_fraction *rate) +SPA_API_IMPL int spa_filter_graph_activate(struct spa_filter_graph *object, const struct spa_fraction *rate) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, activate, 0, rate); } -static inline int spa_filter_graph_deactivate(struct spa_filter_graph *object) +SPA_API_IMPL int spa_filter_graph_deactivate(struct spa_filter_graph *object) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, deactivate, 0); } -static inline int spa_filter_graph_reset(struct spa_filter_graph *object) +SPA_API_IMPL int spa_filter_graph_reset(struct spa_filter_graph *object) { return spa_api_method_r(int, -ENOTSUP, spa_filter_graph, &object->iface, reset, 0); } -static inline int spa_filter_graph_process(struct spa_filter_graph *object, +SPA_API_IMPL int spa_filter_graph_process(struct spa_filter_graph *object, const struct spa_filter_graph_chunk in[], uint32_t n_in, struct spa_filter_graph_chunk out[], uint32_t n_out) { diff --git a/spa/include/spa/graph/graph.h b/spa/include/spa/graph/graph.h index 117f6eef3..b9c35fd4c 100644 --- a/spa/include/spa/graph/graph.h +++ b/spa/include/spa/graph/graph.h @@ -40,7 +40,7 @@ struct spa_graph_state { int32_t pending; /**< number of pending signals */ }; -static inline void spa_graph_state_reset(struct spa_graph_state *state) +SPA_API_IMPL void spa_graph_state_reset(struct spa_graph_state *state) { state->pending = state->required; } @@ -56,7 +56,7 @@ struct spa_graph_link { #define spa_graph_state_dec(s) (SPA_ATOMIC_DEC(s->pending) == 0) -static inline int spa_graph_link_trigger(struct spa_graph_link *link) +SPA_API_IMPL int spa_graph_link_trigger(struct spa_graph_link *link) { struct spa_graph_state *state = link->state; @@ -118,7 +118,7 @@ struct spa_graph_port { struct spa_graph_port *peer; /**< peer */ }; -static inline int spa_graph_node_trigger(struct spa_graph_node *node) +SPA_API_IMPL int spa_graph_node_trigger(struct spa_graph_node *node) { struct spa_graph_link *l; spa_debug("node %p trigger", node); @@ -127,7 +127,7 @@ static inline int spa_graph_node_trigger(struct spa_graph_node *node) return 0; } -static inline int spa_graph_run(struct spa_graph *graph) +SPA_API_IMPL int spa_graph_run(struct spa_graph *graph) { struct spa_graph_node *n, *t; struct spa_list pending; @@ -152,27 +152,27 @@ static inline int spa_graph_run(struct spa_graph *graph) return 0; } -static inline int spa_graph_finish(struct spa_graph *graph) +SPA_API_IMPL int spa_graph_finish(struct spa_graph *graph) { spa_debug("graph %p finish", graph); if (graph->parent) return spa_graph_node_trigger(graph->parent); return 0; } -static inline int spa_graph_link_signal_node(void *data) +SPA_API_IMPL int spa_graph_link_signal_node(void *data) { struct spa_graph_node *node = (struct spa_graph_node *)data; spa_debug("node %p call process", node); return spa_graph_node_process(node); } -static inline int spa_graph_link_signal_graph(void *data) +SPA_API_IMPL int spa_graph_link_signal_graph(void *data) { struct spa_graph_node *node = (struct spa_graph_node *)data; return spa_graph_finish(node->graph); } -static inline void spa_graph_init(struct spa_graph *graph, struct spa_graph_state *state) +SPA_API_IMPL void spa_graph_init(struct spa_graph *graph, struct spa_graph_state *state) { spa_list_init(&graph->nodes); graph->flags = 0; @@ -180,7 +180,7 @@ static inline void spa_graph_init(struct spa_graph *graph, struct spa_graph_stat spa_debug("graph %p init state %p", graph, state); } -static inline void +SPA_API_IMPL void spa_graph_link_add(struct spa_graph_node *out, struct spa_graph_state *state, struct spa_graph_link *link) @@ -191,14 +191,14 @@ spa_graph_link_add(struct spa_graph_node *out, spa_list_append(&out->links, &link->link); } -static inline void spa_graph_link_remove(struct spa_graph_link *link) +SPA_API_IMPL void spa_graph_link_remove(struct spa_graph_link *link) { link->state->required--; spa_debug("link %p state %p remove %d", link, link->state, link->state->required); spa_list_remove(&link->link); } -static inline void +SPA_API_IMPL void spa_graph_node_init(struct spa_graph_node *node, struct spa_graph_state *state) { spa_list_init(&node->ports[SPA_DIRECTION_INPUT]); @@ -215,7 +215,7 @@ spa_graph_node_init(struct spa_graph_node *node, struct spa_graph_state *state) } -static inline int spa_graph_node_impl_sub_process(void *data SPA_UNUSED, struct spa_graph_node *node) +SPA_API_IMPL int spa_graph_node_impl_sub_process(void *data SPA_UNUSED, struct spa_graph_node *node) { struct spa_graph *graph = node->subgraph; spa_debug("node %p: sub process %p", node, graph); @@ -227,7 +227,7 @@ static const struct spa_graph_node_callbacks spa_graph_node_sub_impl_default = { .process = spa_graph_node_impl_sub_process, }; -static inline void spa_graph_node_set_subgraph(struct spa_graph_node *node, +SPA_API_IMPL void spa_graph_node_set_subgraph(struct spa_graph_node *node, struct spa_graph *subgraph) { node->subgraph = subgraph; @@ -235,7 +235,7 @@ static inline void spa_graph_node_set_subgraph(struct spa_graph_node *node, spa_debug("node %p set subgraph %p", node, subgraph); } -static inline void +SPA_API_IMPL void spa_graph_node_set_callbacks(struct spa_graph_node *node, const struct spa_graph_node_callbacks *callbacks, void *data) @@ -243,7 +243,7 @@ spa_graph_node_set_callbacks(struct spa_graph_node *node, node->callbacks = SPA_CALLBACKS_INIT(callbacks, data); } -static inline void +SPA_API_IMPL void spa_graph_node_add(struct spa_graph *graph, struct spa_graph_node *node) { @@ -255,7 +255,7 @@ spa_graph_node_add(struct spa_graph *graph, spa_graph_link_add(node, graph->state, &node->graph_link); } -static inline void spa_graph_node_remove(struct spa_graph_node *node) +SPA_API_IMPL void spa_graph_node_remove(struct spa_graph_node *node) { spa_debug("node %p remove from graph %p, state %p required %d", node, node->graph, node->state, node->state->required); @@ -265,7 +265,7 @@ static inline void spa_graph_node_remove(struct spa_graph_node *node) } -static inline void +SPA_API_IMPL void spa_graph_port_init(struct spa_graph_port *port, enum spa_direction direction, uint32_t port_id, @@ -277,7 +277,7 @@ spa_graph_port_init(struct spa_graph_port *port, port->flags = flags; } -static inline void +SPA_API_IMPL void spa_graph_port_add(struct spa_graph_node *node, struct spa_graph_port *port) { @@ -286,13 +286,13 @@ spa_graph_port_add(struct spa_graph_node *node, spa_list_append(&node->ports[port->direction], &port->link); } -static inline void spa_graph_port_remove(struct spa_graph_port *port) +SPA_API_IMPL void spa_graph_port_remove(struct spa_graph_port *port) { spa_debug("port %p remove", port); spa_list_remove(&port->link); } -static inline void +SPA_API_IMPL void spa_graph_port_link(struct spa_graph_port *out, struct spa_graph_port *in) { spa_debug("port %p link to %p %p %p", out, in, in->node, in->node->state); @@ -300,7 +300,7 @@ spa_graph_port_link(struct spa_graph_port *out, struct spa_graph_port *in) in->peer = out; } -static inline void +SPA_API_IMPL void spa_graph_port_unlink(struct spa_graph_port *port) { spa_debug("port %p unlink from %p", port, port->peer); @@ -310,7 +310,7 @@ spa_graph_port_unlink(struct spa_graph_port *port) } } -static inline int spa_graph_node_impl_process(void *data, struct spa_graph_node *node) +SPA_API_IMPL int spa_graph_node_impl_process(void *data, struct spa_graph_node *node) { struct spa_node *n = (struct spa_node *)data; struct spa_graph_state *state = node->state; @@ -322,7 +322,7 @@ static inline int spa_graph_node_impl_process(void *data, struct spa_graph_node return state->status; } -static inline int spa_graph_node_impl_reuse_buffer(void *data, struct spa_graph_node *node SPA_UNUSED, +SPA_API_IMPL int spa_graph_node_impl_reuse_buffer(void *data, struct spa_graph_node *node SPA_UNUSED, uint32_t port_id, uint32_t buffer_id) { struct spa_node *n = (struct spa_node *)data; diff --git a/spa/include/spa/interfaces/audio/aec.h b/spa/include/spa/interfaces/audio/aec.h index d1f571d6c..1828efdc5 100644 --- a/spa/include/spa/interfaces/audio/aec.h +++ b/spa/include/spa/interfaces/audio/aec.h @@ -68,7 +68,7 @@ struct spa_audio_aec_methods { struct spa_audio_info_raw *out_info); }; -static inline int spa_audio_aec_add_listener(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_add_listener(struct spa_audio_aec *object, struct spa_hook *listener, const struct spa_audio_aec_events *events, void *data) @@ -77,52 +77,52 @@ static inline int spa_audio_aec_add_listener(struct spa_audio_aec *object, spa_audio_aec, &object->iface, add_listener, 0, listener, events, data); } -static inline int spa_audio_aec_init(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_init(struct spa_audio_aec *object, const struct spa_dict *args, const struct spa_audio_info_raw *info) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, init, 0, args, info); } -static inline int spa_audio_aec_run(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_run(struct spa_audio_aec *object, const float *rec[], const float *play[], float *out[], uint32_t n_samples) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, run, 0, rec, play, out, n_samples); } -static inline int spa_audio_aec_set_props(struct spa_audio_aec *object, const struct spa_dict *args) +SPA_API_IMPL int spa_audio_aec_set_props(struct spa_audio_aec *object, const struct spa_dict *args) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, set_props, 0, args); } -static inline int spa_audio_aec_activate(struct spa_audio_aec *object) +SPA_API_IMPL int spa_audio_aec_activate(struct spa_audio_aec *object) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, activate, 1); } -static inline int spa_audio_aec_deactivate(struct spa_audio_aec *object) +SPA_API_IMPL int spa_audio_aec_deactivate(struct spa_audio_aec *object) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, deactivate, 1); } -static inline int spa_audio_aec_enum_props(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_enum_props(struct spa_audio_aec *object, int index, struct spa_pod_builder* builder) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, enum_props, 2, index, builder); } -static inline int spa_audio_aec_get_params(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_get_params(struct spa_audio_aec *object, struct spa_pod_builder* builder) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, get_params, 2, builder); } -static inline int spa_audio_aec_set_params(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_set_params(struct spa_audio_aec *object, const struct spa_pod *args) { return spa_api_method_r(int, -ENOTSUP, spa_audio_aec, &object->iface, set_params, 2, args); } -static inline int spa_audio_aec_init2(struct spa_audio_aec *object, +SPA_API_IMPL int spa_audio_aec_init2(struct spa_audio_aec *object, const struct spa_dict *args, struct spa_audio_info_raw *play_info, struct spa_audio_info_raw *rec_info, diff --git a/spa/include/spa/monitor/device.h b/spa/include/spa/monitor/device.h index b16a6c5fe..5dbd613d1 100644 --- a/spa/include/spa/monitor/device.h +++ b/spa/include/spa/monitor/device.h @@ -220,7 +220,7 @@ struct spa_device_methods { const struct spa_pod *param); }; -static inline int spa_device_add_listener(struct spa_device *object, +SPA_API_IMPL int spa_device_add_listener(struct spa_device *object, struct spa_hook *listener, const struct spa_device_events *events, void *data) @@ -229,19 +229,19 @@ static inline int spa_device_add_listener(struct spa_device *object, listener, events, data); } -static inline int spa_device_sync(struct spa_device *object, int seq) +SPA_API_IMPL int spa_device_sync(struct spa_device *object, int seq) { return spa_api_method_r(int, -ENOTSUP, spa_device, &object->iface, sync, 0, seq); } -static inline int spa_device_enum_params(struct spa_device *object, int seq, +SPA_API_IMPL int spa_device_enum_params(struct spa_device *object, int seq, uint32_t id, uint32_t index, uint32_t max, const struct spa_pod *filter) { return spa_api_method_r(int, -ENOTSUP, spa_device, &object->iface, enum_params, 0, seq, id, index, max, filter); } -static inline int spa_device_set_param(struct spa_device *object, +SPA_API_IMPL int spa_device_set_param(struct spa_device *object, uint32_t id, uint32_t flags, const struct spa_pod *param) { diff --git a/spa/include/spa/monitor/utils.h b/spa/include/spa/monitor/utils.h index 93f8f41b0..d2ee2f2ca 100644 --- a/spa/include/spa/monitor/utils.h +++ b/spa/include/spa/monitor/utils.h @@ -22,7 +22,7 @@ struct spa_result_device_params_data { struct spa_result_device_params data; }; -static inline void spa_result_func_device_params(void *data, int seq SPA_UNUSED, int res SPA_UNUSED, +SPA_API_IMPL void spa_result_func_device_params(void *data, int seq SPA_UNUSED, int res SPA_UNUSED, uint32_t type SPA_UNUSED, const void *result) { struct spa_result_device_params_data *d = @@ -36,7 +36,7 @@ static inline void spa_result_func_device_params(void *data, int seq SPA_UNUSED, d->data.param = spa_pod_builder_deref(d->builder, offset); } -static inline int spa_device_enum_params_sync(struct spa_device *device, +SPA_API_IMPL int spa_device_enum_params_sync(struct spa_device *device, uint32_t id, uint32_t *index, const struct spa_pod *filter, struct spa_pod **param, diff --git a/spa/include/spa/node/node.h b/spa/include/spa/node/node.h index d75ea2c33..c404b186f 100644 --- a/spa/include/spa/node/node.h +++ b/spa/include/spa/node/node.h @@ -634,7 +634,7 @@ struct spa_node_methods { }; -static inline int spa_node_add_listener(struct spa_node *object, +SPA_API_IMPL int spa_node_add_listener(struct spa_node *object, struct spa_hook *listener, const struct spa_node_events *events, void *data) @@ -642,58 +642,58 @@ static inline int spa_node_add_listener(struct spa_node *object, return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, add_listener, 0, listener, events, data); } -static inline int spa_node_set_callbacks(struct spa_node *object, +SPA_API_IMPL int spa_node_set_callbacks(struct spa_node *object, const struct spa_node_callbacks *callbacks, void *data) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, set_callbacks, 0, callbacks, data); } -static inline int spa_node_sync(struct spa_node *object, int seq) +SPA_API_IMPL int spa_node_sync(struct spa_node *object, int seq) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, sync, 0, seq); } -static inline int spa_node_enum_params(struct spa_node *object, int seq, +SPA_API_IMPL int spa_node_enum_params(struct spa_node *object, int seq, uint32_t id, uint32_t start, uint32_t max, const struct spa_pod *filter) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, enum_params, 0, seq, id, start, max, filter); } -static inline int spa_node_set_param(struct spa_node *object, +SPA_API_IMPL int spa_node_set_param(struct spa_node *object, uint32_t id, uint32_t flags, const struct spa_pod *param) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, set_param, 0, id, flags, param); } -static inline int spa_node_set_io(struct spa_node *object, +SPA_API_IMPL int spa_node_set_io(struct spa_node *object, uint32_t id, void *data, size_t size) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, set_io, 0, id, data, size); } -static inline int spa_node_send_command(struct spa_node *object, +SPA_API_IMPL int spa_node_send_command(struct spa_node *object, const struct spa_command *command) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, send_command, 0, command); } -static inline int spa_node_add_port(struct spa_node *object, +SPA_API_IMPL int spa_node_add_port(struct spa_node *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, add_port, 0, direction, port_id, props); } -static inline int spa_node_remove_port(struct spa_node *object, +SPA_API_IMPL int spa_node_remove_port(struct spa_node *object, enum spa_direction direction, uint32_t port_id) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, remove_port, 0, direction, port_id); } -static inline int spa_node_port_enum_params(struct spa_node *object, int seq, +SPA_API_IMPL int spa_node_port_enum_params(struct spa_node *object, int seq, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t start, uint32_t max, const struct spa_pod *filter) @@ -701,7 +701,7 @@ static inline int spa_node_port_enum_params(struct spa_node *object, int seq, return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, port_enum_params, 0, seq, direction, port_id, id, start, max, filter); } -static inline int spa_node_port_set_param(struct spa_node *object, +SPA_API_IMPL int spa_node_port_set_param(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t flags, @@ -710,7 +710,7 @@ static inline int spa_node_port_set_param(struct spa_node *object, return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, port_set_param, 0, direction, port_id, id, flags, param); } -static inline int spa_node_port_use_buffers(struct spa_node *object, +SPA_API_IMPL int spa_node_port_use_buffers(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t flags, @@ -720,7 +720,7 @@ static inline int spa_node_port_use_buffers(struct spa_node *object, return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, port_use_buffers, 0, direction, port_id, flags, buffers, n_buffers); } -static inline int spa_node_port_set_io(struct spa_node *object, +SPA_API_IMPL int spa_node_port_set_io(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t id, void *data, size_t size) @@ -729,21 +729,21 @@ static inline int spa_node_port_set_io(struct spa_node *object, direction, port_id, id, data, size); } -static inline int spa_node_port_reuse_buffer(struct spa_node *object, uint32_t port_id, uint32_t buffer_id) +SPA_API_IMPL int spa_node_port_reuse_buffer(struct spa_node *object, uint32_t port_id, uint32_t buffer_id) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, port_reuse_buffer, 0, port_id, buffer_id); } -static inline int spa_node_port_reuse_buffer_fast(struct spa_node *object, uint32_t port_id, uint32_t buffer_id) +SPA_API_IMPL int spa_node_port_reuse_buffer_fast(struct spa_node *object, uint32_t port_id, uint32_t buffer_id) { return spa_api_method_fast_r(int, -ENOTSUP, spa_node, &object->iface, port_reuse_buffer, 0, port_id, buffer_id); } -static inline int spa_node_process(struct spa_node *object) +SPA_API_IMPL int spa_node_process(struct spa_node *object) { return spa_api_method_r(int, -ENOTSUP, spa_node, &object->iface, process, 0); } -static inline int spa_node_process_fast(struct spa_node *object) +SPA_API_IMPL int spa_node_process_fast(struct spa_node *object) { return spa_api_method_fast_r(int, -ENOTSUP, spa_node, &object->iface, process, 0); } diff --git a/spa/include/spa/node/utils.h b/spa/include/spa/node/utils.h index 01d249ab9..d92600b0c 100644 --- a/spa/include/spa/node/utils.h +++ b/spa/include/spa/node/utils.h @@ -23,7 +23,7 @@ struct spa_result_node_params_data { struct spa_result_node_params data; }; -static inline void spa_result_func_node_params(void *data, +SPA_API_IMPL void spa_result_func_node_params(void *data, int seq SPA_UNUSED, int res SPA_UNUSED, uint32_t type SPA_UNUSED, const void *result) { struct spa_result_node_params_data *d = @@ -37,7 +37,7 @@ static inline void spa_result_func_node_params(void *data, d->data.param = spa_pod_builder_deref(d->builder, offset); } -static inline int spa_node_enum_params_sync(struct spa_node *node, +SPA_API_IMPL int spa_node_enum_params_sync(struct spa_node *node, uint32_t id, uint32_t *index, const struct spa_pod *filter, struct spa_pod **param, @@ -70,7 +70,7 @@ static inline int spa_node_enum_params_sync(struct spa_node *node, return res; } -static inline int spa_node_port_enum_params_sync(struct spa_node *node, +SPA_API_IMPL int spa_node_port_enum_params_sync(struct spa_node *node, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t *index, const struct spa_pod *filter, diff --git a/spa/include/spa/param/audio/aac-utils.h b/spa/include/spa/param/audio/aac-utils.h index 07d436ac2..d1714d329 100644 --- a/spa/include/spa/param/audio/aac-utils.h +++ b/spa/include/spa/param/audio/aac-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_aac *info) { int res; @@ -33,7 +33,7 @@ spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_a return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_aac_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_aac *info) { diff --git a/spa/include/spa/param/audio/alac-utils.h b/spa/include/spa/param/audio/alac-utils.h index 262c2af3d..d43f440ea 100644 --- a/spa/include/spa/param/audio/alac-utils.h +++ b/spa/include/spa/param/audio/alac-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_alac *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_ return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_alac_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_alac *info) { diff --git a/spa/include/spa/param/audio/amr-utils.h b/spa/include/spa/param/audio/amr-utils.h index 3ecbda8fa..de680565d 100644 --- a/spa/include/spa/param/audio/amr-utils.h +++ b/spa/include/spa/param/audio/amr-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_amr *info) { int res; @@ -31,7 +31,7 @@ spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_a return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_amr_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_amr *info) { diff --git a/spa/include/spa/param/audio/ape-utils.h b/spa/include/spa/param/audio/ape-utils.h index 76ae6d890..a43983c6e 100644 --- a/spa/include/spa/param/audio/ape-utils.h +++ b/spa/include/spa/param/audio/ape-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_ape *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_a return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_ape_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_ape *info) { diff --git a/spa/include/spa/param/audio/dsd-utils.h b/spa/include/spa/param/audio/dsd-utils.h index 5f4585aa0..fcc79e2a2 100644 --- a/spa/include/spa/param/audio/dsd-utils.h +++ b/spa/include/spa/param/audio/dsd-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_dsd *info) { struct spa_pod *position = NULL; @@ -39,7 +39,7 @@ spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_d return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_dsd_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_dsd *info) { diff --git a/spa/include/spa/param/audio/dsp-utils.h b/spa/include/spa/param/audio/dsp-utils.h index 621c370ce..0d10ea0cc 100644 --- a/spa/include/spa/param/audio/dsp-utils.h +++ b/spa/include/spa/param/audio/dsp-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_dsp *info) { int res; @@ -29,7 +29,7 @@ spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_d return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_dsp_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_dsp *info) { diff --git a/spa/include/spa/param/audio/flac-utils.h b/spa/include/spa/param/audio/flac-utils.h index 007436c97..095503aed 100644 --- a/spa/include/spa/param/audio/flac-utils.h +++ b/spa/include/spa/param/audio/flac-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_flac *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_ return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_flac_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_flac *info) { diff --git a/spa/include/spa/param/audio/format-utils.h b/spa/include/spa/param/audio/format-utils.h index 1fad6292a..b5799d0db 100644 --- a/spa/include/spa/param/audio/format-utils.h +++ b/spa/include/spa/param/audio/format-utils.h @@ -34,7 +34,7 @@ extern "C" { * \{ */ -static inline int +SPA_API_IMPL int spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info) { int res; @@ -76,7 +76,7 @@ spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info return -ENOTSUP; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info *info) { diff --git a/spa/include/spa/param/audio/iec958-types.h b/spa/include/spa/param/audio/iec958-types.h index 38a4127b9..e1cf86c90 100644 --- a/spa/include/spa/param/audio/iec958-types.h +++ b/spa/include/spa/param/audio/iec958-types.h @@ -33,11 +33,11 @@ static const struct spa_type_info spa_type_audio_iec958_codec[] = { { 0, 0, NULL, NULL }, }; -static inline uint32_t spa_type_audio_iec958_codec_from_short_name(const char *name) +SPA_API_IMPL uint32_t spa_type_audio_iec958_codec_from_short_name(const char *name) { return spa_type_from_short_name(name, spa_type_audio_iec958_codec, SPA_AUDIO_IEC958_CODEC_UNKNOWN); } -static inline const char * spa_type_audio_iec958_codec_to_short_name(uint32_t type) +SPA_API_IMPL const char * spa_type_audio_iec958_codec_to_short_name(uint32_t type) { return spa_type_to_short_name(type, spa_type_audio_iec958_codec, "UNKNOWN"); } diff --git a/spa/include/spa/param/audio/iec958-utils.h b/spa/include/spa/param/audio/iec958-utils.h index 56bade23a..cf762399d 100644 --- a/spa/include/spa/param/audio/iec958-utils.h +++ b/spa/include/spa/param/audio/iec958-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_info_iec958 *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_inf return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_iec958_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_iec958 *info) { diff --git a/spa/include/spa/param/audio/mp3-utils.h b/spa/include/spa/param/audio/mp3-utils.h index 4c1ace261..1c021d79d 100644 --- a/spa/include/spa/param/audio/mp3-utils.h +++ b/spa/include/spa/param/audio/mp3-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_mp3 *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_m return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_mp3_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_mp3 *info) { diff --git a/spa/include/spa/param/audio/ra-utils.h b/spa/include/spa/param/audio/ra-utils.h index 0f267fb1b..52eceddde 100644 --- a/spa/include/spa/param/audio/ra-utils.h +++ b/spa/include/spa/param/audio/ra-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_ra_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_ra *info) { diff --git a/spa/include/spa/param/audio/raw-json.h b/spa/include/spa/param/audio/raw-json.h index f8608868f..10e72a5a2 100644 --- a/spa/include/spa/param/audio/raw-json.h +++ b/spa/include/spa/param/audio/raw-json.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_audio_parse_position(const char *str, size_t len, uint32_t *position, uint32_t *n_channels) { @@ -38,7 +38,7 @@ spa_audio_parse_position(const char *str, size_t len, return channels; } -static inline int +SPA_API_IMPL int spa_audio_info_raw_update(struct spa_audio_info_raw *info, const char *key, const char *val, bool force) { uint32_t v; @@ -60,7 +60,7 @@ spa_audio_info_raw_update(struct spa_audio_info_raw *info, const char *key, cons return 0; } -static inline int SPA_SENTINEL +SPA_API_IMPL int SPA_SENTINEL spa_audio_info_raw_init_dict_keys(struct spa_audio_info_raw *info, const struct spa_dict *defaults, const struct spa_dict *dict, ...) diff --git a/spa/include/spa/param/audio/raw-types.h b/spa/include/spa/param/audio/raw-types.h index e55f8d25c..d950eb6c5 100644 --- a/spa/include/spa/param/audio/raw-types.h +++ b/spa/include/spa/param/audio/raw-types.h @@ -129,11 +129,11 @@ static const struct spa_type_info spa_type_audio_format[] = { { 0, 0, NULL, NULL }, }; -static inline uint32_t spa_type_audio_format_from_short_name(const char *name) +SPA_API_IMPL uint32_t spa_type_audio_format_from_short_name(const char *name) { return spa_type_from_short_name(name, spa_type_audio_format, SPA_AUDIO_FORMAT_UNKNOWN); } -static inline const char * spa_type_audio_format_to_short_name(uint32_t type) +SPA_API_IMPL const char * spa_type_audio_format_to_short_name(uint32_t type) { return spa_type_to_short_name(type, spa_type_audio_format, "UNKNOWN"); } @@ -257,11 +257,11 @@ static const struct spa_type_info spa_type_audio_channel[] = { { 0, 0, NULL, NULL }, }; -static inline uint32_t spa_type_audio_channel_from_short_name(const char *name) +SPA_API_IMPL uint32_t spa_type_audio_channel_from_short_name(const char *name) { return spa_type_from_short_name(name, spa_type_audio_channel, SPA_AUDIO_CHANNEL_UNKNOWN); } -static inline const char * spa_type_audio_channel_to_short_name(uint32_t type) +SPA_API_IMPL const char * spa_type_audio_channel_to_short_name(uint32_t type) { return spa_type_to_short_name(type, spa_type_audio_channel, "UNK"); } diff --git a/spa/include/spa/param/audio/raw-utils.h b/spa/include/spa/param/audio/raw-utils.h index 8790c452a..bd0ef0155 100644 --- a/spa/include/spa/param/audio/raw-utils.h +++ b/spa/include/spa/param/audio/raw-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info) { struct spa_pod *position = NULL; @@ -38,7 +38,7 @@ spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_r return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_raw *info) { diff --git a/spa/include/spa/param/audio/vorbis-utils.h b/spa/include/spa/param/audio/vorbis-utils.h index 9f3fee1df..4150c133c 100644 --- a/spa/include/spa/param/audio/vorbis-utils.h +++ b/spa/include/spa/param/audio/vorbis-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_info_vorbis *info) { int res; @@ -30,7 +30,7 @@ spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_inf return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_vorbis_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_vorbis *info) { diff --git a/spa/include/spa/param/audio/wma-utils.h b/spa/include/spa/param/audio/wma-utils.h index 9517e122d..016f2d368 100644 --- a/spa/include/spa/param/audio/wma-utils.h +++ b/spa/include/spa/param/audio/wma-utils.h @@ -19,7 +19,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_wma *info) { int res; @@ -33,7 +33,7 @@ spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_w return res; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_audio_wma_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_audio_info_wma *info) { diff --git a/spa/include/spa/param/format-utils.h b/spa/include/spa/param/format-utils.h index fb5cb39a8..764d389d0 100644 --- a/spa/include/spa/param/format-utils.h +++ b/spa/include/spa/param/format-utils.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype) { return spa_pod_parse_object(format, diff --git a/spa/include/spa/param/latency-utils.h b/spa/include/spa/param/latency-utils.h index 93c0f6687..eb3a96539 100644 --- a/spa/include/spa/param/latency-utils.h +++ b/spa/include/spa/param/latency-utils.h @@ -20,7 +20,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_latency_info_compare(const struct spa_latency_info *a, const struct spa_latency_info *b) { if (a->min_quantum == b->min_quantum && @@ -33,7 +33,7 @@ spa_latency_info_compare(const struct spa_latency_info *a, const struct spa_late return 1; } -static inline void +SPA_API_IMPL void spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction direction) { *info = SPA_LATENCY_INFO(direction, @@ -44,7 +44,7 @@ spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction .min_ns = INT64_MAX, .max_ns = INT64_MIN); } -static inline void +SPA_API_IMPL void spa_latency_info_combine_finish(struct spa_latency_info *info) { if (info->min_quantum == FLT_MAX) @@ -61,7 +61,7 @@ spa_latency_info_combine_finish(struct spa_latency_info *info) info->max_ns = 0; } -static inline int +SPA_API_IMPL int spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency_info *other) { if (info->direction != other->direction) @@ -81,7 +81,7 @@ spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency return 0; } -static inline int +SPA_API_IMPL int spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info) { int res; @@ -100,7 +100,7 @@ spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info) return 0; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_latency_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_latency_info *info) { return (struct spa_pod *)spa_pod_builder_add_object(builder, @@ -114,7 +114,7 @@ spa_latency_build(struct spa_pod_builder *builder, uint32_t id, const struct spa SPA_PARAM_LATENCY_maxNs, SPA_POD_Long(info->max_ns)); } -static inline int +SPA_API_IMPL int spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_latency_info *info) { int res; @@ -128,7 +128,7 @@ spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_late return 0; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_process_latency_info *info) { @@ -139,7 +139,7 @@ spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id, SPA_PARAM_PROCESS_LATENCY_ns, SPA_POD_Long(info->ns)); } -static inline int +SPA_API_IMPL int spa_process_latency_info_add(const struct spa_process_latency_info *process, struct spa_latency_info *info) { @@ -152,7 +152,7 @@ spa_process_latency_info_add(const struct spa_process_latency_info *process, return 0; } -static inline int +SPA_API_IMPL int spa_process_latency_info_compare(const struct spa_process_latency_info *a, const struct spa_process_latency_info *b) { diff --git a/spa/include/spa/param/tag-utils.h b/spa/include/spa/param/tag-utils.h index 2bce7b199..4d3256f1c 100644 --- a/spa/include/spa/param/tag-utils.h +++ b/spa/include/spa/param/tag-utils.h @@ -21,14 +21,14 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_tag_compare(const struct spa_pod *a, const struct spa_pod *b) { return ((a == b) || (a && b && SPA_POD_SIZE(a) == SPA_POD_SIZE(b) && memcmp(a, b, SPA_POD_SIZE(b)) == 0)) ? 0 : 1; } -static inline int +SPA_API_IMPL int spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state) { int res; @@ -57,7 +57,7 @@ spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state return 0; } -static inline int +SPA_API_IMPL int spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struct spa_dict_item *items) { struct spa_pod_parser prs; @@ -90,7 +90,7 @@ spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struc return 0; } -static inline void +SPA_API_IMPL void spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f, uint32_t id, enum spa_direction direction) { @@ -100,7 +100,7 @@ spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f, 0); } -static inline void +SPA_API_IMPL void spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *info) { spa_pod_builder_add(builder, @@ -108,7 +108,7 @@ spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *in 0); } -static inline void +SPA_API_IMPL void spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *dict) { uint32_t i, n_items; @@ -126,7 +126,7 @@ spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *d spa_pod_builder_pop(builder, &f); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_tag_build_end(struct spa_pod_builder *builder, struct spa_pod_frame *f) { return (struct spa_pod*)spa_pod_builder_pop(builder, f); diff --git a/spa/include/spa/param/video/dsp-utils.h b/spa/include/spa/param/video/dsp-utils.h index 193e31944..eb2eb0bdd 100644 --- a/spa/include/spa/param/video/dsp-utils.h +++ b/spa/include/spa/param/video/dsp-utils.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_video_dsp_parse(const struct spa_pod *format, struct spa_video_info_dsp *info) { @@ -36,7 +36,7 @@ spa_format_video_dsp_parse(const struct spa_pod *format, SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier)); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_video_dsp_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_video_info_dsp *info) { diff --git a/spa/include/spa/param/video/format-utils.h b/spa/include/spa/param/video/format-utils.h index a04b67b23..6407c5c2f 100644 --- a/spa/include/spa/param/video/format-utils.h +++ b/spa/include/spa/param/video/format-utils.h @@ -16,7 +16,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info) { int res; @@ -40,7 +40,7 @@ spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info return -ENOTSUP; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_video_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_video_info *info) { diff --git a/spa/include/spa/param/video/h264-utils.h b/spa/include/spa/param/video/h264-utils.h index fbf22c952..32ce61437 100644 --- a/spa/include/spa/param/video/h264-utils.h +++ b/spa/include/spa/param/video/h264-utils.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_video_h264_parse(const struct spa_pod *format, struct spa_video_info_h264 *info) { @@ -31,7 +31,7 @@ spa_format_video_h264_parse(const struct spa_pod *format, SPA_FORMAT_VIDEO_H264_alignment, SPA_POD_OPT_Id(&info->alignment)); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_video_h264_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_video_info_h264 *info) { diff --git a/spa/include/spa/param/video/mjpg-utils.h b/spa/include/spa/param/video/mjpg-utils.h index b6bec003a..221f9e80d 100644 --- a/spa/include/spa/param/video/mjpg-utils.h +++ b/spa/include/spa/param/video/mjpg-utils.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_video_mjpg_parse(const struct spa_pod *format, struct spa_video_info_mjpg *info) { @@ -29,7 +29,7 @@ spa_format_video_mjpg_parse(const struct spa_pod *format, SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_OPT_Fraction(&info->max_framerate)); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_video_mjpg_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_video_info_mjpg *info) { diff --git a/spa/include/spa/param/video/raw-types.h b/spa/include/spa/param/video/raw-types.h index d21f238c3..cc45bc600 100644 --- a/spa/include/spa/param/video/raw-types.h +++ b/spa/include/spa/param/video/raw-types.h @@ -111,11 +111,11 @@ static const struct spa_type_info spa_type_video_format[] = { { 0, 0, NULL, NULL }, }; -static inline uint32_t spa_type_video_format_from_short_name(const char *name) +SPA_API_IMPL uint32_t spa_type_video_format_from_short_name(const char *name) { return spa_type_from_short_name(name, spa_type_video_format, SPA_VIDEO_FORMAT_UNKNOWN); } -static inline const char * spa_type_video_format_to_short_name(uint32_t type) +SPA_API_IMPL const char * spa_type_video_format_to_short_name(uint32_t type) { return spa_type_to_short_name(type, spa_type_video_format, "UNKNOWN"); } diff --git a/spa/include/spa/param/video/raw-utils.h b/spa/include/spa/param/video/raw-utils.h index 41d9cc1e2..4999df25a 100644 --- a/spa/include/spa/param/video/raw-utils.h +++ b/spa/include/spa/param/video/raw-utils.h @@ -18,7 +18,7 @@ extern "C" { #include #include -static inline int +SPA_API_IMPL int spa_format_video_raw_parse(const struct spa_pod *format, struct spa_video_info_raw *info) { @@ -49,7 +49,7 @@ spa_format_video_raw_parse(const struct spa_pod *format, SPA_FORMAT_VIDEO_colorPrimaries, SPA_POD_OPT_Id(&info->color_primaries)); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_format_video_raw_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_video_info_raw *info) { diff --git a/spa/include/spa/pod/builder.h b/spa/include/spa/pod/builder.h index 6d3e9d54a..ed789b819 100644 --- a/spa/include/spa/pod/builder.h +++ b/spa/include/spa/pod/builder.h @@ -51,20 +51,20 @@ struct spa_pod_builder { #define SPA_POD_BUILDER_INIT(buffer,size) ((struct spa_pod_builder){ (buffer), (size), 0, {0,0,NULL},{NULL,NULL}}) -static inline void +SPA_API_IMPL void spa_pod_builder_get_state(struct spa_pod_builder *builder, struct spa_pod_builder_state *state) { *state = builder->state; } -static inline void +SPA_API_IMPL void spa_pod_builder_set_callbacks(struct spa_pod_builder *builder, const struct spa_pod_builder_callbacks *callbacks, void *data) { builder->callbacks = SPA_CALLBACKS_INIT(callbacks, data); } -static inline void +SPA_API_IMPL void spa_pod_builder_reset(struct spa_pod_builder *builder, struct spa_pod_builder_state *state) { struct spa_pod_frame *f; @@ -74,12 +74,12 @@ spa_pod_builder_reset(struct spa_pod_builder *builder, struct spa_pod_builder_st f->pod.size -= size; } -static inline void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size) +SPA_API_IMPL void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size) { *builder = SPA_POD_BUILDER_INIT(data, size); } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_pod_builder_deref(struct spa_pod_builder *builder, uint32_t offset) { uint32_t size = builder->size; @@ -91,7 +91,7 @@ spa_pod_builder_deref(struct spa_pod_builder *builder, uint32_t offset) return NULL; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_pod_builder_frame(struct spa_pod_builder *builder, struct spa_pod_frame *frame) { if (frame->offset + SPA_POD_SIZE(&frame->pod) <= builder->size) @@ -99,7 +99,7 @@ spa_pod_builder_frame(struct spa_pod_builder *builder, struct spa_pod_frame *fra return NULL; } -static inline void +SPA_API_IMPL void spa_pod_builder_push(struct spa_pod_builder *builder, struct spa_pod_frame *frame, const struct spa_pod *pod, @@ -115,7 +115,7 @@ spa_pod_builder_push(struct spa_pod_builder *builder, builder->state.flags = SPA_POD_BUILDER_FLAG_FIRST | SPA_POD_BUILDER_FLAG_BODY; } -static inline int spa_pod_builder_raw(struct spa_pod_builder *builder, const void *data, uint32_t size) +SPA_API_IMPL int spa_pod_builder_raw(struct spa_pod_builder *builder, const void *data, uint32_t size) { int res = 0; struct spa_pod_frame *f; @@ -139,14 +139,14 @@ static inline int spa_pod_builder_raw(struct spa_pod_builder *builder, const voi return res; } -static inline int spa_pod_builder_pad(struct spa_pod_builder *builder, uint32_t size) +SPA_API_IMPL int spa_pod_builder_pad(struct spa_pod_builder *builder, uint32_t size) { uint64_t zeroes = 0; size = SPA_ROUND_UP_N(size, 8) - size; return size ? spa_pod_builder_raw(builder, &zeroes, size) : 0; } -static inline int +SPA_API_IMPL int spa_pod_builder_raw_padded(struct spa_pod_builder *builder, const void *data, uint32_t size) { int r, res = spa_pod_builder_raw(builder, data, size); @@ -155,7 +155,7 @@ spa_pod_builder_raw_padded(struct spa_pod_builder *builder, const void *data, ui return res; } -static inline void *spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame) +SPA_API_IMPL void *spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame) { struct spa_pod *pod; @@ -172,7 +172,7 @@ static inline void *spa_pod_builder_pop(struct spa_pod_builder *builder, struct return pod; } -static inline int +SPA_API_IMPL int spa_pod_builder_primitive(struct spa_pod_builder *builder, const struct spa_pod *p) { const void *data; @@ -198,13 +198,13 @@ spa_pod_builder_primitive(struct spa_pod_builder *builder, const struct spa_pod #define SPA_POD_INIT_None() SPA_POD_INIT(0, SPA_TYPE_None) -static inline int spa_pod_builder_none(struct spa_pod_builder *builder) +SPA_API_IMPL int spa_pod_builder_none(struct spa_pod_builder *builder) { const struct spa_pod p = SPA_POD_INIT_None(); return spa_pod_builder_primitive(builder, &p); } -static inline int spa_pod_builder_child(struct spa_pod_builder *builder, uint32_t size, uint32_t type) +SPA_API_IMPL int spa_pod_builder_child(struct spa_pod_builder *builder, uint32_t size, uint32_t type) { const struct spa_pod p = SPA_POD_INIT(size,type); SPA_FLAG_CLEAR(builder->state.flags, SPA_POD_BUILDER_FLAG_FIRST); @@ -213,7 +213,7 @@ static inline int spa_pod_builder_child(struct spa_pod_builder *builder, uint32_ #define SPA_POD_INIT_Bool(val) ((struct spa_pod_bool){ { sizeof(uint32_t), SPA_TYPE_Bool }, (val) ? 1 : 0, 0 }) -static inline int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val) +SPA_API_IMPL int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val) { const struct spa_pod_bool p = SPA_POD_INIT_Bool(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -221,7 +221,7 @@ static inline int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val #define SPA_POD_INIT_Id(val) ((struct spa_pod_id){ { sizeof(uint32_t), SPA_TYPE_Id }, (val), 0 }) -static inline int spa_pod_builder_id(struct spa_pod_builder *builder, uint32_t val) +SPA_API_IMPL int spa_pod_builder_id(struct spa_pod_builder *builder, uint32_t val) { const struct spa_pod_id p = SPA_POD_INIT_Id(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -229,7 +229,7 @@ static inline int spa_pod_builder_id(struct spa_pod_builder *builder, uint32_t v #define SPA_POD_INIT_Int(val) ((struct spa_pod_int){ { sizeof(int32_t), SPA_TYPE_Int }, (val), 0 }) -static inline int spa_pod_builder_int(struct spa_pod_builder *builder, int32_t val) +SPA_API_IMPL int spa_pod_builder_int(struct spa_pod_builder *builder, int32_t val) { const struct spa_pod_int p = SPA_POD_INIT_Int(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -237,7 +237,7 @@ static inline int spa_pod_builder_int(struct spa_pod_builder *builder, int32_t v #define SPA_POD_INIT_Long(val) ((struct spa_pod_long){ { sizeof(int64_t), SPA_TYPE_Long }, (val) }) -static inline int spa_pod_builder_long(struct spa_pod_builder *builder, int64_t val) +SPA_API_IMPL int spa_pod_builder_long(struct spa_pod_builder *builder, int64_t val) { const struct spa_pod_long p = SPA_POD_INIT_Long(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -245,7 +245,7 @@ static inline int spa_pod_builder_long(struct spa_pod_builder *builder, int64_t #define SPA_POD_INIT_Float(val) ((struct spa_pod_float){ { sizeof(float), SPA_TYPE_Float }, (val), 0 }) -static inline int spa_pod_builder_float(struct spa_pod_builder *builder, float val) +SPA_API_IMPL int spa_pod_builder_float(struct spa_pod_builder *builder, float val) { const struct spa_pod_float p = SPA_POD_INIT_Float(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -253,7 +253,7 @@ static inline int spa_pod_builder_float(struct spa_pod_builder *builder, float v #define SPA_POD_INIT_Double(val) ((struct spa_pod_double){ { sizeof(double), SPA_TYPE_Double }, (val) }) -static inline int spa_pod_builder_double(struct spa_pod_builder *builder, double val) +SPA_API_IMPL int spa_pod_builder_double(struct spa_pod_builder *builder, double val) { const struct spa_pod_double p = SPA_POD_INIT_Double(val); return spa_pod_builder_primitive(builder, &p.pod); @@ -261,7 +261,7 @@ static inline int spa_pod_builder_double(struct spa_pod_builder *builder, double #define SPA_POD_INIT_String(len) ((struct spa_pod_string){ { (len), SPA_TYPE_String } }) -static inline int +SPA_API_IMPL int spa_pod_builder_write_string(struct spa_pod_builder *builder, const char *str, uint32_t len) { int r, res; @@ -273,7 +273,7 @@ spa_pod_builder_write_string(struct spa_pod_builder *builder, const char *str, u return res; } -static inline int +SPA_API_IMPL int spa_pod_builder_string_len(struct spa_pod_builder *builder, const char *str, uint32_t len) { const struct spa_pod_string p = SPA_POD_INIT_String(len+1); @@ -283,7 +283,7 @@ spa_pod_builder_string_len(struct spa_pod_builder *builder, const char *str, uin return res; } -static inline int spa_pod_builder_string(struct spa_pod_builder *builder, const char *str) +SPA_API_IMPL int spa_pod_builder_string(struct spa_pod_builder *builder, const char *str) { uint32_t len = str ? strlen(str) : 0; return spa_pod_builder_string_len(builder, str ? str : "", len); @@ -291,7 +291,7 @@ static inline int spa_pod_builder_string(struct spa_pod_builder *builder, const #define SPA_POD_INIT_Bytes(len) ((struct spa_pod_bytes){ { (len), SPA_TYPE_Bytes } }) -static inline int +SPA_API_IMPL int spa_pod_builder_bytes(struct spa_pod_builder *builder, const void *bytes, uint32_t len) { const struct spa_pod_bytes p = SPA_POD_INIT_Bytes(len); @@ -300,7 +300,7 @@ spa_pod_builder_bytes(struct spa_pod_builder *builder, const void *bytes, uint32 res = r; return res; } -static inline void * +SPA_API_IMPL void * spa_pod_builder_reserve_bytes(struct spa_pod_builder *builder, uint32_t len) { uint32_t offset = builder->state.offset; @@ -311,7 +311,7 @@ spa_pod_builder_reserve_bytes(struct spa_pod_builder *builder, uint32_t len) #define SPA_POD_INIT_Pointer(type,value) ((struct spa_pod_pointer){ { sizeof(struct spa_pod_pointer_body), SPA_TYPE_Pointer }, { (type), 0, (value) } }) -static inline int +SPA_API_IMPL int spa_pod_builder_pointer(struct spa_pod_builder *builder, uint32_t type, const void *val) { const struct spa_pod_pointer p = SPA_POD_INIT_Pointer(type, val); @@ -320,7 +320,7 @@ spa_pod_builder_pointer(struct spa_pod_builder *builder, uint32_t type, const vo #define SPA_POD_INIT_Fd(fd) ((struct spa_pod_fd){ { sizeof(int64_t), SPA_TYPE_Fd }, (fd) }) -static inline int spa_pod_builder_fd(struct spa_pod_builder *builder, int64_t fd) +SPA_API_IMPL int spa_pod_builder_fd(struct spa_pod_builder *builder, int64_t fd) { const struct spa_pod_fd p = SPA_POD_INIT_Fd(fd); return spa_pod_builder_primitive(builder, &p.pod); @@ -328,7 +328,7 @@ static inline int spa_pod_builder_fd(struct spa_pod_builder *builder, int64_t fd #define SPA_POD_INIT_Rectangle(val) ((struct spa_pod_rectangle){ { sizeof(struct spa_rectangle), SPA_TYPE_Rectangle }, (val) }) -static inline int +SPA_API_IMPL int spa_pod_builder_rectangle(struct spa_pod_builder *builder, uint32_t width, uint32_t height) { const struct spa_pod_rectangle p = SPA_POD_INIT_Rectangle(SPA_RECTANGLE(width, height)); @@ -337,14 +337,14 @@ spa_pod_builder_rectangle(struct spa_pod_builder *builder, uint32_t width, uint3 #define SPA_POD_INIT_Fraction(val) ((struct spa_pod_fraction){ { sizeof(struct spa_fraction), SPA_TYPE_Fraction }, (val) }) -static inline int +SPA_API_IMPL int spa_pod_builder_fraction(struct spa_pod_builder *builder, uint32_t num, uint32_t denom) { const struct spa_pod_fraction p = SPA_POD_INIT_Fraction(SPA_FRACTION(num, denom)); return spa_pod_builder_primitive(builder, &p.pod); } -static inline int +SPA_API_IMPL int spa_pod_builder_push_array(struct spa_pod_builder *builder, struct spa_pod_frame *frame) { const struct spa_pod_array p = @@ -356,7 +356,7 @@ spa_pod_builder_push_array(struct spa_pod_builder *builder, struct spa_pod_frame return res; } -static inline int +SPA_API_IMPL int spa_pod_builder_array(struct spa_pod_builder *builder, uint32_t child_size, uint32_t child_type, uint32_t n_elems, const void *elems) { @@ -378,7 +378,7 @@ spa_pod_builder_array(struct spa_pod_builder *builder, { { { (n_vals) * sizeof(ctype) + sizeof(struct spa_pod_choice_body), SPA_TYPE_Choice }, \ { (type), 0, { sizeof(ctype), (child_type) } } }, { __VA_ARGS__ } }) -static inline int +SPA_API_IMPL int spa_pod_builder_push_choice(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t flags) { @@ -393,7 +393,7 @@ spa_pod_builder_push_choice(struct spa_pod_builder *builder, struct spa_pod_fram #define SPA_POD_INIT_Struct(size) ((struct spa_pod_struct){ { (size), SPA_TYPE_Struct } }) -static inline int +SPA_API_IMPL int spa_pod_builder_push_struct(struct spa_pod_builder *builder, struct spa_pod_frame *frame) { const struct spa_pod_struct p = SPA_POD_INIT_Struct(0); @@ -405,7 +405,7 @@ spa_pod_builder_push_struct(struct spa_pod_builder *builder, struct spa_pod_fram #define SPA_POD_INIT_Object(size,type,id,...) ((struct spa_pod_object){ { (size), SPA_TYPE_Object }, { (type), (id) }, ##__VA_ARGS__ }) -static inline int +SPA_API_IMPL int spa_pod_builder_push_object(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t id) { @@ -420,7 +420,7 @@ spa_pod_builder_push_object(struct spa_pod_builder *builder, struct spa_pod_fram #define SPA_POD_INIT_Prop(key,flags,size,type) \ ((struct spa_pod_prop){ (key), (flags), { (size), (type) } }) -static inline int +SPA_API_IMPL int spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags) { const struct { uint32_t key; uint32_t flags; } p = { key, flags }; @@ -430,7 +430,7 @@ spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t fla #define SPA_POD_INIT_Sequence(size,unit) \ ((struct spa_pod_sequence){ { (size), SPA_TYPE_Sequence}, {(unit), 0 } }) -static inline int +SPA_API_IMPL int spa_pod_builder_push_sequence(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t unit) { const struct spa_pod_sequence p = @@ -441,14 +441,14 @@ spa_pod_builder_push_sequence(struct spa_pod_builder *builder, struct spa_pod_fr return res; } -static inline int +SPA_API_IMPL int spa_pod_builder_control(struct spa_pod_builder *builder, uint32_t offset, uint32_t type) { const struct { uint32_t offset; uint32_t type; } p = { offset, type }; return spa_pod_builder_raw(builder, &p, sizeof(p)); } -static inline uint32_t spa_choice_from_id(char id) +SPA_API_IMPL uint32_t spa_choice_from_id(char id) { switch (id) { case 'r': @@ -560,7 +560,7 @@ do { \ } \ } while(false) -static inline int +SPA_API_IMPL int spa_pod_builder_addv(struct spa_pod_builder *builder, va_list args) { int res = 0; @@ -618,7 +618,7 @@ spa_pod_builder_addv(struct spa_pod_builder *builder, va_list args) return res; } -static inline int spa_pod_builder_add(struct spa_pod_builder *builder, ...) +SPA_API_IMPL int spa_pod_builder_add(struct spa_pod_builder *builder, ...) { int res; va_list args; @@ -658,7 +658,7 @@ static inline int spa_pod_builder_add(struct spa_pod_builder *builder, ...) }) /** Copy a pod structure */ -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_pod_copy(const struct spa_pod *pod) { size_t size; diff --git a/spa/include/spa/pod/compare.h b/spa/include/spa/pod/compare.h index f41e48116..8f99a6e93 100644 --- a/spa/include/spa/pod/compare.h +++ b/spa/include/spa/pod/compare.h @@ -25,7 +25,7 @@ extern "C" { * \{ */ -static inline int spa_pod_compare_value(uint32_t type, const void *r1, const void *r2, uint32_t size) +SPA_API_IMPL int spa_pod_compare_value(uint32_t type, const void *r1, const void *r2, uint32_t size) { switch (type) { case SPA_TYPE_None: @@ -72,7 +72,7 @@ static inline int spa_pod_compare_value(uint32_t type, const void *r1, const voi return 0; } -static inline int spa_pod_compare(const struct spa_pod *pod1, +SPA_API_IMPL int spa_pod_compare(const struct spa_pod *pod1, const struct spa_pod *pod2) { int res = 0; diff --git a/spa/include/spa/pod/dynamic.h b/spa/include/spa/pod/dynamic.h index 9edff2d05..73380a049 100644 --- a/spa/include/spa/pod/dynamic.h +++ b/spa/include/spa/pod/dynamic.h @@ -37,7 +37,7 @@ static int spa_pod_dynamic_builder_overflow(void *data, uint32_t size) return 0; } -static inline void spa_pod_dynamic_builder_init(struct spa_pod_dynamic_builder *builder, +SPA_API_IMPL void spa_pod_dynamic_builder_init(struct spa_pod_dynamic_builder *builder, void *data, uint32_t size, uint32_t extend) { static const struct spa_pod_builder_callbacks spa_pod_dynamic_builder_callbacks = { @@ -50,7 +50,7 @@ static inline void spa_pod_dynamic_builder_init(struct spa_pod_dynamic_builder * builder->data = data; } -static inline void spa_pod_dynamic_builder_clean(struct spa_pod_dynamic_builder *builder) +SPA_API_IMPL void spa_pod_dynamic_builder_clean(struct spa_pod_dynamic_builder *builder) { if (builder->data != builder->b.data) free(builder->b.data); diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index 3a682e1ac..4c614ac27 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -25,7 +25,7 @@ extern "C" { * \{ */ -static inline int spa_pod_choice_fix_default(struct spa_pod_choice *choice) +SPA_API_IMPL int spa_pod_choice_fix_default(struct spa_pod_choice *choice) { void *val, *alt; int i, nvals; @@ -77,7 +77,7 @@ static inline int spa_pod_choice_fix_default(struct spa_pod_choice *choice) return 0; } -static inline int spa_pod_filter_flags_value(struct spa_pod_builder *b, +SPA_API_IMPL int spa_pod_filter_flags_value(struct spa_pod_builder *b, uint32_t type, const void *r1, const void *r2, uint32_t size SPA_UNUSED) { switch (type) { @@ -103,7 +103,7 @@ static inline int spa_pod_filter_flags_value(struct spa_pod_builder *b, return 1; } -static inline int spa_pod_filter_is_step_of(uint32_t type, const void *r1, +SPA_API_IMPL int spa_pod_filter_is_step_of(uint32_t type, const void *r1, const void *r2, uint32_t size SPA_UNUSED) { switch (type) { @@ -125,7 +125,7 @@ static inline int spa_pod_filter_is_step_of(uint32_t type, const void *r1, return 0; } -static inline int +SPA_API_IMPL int spa_pod_filter_prop(struct spa_pod_builder *b, const struct spa_pod_prop *p1, const struct spa_pod_prop *p2) @@ -322,7 +322,7 @@ spa_pod_filter_prop(struct spa_pod_builder *b, return 0; } -static inline int spa_pod_filter_part(struct spa_pod_builder *b, +SPA_API_IMPL int spa_pod_filter_part(struct spa_pod_builder *b, const struct spa_pod *pod, uint32_t pod_size, const struct spa_pod *filter, uint32_t filter_size) { @@ -422,7 +422,7 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b, return res; } -static inline int +SPA_API_IMPL int spa_pod_filter(struct spa_pod_builder *b, struct spa_pod **result, const struct spa_pod *pod, diff --git a/spa/include/spa/pod/iter.h b/spa/include/spa/pod/iter.h index 93a23ad98..51fed6b31 100644 --- a/spa/include/spa/pod/iter.h +++ b/spa/include/spa/pod/iter.h @@ -26,7 +26,7 @@ struct spa_pod_frame { uint32_t flags; }; -static inline bool spa_pod_is_inside(const void *pod, uint32_t size, const void *iter) +SPA_API_IMPL bool spa_pod_is_inside(const void *pod, uint32_t size, const void *iter) { size_t remaining; @@ -34,17 +34,17 @@ static inline bool spa_pod_is_inside(const void *pod, uint32_t size, const void remaining >= SPA_POD_BODY_SIZE(iter); } -static inline void *spa_pod_next(const void *iter) +SPA_API_IMPL void *spa_pod_next(const void *iter) { return SPA_PTROFF(iter, SPA_ROUND_UP_N(SPA_POD_SIZE(iter), 8), void); } -static inline struct spa_pod_prop *spa_pod_prop_first(const struct spa_pod_object_body *body) +SPA_API_IMPL struct spa_pod_prop *spa_pod_prop_first(const struct spa_pod_object_body *body) { return SPA_PTROFF(body, sizeof(struct spa_pod_object_body), struct spa_pod_prop); } -static inline bool spa_pod_prop_is_inside(const struct spa_pod_object_body *body, +SPA_API_IMPL bool spa_pod_prop_is_inside(const struct spa_pod_object_body *body, uint32_t size, const struct spa_pod_prop *iter) { size_t remaining; @@ -53,17 +53,17 @@ static inline bool spa_pod_prop_is_inside(const struct spa_pod_object_body *body remaining >= iter->value.size; } -static inline struct spa_pod_prop *spa_pod_prop_next(const struct spa_pod_prop *iter) +SPA_API_IMPL struct spa_pod_prop *spa_pod_prop_next(const struct spa_pod_prop *iter) { return SPA_PTROFF(iter, SPA_ROUND_UP_N(SPA_POD_PROP_SIZE(iter), 8), struct spa_pod_prop); } -static inline struct spa_pod_control *spa_pod_control_first(const struct spa_pod_sequence_body *body) +SPA_API_IMPL struct spa_pod_control *spa_pod_control_first(const struct spa_pod_sequence_body *body) { return SPA_PTROFF(body, sizeof(struct spa_pod_sequence_body), struct spa_pod_control); } -static inline bool spa_pod_control_is_inside(const struct spa_pod_sequence_body *body, +SPA_API_IMPL bool spa_pod_control_is_inside(const struct spa_pod_sequence_body *body, uint32_t size, const struct spa_pod_control *iter) { size_t remaining; @@ -72,7 +72,7 @@ static inline bool spa_pod_control_is_inside(const struct spa_pod_sequence_body remaining >= iter->value.size; } -static inline struct spa_pod_control *spa_pod_control_next(const struct spa_pod_control *iter) +SPA_API_IMPL struct spa_pod_control *spa_pod_control_next(const struct spa_pod_control *iter) { return SPA_PTROFF(iter, SPA_ROUND_UP_N(SPA_POD_CONTROL_SIZE(iter), 8), struct spa_pod_control); } @@ -118,7 +118,7 @@ static inline struct spa_pod_control *spa_pod_control_next(const struct spa_pod_ SPA_POD_SEQUENCE_BODY_FOREACH(&(seq)->body, SPA_POD_BODY_SIZE(seq), iter) -static inline void *spa_pod_from_data(void *data, size_t maxsize, off_t offset, size_t size) +SPA_API_IMPL void *spa_pod_from_data(void *data, size_t maxsize, off_t offset, size_t size) { void *pod; if (size < sizeof(struct spa_pod) || offset + size > maxsize) @@ -129,17 +129,17 @@ static inline void *spa_pod_from_data(void *data, size_t maxsize, off_t offset, return pod; } -static inline int spa_pod_is_none(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_none(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_None); } -static inline int spa_pod_is_bool(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_bool(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Bool && SPA_POD_BODY_SIZE(pod) >= sizeof(int32_t)); } -static inline int spa_pod_get_bool(const struct spa_pod *pod, bool *value) +SPA_API_IMPL int spa_pod_get_bool(const struct spa_pod *pod, bool *value) { if (!spa_pod_is_bool(pod)) return -EINVAL; @@ -147,12 +147,12 @@ static inline int spa_pod_get_bool(const struct spa_pod *pod, bool *value) return 0; } -static inline int spa_pod_is_id(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_id(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Id && SPA_POD_BODY_SIZE(pod) >= sizeof(uint32_t)); } -static inline int spa_pod_get_id(const struct spa_pod *pod, uint32_t *value) +SPA_API_IMPL int spa_pod_get_id(const struct spa_pod *pod, uint32_t *value) { if (!spa_pod_is_id(pod)) return -EINVAL; @@ -160,12 +160,12 @@ static inline int spa_pod_get_id(const struct spa_pod *pod, uint32_t *value) return 0; } -static inline int spa_pod_is_int(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_int(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Int && SPA_POD_BODY_SIZE(pod) >= sizeof(int32_t)); } -static inline int spa_pod_get_int(const struct spa_pod *pod, int32_t *value) +SPA_API_IMPL int spa_pod_get_int(const struct spa_pod *pod, int32_t *value) { if (!spa_pod_is_int(pod)) return -EINVAL; @@ -173,12 +173,12 @@ static inline int spa_pod_get_int(const struct spa_pod *pod, int32_t *value) return 0; } -static inline int spa_pod_is_long(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_long(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Long && SPA_POD_BODY_SIZE(pod) >= sizeof(int64_t)); } -static inline int spa_pod_get_long(const struct spa_pod *pod, int64_t *value) +SPA_API_IMPL int spa_pod_get_long(const struct spa_pod *pod, int64_t *value) { if (!spa_pod_is_long(pod)) return -EINVAL; @@ -186,12 +186,12 @@ static inline int spa_pod_get_long(const struct spa_pod *pod, int64_t *value) return 0; } -static inline int spa_pod_is_float(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_float(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Float && SPA_POD_BODY_SIZE(pod) >= sizeof(float)); } -static inline int spa_pod_get_float(const struct spa_pod *pod, float *value) +SPA_API_IMPL int spa_pod_get_float(const struct spa_pod *pod, float *value) { if (!spa_pod_is_float(pod)) return -EINVAL; @@ -199,12 +199,12 @@ static inline int spa_pod_get_float(const struct spa_pod *pod, float *value) return 0; } -static inline int spa_pod_is_double(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_double(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Double && SPA_POD_BODY_SIZE(pod) >= sizeof(double)); } -static inline int spa_pod_get_double(const struct spa_pod *pod, double *value) +SPA_API_IMPL int spa_pod_get_double(const struct spa_pod *pod, double *value) { if (!spa_pod_is_double(pod)) return -EINVAL; @@ -212,7 +212,7 @@ static inline int spa_pod_get_double(const struct spa_pod *pod, double *value) return 0; } -static inline int spa_pod_is_string(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_string(const struct spa_pod *pod) { const char *s = (const char *)SPA_POD_CONTENTS(struct spa_pod_string, pod); return (SPA_POD_TYPE(pod) == SPA_TYPE_String && @@ -220,7 +220,7 @@ static inline int spa_pod_is_string(const struct spa_pod *pod) s[SPA_POD_BODY_SIZE(pod)-1] == '\0'); } -static inline int spa_pod_get_string(const struct spa_pod *pod, const char **value) +SPA_API_IMPL int spa_pod_get_string(const struct spa_pod *pod, const char **value) { if (!spa_pod_is_string(pod)) return -EINVAL; @@ -228,7 +228,7 @@ static inline int spa_pod_get_string(const struct spa_pod *pod, const char **val return 0; } -static inline int spa_pod_copy_string(const struct spa_pod *pod, size_t maxlen, char *dest) +SPA_API_IMPL int spa_pod_copy_string(const struct spa_pod *pod, size_t maxlen, char *dest) { const char *s = (const char *)SPA_POD_CONTENTS(struct spa_pod_string, pod); if (!spa_pod_is_string(pod) || maxlen < 1) @@ -238,12 +238,12 @@ static inline int spa_pod_copy_string(const struct spa_pod *pod, size_t maxlen, return 0; } -static inline int spa_pod_is_bytes(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_bytes(const struct spa_pod *pod) { return SPA_POD_TYPE(pod) == SPA_TYPE_Bytes; } -static inline int spa_pod_get_bytes(const struct spa_pod *pod, const void **value, uint32_t *len) +SPA_API_IMPL int spa_pod_get_bytes(const struct spa_pod *pod, const void **value, uint32_t *len) { if (!spa_pod_is_bytes(pod)) return -EINVAL; @@ -252,13 +252,13 @@ static inline int spa_pod_get_bytes(const struct spa_pod *pod, const void **valu return 0; } -static inline int spa_pod_is_pointer(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_pointer(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Pointer && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_pod_pointer_body)); } -static inline int spa_pod_get_pointer(const struct spa_pod *pod, uint32_t *type, const void **value) +SPA_API_IMPL int spa_pod_get_pointer(const struct spa_pod *pod, uint32_t *type, const void **value) { if (!spa_pod_is_pointer(pod)) return -EINVAL; @@ -267,13 +267,13 @@ static inline int spa_pod_get_pointer(const struct spa_pod *pod, uint32_t *type, return 0; } -static inline int spa_pod_is_fd(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_fd(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Fd && SPA_POD_BODY_SIZE(pod) >= sizeof(int64_t)); } -static inline int spa_pod_get_fd(const struct spa_pod *pod, int64_t *value) +SPA_API_IMPL int spa_pod_get_fd(const struct spa_pod *pod, int64_t *value) { if (!spa_pod_is_fd(pod)) return -EINVAL; @@ -281,13 +281,13 @@ static inline int spa_pod_get_fd(const struct spa_pod *pod, int64_t *value) return 0; } -static inline int spa_pod_is_rectangle(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_rectangle(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Rectangle && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_rectangle)); } -static inline int spa_pod_get_rectangle(const struct spa_pod *pod, struct spa_rectangle *value) +SPA_API_IMPL int spa_pod_get_rectangle(const struct spa_pod *pod, struct spa_rectangle *value) { if (!spa_pod_is_rectangle(pod)) return -EINVAL; @@ -295,39 +295,39 @@ static inline int spa_pod_get_rectangle(const struct spa_pod *pod, struct spa_re return 0; } -static inline int spa_pod_is_fraction(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_fraction(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Fraction && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_fraction)); } -static inline int spa_pod_get_fraction(const struct spa_pod *pod, struct spa_fraction *value) +SPA_API_IMPL int spa_pod_get_fraction(const struct spa_pod *pod, struct spa_fraction *value) { spa_return_val_if_fail(spa_pod_is_fraction(pod), -EINVAL); *value = SPA_POD_VALUE(struct spa_pod_fraction, pod); return 0; } -static inline int spa_pod_is_bitmap(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_bitmap(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Bitmap && SPA_POD_BODY_SIZE(pod) >= sizeof(uint8_t)); } -static inline int spa_pod_is_array(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_array(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Array && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_pod_array_body)); } -static inline void *spa_pod_get_array(const struct spa_pod *pod, uint32_t *n_values) +SPA_API_IMPL void *spa_pod_get_array(const struct spa_pod *pod, uint32_t *n_values) { spa_return_val_if_fail(spa_pod_is_array(pod), NULL); *n_values = SPA_POD_ARRAY_N_VALUES(pod); return SPA_POD_ARRAY_VALUES(pod); } -static inline uint32_t spa_pod_copy_array(const struct spa_pod *pod, uint32_t type, +SPA_API_IMPL uint32_t spa_pod_copy_array(const struct spa_pod *pod, uint32_t type, void *values, uint32_t max_values) { uint32_t n_values; @@ -339,13 +339,13 @@ static inline uint32_t spa_pod_copy_array(const struct spa_pod *pod, uint32_t ty return n_values; } -static inline int spa_pod_is_choice(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_choice(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Choice && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_pod_choice_body)); } -static inline struct spa_pod *spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice) +SPA_API_IMPL struct spa_pod *spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice) { if (pod->type == SPA_TYPE_Choice) { *n_vals = SPA_POD_CHOICE_N_VALUES(pod); @@ -359,34 +359,34 @@ static inline struct spa_pod *spa_pod_get_values(const struct spa_pod *pod, uint } } -static inline int spa_pod_is_struct(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_struct(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Struct); } -static inline int spa_pod_is_object(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_object(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Object && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_pod_object_body)); } -static inline bool spa_pod_is_object_type(const struct spa_pod *pod, uint32_t type) +SPA_API_IMPL bool spa_pod_is_object_type(const struct spa_pod *pod, uint32_t type) { return (pod && spa_pod_is_object(pod) && SPA_POD_OBJECT_TYPE(pod) == type); } -static inline bool spa_pod_is_object_id(const struct spa_pod *pod, uint32_t id) +SPA_API_IMPL bool spa_pod_is_object_id(const struct spa_pod *pod, uint32_t id) { return (pod && spa_pod_is_object(pod) && SPA_POD_OBJECT_ID(pod) == id); } -static inline int spa_pod_is_sequence(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_sequence(const struct spa_pod *pod) { return (SPA_POD_TYPE(pod) == SPA_TYPE_Sequence && SPA_POD_BODY_SIZE(pod) >= sizeof(struct spa_pod_sequence_body)); } -static inline const struct spa_pod_prop *spa_pod_object_find_prop(const struct spa_pod_object *pod, +SPA_API_IMPL const struct spa_pod_prop *spa_pod_object_find_prop(const struct spa_pod_object *pod, const struct spa_pod_prop *start, uint32_t key) { const struct spa_pod_prop *first, *res; @@ -406,7 +406,7 @@ static inline const struct spa_pod_prop *spa_pod_object_find_prop(const struct s return NULL; } -static inline const struct spa_pod_prop *spa_pod_find_prop(const struct spa_pod *pod, +SPA_API_IMPL const struct spa_pod_prop *spa_pod_find_prop(const struct spa_pod *pod, const struct spa_pod_prop *start, uint32_t key) { if (!spa_pod_is_object(pod)) @@ -414,7 +414,7 @@ static inline const struct spa_pod_prop *spa_pod_find_prop(const struct spa_pod return spa_pod_object_find_prop((const struct spa_pod_object *)pod, start, key); } -static inline int spa_pod_object_fixate(struct spa_pod_object *pod) +SPA_API_IMPL int spa_pod_object_fixate(struct spa_pod_object *pod) { struct spa_pod_prop *res; SPA_POD_OBJECT_FOREACH(pod, res) { @@ -425,14 +425,14 @@ static inline int spa_pod_object_fixate(struct spa_pod_object *pod) return 0; } -static inline int spa_pod_fixate(struct spa_pod *pod) +SPA_API_IMPL int spa_pod_fixate(struct spa_pod *pod) { if (!spa_pod_is_object(pod)) return -EINVAL; return spa_pod_object_fixate((struct spa_pod_object *)pod); } -static inline int spa_pod_object_is_fixated(const struct spa_pod_object *pod) +SPA_API_IMPL int spa_pod_object_is_fixated(const struct spa_pod_object *pod) { struct spa_pod_prop *res; SPA_POD_OBJECT_FOREACH(pod, res) { @@ -443,7 +443,7 @@ static inline int spa_pod_object_is_fixated(const struct spa_pod_object *pod) return 1; } -static inline int spa_pod_object_has_props(const struct spa_pod_object *pod) +SPA_API_IMPL int spa_pod_object_has_props(const struct spa_pod_object *pod) { struct spa_pod_prop *res; SPA_POD_OBJECT_FOREACH(pod, res) @@ -451,7 +451,7 @@ static inline int spa_pod_object_has_props(const struct spa_pod_object *pod) return 0; } -static inline int spa_pod_is_fixated(const struct spa_pod *pod) +SPA_API_IMPL int spa_pod_is_fixated(const struct spa_pod *pod) { if (!spa_pod_is_object(pod)) return -EINVAL; diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index 4c1e72acc..66a03aab7 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -35,31 +35,31 @@ struct spa_pod_parser { #define SPA_POD_PARSER_INIT(buffer,size) ((struct spa_pod_parser){ (buffer), (size), 0, {0,0,NULL}}) -static inline void spa_pod_parser_init(struct spa_pod_parser *parser, +SPA_API_IMPL void spa_pod_parser_init(struct spa_pod_parser *parser, const void *data, uint32_t size) { *parser = SPA_POD_PARSER_INIT(data, size); } -static inline void spa_pod_parser_pod(struct spa_pod_parser *parser, +SPA_API_IMPL void spa_pod_parser_pod(struct spa_pod_parser *parser, const struct spa_pod *pod) { spa_pod_parser_init(parser, pod, SPA_POD_SIZE(pod)); } -static inline void +SPA_API_IMPL void spa_pod_parser_get_state(struct spa_pod_parser *parser, struct spa_pod_parser_state *state) { *state = parser->state; } -static inline void +SPA_API_IMPL void spa_pod_parser_reset(struct spa_pod_parser *parser, struct spa_pod_parser_state *state) { parser->state = *state; } -static inline struct spa_pod * +SPA_API_IMPL struct spa_pod * spa_pod_parser_deref(struct spa_pod_parser *parser, uint32_t offset, uint32_t size) { /* Cast to uint64_t to avoid wraparound. Add 8 for the pod itself. */ @@ -78,12 +78,12 @@ spa_pod_parser_deref(struct spa_pod_parser *parser, uint32_t offset, uint32_t si return NULL; } -static inline struct spa_pod *spa_pod_parser_frame(struct spa_pod_parser *parser, struct spa_pod_frame *frame) +SPA_API_IMPL struct spa_pod *spa_pod_parser_frame(struct spa_pod_parser *parser, struct spa_pod_frame *frame) { return SPA_PTROFF(parser->data, frame->offset, struct spa_pod); } -static inline void spa_pod_parser_push(struct spa_pod_parser *parser, +SPA_API_IMPL void spa_pod_parser_push(struct spa_pod_parser *parser, struct spa_pod_frame *frame, const struct spa_pod *pod, uint32_t offset) { frame->pod = *pod; @@ -93,19 +93,19 @@ static inline void spa_pod_parser_push(struct spa_pod_parser *parser, parser->state.frame = frame; } -static inline struct spa_pod *spa_pod_parser_current(struct spa_pod_parser *parser) +SPA_API_IMPL struct spa_pod *spa_pod_parser_current(struct spa_pod_parser *parser) { struct spa_pod_frame *f = parser->state.frame; uint32_t size = f ? f->offset + SPA_POD_SIZE(&f->pod) : parser->size; return spa_pod_parser_deref(parser, parser->state.offset, size); } -static inline void spa_pod_parser_advance(struct spa_pod_parser *parser, const struct spa_pod *pod) +SPA_API_IMPL void spa_pod_parser_advance(struct spa_pod_parser *parser, const struct spa_pod *pod) { parser->state.offset += SPA_ROUND_UP_N(SPA_POD_SIZE(pod), 8); } -static inline struct spa_pod *spa_pod_parser_next(struct spa_pod_parser *parser) +SPA_API_IMPL struct spa_pod *spa_pod_parser_next(struct spa_pod_parser *parser) { struct spa_pod *pod = spa_pod_parser_current(parser); if (pod) @@ -113,7 +113,7 @@ static inline struct spa_pod *spa_pod_parser_next(struct spa_pod_parser *parser) return pod; } -static inline int spa_pod_parser_pop(struct spa_pod_parser *parser, +SPA_API_IMPL int spa_pod_parser_pop(struct spa_pod_parser *parser, struct spa_pod_frame *frame) { parser->state.frame = frame->parent; @@ -121,7 +121,7 @@ static inline int spa_pod_parser_pop(struct spa_pod_parser *parser, return 0; } -static inline int spa_pod_parser_get_bool(struct spa_pod_parser *parser, bool *value) +SPA_API_IMPL int spa_pod_parser_get_bool(struct spa_pod_parser *parser, bool *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -130,7 +130,7 @@ static inline int spa_pod_parser_get_bool(struct spa_pod_parser *parser, bool *v return res; } -static inline int spa_pod_parser_get_id(struct spa_pod_parser *parser, uint32_t *value) +SPA_API_IMPL int spa_pod_parser_get_id(struct spa_pod_parser *parser, uint32_t *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -139,7 +139,7 @@ static inline int spa_pod_parser_get_id(struct spa_pod_parser *parser, uint32_t return res; } -static inline int spa_pod_parser_get_int(struct spa_pod_parser *parser, int32_t *value) +SPA_API_IMPL int spa_pod_parser_get_int(struct spa_pod_parser *parser, int32_t *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -148,7 +148,7 @@ static inline int spa_pod_parser_get_int(struct spa_pod_parser *parser, int32_t return res; } -static inline int spa_pod_parser_get_long(struct spa_pod_parser *parser, int64_t *value) +SPA_API_IMPL int spa_pod_parser_get_long(struct spa_pod_parser *parser, int64_t *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -157,7 +157,7 @@ static inline int spa_pod_parser_get_long(struct spa_pod_parser *parser, int64_t return res; } -static inline int spa_pod_parser_get_float(struct spa_pod_parser *parser, float *value) +SPA_API_IMPL int spa_pod_parser_get_float(struct spa_pod_parser *parser, float *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -166,7 +166,7 @@ static inline int spa_pod_parser_get_float(struct spa_pod_parser *parser, float return res; } -static inline int spa_pod_parser_get_double(struct spa_pod_parser *parser, double *value) +SPA_API_IMPL int spa_pod_parser_get_double(struct spa_pod_parser *parser, double *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -175,7 +175,7 @@ static inline int spa_pod_parser_get_double(struct spa_pod_parser *parser, doubl return res; } -static inline int spa_pod_parser_get_string(struct spa_pod_parser *parser, const char **value) +SPA_API_IMPL int spa_pod_parser_get_string(struct spa_pod_parser *parser, const char **value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -184,7 +184,7 @@ static inline int spa_pod_parser_get_string(struct spa_pod_parser *parser, const return res; } -static inline int spa_pod_parser_get_bytes(struct spa_pod_parser *parser, const void **value, uint32_t *len) +SPA_API_IMPL int spa_pod_parser_get_bytes(struct spa_pod_parser *parser, const void **value, uint32_t *len) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -193,7 +193,7 @@ static inline int spa_pod_parser_get_bytes(struct spa_pod_parser *parser, const return res; } -static inline int spa_pod_parser_get_pointer(struct spa_pod_parser *parser, uint32_t *type, const void **value) +SPA_API_IMPL int spa_pod_parser_get_pointer(struct spa_pod_parser *parser, uint32_t *type, const void **value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -202,7 +202,7 @@ static inline int spa_pod_parser_get_pointer(struct spa_pod_parser *parser, uint return res; } -static inline int spa_pod_parser_get_fd(struct spa_pod_parser *parser, int64_t *value) +SPA_API_IMPL int spa_pod_parser_get_fd(struct spa_pod_parser *parser, int64_t *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -211,7 +211,7 @@ static inline int spa_pod_parser_get_fd(struct spa_pod_parser *parser, int64_t * return res; } -static inline int spa_pod_parser_get_rectangle(struct spa_pod_parser *parser, struct spa_rectangle *value) +SPA_API_IMPL int spa_pod_parser_get_rectangle(struct spa_pod_parser *parser, struct spa_rectangle *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -220,7 +220,7 @@ static inline int spa_pod_parser_get_rectangle(struct spa_pod_parser *parser, st return res; } -static inline int spa_pod_parser_get_fraction(struct spa_pod_parser *parser, struct spa_fraction *value) +SPA_API_IMPL int spa_pod_parser_get_fraction(struct spa_pod_parser *parser, struct spa_fraction *value) { int res = -EPIPE; const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -229,7 +229,7 @@ static inline int spa_pod_parser_get_fraction(struct spa_pod_parser *parser, str return res; } -static inline int spa_pod_parser_get_pod(struct spa_pod_parser *parser, struct spa_pod **value) +SPA_API_IMPL int spa_pod_parser_get_pod(struct spa_pod_parser *parser, struct spa_pod **value) { struct spa_pod *pod = spa_pod_parser_current(parser); if (pod == NULL) @@ -238,7 +238,7 @@ static inline int spa_pod_parser_get_pod(struct spa_pod_parser *parser, struct s spa_pod_parser_advance(parser, pod); return 0; } -static inline int spa_pod_parser_push_struct(struct spa_pod_parser *parser, +SPA_API_IMPL int spa_pod_parser_push_struct(struct spa_pod_parser *parser, struct spa_pod_frame *frame) { const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -251,7 +251,7 @@ static inline int spa_pod_parser_push_struct(struct spa_pod_parser *parser, return 0; } -static inline int spa_pod_parser_push_object(struct spa_pod_parser *parser, +SPA_API_IMPL int spa_pod_parser_push_object(struct spa_pod_parser *parser, struct spa_pod_frame *frame, uint32_t type, uint32_t *id) { const struct spa_pod *pod = spa_pod_parser_current(parser); @@ -268,7 +268,7 @@ static inline int spa_pod_parser_push_object(struct spa_pod_parser *parser, return 0; } -static inline bool spa_pod_parser_can_collect(const struct spa_pod *pod, char type) +SPA_API_IMPL bool spa_pod_parser_can_collect(const struct spa_pod *pod, char type) { if (pod == NULL) return false; @@ -443,7 +443,7 @@ do { \ } \ } while(false) -static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, va_list args) +SPA_API_IMPL int spa_pod_parser_getv(struct spa_pod_parser *parser, va_list args) { struct spa_pod_frame *f = parser->state.frame; uint32_t ftype = f ? f->pod.type : (uint32_t)SPA_TYPE_Struct; @@ -496,7 +496,7 @@ static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, va_list arg return count; } -static inline int spa_pod_parser_get(struct spa_pod_parser *parser, ...) +SPA_API_IMPL int spa_pod_parser_get(struct spa_pod_parser *parser, ...) { int res; va_list args; diff --git a/spa/include/spa/support/cpu.h b/spa/include/spa/support/cpu.h index 4f61bd0c3..acc407c83 100644 --- a/spa/include/spa/support/cpu.h +++ b/spa/include/spa/support/cpu.h @@ -91,7 +91,7 @@ struct spa_cpu { struct spa_interface iface; }; #define SPA_CPU_VM_ACRN (1 << 13) #define SPA_CPU_VM_POWERVM (1 << 14) -static inline const char *spa_cpu_vm_type_to_string(uint32_t vm_type) +SPA_API_IMPL const char *spa_cpu_vm_type_to_string(uint32_t vm_type) { switch(vm_type) { case SPA_CPU_VM_NONE: @@ -160,27 +160,27 @@ struct spa_cpu_methods { int (*zero_denormals) (void *object, bool enable); }; -static inline uint32_t spa_cpu_get_flags(struct spa_cpu *c) +SPA_API_IMPL 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); } -static inline int spa_cpu_force_flags(struct spa_cpu *c, uint32_t flags) +SPA_API_IMPL 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); } -static inline uint32_t spa_cpu_get_count(struct spa_cpu *c) +SPA_API_IMPL 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); } -static inline uint32_t spa_cpu_get_max_align(struct spa_cpu *c) +SPA_API_IMPL 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); } -static inline uint32_t spa_cpu_get_vm_type(struct spa_cpu *c) +SPA_API_IMPL 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); } -static inline int spa_cpu_zero_denormals(struct spa_cpu *c, bool enable) +SPA_API_IMPL 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); } diff --git a/spa/include/spa/support/dbus.h b/spa/include/spa/support/dbus.h index 52da0457b..a958e9dfa 100644 --- a/spa/include/spa/support/dbus.h +++ b/spa/include/spa/support/dbus.h @@ -81,19 +81,19 @@ struct spa_dbus_connection { /** \copydoc spa_dbus_connection.get * \sa spa_dbus_connection.get */ -static inline void *spa_dbus_connection_get(struct spa_dbus_connection *conn) +SPA_API_IMPL 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 */ -static inline void spa_dbus_connection_destroy(struct spa_dbus_connection *conn) +SPA_API_IMPL 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 */ -static inline void spa_dbus_connection_add_listener(struct spa_dbus_connection *conn, +SPA_API_IMPL 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 +124,7 @@ struct spa_dbus_methods { /** \copydoc spa_dbus_methods.get_connection * \sa spa_dbus_methods.get_connection */ -static inline struct spa_dbus_connection * +SPA_API_IMPL 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, diff --git a/spa/include/spa/support/i18n.h b/spa/include/spa/support/i18n.h index b53ce42d7..4a602c4e8 100644 --- a/spa/include/spa/support/i18n.h +++ b/spa/include/spa/support/i18n.h @@ -53,14 +53,14 @@ struct spa_i18n_methods { }; SPA_FORMAT_ARG_FUNC(2) -static inline const char * +SPA_API_IMPL 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); } -static inline const char * +SPA_API_IMPL const char * spa_i18n_ntext(struct spa_i18n *i18n, const char *msgid, const char *msgid_plural, unsigned long int n) { diff --git a/spa/include/spa/support/log-impl.h b/spa/include/spa/support/log-impl.h index 8132d05bf..293589e8e 100644 --- a/spa/include/spa/support/log-impl.h +++ b/spa/include/spa/support/log-impl.h @@ -19,7 +19,7 @@ extern "C" { * \{ */ -static inline SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNUSED, +SPA_API_IMPL 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 @@ static inline SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNU fputs(location, stderr); } -static inline SPA_PRINTF_FUNC(7,8) void spa_log_impl_logt(void *object, +SPA_API_IMPL 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 @@ static inline SPA_PRINTF_FUNC(7,8) void spa_log_impl_logt(void *object, va_end(args); } -static inline SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object, +SPA_API_IMPL 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 @@ static inline SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object, spa_log_impl_logtv(object, level, NULL, file, line, func, fmt, args); } -static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object, +SPA_API_IMPL 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 @@ static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object, va_end(args); } -static inline void spa_log_impl_topic_init(void *object SPA_UNUSED, struct spa_log_topic *topic SPA_UNUSED) +SPA_API_IMPL void spa_log_impl_topic_init(void *object SPA_UNUSED, struct spa_log_topic *topic SPA_UNUSED) { /* noop */ } diff --git a/spa/include/spa/support/log.h b/spa/include/spa/support/log.h index 640a1cd01..135e6b507 100644 --- a/spa/include/spa/support/log.h +++ b/spa/include/spa/support/log.h @@ -213,7 +213,7 @@ struct spa_log_methods { #define SPA_LOG_TOPIC(v, t) \ (struct spa_log_topic){ .version = (v), .topic = (t)} -static inline void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic) +SPA_API_IMPL void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic) { if (SPA_UNLIKELY(!log)) return; @@ -221,7 +221,7 @@ static inline 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); } -static inline bool spa_log_level_topic_enabled(const struct spa_log *log, +SPA_API_IMPL bool spa_log_level_topic_enabled(const struct spa_log *log, const struct spa_log_topic *topic, enum spa_log_level level) { @@ -256,7 +256,7 @@ static inline 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) -static inline void spa_log_logtv(struct spa_log *l, enum spa_log_level level, +SPA_API_IMPL 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) { diff --git a/spa/include/spa/support/loop.h b/spa/include/spa/support/loop.h index 4dd532cc7..75b137f99 100644 --- a/spa/include/spa/support/loop.h +++ b/spa/include/spa/support/loop.h @@ -127,22 +127,22 @@ struct spa_loop_methods { void *user_data); }; -static inline int spa_loop_add_source(struct spa_loop *object, struct spa_source *source) +SPA_API_IMPL 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); } -static inline int spa_loop_update_source(struct spa_loop *object, struct spa_source *source) +SPA_API_IMPL 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); } -static inline int spa_loop_remove_source(struct spa_loop *object, struct spa_source *source) +SPA_API_IMPL 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); } -static inline int spa_loop_invoke(struct spa_loop *object, +SPA_API_IMPL 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 +165,14 @@ struct spa_loop_control_hooks { void (*after) (void *data); }; -static inline void spa_loop_control_hook_before(struct spa_hook_list *l) +SPA_API_IMPL 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); } -static inline void spa_loop_control_hook_after(struct spa_hook_list *l) +SPA_API_IMPL 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 +239,39 @@ struct spa_loop_control_methods { int (*check) (void *object); }; -static inline int spa_loop_control_get_fd(struct spa_loop_control *object) +SPA_API_IMPL 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); } -static inline void spa_loop_control_add_hook(struct spa_loop_control *object, +SPA_API_IMPL 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); } -static inline void spa_loop_control_enter(struct spa_loop_control *object) +SPA_API_IMPL void spa_loop_control_enter(struct spa_loop_control *object) { spa_api_method_v(spa_loop_control, &object->iface, enter, 0); } -static inline void spa_loop_control_leave(struct spa_loop_control *object) +SPA_API_IMPL void spa_loop_control_leave(struct spa_loop_control *object) { spa_api_method_v(spa_loop_control, &object->iface, leave, 0); } -static inline int spa_loop_control_iterate(struct spa_loop_control *object, +SPA_API_IMPL 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); } -static inline int spa_loop_control_iterate_fast(struct spa_loop_control *object, +SPA_API_IMPL 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); } -static inline int spa_loop_control_check(struct spa_loop_control *object) +SPA_API_IMPL 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 +326,51 @@ struct spa_loop_utils_methods { void (*destroy_source) (void *object, struct spa_source *source); }; -static inline struct spa_source * +SPA_API_IMPL 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); } -static inline int spa_loop_utils_update_io(struct spa_loop_utils *object, +SPA_API_IMPL 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); } -static inline struct spa_source * +SPA_API_IMPL 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); } -static inline int spa_loop_utils_enable_idle(struct spa_loop_utils *object, +SPA_API_IMPL 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); } -static inline struct spa_source * +SPA_API_IMPL 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); } -static inline int spa_loop_utils_signal_event(struct spa_loop_utils *object, +SPA_API_IMPL 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); } -static inline struct spa_source * +SPA_API_IMPL 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); } -static inline int spa_loop_utils_update_timer(struct spa_loop_utils *object, +SPA_API_IMPL 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 +378,7 @@ static inline int spa_loop_utils_update_timer(struct spa_loop_utils *object, spa_loop_utils, &object->iface, update_timer, 0, source, value, interval, absolute); } -static inline struct spa_source * +SPA_API_IMPL 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 +386,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); } -static inline void spa_loop_utils_destroy_source(struct spa_loop_utils *object, +SPA_API_IMPL 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); diff --git a/spa/include/spa/support/plugin-loader.h b/spa/include/spa/support/plugin-loader.h index e8519be69..dffe21f9c 100644 --- a/spa/include/spa/support/plugin-loader.h +++ b/spa/include/spa/support/plugin-loader.h @@ -48,14 +48,14 @@ struct spa_plugin_loader_methods { int (*unload)(void *object, struct spa_handle *handle); }; -static inline struct spa_handle * +SPA_API_IMPL 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); } -static inline int +SPA_API_IMPL 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, diff --git a/spa/include/spa/support/plugin.h b/spa/include/spa/support/plugin.h index 12ab8140a..c5fb99619 100644 --- a/spa/include/spa/support/plugin.h +++ b/spa/include/spa/support/plugin.h @@ -54,13 +54,13 @@ struct spa_handle { int (*clear) (struct spa_handle *handle); }; -static inline int +SPA_API_IMPL 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); } -static inline int +SPA_API_IMPL int spa_handle_clear(struct spa_handle *object) { return spa_api_func_r(int, -ENOTSUP, object, clear, 0); @@ -85,7 +85,7 @@ struct spa_support { }; /** Find a support item of the given type */ -static inline void *spa_support_find(const struct spa_support *support, +SPA_API_IMPL void *spa_support_find(const struct spa_support *support, uint32_t n_support, const char *type) { @@ -170,13 +170,13 @@ struct spa_handle_factory { uint32_t *index); }; -static inline size_t +SPA_API_IMPL 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); } -static inline int +SPA_API_IMPL 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 +184,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); } -static inline int +SPA_API_IMPL int spa_handle_factory_enum_interface_info(const struct spa_handle_factory *object, const struct spa_interface_info **info, uint32_t *index) { diff --git a/spa/include/spa/support/system.h b/spa/include/spa/support/system.h index 88d3a6eef..a65ca1f11 100644 --- a/spa/include/spa/support/system.h +++ b/spa/include/spa/support/system.h @@ -98,60 +98,60 @@ struct spa_system_methods { int (*signalfd_read) (void *object, int fd, int *signal); }; -static inline ssize_t spa_system_read(struct spa_system *object, int fd, void *buf, size_t count) +SPA_API_IMPL 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); } -static inline ssize_t spa_system_write(struct spa_system *object, int fd, const void *buf, size_t count) +SPA_API_IMPL 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__) -static inline int spa_system_close(struct spa_system *object, int fd) +SPA_API_IMPL 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); } -static inline int spa_system_clock_gettime(struct spa_system *object, +SPA_API_IMPL 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); } -static inline int spa_system_clock_getres(struct spa_system *object, +SPA_API_IMPL 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); } -static inline int spa_system_pollfd_create(struct spa_system *object, int flags) +SPA_API_IMPL 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); } -static inline int spa_system_pollfd_add(struct spa_system *object, int pfd, int fd, uint32_t events, void *data) +SPA_API_IMPL 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); } -static inline int spa_system_pollfd_mod(struct spa_system *object, int pfd, int fd, uint32_t events, void *data) +SPA_API_IMPL 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); } -static inline int spa_system_pollfd_del(struct spa_system *object, int pfd, int fd) +SPA_API_IMPL 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); } -static inline int spa_system_pollfd_wait(struct spa_system *object, int pfd, +SPA_API_IMPL 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); } -static inline int spa_system_timerfd_create(struct spa_system *object, int clockid, int flags) +SPA_API_IMPL 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); } -static inline int spa_system_timerfd_settime(struct spa_system *object, +SPA_API_IMPL int spa_system_timerfd_settime(struct spa_system *object, int fd, int flags, const struct itimerspec *new_value, struct itimerspec *old_value) @@ -160,40 +160,40 @@ static inline int spa_system_timerfd_settime(struct spa_system *object, fd, flags, new_value, old_value); } -static inline int spa_system_timerfd_gettime(struct spa_system *object, +SPA_API_IMPL 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); } -static inline int spa_system_timerfd_read(struct spa_system *object, int fd, uint64_t *expirations) +SPA_API_IMPL 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); } -static inline int spa_system_eventfd_create(struct spa_system *object, int flags) +SPA_API_IMPL 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); } -static inline int spa_system_eventfd_write(struct spa_system *object, int fd, uint64_t count) +SPA_API_IMPL 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); } -static inline int spa_system_eventfd_read(struct spa_system *object, int fd, uint64_t *count) +SPA_API_IMPL 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); } -static inline int spa_system_signalfd_create(struct spa_system *object, int signal, int flags) +SPA_API_IMPL 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); } -static inline int spa_system_signalfd_read(struct spa_system *object, int fd, int *signal) +SPA_API_IMPL 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); diff --git a/spa/include/spa/support/thread.h b/spa/include/spa/support/thread.h index 29baa5882..2d672b49a 100644 --- a/spa/include/spa/support/thread.h +++ b/spa/include/spa/support/thread.h @@ -58,7 +58,7 @@ struct spa_thread_utils_methods { /** \copydoc spa_thread_utils_methods.create * \sa spa_thread_utils_methods.create */ -static inline struct spa_thread *spa_thread_utils_create(struct spa_thread_utils *o, +SPA_API_IMPL 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 +68,7 @@ static inline struct spa_thread *spa_thread_utils_create(struct spa_thread_utils /** \copydoc spa_thread_utils_methods.join * \sa spa_thread_utils_methods.join */ -static inline int spa_thread_utils_join(struct spa_thread_utils *o, +SPA_API_IMPL 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 +78,7 @@ static inline 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 */ -static inline int spa_thread_utils_get_rt_range(struct spa_thread_utils *o, +SPA_API_IMPL 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 +88,7 @@ static inline 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 */ -static inline int spa_thread_utils_acquire_rt(struct spa_thread_utils *o, +SPA_API_IMPL 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 +98,7 @@ static inline 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 */ -static inline int spa_thread_utils_drop_rt(struct spa_thread_utils *o, +SPA_API_IMPL int spa_thread_utils_drop_rt(struct spa_thread_utils *o, struct spa_thread *thread) { return spa_api_method_r(int, -ENOTSUP, diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index 57173b65c..818af362d 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -254,6 +254,11 @@ struct spa_fraction { #define SPA_WARN_UNUSED_RESULT #endif +#ifndef SPA_API_IMPL +#define SPA_API_PROTO static inline +#define SPA_API_IMPL static inline +#endif + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define SPA_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 @@ -300,7 +305,7 @@ struct spa_fraction { #endif #endif -static inline bool spa_ptrinside(const void *p1, size_t s1, const void *p2, size_t s2, +SPA_API_IMPL bool spa_ptrinside(const void *p1, size_t s1, const void *p2, size_t s2, size_t *remaining) { if (SPA_LIKELY((uintptr_t)p1 <= (uintptr_t)p2 && s2 <= s1 && @@ -315,7 +320,7 @@ static inline bool spa_ptrinside(const void *p1, size_t s1, const void *p2, size } } -static inline bool spa_ptr_inside_and_aligned(const void *p1, size_t s1, +SPA_API_IMPL bool spa_ptr_inside_and_aligned(const void *p1, size_t s1, const void *p2, size_t s2, size_t align, size_t *remaining) { diff --git a/spa/include/spa/utils/dict.h b/spa/include/spa/utils/dict.h index bfdb447d8..105276176 100644 --- a/spa/include/spa/utils/dict.h +++ b/spa/include/spa/utils/dict.h @@ -50,14 +50,14 @@ struct spa_dict { (item) < &(dict)->items[(dict)->n_items]; \ (item)++) -static inline int spa_dict_item_compare(const void *i1, const void *i2) +SPA_API_IMPL int spa_dict_item_compare(const void *i1, const void *i2) { const struct spa_dict_item *it1 = (const struct spa_dict_item *)i1, *it2 = (const struct spa_dict_item *)i2; return strcmp(it1->key, it2->key); } -static inline void spa_dict_qsort(struct spa_dict *dict) +SPA_API_IMPL void spa_dict_qsort(struct spa_dict *dict) { if (dict->n_items > 0) qsort((void*)dict->items, dict->n_items, sizeof(struct spa_dict_item), @@ -65,7 +65,7 @@ static inline void spa_dict_qsort(struct spa_dict *dict) SPA_FLAG_SET(dict->flags, SPA_DICT_FLAG_SORTED); } -static inline const struct spa_dict_item *spa_dict_lookup_item(const struct spa_dict *dict, +SPA_API_IMPL const struct spa_dict_item *spa_dict_lookup_item(const struct spa_dict *dict, const char *key) { const struct spa_dict_item *item; @@ -88,7 +88,7 @@ static inline const struct spa_dict_item *spa_dict_lookup_item(const struct spa_ return NULL; } -static inline const char *spa_dict_lookup(const struct spa_dict *dict, const char *key) +SPA_API_IMPL const char *spa_dict_lookup(const struct spa_dict *dict, const char *key) { const struct spa_dict_item *item = spa_dict_lookup_item(dict, key); return item ? item->value : NULL; diff --git a/spa/include/spa/utils/dll.h b/spa/include/spa/utils/dll.h index 0372d63e1..978835a93 100644 --- a/spa/include/spa/utils/dll.h +++ b/spa/include/spa/utils/dll.h @@ -12,6 +12,8 @@ extern "C" { #include #include +#include + #define SPA_DLL_BW_MAX 0.128 #define SPA_DLL_BW_MIN 0.016 @@ -21,13 +23,13 @@ struct spa_dll { double w0, w1, w2; }; -static inline void spa_dll_init(struct spa_dll *dll) +SPA_API_IMPL void spa_dll_init(struct spa_dll *dll) { dll->bw = 0.0; dll->z1 = dll->z2 = dll->z3 = 0.0; } -static inline void spa_dll_set_bw(struct spa_dll *dll, double bw, unsigned period, unsigned rate) +SPA_API_IMPL void spa_dll_set_bw(struct spa_dll *dll, double bw, unsigned period, unsigned rate) { double w = 2 * M_PI * bw * period / rate; dll->w0 = 1.0 - exp (-20.0 * w); @@ -36,7 +38,7 @@ static inline void spa_dll_set_bw(struct spa_dll *dll, double bw, unsigned perio dll->bw = bw; } -static inline double spa_dll_update(struct spa_dll *dll, double err) +SPA_API_IMPL double spa_dll_update(struct spa_dll *dll, double err) { dll->z1 += dll->w0 * (dll->w1 * err - dll->z1); dll->z2 += dll->w0 * (dll->z1 - dll->z2); diff --git a/spa/include/spa/utils/hook.h b/spa/include/spa/utils/hook.h index 785b42099..5bda920fb 100644 --- a/spa/include/spa/utils/hook.h +++ b/spa/include/spa/utils/hook.h @@ -411,18 +411,18 @@ struct spa_hook { }; /** Initialize a hook list to the empty list*/ -static inline void spa_hook_list_init(struct spa_hook_list *list) +SPA_API_IMPL void spa_hook_list_init(struct spa_hook_list *list) { spa_list_init(&list->list); } -static inline bool spa_hook_list_is_empty(struct spa_hook_list *list) +SPA_API_IMPL bool spa_hook_list_is_empty(struct spa_hook_list *list) { return spa_list_is_empty(&list->list); } /** Append a hook. */ -static inline void spa_hook_list_append(struct spa_hook_list *list, +SPA_API_IMPL void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data) { @@ -432,7 +432,7 @@ static inline void spa_hook_list_append(struct spa_hook_list *list, } /** Prepend a hook */ -static inline void spa_hook_list_prepend(struct spa_hook_list *list, +SPA_API_IMPL void spa_hook_list_prepend(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data) { @@ -442,7 +442,7 @@ static inline void spa_hook_list_prepend(struct spa_hook_list *list, } /** Remove a hook */ -static inline void spa_hook_remove(struct spa_hook *hook) +SPA_API_IMPL void spa_hook_remove(struct spa_hook *hook) { if (spa_list_is_initialized(&hook->link)) spa_list_remove(&hook->link); @@ -451,14 +451,14 @@ static inline void spa_hook_remove(struct spa_hook *hook) } /** Remove all hooks from the list */ -static inline void spa_hook_list_clean(struct spa_hook_list *list) +SPA_API_IMPL void spa_hook_list_clean(struct spa_hook_list *list) { struct spa_hook *h; spa_list_consume(h, &list->list, link) spa_hook_remove(h); } -static inline void +SPA_API_IMPL void spa_hook_list_isolate(struct spa_hook_list *list, struct spa_hook_list *save, struct spa_hook *hook, @@ -472,7 +472,7 @@ spa_hook_list_isolate(struct spa_hook_list *list, spa_hook_list_append(list, hook, funcs, data); } -static inline void +SPA_API_IMPL void spa_hook_list_join(struct spa_hook_list *list, struct spa_hook_list *save) { diff --git a/spa/include/spa/utils/json-core.h b/spa/include/spa/utils/json-core.h index cc2d4945d..261985369 100644 --- a/spa/include/spa/utils/json-core.h +++ b/spa/include/spa/utils/json-core.h @@ -41,13 +41,13 @@ struct spa_json { #define SPA_JSON_INIT(data,size) ((struct spa_json) { (data), (data)+(size), NULL, 0, 0 }) -static inline void spa_json_init(struct spa_json * iter, const char *data, size_t size) +SPA_API_IMPL void spa_json_init(struct spa_json * iter, const char *data, size_t size) { *iter = SPA_JSON_INIT(data, size); } #define SPA_JSON_ENTER(iter) ((struct spa_json) { (iter)->cur, (iter)->end, (iter), (iter)->state & 0xff0, 0 }) -static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub) +SPA_API_IMPL void spa_json_enter(struct spa_json * iter, struct spa_json * sub) { *sub = SPA_JSON_ENTER(iter); } @@ -58,7 +58,7 @@ static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub) /** Get the next token. \a value points to the token and the return value * is the length. Returns -1 on parse error, 0 on end of input. */ -static inline int spa_json_next(struct spa_json * iter, const char **value) +SPA_API_IMPL int spa_json_next(struct spa_json * iter, const char **value) { int utf8_remain = 0, err = 0; enum { @@ -312,7 +312,7 @@ error: * * \since 1.1.0 */ -static inline bool spa_json_get_error(struct spa_json *iter, const char *start, +SPA_API_IMPL bool spa_json_get_error(struct spa_json *iter, const char *start, struct spa_error_location *loc) { static const char *reasons[] = { @@ -358,31 +358,31 @@ static inline bool spa_json_get_error(struct spa_json *iter, const char *start, return true; } -static inline int spa_json_is_container(const char *val, int len) +SPA_API_IMPL int spa_json_is_container(const char *val, int len) { return len > 0 && (*val == '{' || *val == '['); } /* object */ -static inline int spa_json_is_object(const char *val, int len) +SPA_API_IMPL int spa_json_is_object(const char *val, int len) { return len > 0 && *val == '{'; } /* array */ -static inline bool spa_json_is_array(const char *val, int len) +SPA_API_IMPL bool spa_json_is_array(const char *val, int len) { return len > 0 && *val == '['; } /* null */ -static inline bool spa_json_is_null(const char *val, int len) +SPA_API_IMPL bool spa_json_is_null(const char *val, int len) { return len == 4 && strncmp(val, "null", 4) == 0; } /* float */ -static inline int spa_json_parse_float(const char *val, int len, float *result) +SPA_API_IMPL int spa_json_parse_float(const char *val, int len, float *result) { char buf[96]; char *end; @@ -405,13 +405,13 @@ static inline int spa_json_parse_float(const char *val, int len, float *result) return len > 0 && end == buf + len; } -static inline bool spa_json_is_float(const char *val, int len) +SPA_API_IMPL bool spa_json_is_float(const char *val, int len) { float dummy; return spa_json_parse_float(val, len, &dummy); } -static inline char *spa_json_format_float(char *str, int size, float val) +SPA_API_IMPL char *spa_json_format_float(char *str, int size, float val) { if (SPA_UNLIKELY(!isnormal(val))) { if (isinf(val)) @@ -423,7 +423,7 @@ static inline char *spa_json_format_float(char *str, int size, float val) } /* int */ -static inline int spa_json_parse_int(const char *val, int len, int *result) +SPA_API_IMPL int spa_json_parse_int(const char *val, int len, int *result) { char buf[64]; char *end; @@ -437,29 +437,29 @@ static inline int spa_json_parse_int(const char *val, int len, int *result) *result = strtol(buf, &end, 0); return len > 0 && end == buf + len; } -static inline bool spa_json_is_int(const char *val, int len) +SPA_API_IMPL bool spa_json_is_int(const char *val, int len) { int dummy; return spa_json_parse_int(val, len, &dummy); } /* bool */ -static inline bool spa_json_is_true(const char *val, int len) +SPA_API_IMPL bool spa_json_is_true(const char *val, int len) { return len == 4 && strncmp(val, "true", 4) == 0; } -static inline bool spa_json_is_false(const char *val, int len) +SPA_API_IMPL bool spa_json_is_false(const char *val, int len) { return len == 5 && strncmp(val, "false", 5) == 0; } -static inline bool spa_json_is_bool(const char *val, int len) +SPA_API_IMPL bool spa_json_is_bool(const char *val, int len) { return spa_json_is_true(val, len) || spa_json_is_false(val, len); } -static inline int spa_json_parse_bool(const char *val, int len, bool *result) +SPA_API_IMPL int spa_json_parse_bool(const char *val, int len, bool *result) { if ((*result = spa_json_is_true(val, len))) return 1; @@ -469,12 +469,12 @@ static inline int spa_json_parse_bool(const char *val, int len, bool *result) } /* string */ -static inline bool spa_json_is_string(const char *val, int len) +SPA_API_IMPL bool spa_json_is_string(const char *val, int len) { return len > 1 && *val == '"'; } -static inline int spa_json_parse_hex(const char *p, int num, uint32_t *res) +SPA_API_IMPL int spa_json_parse_hex(const char *p, int num, uint32_t *res) { int i; *res = 0; @@ -493,7 +493,7 @@ static inline int spa_json_parse_hex(const char *p, int num, uint32_t *res) return 1; } -static inline int spa_json_parse_stringn(const char *val, int len, char *result, int maxlen) +SPA_API_IMPL int spa_json_parse_stringn(const char *val, int len, char *result, int maxlen) { const char *p; if (maxlen <= len) @@ -556,12 +556,12 @@ static inline int spa_json_parse_stringn(const char *val, int len, char *result, return 1; } -static inline int spa_json_parse_string(const char *val, int len, char *result) +SPA_API_IMPL int spa_json_parse_string(const char *val, int len, char *result) { return spa_json_parse_stringn(val, len, result, len+1); } -static inline int spa_json_encode_string(char *str, int size, const char *val) +SPA_API_IMPL int spa_json_encode_string(char *str, int size, const char *val) { int len = 0; static const char hex[] = { "0123456789abcdef" }; diff --git a/spa/include/spa/utils/json-pod.h b/spa/include/spa/utils/json-pod.h index 615b97e2e..7f43eaecd 100644 --- a/spa/include/spa/utils/json-pod.h +++ b/spa/include/spa/utils/json-pod.h @@ -24,7 +24,7 @@ extern "C" { * \{ */ -static inline int spa_json_to_pod_part(struct spa_pod_builder *b, uint32_t flags, uint32_t id, +SPA_API_IMPL int spa_json_to_pod_part(struct spa_pod_builder *b, uint32_t flags, uint32_t id, const struct spa_type_info *info, struct spa_json *iter, const char *value, int len) { const struct spa_type_info *ti; @@ -135,7 +135,7 @@ static inline int spa_json_to_pod_part(struct spa_pod_builder *b, uint32_t flags return 0; } -static inline int spa_json_to_pod_checked(struct spa_pod_builder *b, uint32_t flags, +SPA_API_IMPL int spa_json_to_pod_checked(struct spa_pod_builder *b, uint32_t flags, const struct spa_type_info *info, const char *value, int len, struct spa_error_location *loc) { @@ -157,7 +157,7 @@ error: return res; } -static inline int spa_json_to_pod(struct spa_pod_builder *b, uint32_t flags, +SPA_API_IMPL int spa_json_to_pod(struct spa_pod_builder *b, uint32_t flags, const struct spa_type_info *info, const char *value, int len) { return spa_json_to_pod_checked(b, flags, info, value, len, NULL); diff --git a/spa/include/spa/utils/json.h b/spa/include/spa/utils/json.h index 64e78de8e..df7442aec 100644 --- a/spa/include/spa/utils/json.h +++ b/spa/include/spa/utils/json.h @@ -28,14 +28,14 @@ extern "C" { * \{ */ -static inline int spa_json_begin(struct spa_json * iter, const char *data, size_t size, const char **val) +SPA_API_IMPL int spa_json_begin(struct spa_json * iter, const char *data, size_t size, const char **val) { spa_json_init(iter, data, size); return spa_json_next(iter, val); } /* float */ -static inline int spa_json_get_float(struct spa_json *iter, float *res) +SPA_API_IMPL int spa_json_get_float(struct spa_json *iter, float *res) { const char *value; int len; @@ -45,7 +45,7 @@ static inline int spa_json_get_float(struct spa_json *iter, float *res) } /* int */ -static inline int spa_json_get_int(struct spa_json *iter, int *res) +SPA_API_IMPL int spa_json_get_int(struct spa_json *iter, int *res) { const char *value; int len; @@ -55,7 +55,7 @@ static inline int spa_json_get_int(struct spa_json *iter, int *res) } /* bool */ -static inline int spa_json_get_bool(struct spa_json *iter, bool *res) +SPA_API_IMPL int spa_json_get_bool(struct spa_json *iter, bool *res) { const char *value; int len; @@ -65,7 +65,7 @@ static inline int spa_json_get_bool(struct spa_json *iter, bool *res) } /* string */ -static inline int spa_json_get_string(struct spa_json *iter, char *res, int maxlen) +SPA_API_IMPL int spa_json_get_string(struct spa_json *iter, char *res, int maxlen) { const char *value; int len; @@ -75,7 +75,7 @@ static inline int spa_json_get_string(struct spa_json *iter, char *res, int maxl } -static inline int spa_json_enter_container(struct spa_json *iter, struct spa_json *sub, char type) +SPA_API_IMPL int spa_json_enter_container(struct spa_json *iter, struct spa_json *sub, char type) { const char *value; int len; @@ -89,7 +89,7 @@ static inline int spa_json_enter_container(struct spa_json *iter, struct spa_jso return 1; } -static inline int spa_json_begin_container(struct spa_json * iter, +SPA_API_IMPL int spa_json_begin_container(struct spa_json * iter, const char *data, size_t size, char type, bool relax) { int res; @@ -106,7 +106,7 @@ static inline int spa_json_begin_container(struct spa_json * iter, * * \return Length of container including {} or [], or 0 on error. */ -static inline int spa_json_container_len(struct spa_json *iter, const char *value, int len SPA_UNUSED) +SPA_API_IMPL int spa_json_container_len(struct spa_json *iter, const char *value, int len SPA_UNUSED) { const char *val; struct spa_json sub; @@ -119,20 +119,20 @@ static inline int spa_json_container_len(struct spa_json *iter, const char *valu } /* object */ -static inline int spa_json_enter_object(struct spa_json *iter, struct spa_json *sub) +SPA_API_IMPL int spa_json_enter_object(struct spa_json *iter, struct spa_json *sub) { return spa_json_enter_container(iter, sub, '{'); } -static inline int spa_json_begin_object_relax(struct spa_json * iter, const char *data, size_t size) +SPA_API_IMPL int spa_json_begin_object_relax(struct spa_json * iter, const char *data, size_t size) { return spa_json_begin_container(iter, data, size, '{', true); } -static inline int spa_json_begin_object(struct spa_json * iter, const char *data, size_t size) +SPA_API_IMPL int spa_json_begin_object(struct spa_json * iter, const char *data, size_t size) { return spa_json_begin_container(iter, data, size, '{', false); } -static inline int spa_json_object_next(struct spa_json *iter, char *key, int maxkeylen, const char **value) +SPA_API_IMPL int spa_json_object_next(struct spa_json *iter, char *key, int maxkeylen, const char **value) { int res1, res2; while (true) { @@ -145,7 +145,7 @@ static inline int spa_json_object_next(struct spa_json *iter, char *key, int max } } -static inline int spa_json_object_find(struct spa_json *iter, const char *key, const char **value) +SPA_API_IMPL int spa_json_object_find(struct spa_json *iter, const char *key, const char **value) { struct spa_json obj = SPA_JSON_SAVE(iter); int res, len = strlen(key) + 3; @@ -157,7 +157,7 @@ static inline int spa_json_object_find(struct spa_json *iter, const char *key, c return -ENOENT; } -static inline int spa_json_str_object_find(const char *obj, size_t obj_len, +SPA_API_IMPL int spa_json_str_object_find(const char *obj, size_t obj_len, const char *key, char *value, size_t maxlen) { struct spa_json iter; @@ -172,15 +172,15 @@ static inline int spa_json_str_object_find(const char *obj, size_t obj_len, } /* array */ -static inline int spa_json_enter_array(struct spa_json *iter, struct spa_json *sub) +SPA_API_IMPL int spa_json_enter_array(struct spa_json *iter, struct spa_json *sub) { return spa_json_enter_container(iter, sub, '['); } -static inline int spa_json_begin_array_relax(struct spa_json * iter, const char *data, size_t size) +SPA_API_IMPL int spa_json_begin_array_relax(struct spa_json * iter, const char *data, size_t size) { return spa_json_begin_container(iter, data, size, '[', true); } -static inline int spa_json_begin_array(struct spa_json * iter, const char *data, size_t size) +SPA_API_IMPL int spa_json_begin_array(struct spa_json * iter, const char *data, size_t size) { return spa_json_begin_container(iter, data, size, '[', false); } @@ -197,7 +197,7 @@ static inline int spa_json_begin_array(struct spa_json * iter, const char *data, return count; \ } -static inline int spa_json_str_array_uint32(const char *arr, size_t arr_len, +SPA_API_IMPL int spa_json_str_array_uint32(const char *arr, size_t arr_len, uint32_t *values, size_t max) { spa_json_make_str_array_unpack(32,uint32_t, atoi); diff --git a/spa/include/spa/utils/list.h b/spa/include/spa/utils/list.h index 0c03854b5..33e00ec23 100644 --- a/spa/include/spa/utils/list.h +++ b/spa/include/spa/utils/list.h @@ -9,6 +9,8 @@ extern "C" { #endif +#include + /** * \defgroup spa_list List * Doubly linked list data structure @@ -26,19 +28,19 @@ struct spa_list { #define SPA_LIST_INIT(list) ((struct spa_list){ (list), (list) }) -static inline void spa_list_init(struct spa_list *list) +SPA_API_IMPL void spa_list_init(struct spa_list *list) { *list = SPA_LIST_INIT(list); } -static inline int spa_list_is_initialized(struct spa_list *list) +SPA_API_IMPL int spa_list_is_initialized(struct spa_list *list) { return !!list->prev; } #define spa_list_is_empty(l) ((l)->next == (l)) -static inline void spa_list_insert(struct spa_list *list, struct spa_list *elem) +SPA_API_IMPL void spa_list_insert(struct spa_list *list, struct spa_list *elem) { elem->prev = list; elem->next = list->next; @@ -46,7 +48,7 @@ static inline void spa_list_insert(struct spa_list *list, struct spa_list *elem) elem->next->prev = elem; } -static inline void spa_list_insert_list(struct spa_list *list, struct spa_list *other) +SPA_API_IMPL void spa_list_insert_list(struct spa_list *list, struct spa_list *other) { if (spa_list_is_empty(other)) return; @@ -56,7 +58,7 @@ static inline void spa_list_insert_list(struct spa_list *list, struct spa_list * list->next = other->next; } -static inline void spa_list_remove(struct spa_list *elem) +SPA_API_IMPL void spa_list_remove(struct spa_list *elem) { elem->prev->next = elem->next; elem->next->prev = elem->prev; diff --git a/spa/include/spa/utils/ratelimit.h b/spa/include/spa/utils/ratelimit.h index ef1b94127..7629fea81 100644 --- a/spa/include/spa/utils/ratelimit.h +++ b/spa/include/spa/utils/ratelimit.h @@ -12,6 +12,8 @@ extern "C" { #include #include +#include + struct spa_ratelimit { uint64_t interval; uint64_t begin; @@ -20,7 +22,7 @@ struct spa_ratelimit { unsigned n_suppressed; }; -static inline int spa_ratelimit_test(struct spa_ratelimit *r, uint64_t now) +SPA_API_IMPL int spa_ratelimit_test(struct spa_ratelimit *r, uint64_t now) { unsigned suppressed = 0; if (r->begin + r->interval < now) { diff --git a/spa/include/spa/utils/ringbuffer.h b/spa/include/spa/utils/ringbuffer.h index 51b502d74..6429466b7 100644 --- a/spa/include/spa/utils/ringbuffer.h +++ b/spa/include/spa/utils/ringbuffer.h @@ -40,7 +40,7 @@ struct spa_ringbuffer { * * \param rbuf a spa_ringbuffer */ -static inline void spa_ringbuffer_init(struct spa_ringbuffer *rbuf) +SPA_API_IMPL void spa_ringbuffer_init(struct spa_ringbuffer *rbuf) { *rbuf = SPA_RINGBUFFER_INIT(); } @@ -51,7 +51,7 @@ static inline void spa_ringbuffer_init(struct spa_ringbuffer *rbuf) * \param rbuf a spa_ringbuffer * \param size the target size of \a rbuf */ -static inline void spa_ringbuffer_set_avail(struct spa_ringbuffer *rbuf, uint32_t size) +SPA_API_IMPL void spa_ringbuffer_set_avail(struct spa_ringbuffer *rbuf, uint32_t size) { rbuf->readindex = 0; rbuf->writeindex = size; @@ -67,7 +67,7 @@ static inline void spa_ringbuffer_set_avail(struct spa_ringbuffer *rbuf, uint32_ * there was an underrun. values > rbuf->size means there * was an overrun. */ -static inline int32_t spa_ringbuffer_get_read_index(struct spa_ringbuffer *rbuf, uint32_t *index) +SPA_API_IMPL int32_t spa_ringbuffer_get_read_index(struct spa_ringbuffer *rbuf, uint32_t *index) { *index = __atomic_load_n(&rbuf->readindex, __ATOMIC_RELAXED); return (int32_t) (__atomic_load_n(&rbuf->writeindex, __ATOMIC_ACQUIRE) - *index); @@ -84,7 +84,7 @@ static inline int32_t spa_ringbuffer_get_read_index(struct spa_ringbuffer *rbuf, * \param data destination memory * \param len number of bytes to read */ -static inline void +SPA_API_IMPL void spa_ringbuffer_read_data(struct spa_ringbuffer *rbuf SPA_UNUSED, const void *buffer, uint32_t size, uint32_t offset, void *data, uint32_t len) @@ -101,7 +101,7 @@ spa_ringbuffer_read_data(struct spa_ringbuffer *rbuf SPA_UNUSED, * \param rbuf a spa_ringbuffer * \param index new index */ -static inline void spa_ringbuffer_read_update(struct spa_ringbuffer *rbuf, int32_t index) +SPA_API_IMPL void spa_ringbuffer_read_update(struct spa_ringbuffer *rbuf, int32_t index) { __atomic_store_n(&rbuf->readindex, index, __ATOMIC_RELEASE); } @@ -117,7 +117,7 @@ static inline void spa_ringbuffer_read_update(struct spa_ringbuffer *rbuf, int32 * was an overrun. Subtract from the buffer size to get * the number of bytes available for writing. */ -static inline int32_t spa_ringbuffer_get_write_index(struct spa_ringbuffer *rbuf, uint32_t *index) +SPA_API_IMPL int32_t spa_ringbuffer_get_write_index(struct spa_ringbuffer *rbuf, uint32_t *index) { *index = __atomic_load_n(&rbuf->writeindex, __ATOMIC_RELAXED); return (int32_t) (*index - __atomic_load_n(&rbuf->readindex, __ATOMIC_ACQUIRE)); @@ -134,7 +134,7 @@ static inline int32_t spa_ringbuffer_get_write_index(struct spa_ringbuffer *rbuf * \param data source memory * \param len number of bytes to write */ -static inline void +SPA_API_IMPL void spa_ringbuffer_write_data(struct spa_ringbuffer *rbuf SPA_UNUSED, void *buffer, uint32_t size, uint32_t offset, const void *data, uint32_t len) @@ -151,7 +151,7 @@ spa_ringbuffer_write_data(struct spa_ringbuffer *rbuf SPA_UNUSED, * \param rbuf a spa_ringbuffer * \param index new index */ -static inline void spa_ringbuffer_write_update(struct spa_ringbuffer *rbuf, int32_t index) +SPA_API_IMPL void spa_ringbuffer_write_update(struct spa_ringbuffer *rbuf, int32_t index) { __atomic_store_n(&rbuf->writeindex, index, __ATOMIC_RELEASE); } diff --git a/spa/include/spa/utils/string.h b/spa/include/spa/utils/string.h index 6ee9e2cd3..0d225bf37 100644 --- a/spa/include/spa/utils/string.h +++ b/spa/include/spa/utils/string.h @@ -33,7 +33,7 @@ extern "C" { * If both \a a and \a b are NULL, the two are considered equal. * */ -static inline bool spa_streq(const char *s1, const char *s2) +SPA_API_IMPL bool spa_streq(const char *s1, const char *s2) { return SPA_LIKELY(s1 && s2) ? strcmp(s1, s2) == 0 : s1 == s2; } @@ -43,7 +43,7 @@ static inline bool spa_streq(const char *s1, const char *s2) * * If both \a a and \a b are NULL, the two are considered equal. */ -static inline bool spa_strneq(const char *s1, const char *s2, size_t len) +SPA_API_IMPL bool spa_strneq(const char *s1, const char *s2, size_t len) { return SPA_LIKELY(s1 && s2) ? strncmp(s1, s2, len) == 0 : s1 == s2; } @@ -54,7 +54,7 @@ static inline bool spa_strneq(const char *s1, const char *s2, size_t len) * A \a s is NULL, it never starts with the given \a prefix. A \a prefix of * NULL is a bug in the caller. */ -static inline bool spa_strstartswith(const char *s, const char *prefix) +SPA_API_IMPL bool spa_strstartswith(const char *s, const char *prefix) { if (SPA_UNLIKELY(s == NULL)) return false; @@ -70,7 +70,7 @@ static inline bool spa_strstartswith(const char *s, const char *prefix) * A \a s is NULL, it never ends with the given \a suffix. A \a suffix of * NULL is a bug in the caller. */ -static inline bool spa_strendswith(const char *s, const char *suffix) +SPA_API_IMPL bool spa_strendswith(const char *s, const char *suffix) { size_t l1, l2; @@ -92,7 +92,7 @@ static inline bool spa_strendswith(const char *s, const char *suffix) * * \return true on success, false otherwise */ -static inline bool spa_atoi32(const char *str, int32_t *val, int base) +SPA_API_IMPL bool spa_atoi32(const char *str, int32_t *val, int base) { char *endptr; long v; @@ -120,7 +120,7 @@ static inline bool spa_atoi32(const char *str, int32_t *val, int base) * * \return true on success, false otherwise */ -static inline bool spa_atou32(const char *str, uint32_t *val, int base) +SPA_API_IMPL bool spa_atou32(const char *str, uint32_t *val, int base) { char *endptr; unsigned long long v; @@ -148,7 +148,7 @@ static inline bool spa_atou32(const char *str, uint32_t *val, int base) * * \return true on success, false otherwise */ -static inline bool spa_atoi64(const char *str, int64_t *val, int base) +SPA_API_IMPL bool spa_atoi64(const char *str, int64_t *val, int base) { char *endptr; long long v; @@ -173,7 +173,7 @@ static inline bool spa_atoi64(const char *str, int64_t *val, int base) * * \return true on success, false otherwise */ -static inline bool spa_atou64(const char *str, uint64_t *val, int base) +SPA_API_IMPL bool spa_atou64(const char *str, uint64_t *val, int base) { char *endptr; unsigned long long v; @@ -196,7 +196,7 @@ static inline bool spa_atou64(const char *str, uint64_t *val, int base) * * \return true on success, false otherwise */ -static inline bool spa_atob(const char *str) +SPA_API_IMPL bool spa_atob(const char *str) { return spa_streq(str, "true") || spa_streq(str, "1"); } @@ -210,7 +210,7 @@ static inline bool spa_atob(const char *str) * number on error. */ SPA_PRINTF_FUNC(3, 0) -static inline int spa_vscnprintf(char *buffer, size_t size, const char *format, va_list args) +SPA_API_IMPL int spa_vscnprintf(char *buffer, size_t size, const char *format, va_list args) { int r; @@ -233,7 +233,7 @@ static inline int spa_vscnprintf(char *buffer, size_t size, const char *format, * number on error. */ SPA_PRINTF_FUNC(3, 4) -static inline int spa_scnprintf(char *buffer, size_t size, const char *format, ...) +SPA_API_IMPL int spa_scnprintf(char *buffer, size_t size, const char *format, ...) { int r; va_list args; @@ -253,7 +253,7 @@ static inline int spa_scnprintf(char *buffer, size_t size, const char *format, . * * \return the result float. */ -static inline float spa_strtof(const char *str, char **endptr) +SPA_API_IMPL float spa_strtof(const char *str, char **endptr) { #ifndef __LOCALE_C_ONLY static locale_t locale = NULL; @@ -279,7 +279,7 @@ static inline float spa_strtof(const char *str, char **endptr) * * \return true on success, false otherwise */ -static inline bool spa_atof(const char *str, float *val) +SPA_API_IMPL bool spa_atof(const char *str, float *val) { char *endptr; float v; @@ -303,7 +303,7 @@ static inline bool spa_atof(const char *str, float *val) * * \return the result float. */ -static inline double spa_strtod(const char *str, char **endptr) +SPA_API_IMPL double spa_strtod(const char *str, char **endptr) { #ifndef __LOCALE_C_ONLY static locale_t locale = NULL; @@ -329,7 +329,7 @@ static inline double spa_strtod(const char *str, char **endptr) * * \return true on success, false otherwise */ -static inline bool spa_atod(const char *str, double *val) +SPA_API_IMPL bool spa_atod(const char *str, double *val) { char *endptr; double v; @@ -346,7 +346,7 @@ static inline bool spa_atod(const char *str, double *val) return true; } -static inline char *spa_dtoa(char *str, size_t size, double val) +SPA_API_IMPL char *spa_dtoa(char *str, size_t size, double val) { int i, l; l = spa_scnprintf(str, size, "%f", val); @@ -362,7 +362,7 @@ struct spa_strbuf { size_t pos; }; -static inline void spa_strbuf_init(struct spa_strbuf *buf, char *buffer, size_t maxsize) +SPA_API_IMPL void spa_strbuf_init(struct spa_strbuf *buf, char *buffer, size_t maxsize) { buf->buffer = buffer; buf->maxsize = maxsize; @@ -372,7 +372,7 @@ static inline void spa_strbuf_init(struct spa_strbuf *buf, char *buffer, size_t } SPA_PRINTF_FUNC(2, 3) -static inline int spa_strbuf_append(struct spa_strbuf *buf, const char *fmt, ...) +SPA_API_IMPL int spa_strbuf_append(struct spa_strbuf *buf, const char *fmt, ...) { size_t remain = buf->maxsize - buf->pos; ssize_t written; diff --git a/spa/include/spa/utils/type.h b/spa/include/spa/utils/type.h index f814c0fb5..52e17d590 100644 --- a/spa/include/spa/utils/type.h +++ b/spa/include/spa/utils/type.h @@ -124,12 +124,12 @@ struct spa_type_info { const struct spa_type_info *values; }; -static inline bool spa_type_is_a(const char *type, const char *parent) +SPA_API_IMPL bool spa_type_is_a(const char *type, const char *parent) { return type != NULL && parent != NULL && strncmp(type, parent, strlen(parent)) == 0; } -static inline const char *spa_type_short_name(const char *name) +SPA_API_IMPL const char *spa_type_short_name(const char *name) { const char *h; if ((h = strrchr(name, ':')) != NULL) @@ -137,7 +137,7 @@ static inline const char *spa_type_short_name(const char *name) return name; } -static inline uint32_t spa_type_from_short_name(const char *name, +SPA_API_IMPL uint32_t spa_type_from_short_name(const char *name, const struct spa_type_info *info, uint32_t unknown) { int i; @@ -147,7 +147,7 @@ static inline uint32_t spa_type_from_short_name(const char *name, } return unknown; } -static inline const char * spa_type_to_name(uint32_t type, +SPA_API_IMPL const char * spa_type_to_name(uint32_t type, const struct spa_type_info *info, const char *unknown) { int i; @@ -158,7 +158,7 @@ static inline const char * spa_type_to_name(uint32_t type, return unknown; } -static inline const char * spa_type_to_short_name(uint32_t type, +SPA_API_IMPL const char * spa_type_to_short_name(uint32_t type, const struct spa_type_info *info, const char *unknown) { const char *n = spa_type_to_name(type, info, unknown); diff --git a/src/pipewire/array.h b/src/pipewire/array.h index cbded821d..f5e165122 100644 --- a/src/pipewire/array.h +++ b/src/pipewire/array.h @@ -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) diff --git a/src/pipewire/client.h b/src/pipewire/client.h index a08eb271f..5cfe6f51a 100644 --- a/src/pipewire/client.h +++ b/src/pipewire/client.h @@ -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, diff --git a/src/pipewire/core.h b/src/pipewire/core.h index e5a0f02aa..a915b8164 100644 --- a/src/pipewire/core.h +++ b/src/pipewire/core.h @@ -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, diff --git a/src/pipewire/device.h b/src/pipewire/device.h index 7c5520eee..07dcb3cee 100644 --- a/src/pipewire/device.h +++ b/src/pipewire/device.h @@ -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, diff --git a/src/pipewire/extensions/client-node.h b/src/pipewire/extensions/client-node.h index 65d5a4df2..08831f6a0 100644 --- a/src/pipewire/extensions/client-node.h +++ b/src/pipewire/extensions/client-node.h @@ -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) { diff --git a/src/pipewire/extensions/metadata.h b/src/pipewire/extensions/metadata.h index 0504ae5fe..7434dbef5 100644 --- a/src/pipewire/extensions/metadata.h +++ b/src/pipewire/extensions/metadata.h @@ -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); diff --git a/src/pipewire/extensions/profiler.h b/src/pipewire/extensions/profiler.h index fc0b56626..f7d2bd1a0 100644 --- a/src/pipewire/extensions/profiler.h +++ b/src/pipewire/extensions/profiler.h @@ -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) diff --git a/src/pipewire/extensions/security-context.h b/src/pipewire/extensions/security-context.h index 347ed6fb2..bf01ab289 100644 --- a/src/pipewire/extensions/security-context.h +++ b/src/pipewire/extensions/security-context.h @@ -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, diff --git a/src/pipewire/factory.h b/src/pipewire/factory.h index 517407120..a017d5942 100644 --- a/src/pipewire/factory.h +++ b/src/pipewire/factory.h @@ -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) diff --git a/src/pipewire/link.h b/src/pipewire/link.h index 7ce0cb592..4e33a3bce 100644 --- a/src/pipewire/link.h +++ b/src/pipewire/link.h @@ -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) diff --git a/src/pipewire/map.h b/src/pipewire/map.h index 39d6d0848..02d48a2bb 100644 --- a/src/pipewire/map.h +++ b/src/pipewire/map.h @@ -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; diff --git a/src/pipewire/mem.h b/src/pipewire/mem.h index 8ce57bd91..7e3820f83 100644 --- a/src/pipewire/mem.h +++ b/src/pipewire/mem.h @@ -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) { diff --git a/src/pipewire/module.h b/src/pipewire/module.h index 3bb4d6b4e..c74831ef6 100644 --- a/src/pipewire/module.h +++ b/src/pipewire/module.h @@ -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) diff --git a/src/pipewire/node.h b/src/pipewire/node.h index 408a3e67b..a52a81540 100644 --- a/src/pipewire/node.h +++ b/src/pipewire/node.h @@ -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); diff --git a/src/pipewire/port.h b/src/pipewire/port.h index 6af7de5a5..3e042f4de 100644 --- a/src/pipewire/port.h +++ b/src/pipewire/port.h @@ -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) { diff --git a/src/pipewire/properties.h b/src/pipewire/properties.h index dec816a8d..c86aacd74 100644 --- a/src/pipewire/properties.h +++ b/src/pipewire/properties.h @@ -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; }