src/imap/imap.c
/*
 * Returns NULL in case an error has occurred.
 *
 * When successful a BORROWED pointer to slist is returned.
 */
Returns NULL in case an error has occurred.
When successful a BORROWED pointer to slist is returned.
Returns NULL in case an error has occurred . When successful a BORROWED pointer to slist is returned .
slist_t * imap_slist(imap_t * imap)
{
    if (imap->slist == NULL)
    {
        imap->slist = slist_new(imap->len);
        if (imap->slist != NULL && imap->len)
        {
            imap_node_t * nd;
            for (uint_fast8_t i = 0; i < IMAP_NODE_SZ; i++)
            {
                nd = imap->nodes + i;
                if (nd->data != NULL)
                {
                    slist_append(imap->slist, nd->data);
                }
                if (nd->nodes != NULL)
                {
                    IMAP_2slist(nd, imap->slist);
                }
            }
        }
    }
    return imap->slist;
}
slist_t * imap_slist ( imap_t * imap ) { if ( imap -> slist == NULL ) { imap -> slist = slist_new ( imap -> len ) ; if ( imap -> slist != NULL && imap -> len ) { imap_node_t * nd ; for ( uint_fast8_t i = 0 ; i < IMAP_NODE_SZ ; i ++ ) { nd = imap -> nodes + i ; if ( nd -> data != NULL ) { slist_append ( imap -> slist , nd -> data ) ; } if ( nd -> nodes != NULL ) { IMAP_2slist ( nd , imap -> slist ) ; } } } } return imap -> slist ; }
Returns NULL in case an error has occurred.
Returns NULL in case an error has occurred .