Пример #1
0
List list_create(ListDelF f)
{
    List l;

    if (!(l = list_alloc()))
        return(out_of_memory());
    l->head = NULL;
    l->tail = &l->head;
    l->iNext = NULL;
    l->fDel = f;
    l->count = 0;
    list_mutex_init(&l->mutex);
    assert(l->magic = LIST_MAGIC);      /* set magic via assert abuse */
    return(l);
}
Пример #2
0
List
list_create (ListDelF f)
{
    List l;

    if (!(l = list_alloc()))
        return(lsd_nomem_error(__FILE__, __LINE__, "list create"));
    l->head = NULL;
    l->tail = &l->head;
    l->iNext = NULL;
    l->fDel = f;
    l->count = 0;
    list_mutex_init(&l->mutex);
    assert(l->magic = LIST_MAGIC);      /* set magic via assert abuse */
    return(l);
}