![]() |
![]() |
![]() |
Camel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
struct CamelDList; struct CamelDListNode; #define CAMEL_DLIST_INITIALISER (l) void camel_dlist_init (CamelDList *v
); CamelDListNode * camel_dlist_addhead (CamelDList *l
,CamelDListNode *n
); CamelDListNode * camel_dlist_addtail (CamelDList *l
,CamelDListNode *n
); CamelDListNode * camel_dlist_remove (CamelDListNode *n
); CamelDListNode * camel_dlist_remhead (CamelDList *l
); CamelDListNode * camel_dlist_remtail (CamelDList *l
); gint camel_dlist_empty (CamelDList *l
); gint camel_dlist_length (CamelDList *l
); struct CamelSListNode; struct CamelSList; #define CAMEL_SLIST_INITIALISER (l) void camel_slist_init (CamelSList *l
); CamelSListNode * camel_slist_addhead (CamelSList *l
,CamelSListNode *n
); CamelSListNode * camel_slist_addtail (CamelSList *l
,CamelSListNode *n
); CamelSListNode * camel_slist_remove (CamelSList *l
,CamelSListNode *n
); CamelSListNode * camel_slist_remhead (CamelSList *l
); CamelSListNode * camel_slist_remtail (CamelSList *l
); gint camel_slist_empty (CamelSList *l
); gint camel_slist_length (CamelSList *l
);
struct CamelDList { struct _CamelDListNode *head; struct _CamelDListNode *tail; struct _CamelDListNode *tailpred; };
struct CamelDListNode { struct _CamelDListNode *next; struct _CamelDListNode *prev; };
#define CAMEL_DLIST_INITIALISER(l) { (CamelDListNode *)&l.tail, NULL, (CamelDListNode *)&l.head }
void camel_dlist_init (CamelDList *v
);
Initialise a double-linked list header. All list headers must be initialised before use.
CamelDListNode * camel_dlist_addhead (CamelDList *l
,CamelDListNode *n
);
Add the list node n
to the head (start) of the list l
.
|
An initialised list header. |
|
A node, the next and prev pointers will be overwritten. |
Returns : |
n . |
CamelDListNode * camel_dlist_addtail (CamelDList *l
,CamelDListNode *n
);
Add the list onde n
to the tail (end) of the list l
.
|
An intialised list header. |
|
A node, the next and prev pointers will be overwritten. |
Returns : |
n . |
CamelDListNode * camel_dlist_remove (CamelDListNode *n
);
Remove n
from the list it's in. n
must belong to a list.
|
A node which is part of a list. |
Returns : |
n . |
CamelDListNode * camel_dlist_remhead (CamelDList *l
);
Remove the head node (start) of the list.
xReturn value: The previously first-node in the list, or NULLif l
is an empty list.
|
An initialised list, maybe containing items. |
CamelDListNode * camel_dlist_remtail (CamelDList *l
);
Remove the last node in the list.
|
An initialised list, maybe containing items. |
Returns : |
The previously last-node in the list, or NULL if l
is an empty list. |
gint camel_dlist_empty (CamelDList *l
);
Returns TRUE
if l
is an empty list.
|
An initialised list header. |
Returns : |
TRUE if l is an empty list, FALSE otherwise. |
gint camel_dlist_length (CamelDList *l
);
Returns the number of nodes in the list l
.
|
An initialised list header. |
Returns : |
The number of nodes. |