Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

queue.h File Reference

Go to the source code of this file.

Defines

#define LIST_HEAD(name, type)
 Declare/define a list head.

#define LIST_HEAD_INITIALIZER(head)   { NULL }
#define LIST_ENTRY(type)
 declare/define a list entry

#define LIST_ENTRY_INITIALIZER   { NULL, NULL }
#define LIST_INIT(head)
 Initialize a list to be valid and have no entries.

#define LIST_ENTRY_INIT(elm, field)
#define LIST_INSERT_AFTER(listelm, elm, field)
#define LIST_INSERT_BEFORE(listelm, elm, field)
#define LIST_INSERT_HEAD(head, elm, field)
 Insert at the top.

#define LIST_REMOVE(elm, field)
 remove an item from a list

#define LIST_FIRST(head)   ((head)->lh_first)
 Get the first item.

#define LIST_NEXT(elm, field)   ((elm)->field.le_next)
 Get the next item.

#define SIMPLEQ_HEAD(name, type)
#define SIMPLEQ_HEAD_INITIALIZER(head)   { NULL, &(head).sqh_first }
#define SIMPLEQ_ENTRY(type)
#define SIMPLEQ_INIT(head)
#define SIMPLEQ_INSERT_HEAD(head, elm, field)
#define SIMPLEQ_INSERT_TAIL(head, elm, field)
#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field)
#define SIMPLEQ_REMOVE_HEAD(head, elm, field)
#define TAILQ_HEAD(name, type)
#define TAILQ_HEAD_INITIALIZER(head)   { NULL, &(head).tqh_first }
#define TAILQ_ENTRY(type)
#define TAILQ_INIT(head)
#define TAILQ_INSERT_HEAD(head, elm, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
#define TAILQ_REMOVE(head, elm, field)
#define CIRCLEQ_HEAD(name, type)
#define CIRCLEQ_HEAD_INITIALIZER(head)   { (void *)&head, (void *)&head }
#define CIRCLEQ_ENTRY(type)
#define CIRCLEQ_INIT(head)
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field)
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field)
#define CIRCLEQ_INSERT_HEAD(head, elm, field)
#define CIRCLEQ_INSERT_TAIL(head, elm, field)
#define CIRCLEQ_REMOVE(head, elm, field)


Detailed Description

Macros used for services' linked lists.

NetBSD
queue.h,v 1.13 1997/02/08 04:47:41 mrg Exp
Id
queue.h,v 1.1.1.1 2003/07/04 02:56:10 Mysid Exp

Definition in file queue.h.


Define Documentation

#define CIRCLEQ_ENTRY type   ) 
 

Value:

struct {                                \
    struct type *cqe_next;              \
    struct type *cqe_prev;              \
}

Definition at line 279 of file queue.h.

#define CIRCLEQ_HEAD name,
type   ) 
 

Value:

struct name {                               \
    struct type *cqh_first;             \
    struct type *cqh_last;              \
}

Definition at line 270 of file queue.h.

#define CIRCLEQ_INIT head   ) 
 

Value:

do {                        \
    (head)->cqh_first = (void *)(head);             \
    (head)->cqh_last = (void *)(head);              \
} while (0)

Definition at line 288 of file queue.h.

#define CIRCLEQ_INSERT_AFTER head,
listelm,
elm,
field   ) 
 

Value:

do {        \
    (elm)->field.cqe_next = (listelm)->field.cqe_next;      \
    (elm)->field.cqe_prev = (listelm);              \
    if ((listelm)->field.cqe_next == (void *)(head))        \
        (head)->cqh_last = (elm);               \
    else                                \
        (listelm)->field.cqe_next->field.cqe_prev = (elm);  \
    (listelm)->field.cqe_next = (elm);              \
} while (0)

Definition at line 293 of file queue.h.

#define CIRCLEQ_INSERT_BEFORE head,
listelm,
elm,
field   ) 
 

Value:

do {        \
    (elm)->field.cqe_next = (listelm);              \
    (elm)->field.cqe_prev = (listelm)->field.cqe_prev;      \
    if ((listelm)->field.cqe_prev == (void *)(head))        \
        (head)->cqh_first = (elm);              \
    else                                \
        (listelm)->field.cqe_prev->field.cqe_next = (elm);  \
    (listelm)->field.cqe_prev = (elm);              \
} while (0)

Definition at line 303 of file queue.h.

#define CIRCLEQ_INSERT_HEAD head,
elm,
field   ) 
 

Value:

do {            \
    (elm)->field.cqe_next = (head)->cqh_first;          \
    (elm)->field.cqe_prev = (void *)(head);             \
    if ((head)->cqh_last == (void *)(head))             \
        (head)->cqh_last = (elm);               \
    else                                \
        (head)->cqh_first->field.cqe_prev = (elm);      \
    (head)->cqh_first = (elm);                  \
} while (0)

