5#ifndef SPA_POD_COMPARE_H
6#define SPA_POD_COMPARE_H
34 return SPA_CMP(!!*(int32_t *)r1, !!*(int32_t *)r2);
36 return SPA_CMP(*(uint32_t *)r1, *(uint32_t *)r2);
38 return SPA_CMP(*(int32_t *)r1, *(int32_t *)r2);
40 return SPA_CMP(*(int64_t *)r1, *(int64_t *)r2);
42 return SPA_CMP(*(
float *)r1, *(
float *)r2);
44 return SPA_CMP(*(
double *)r1, *(
double *)r2);
46 return strcmp((
char *)r1, (
char *)r2);
48 return memcmp((
char *)r1, (
char *)r2, size);
53 if (rec1->
width == rec2->width && rec1->
height == rec2->height)
55 else if (rec1->
width < rec2->width || rec1->
height < rec2->height)
65 n1 = ((uint64_t) f1->
num) * f2->
denom;
66 n2 = ((uint64_t) f2->num) * f1->
denom;
79 uint32_t n_vals1, n_vals2;
80 uint32_t choice1, choice2;
88 if (n_vals1 != n_vals2)
static 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)
Definition iter.h:394
#define SPA_POD_BODY_CONST(pod)
Definition pod.h:41
static int spa_pod_compare_value(uint32_t type, const void *r1, const void *r2, uint32_t size)
Definition compare.h:33
static void * spa_pod_next(const void *iter)
Definition iter.h:42
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition iter.h:114
#define SPA_POD_BODY(pod)
Definition pod.h:39
#define SPA_POD_TYPE(pod)
Definition pod.h:28
#define SPA_POD_BODY_SIZE(pod)
Definition pod.h:26
static bool spa_pod_is_inside(const void *pod, uint32_t size, const void *iter)
Definition iter.h:34
static int spa_pod_compare(const struct spa_pod *pod1, const struct spa_pod *pod2)
Definition compare.h:80
static struct spa_pod * spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice)
Definition iter.h:353
@ SPA_TYPE_Int
Definition type.h:34
@ SPA_TYPE_Rectangle
Definition type.h:40
@ SPA_TYPE_Long
Definition type.h:35
@ SPA_TYPE_Bool
Definition type.h:32
@ SPA_TYPE_Bytes
Definition type.h:39
@ SPA_TYPE_Object
Definition type.h:45
@ SPA_TYPE_Float
Definition type.h:36
@ SPA_TYPE_Fraction
Definition type.h:41
@ SPA_TYPE_None
Definition type.h:31
@ SPA_TYPE_Double
Definition type.h:37
@ SPA_TYPE_Id
Definition type.h:33
@ SPA_TYPE_Array
Definition type.h:43
@ SPA_TYPE_String
Definition type.h:38
@ SPA_TYPE_Struct
Definition type.h:44
#define spa_return_val_if_fail(expr, val)
Definition defs.h:431
#define SPA_CMP(a, b)
3-way comparison.
Definition defs.h:209
uint32_t num
Definition defs.h:138
uint32_t denom
Definition defs.h:139
uint32_t key
key of property, list of valid keys depends on the object type
Definition pod.h:209
struct spa_pod value
Definition pod.h:226
uint32_t type
Definition pod.h:45
uint32_t width
Definition defs.h:117
uint32_t height
Definition defs.h:118