ns2 Network Simulator      C++ Class Hierarchy of version ns-snapshot-20040722
Home |  Source Code |  Manual |  FAQ |  Mailing List Archive |  Search |  Download | 


Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ns-2/lib/bsd-list.h File Reference


Defines

#define LIST_HEAD(name, type)
#define LIST_ENTRY(type)
#define LIST_INIT(head)
#define LIST_INSERT_AFTER(listelm, elm, field)
#define LIST_INSERT_BEFORE(listelm, elm, field)
#define LIST_INSERT_HEAD(head, elm, field)
#define LIST_REMOVE(elm, field)

Define Documentation

#define LIST_ENTRY type   
 

Value:

struct {                                                                \
        type *le_next;                          \
        type **le_prev;         \
}

#define LIST_HEAD name,
type   
 

Value:

struct name {                                                           \
        type *lh_first;                         \
}

#define LIST_INIT head   
 

Value:

{                                               \
        (head)->lh_first = NULL;                                        \
}

#define LIST_INSERT_AFTER listelm,
elm,
field   
 

Value:

{                       \
        if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
                (listelm)->field.le_next->field.le_prev =               \
                    &(elm)->field.le_next;                              \
        (listelm)->field.le_next = (elm);                               \
        (elm)->field.le_prev = &(listelm)->field.le_next;               \
}

#define LIST_INSERT_BEFORE listelm,
elm,
field   
 

Value:

{                       \
        (elm)->field.le_prev = (listelm)->field.le_prev;                \
        (elm)->field.le_next = (listelm);                               \
        *(listelm)->field.le_prev = (elm);                              \
        (listelm)->field.le_prev = &(elm)->field.le_next;               \
}

#define LIST_INSERT_HEAD head,
elm,
field   
 

Value:

{                               \
        if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
                (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
        (head)->lh_first = (elm);                                       \
        (elm)->field.le_prev = &(head)->lh_first;                       \
}

#define LIST_REMOVE elm,
field   
 

Value:

{                                       \
        if ((elm)->field.le_next != NULL)                               \
                (elm)->field.le_next->field.le_prev =                   \
                    (elm)->field.le_prev;                               \
        *(elm)->field.le_prev = (elm)->field.le_next;                   \
}


This document is generated by doxygen.