Definition at line 313 of file queue.h.

#define CIRCLEQ_INSERT_TAIL head,
elm,
field   ) 
 

Value:

do {            \
    (elm)->field.cqe_next = (void *)(head);             \
    (elm)->field.cqe_prev = (head)->cqh_last;           \
    if ((head)->cqh_first == (void *)(head))            \
        (head)->cqh_first = (elm);              \
    else                                \
        (head)->cqh_last->field.cqe_next = (elm);       \
    (head)->cqh_last = (elm);                   \
} while (0)

Definition at line 323 of file queue.h.

#define CIRCLEQ_REMOVE head,
elm,
field   ) 
 

Value:

do {                \
    if ((elm)->field.cqe_next == (void *)(head))            \
        (head)->cqh_last = (elm)->field.cqe_prev;       \
    else                                \
        (elm)->field.cqe_next->field.cqe_prev =         \
            (elm)->field.cqe_prev;              \
    if ((elm)->field.cqe_prev == (void *)(head))            \
        (head)->cqh_first = (elm)->field.cqe_next;      \
    else                                \
        (elm)->field.cqe_prev->field.cqe_next =         \
            (elm)->field.cqe_next;              \
} while (0)

Definition at line 333 of file queue.h.

#define LIST_ENTRY type   ) 
 

Value:

struct {                                \
    struct type *le_next;               \
    struct type **le_prev;      \
}
declare/define a list entry

Parameters:
type Datatype of a list entry Example:

Definition at line 94 of file queue.h.

#define LIST_ENTRY_INIT elm,
field   ) 
 

Value:

do {                \
    (elm)->field.le_next = NULL;                    \
    (elm)->field.le_prev = NULL;                    \
} while (0)
Parameters:
Initialize LIST_ENTRY structure

Definition at line 110 of file queue.h.

Referenced by addNick(), addRegNick(), and readMemoData().

#define LIST_FIRST head   )     ((head)->lh_first)
 

Get the first item.

Parameters:
head List head

Definition at line 144 of file queue.h.

Referenced by addRegNick(), checkAccess(), checkAkillAllUsers(), delAccessMask(), delRegNick(), expire_ads(), find_ad(), FindChannelTrigger(), flush_ad(), getNickData(), getRegNickData(), ms_delete(), IpcType::queryRegNickMessage(), saveMemoData(), and saveNickData().

#define LIST_HEAD name,
type   ) 
 

Value:

struct name {                               \
    struct type *lh_first;              \
}
Declare/define a list head.

Parameters:
name Name to give new list structure
type Datatype of list items Example:
  LIST_HEAD(,_memolist)    mb_memos;

Definition at line 86 of file queue.h.

#define LIST_INIT head   ) 
 

Value:

do {                        \
    (head)->lh_first = NULL;                    \
} while (0)
Initialize a list to be valid and have no entries.

Parameters:
head Name of list head Example:

Definition at line 106 of file queue.h.

#define LIST_INSERT_AFTER listelm,
elm,
field   ) 
 

Value:

do {            \
    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;       \
} while (0)
Parameters:
Insert before reference point
listelm Name of reference element
elm Name of element to insert
list entry field on the reference element

Definition at line 115 of file queue.h.

Referenced by addRegNick().

#define LIST_INSERT_BEFORE listelm,
elm,
field   ) 
 

Value:

do {            \
    (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;       \
} while (0)
Parameters:
Insert after reference point
listelm Name of reference element
elm Name of element to insert
list entry field on the reference element

Definition at line 123 of file queue.h.

Referenced by addRegNick().

#define LIST_INSERT_HEAD head,
elm,
field   ) 
 

Value:

do {                \
    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;           \
} while (0)
Insert at the top.

Parameters:
head Head of the list
elm Name of element to insert
list entry field on the reference element

Definition at line 130 of file queue.h.

Referenced by AddChannelTrigger(), addNick(), addRegNick(), insert_ad(), and readMemoData().

#define LIST_NEXT elm,
field   )     ((elm)->field.le_next)
 

Get the next item.

Parameters:
elm Reference element
head List head

Definition at line 147 of file queue.h.

Referenced by addRegNick(), checkAccess(), checkAkillAllUsers(), delAccessMask(), delRegNick(), expire_ads(), find_ad(), FindChannelTrigger(), flush_ad(), getNickData(), getRegNickData(), ms_delete(), IpcType::queryRegNickMessage(), saveMemoData(), and saveNickData().

#define LIST_REMOVE elm,
field   ) 
 

Value:

do {                    \
    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;           \
} while (0)
remove an item from a list

Parameters:
elm Name of element to remove
list entry field

Definition at line 137 of file queue.h.

Referenced by DelChannelTrigger(), delNick(), delRegNick(), ms_delete(), remove_ad(), and unlink_ad().

#define SIMPLEQ_ENTRY type   ) 
 

Value:

