Home | History | Annotate | Download | only in common

Lines Matching refs:element

39 /* Define a type for the array given the element type */
44 element_type *element; \
57 (a)->element = (__typeof((a)->element)) \
58 realloc((a)->element, \
60 sizeof((a)->element[0])); \
62 &(a)->element[((a)->count)++]; \
65 /* Append an element with the given value to the array a */
71 /* Append a zero element to the array a and return the pointer to the element */
74 typeof((a)->element) _tmp_ptr = _ARRAY_EXTEND(a); \
82 /* Return a pointer to the i-th element in the array a */
83 #define ARRAY_ELEMENT(a, i) ((a)->element + (i))
85 /* Return the index of the element pointed by p in the array a */
86 #define ARRAY_INDEX(a, p) ((p) - (a)->element)
88 /* Go through each element in the array a and assign index and pointer
89 to the element to the variable i and ptr */
91 for ((i) = 0, (ptr) = (a)->element; (i) < (a)->count; \
97 free((a)->element); \
98 (a)->element = NULL; \
104 /* Return the index of the element with the value x. -1 if not found */
107 typeof((a)->element) _bptr = (a)->element; \
108 typeof((a)->element) _eptr = (a)->element + (a)->count; \
111 (_bptr == _eptr) ? -1 : (_bptr - (a)->element); \