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

 

list_add

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

Synopsis

Creates a node at the head of a list of a specified size and copies the specified data into it. Use with the stack & queue macros list_push and list_queue.

Source Code - (sfllist.c)

{
    LIST
        *node;

    node = mem_alloc (sizeof (LIST) + size);
    if (node)
      {
        list_reset (node);
        list_relink_after (node, list);
        memcpy ((char *) node + sizeof (LIST), (char *) data, size);
      }
    return node;
}

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