Lines Matching refs:llist

74 	spl_ptr_llist         *llist;  member
104 spl_ptr_llist *llist = emalloc(sizeof(spl_ptr_llist)); in spl_ptr_llist_init() local
106 llist->head = NULL; in spl_ptr_llist_init()
107 llist->tail = NULL; in spl_ptr_llist_init()
108 llist->count = 0; in spl_ptr_llist_init()
110 return llist; in spl_ptr_llist_init()
114 static zend_long spl_ptr_llist_count(spl_ptr_llist *llist) /* {{{ */ in spl_ptr_llist_count() argument
116 return (zend_long)llist->count; in spl_ptr_llist_count()
120 static void spl_ptr_llist_destroy(spl_ptr_llist *llist) /* {{{ */ in spl_ptr_llist_destroy() argument
122 spl_ptr_llist_element *current = llist->head, *next; in spl_ptr_llist_destroy()
131 efree(llist); in spl_ptr_llist_destroy()
135 static spl_ptr_llist_element *spl_ptr_llist_offset(spl_ptr_llist *llist, zend_long offset, int back… in spl_ptr_llist_offset() argument
142 current = llist->tail; in spl_ptr_llist_offset()
144 current = llist->head; in spl_ptr_llist_offset()
160 static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data) /* {{{ */ in spl_ptr_llist_unshift() argument
165 elem->next = llist->head; in spl_ptr_llist_unshift()
169 if (llist->head) { in spl_ptr_llist_unshift()
170 llist->head->prev = elem; in spl_ptr_llist_unshift()
172 llist->tail = elem; in spl_ptr_llist_unshift()
175 llist->head = elem; in spl_ptr_llist_unshift()
176 llist->count++; in spl_ptr_llist_unshift()
180 static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data) /* {{{ */ in spl_ptr_llist_push() argument
184 elem->prev = llist->tail; in spl_ptr_llist_push()
189 if (llist->tail) { in spl_ptr_llist_push()
190 llist->tail->next = elem; in spl_ptr_llist_push()
192 llist->head = elem; in spl_ptr_llist_push()
195 llist->tail = elem; in spl_ptr_llist_push()
196 llist->count++; in spl_ptr_llist_push()
200 static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret) /* {{{ */ in spl_ptr_llist_pop() argument
202 spl_ptr_llist_element *tail = llist->tail; in spl_ptr_llist_pop()
212 llist->head = NULL; in spl_ptr_llist_pop()
215 llist->tail = tail->prev; in spl_ptr_llist_pop()
216 llist->count--; in spl_ptr_llist_pop()
226 static zval *spl_ptr_llist_last(spl_ptr_llist *llist) /* {{{ */ in spl_ptr_llist_last() argument
228 spl_ptr_llist_element *tail = llist->tail; in spl_ptr_llist_last()
238 static zval *spl_ptr_llist_first(spl_ptr_llist *llist) /* {{{ */ in spl_ptr_llist_first() argument
240 spl_ptr_llist_element *head = llist->head; in spl_ptr_llist_first()
250 static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret) /* {{{ */ in spl_ptr_llist_shift() argument
252 spl_ptr_llist_element *head = llist->head; in spl_ptr_llist_shift()
262 llist->tail = NULL; in spl_ptr_llist_shift()
265 llist->head = head->next; in spl_ptr_llist_shift()
266 llist->count--; in spl_ptr_llist_shift()
298 if (intern->llist) { in spl_dllist_object_free_storage()
299 while (intern->llist->count > 0) { in spl_dllist_object_free_storage()
300 spl_ptr_llist_pop(intern->llist, &tmp); in spl_dllist_object_free_storage()
303 spl_ptr_llist_destroy(intern->llist); in spl_dllist_object_free_storage()
328 intern->llist = spl_ptr_llist_init(); in spl_dllist_object_new_ex()
329 spl_ptr_llist_copy(other->llist, intern->llist); in spl_dllist_object_new_ex()
330 intern->traverse_pointer = intern->llist->head; in spl_dllist_object_new_ex()
333 intern->llist = other->llist; in spl_dllist_object_new_ex()
334 intern->traverse_pointer = intern->llist->head; in spl_dllist_object_new_ex()
340 intern->llist = spl_ptr_llist_init(); in spl_dllist_object_new_ex()
341 intern->traverse_pointer = intern->llist->head; in spl_dllist_object_new_ex()
422 *count = spl_ptr_llist_count(intern->llist); in spl_dllist_object_count_elements()
430 spl_ptr_llist_element *current = intern->llist->head, *next; in spl_dllist_object_get_debug_info()
474 spl_ptr_llist_element *current = intern->llist->head; in spl_dllist_object_get_gc()
497 spl_ptr_llist_push(intern->llist, value); in PHP_METHOD()
512 spl_ptr_llist_unshift(intern->llist, value); in PHP_METHOD()
526 spl_ptr_llist_pop(intern->llist, return_value); in PHP_METHOD()
545 spl_ptr_llist_shift(intern->llist, return_value); in PHP_METHOD()
565 value = spl_ptr_llist_last(intern->llist); in PHP_METHOD()
587 value = spl_ptr_llist_first(intern->llist); in PHP_METHOD()
608 count = spl_ptr_llist_count(intern->llist); in PHP_METHOD()
678 RETURN_BOOL(index >= 0 && index < intern->llist->count); in PHP_METHOD()
694 if (index < 0 || index >= intern->llist->count) { in PHP_METHOD()
699 element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); in PHP_METHOD()
724 spl_ptr_llist_push(intern->llist, value); in PHP_METHOD()
729 if (index < 0 || index >= intern->llist->count) { in PHP_METHOD()
734 element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); in PHP_METHOD()
755 spl_ptr_llist *llist; in PHP_METHOD() local
762 llist = intern->llist; in PHP_METHOD()
764 if (index < 0 || index >= intern->llist->count) { in PHP_METHOD()
769 element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); in PHP_METHOD()
782 if (element == llist->head) { in PHP_METHOD()
783 llist->head = element->next; in PHP_METHOD()
786 if (element == llist->tail) { in PHP_METHOD()
787 llist->tail = element->prev; in PHP_METHOD()
791 llist->count--; in PHP_METHOD()
818 …lement **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{… in spl_dllist_it_helper_rewind() argument
823 *traverse_position_ptr = llist->count-1; in spl_dllist_it_helper_rewind()
824 *traverse_pointer_ptr = llist->tail; in spl_dllist_it_helper_rewind()
827 *traverse_pointer_ptr = llist->head; in spl_dllist_it_helper_rewind()
834 …lement **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{… in spl_dllist_it_helper_move_forward() argument
845 spl_ptr_llist_pop(llist, &prev); in spl_dllist_it_helper_move_forward()
854 spl_ptr_llist_shift(llist, &prev); in spl_dllist_it_helper_move_forward()
872 spl_ptr_llist *llist = object->llist; in spl_dllist_it_rewind() local
874 …spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, iter… in spl_dllist_it_rewind()
913 …forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, iterator->flags); in spl_dllist_it_move_forward()
939 …ve_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ S… in PHP_METHOD()
952 …_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags); in PHP_METHOD()
978 …spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, … in PHP_METHOD()
1005 spl_ptr_llist_element *current = intern->llist->head, *next; in PHP_METHOD()
1053 while (intern->llist->count > 0) { in PHP_METHOD()
1055 spl_ptr_llist_pop(intern->llist, &tmp); in PHP_METHOD()
1079 spl_ptr_llist_push(intern->llist, elem); in PHP_METHOD()
1100 spl_ptr_llist_element *current = intern->llist->head; in PHP_METHOD()
1114 array_init_size(&tmp, intern->llist->count); in PHP_METHOD()
1152 spl_ptr_llist_push(intern->llist, elem); in PHP_METHOD()
1172 if (index < 0 || index > intern->llist->count) { in PHP_METHOD()
1177 if (index == intern->llist->count) { in PHP_METHOD()
1179 spl_ptr_llist_push(intern->llist, value); in PHP_METHOD()
1185 element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); in PHP_METHOD()
1196 intern->llist->head = elem; in PHP_METHOD()
1202 intern->llist->count++; in PHP_METHOD()