list.c
/* Position iterator correctly depenging on the direction */
Position iterator correctly depenging on the direction
Position iterator correctly depenging on the direction
void list_iter_init(list_iter_t *iter, list_t *_list,iter_direction dir)
{
	iter->direction = dir;
	iter->prev = NULL;
	if (_list != NULL) iter->next = dir == FORWARD ? _list->head : _list->tail;
	else iter->next = NULL;
}
void list_iter_init ( list_iter_t * iter , list_t * _list , iter_direction dir ) { iter -> direction = dir ; iter -> prev = NULL ; if ( _list != NULL ) iter -> next = dir == FORWARD ? _list -> head : _list -> tail ; else iter -> next = NULL ; }
Position iterator correctly depenging on the direction
Position iterator correctly depenging on the direction