PipeWire  0.3.27
array.h File Reference

Go to the source code of this file.

Data Structures

class  pw_array
 An array object. More...
 

Macros

#define PW_ARRAY_INIT(extend)   (struct pw_array) { NULL, 0, 0, extend }
 
#define pw_array_get_len_s(a, s)   ((a)->size / (s))
 
#define pw_array_get_unchecked_s(a, idx, s, t)   SPA_PTROFF((a)->data,(idx)*(s),t)
 
#define pw_array_check_index_s(a, idx, s)   ((idx) < pw_array_get_len_s(a,s))
 
#define pw_array_first(a)   ((a)->data)
 
#define pw_array_end(a)   SPA_PTROFF((a)->data, (a)->size, void)
 
#define pw_array_check(a, p)   (SPA_PTROFF(p,sizeof(*p),void) <= pw_array_end(a))
 
#define pw_array_for_each(pos, array)
 
#define pw_array_consume(pos, array)
 
#define pw_array_remove(a, p)
 

Macro Definition Documentation

◆ pw_array_check

#define pw_array_check (   a,
 
)    (SPA_PTROFF(p,sizeof(*p),void) <= pw_array_end(a))

◆ pw_array_check_index_s

#define pw_array_check_index_s (   a,
  idx,
 
)    ((idx) < pw_array_get_len_s(a,s))

◆ pw_array_consume

#define pw_array_consume (   pos,
  array 
)
Value:
for (pos = (__typeof__(pos)) pw_array_first(array); \
pw_array_check(array, pos); \
pos = (__typeof__(pos)) pw_array_first(array))

◆ pw_array_end

#define pw_array_end (   a)    SPA_PTROFF((a)->data, (a)->size, void)

◆ pw_array_first

#define pw_array_first (   a)    ((a)->data)

◆ pw_array_for_each

#define pw_array_for_each (   pos,
  array 
)
Value:
for (pos = (__typeof__(pos)) pw_array_first(array); \
pw_array_check(array, pos); \
(pos)++)

◆ pw_array_get_len_s

#define pw_array_get_len_s (   a,
 
)    ((a)->size / (s))

◆ pw_array_get_unchecked_s

#define pw_array_get_unchecked_s (   a,
  idx,
  s,
 
)    SPA_PTROFF((a)->data,(idx)*(s),t)

◆ PW_ARRAY_INIT

#define PW_ARRAY_INIT (   extend)    (struct pw_array) { NULL, 0, 0, extend }

◆ pw_array_remove

#define pw_array_remove (   a,
 
)
Value:
({ \
(a)->size -= sizeof(*(p)); \
memmove(p, SPA_PTROFF((p), sizeof(*(p)), void), \
SPA_PTRDIFF(pw_array_end(a),(p))); \
})
pw_array_end
#define pw_array_end(a)
Definition: array.h:64
pw_array_first
#define pw_array_first(a)
Definition: array.h:63