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

 

list_relink

#include "sfllist.h"
void *
list_relink (
    void *left,
    void *list,
    void *right)

Synopsis

Links the list into a linked list. This is a general-purpose function that can be used to attach and remove lists anywhere in a list. Sets the global variable 'list_unsafe' while the list is being changed. Returns the address of list.

Source Code - (sfllist.c)

{
    LIST *swap;

    list_unsafe = TRUE;
    swap = ((LIST *) left)-> next;      /*  Exchange left pointers           */
           ((LIST *) left)-> next = list;
    ((LIST *) ((LIST *) list)-> prev)-> next = swap;

    swap = ((LIST *) right)-> prev;     /*  Exchange right pointers          */
           ((LIST *) right)-> prev = ((LIST *) list)-> prev;
                                     ((LIST *) list)-> prev = swap;

    list_unsafe = FALSE;
    return (list);
}

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