src/slist/slist.c
/*
 * Returns NULL in case an error has occurred.
 *
 * In case the size is unknown, SLIST_DEFAULT_SIZE is recommended since in this
 * case we can do a re-allocation with multiples of 64K.
 */
Returns NULL in case an error has occurred.
In case the size is unknown, SLIST_DEFAULT_SIZE is recommended since in this
case we can do a re-allocation with multiples of 64K.
Returns NULL in case an error has occurred . In case the size is unknown SLIST_DEFAULT_SIZE is recommended since in this case we can do a re - allocation with multiples of 64K .
slist_t * slist_new(size_t size)
{
    slist_t * slist = (slist_t *)
            malloc(sizeof(slist_t) + sizeof(void *) * size);
    if (slist == NULL)
    {
        return NULL;
    }
    slist->size = size;
    slist->len = 0;
    return slist;
}
slist_t * slist_new ( size_t size ) { slist_t * slist = ( slist_t * ) malloc ( sizeof ( slist_t ) + sizeof ( void * ) * size ) ; if ( slist == NULL ) { return NULL ; } slist -> size = size ; slist -> len = 0 ; return slist ; }
Returns NULL in case an error has occurred.
Returns NULL in case an error has occurred .
/* sizeof(slist_t) is 16 bytes, only for len and size and data[] is
     * excluded.
     */