src/adlist.c
listIter *listGetIterator(list *list, int direction)
{
    listIter *iter;

    if ((iter = zmalloc(sizeof(*iter))) == NULL) return NULL;
    if (direction == AL_START_HEAD)
        iter->next = list->head;
    else
        iter->next = list->tail;
    iter->direction = direction;
    return iter;
}
/* Returns a list iterator 'iter'. After the initialization every
 * call to listNext() will return the next element of the list.
 *
 * This function can't fail. */
Returns a list iterator 'iter'. After the initialization every
call to listNext() will return the next element of the list.

This function can't fail.
Returns a list iterator ' iter ' . After the initialization every call to listNext () will return the next element of the list . This function can ' t fail .
listIter *listGetIterator(list *list, int direction)
{
    listIter *iter;
    if ((iter = zmalloc(sizeof(*iter))) == NULL) return NULL;
    if (direction == AL_START_HEAD)
        iter->next = list->head;
    else
        iter->next = list->tail;
    iter->direction = direction;
    return iter;
}
listIter * listGetIterator ( list * list , int direction ) { listIter * iter ; if ( ( iter = zmalloc ( sizeof ( * iter ) ) ) == NULL ) return NULL ; if ( direction == AL_START_HEAD ) iter -> next = list -> head ; else iter -> next = list -> tail ; iter -> direction = direction ; return iter ; }
Returns a list iterator 'iter'.
Returns a list iterator ' iter ' .