Lines Matching refs:array
45 struct array {
50 struct array *array_create(void);
51 void array_destroy(struct array *);
52 void array_init(struct array *);
53 void array_cleanup(struct array *);
54 unsigned array_num(const struct array *);
55 void *array_get(const struct array *, unsigned index_);
56 void array_set(const struct array *, unsigned index_, void *val);
57 int array_setsize(struct array *, unsigned num);
58 int array_add(struct array *, void *val, unsigned *index_ret);
59 int array_insert(struct array *a, unsigned index_);
60 void array_remove(struct array *a, unsigned index_);
70 array_num(const struct array *a)
76 array_get(const struct array *a, unsigned index_)
83 array_set(const struct array *a, unsigned index_, void *val)
90 array_add(struct array *a, void *val, unsigned *index_ret)
110 * an array of pointers to "bar", plus the operations on it.
118 * in array.c.
137 #define DECLARRAY_BYTYPE(ARRAY, T) \
138 struct ARRAY { \
139 struct array arr; \
142 struct ARRAY *ARRAY##_create(void); \
143 void ARRAY##_destroy(struct ARRAY *a); \
144 void ARRAY##_init(struct ARRAY *a); \
145 void ARRAY##_cleanup(struct ARRAY *a); \
146 unsigned ARRAY##_num(const struct ARRAY *a); \
147 T *ARRAY##_get(const struct ARRAY *a, unsigned index_); \
148 void ARRAY##_set(struct ARRAY *a, unsigned index_, T *val); \
149 int ARRAY##_setsize(struct ARRAY *a, unsigned num); \
150 int ARRAY##_add(struct ARRAY *a, T *val, unsigned *index_ret); \
151 int ARRAY##_insert(struct ARRAY *a, unsigned index_); \
152 void ARRAY##_remove(struct ARRAY *a, unsigned index_)
155 #define DEFARRAY_BYTYPE(ARRAY, T, INLINE) \
157 ARRAY##_init(struct ARRAY *a) \
163 ARRAY##_cleanup(struct ARRAY *a) \
169 ARRAY *ARRAY##_create(void) \
171 struct ARRAY *a; \
177 ARRAY##_init(a); \
182 ARRAY##_destroy(struct ARRAY *a) \
184 ARRAY##_cleanup(a); \
189 ARRAY##_num(const struct ARRAY *a) \
195 ARRAY##_get(const struct ARRAY *a, unsigned index_) \
201 ARRAY##_set(struct ARRAY *a, unsigned index_, T *val) \
207 ARRAY##_setsize(struct ARRAY *a, unsigned num) \
213 ARRAY##_add(struct ARRAY *a, T *val, unsigned *ret) \
219 ARRAY##_insert(struct ARRAY *a, unsigned index_) \
225 ARRAY##_remove(struct ARRAY *a, unsigned index_) \
230 #define DECLARRAY(T) DECLARRAY_BYTYPE(T##array, struct T)
231 #define DEFARRAY(T, INLINE) DEFARRAY_BYTYPE(T##array, struct T, INLINE)
234 // basic array types