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

Linked-list functions

Filename: sfllist.h
Package: Standard Function Library (SFL)
Written: 1997/07/28 iMatix SFL project team sfl@imatix.com
Revised: 1998/07/26
Copyright: Copyright (c) 1996-2000 iMatix Corporation

Synopsis

Provides functions to maintain doubly-linked lists. You can use these functions to work with lists of any structure. To make this work, all structures must start with two pointers, "void *next, *prev;". When you want to attach a linked-list to another structure, declare the list head as a list. You can then refer to this variable when you attach items to the list head. The code sets the global list_unsafe to TRUE whenever it is changing a list.

List of Functions

List of Symbol Definitions

sfllist.h defines these symbols, possibly conditionally:
Symbol: Defined as:
FORLIST(node,root) for ((node) = (root).next;
SFLLIST_INCLUDED TRUE
list_create(node,size) if (((node) = mem_alloc (size)) != NULL)
list_destroy(list) while (!list_empty(list))
list_empty(list) ((list)-> prev == (list))
list_pop(list,item) list_remove (list,
list_push(list,item) list_add (list,
list_queue(list,item) list_add (((LIST *)list)-> prev,
list_relink_after(l,a) (list_relink (a, l, ((LIST *) a)-> next))
list_relink_before(l,b) (list_relink (((LIST *) b)-> prev, l, b))
list_reset(list) (list)-> prev = (list)-> next = (list)

List of Type Definitions

Type name: Defined as:
NODE_COMPARE Bool (*) (LIST *t1, LIST *t2)

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