• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:l

18 static void** _areflist_items(const ARefList*  l)  in _areflist_items()  argument
20 if (l->max == 1) in _areflist_items()
21 return (void**)&l->u.item0; in _areflist_items()
23 return l->u.items; in _areflist_items()
27 _areflist_checkSize0(ARefList* l) in _areflist_checkSize0() argument
29 if (l->size == 0 && l->max > 1) { in _areflist_checkSize0()
30 AFREE(l->u.items); in _areflist_checkSize0()
31 l->max = 1; in _areflist_checkSize0()
32 l->u.item0 = NULL; in _areflist_checkSize0()
37 areflist_setEmpty(ARefList* l) in areflist_setEmpty() argument
39 if (l->iteration > 0) { in areflist_setEmpty()
42 void** items = _areflist_items(l); in areflist_setEmpty()
43 AARRAY_ZERO(items, l->count); in areflist_setEmpty()
44 l->iteration |= 1; in areflist_setEmpty()
47 l->size = 0; in areflist_setEmpty()
48 _areflist_checkSize0(l); in areflist_setEmpty()
50 l->count = 0; in areflist_setEmpty()
54 areflist_indexOf(const ARefList* l, void* item) in areflist_indexOf() argument
57 void** items = _areflist_items(l); in areflist_indexOf()
58 void** end = items + l->count; in areflist_indexOf()
69 areflist_grow(ARefList* l, int count) in areflist_grow() argument
71 int newcount = l->size + count; in areflist_grow()
72 if (newcount > l->max) { in areflist_grow()
73 int oldmax = l->max; in areflist_grow()
81 items = l->u.items; in areflist_grow()
89 if (l->max == 1) in areflist_grow()
90 items[0] = l->u.item0; in areflist_grow()
92 l->u.items = items; in areflist_grow()
93 l->max = (uint16_t) newmax; in areflist_grow()
99 areflist_add(ARefList* l, void* item) in areflist_add() argument
104 if (l->size >= l->max) { in areflist_add()
105 areflist_grow(l, 1); in areflist_add()
107 items = _areflist_items(l); in areflist_add()
108 items[l->size] = item; in areflist_add()
109 l->size += 1; in areflist_add()
110 l->count += 1; in areflist_add()
115 areflist_append(ARefList* l, const ARefList* l2) in areflist_append() argument
118 areflist_add(l, item); in areflist_append()
123 areflist_popLast(ARefList* l) in areflist_popLast() argument
126 void** items = _areflist_items(l); in areflist_popLast()
129 if (l->count == 0) in areflist_popLast()
132 for (nn = l->size; nn > 0; nn--) { in areflist_popLast()
141 l->count -= 1; in areflist_popLast()
144 if (l->iteration == 0) { in areflist_popLast()
145 l->size = nn; in areflist_popLast()
146 _areflist_checkSize0(l); in areflist_popLast()
152 areflist_delFirst(ARefList* l, void* item) in areflist_delFirst() argument
157 int index = areflist_indexOf(l, item); in areflist_delFirst()
161 void** items = _areflist_items(l); in areflist_delFirst()
163 if (l->iteration > 0) { in areflist_delFirst()
166 l->iteration |= 1; in areflist_delFirst()
167 l->count -= 1; in areflist_delFirst()
170 if (l->max > 1) { in areflist_delFirst()
171 AARRAY_MOVE(items + index, items + index + 1, l->size - index - 1); in areflist_delFirst()
172 l->size -= 1; in areflist_delFirst()
173 l->count -= 1; in areflist_delFirst()
174 _areflist_checkSize0(l); in areflist_delFirst()
176 l->u.item0 = NULL; in areflist_delFirst()
177 l->size = 0; in areflist_delFirst()
178 l->count = 0; in areflist_delFirst()
185 areflist_delAll(ARefList* l, void* item) in areflist_delAll() argument
192 void** items = _areflist_items(l); in areflist_delAll()
198 for ( ; readPos < l->size; readPos++ ) { in areflist_delAll()
206 for ( ; readPos < l->size; readPos++ ) { in areflist_delAll()
217 l->count = l->size = (uint16_t) writePos; in areflist_delAll()
218 _areflist_checkSize0(l); in areflist_delAll()
225 _areflist_remove_deferred(ARefList* l) in _areflist_remove_deferred() argument
227 if (l->iteration & 1) { in _areflist_remove_deferred()
229 void** items = _areflist_items(l); in _areflist_remove_deferred()
232 for ( ; rr < l->size; rr++ ) { in _areflist_remove_deferred()
236 l->count = l->size = (uint16_t) ww; in _areflist_remove_deferred()
237 _areflist_checkSize0(l); in _areflist_remove_deferred()
239 l->iteration = 0; in _areflist_remove_deferred()
267 areflist_get(const ARefList* l, int n) in areflist_get() argument
269 if ((unsigned)n >= (unsigned)l->count) in areflist_get()
272 if (l->max == 1) in areflist_get()
273 return l->u.item0; in areflist_get()
275 return l->u.items[n]; in areflist_get()
279 _areflist_at(const ARefList* l, int n) in _areflist_at() argument
283 if ((unsigned)n >= (unsigned)l->size) in _areflist_at()
286 items = _areflist_items(l); in _areflist_at()