Lines Matching refs:last
111 // get the last element of a ptrlist
113 // @return: the last element of the list or ``NULL`` if the list is empty
263 struct ptr_list *last = NULL; /* gcc complains needlessly */
267 if (!list || (nr = (last = list->prev)->nr) >= LIST_NODE_NR) {
274 newlist->prev = last;
277 last->next = newlist;
279 last = newlist;
282 ret = last->list + nr;
285 last->nr = nr;
376 // remove the last entry of a ptrlist
378 // @return: the last element of the list or NULL if the list is empty.
383 struct ptr_list *last, *first = *head;
387 last = first;
389 last = last->prev;
390 if (last->nr) {
392 int nr = --last->nr;
393 ptr = last->list[nr];
394 last->list[nr] = (void *)0xf1f1f1f1;
397 } while (last != first);
402 // remove the last entry and repack the list
404 // @return: the last element of the list or NULL if the list is empty.
408 struct ptr_list *last, *first = *head;
412 last = first->prev;
413 if (last->nr)
414 ptr = last->list[--last->nr];
415 if (last->nr <=0) {
416 first->prev = last->prev;
417 last->prev->next = first;
418 if (last == first)
420 __free_ptrlist(last);