make static inline -> SPA_API_IMPL

So that we can export the symbols as well.
This commit is contained in:
Wim Taymans 2024-11-20 11:48:08 +01:00
parent 84bd4b7ea9
commit 90b0e45037
91 changed files with 563 additions and 552 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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,

View file

@ -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;

View file

@ -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;