struct {                                \
    struct type *sqe_next;              \
}

Definition at line 162 of file queue.h.

#define SIMPLEQ_HEAD name,
type   ) 
 

Value:

struct name {                               \
    struct type *sqh_first;             \
    struct type **sqh_last;         \
}

Definition at line 153 of file queue.h.

#define SIMPLEQ_INIT head   ) 
 

Value:

do {                        \
    (head)->sqh_first = NULL;                   \
    (head)->sqh_last = &(head)->sqh_first;              \
} while (0)

Definition at line 170 of file queue.h.

#define SIMPLEQ_INSERT_AFTER head,
listelm,
elm,
field   ) 
 

Value:

do {        \
    if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
        (head)->sqh_last = &(elm)->field.sqe_next;      \
    (listelm)->field.sqe_next = (elm);              \
} while (0)

Definition at line 187 of file queue.h.

#define SIMPLEQ_INSERT_HEAD head,
elm,
field   ) 
 

Value:

do {            \
    if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)    \
        (head)->sqh_last = &(elm)->field.sqe_next;      \
    (head)->sqh_first = (elm);                  \
} while (0)

Definition at line 175 of file queue.h.

#define SIMPLEQ_INSERT_TAIL head,
elm,
field   ) 
 

Value:

do {            \
    (elm)->field.sqe_next = NULL;                   \
    *(head)->sqh_last = (elm);                  \
    (head)->sqh_last = &(elm)->field.sqe_next;          \
} while (0)

Definition at line 181 of file queue.h.

#define SIMPLEQ_REMOVE_HEAD head,
elm,
field   ) 
 

Value:

do {            \
    if (((head)->sqh_first = (elm)->field.sqe_next) == NULL)    \
        (head)->sqh_last = &(head)->sqh_first;          \
} while (0)

Definition at line 193 of file queue.h.

#define TAILQ_ENTRY type   ) 
 

Value:

struct {                                \
    struct type *tqe_next;              \
    struct type **tqe_prev;     \
}

Definition at line 210 of file queue.h.

#define TAILQ_HEAD name,
type   ) 
 

Value:

struct name {                               \
    struct type *tqh_first;             \
    struct type **tqh_last;         \
}

Definition at line 201 of file queue.h.

#define TAILQ_INIT head   ) 
 

Value:

do {                        \
    (head)->tqh_first = NULL;                   \
    (head)->tqh_last = &(head)->tqh_first;              \
} while (0)

Definition at line 219 of file queue.h.

#define TAILQ_INSERT_AFTER head,
listelm,
elm,
field   ) 
 

Value:

do {        \
    if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
        (elm)->field.tqe_next->field.tqe_prev =         \
            &(elm)->field.tqe_next;             \
    else                                \
        (head)->tqh_last = &(elm)->field.tqe_next;      \
    (listelm)->field.tqe_next = (elm);              \
    (elm)->field.tqe_prev = &(listelm)->field.tqe_next;     \
} while (0)

Definition at line 241 of file queue.h.

#define TAILQ_INSERT_BEFORE listelm,
elm,
field   ) 
 

Value:

do {            \
    (elm)->field.tqe_prev = (listelm)->field.tqe_prev;      \
    (elm)->field.tqe_next = (listelm);              \
    *(listelm)->field.tqe_prev = (elm);             \
    (listelm)->field.tqe_prev = &(elm)->field.tqe_next;     \
} while (0)

Definition at line 251 of file queue.h.

#define TAILQ_INSERT_HEAD head,
elm,
field   ) 
 

Value:

do {            \
    if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)    \
        (head)->tqh_first->field.tqe_prev =         \
            &(elm)->field.tqe_next;             \
    else                                \
        (head)->tqh_last = &(elm)->field.tqe_next;      \
    (head)->tqh_first = (elm);                  \
    (elm)->field.tqe_prev = &(head)->tqh_first;         \
} while (0)

Definition at line 224 of file queue.h.

#define TAILQ_INSERT_TAIL head,
elm,
field   ) 
 

Value:

do {            \
    (elm)->field.tqe_next = NULL;                   \
    (elm)->field.tqe_prev = (head)->tqh_last;           \
    *(head)->tqh_last = (elm);                  \
    (head)->tqh_last = &(elm)->field.tqe_next;          \
} while (0)

Definition at line 234 of file queue.h.

#define TAILQ_REMOVE head,
elm,
field   ) 
 

Value:

do {                \
    if (((elm)->field.tqe_next) != NULL)                \
        (elm)->field.tqe_next->field.tqe_prev =         \
            (elm)->field.tqe_prev;              \
    else                                \
        (head)->tqh_last = (elm)->field.tqe_prev;       \
    *(elm)->field.tqe_prev = (elm)->field.tqe_next;         \
} while (0)

Definition at line 258 of file queue.h.


Generated at Sat Oct 25 20:56:12 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.