| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

list_remove

#include "sfllist.h"
void
list_remove (LIST *list, void *data, size_t size)

Synopsis

Removes the node at the head of a list, copying the specified amount of data to the specified data block. This size must be exactly equal to the size of the data block. The list may not be empty. Use this with the macro list_pop.

Source Code - (sfllist.c)

{
LIST
    *node;

    ASSERT (!list_empty (list));

    node = list-> next;
    ASSERT (mem_size (node) - sizeof (LIST) == size);

    memcpy ((char *) data, (char *) node + sizeof (LIST), size);
    list unlink (node);
    mem_free (node);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation