mdblist.h File Reference
Go to the source code of this file.
Data Structures
Defines
- #define list_entry(ptr, type, member) ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
- Get the struct for this entry.
- #define list_for_each(pos, head) for (pos = (head)->next; pos != (head); pos = pos->next)
- Iterate over a list.
- #define list_for_each_safe(pos, n, head)
- Iterate over a list safe against removal of list entry.
- #define list_for_each_ex(pos, head, begin) for (pos = (begin)->next; pos != (head); pos = (pos)->next)
- Iterate over a list.
- #define list_for_index(pos, i, head, index) for (pos = (head)->next, i=0; (pos != (head) && i < index); pos = pos->next,i++)
- Iterate over a list for index.
Typedefs
Functions
- static void list_add (struct list_head *_new, struct list_head *head)
- Add a _new entry, insert a _new entry after the specified head. This is good for implementing stacks.
- static void list_add_tail (struct list_head *_new, struct list_head *head)
- Add a _new entry, insert a _new entry before the specified head. This is useful for implementing queues.
- static void list_del (struct list_head *entry)
- Deletes entry from list. Note: list_empty on entry does not return true after this, the entry is in an undefined state.
- static void list_del_init (struct list_head *entry)
- Deletes entry from list and reinitialize it.
- static int list_empty (struct list_head *head)
- Tests whether a list is empty.
Detailed Description
- Author:
- Date:
This file includes the list operations.
Copyright (C) 2009 Feynman Software.
All rights reserved by Feynman Software.
This file is part of mgncs, which is new control
set of MiniGUI.
Definition in file mdblist.h.
Define Documentation
#define list_entry |
( |
ptr, |
|
|
type, |
|
|
member |
|
) |
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
Get the struct for this entry.
- Parameters:
-
| ptr | The &struct list_head pointer. |
| type | The type of the struct this is embedded in. |
| member | The name of the list_struct within the struct. |
Definition at line 172 of file mdblist.h.
#define list_for_each |
( |
pos, |
|
|
head |
|
) |
for (pos = (head)->next; pos != (head); pos = pos->next) |
Iterate over a list.
- Parameters:
-
| pos | The &struct list_head to use as a loop counter. |
| head | The head for your list. |
Definition at line 181 of file mdblist.h.
#define list_for_each_ex |
( |
pos, |
|
|
head, |
|
|
begin |
|
) |
for (pos = (begin)->next; pos != (head); pos = (pos)->next) |
Iterate over a list.
- Parameters:
-
| pos | The &struct list_head to use as a loop counter. |
| head | The head for your list. |
| begin | The previous item of the begining item |
Definition at line 202 of file mdblist.h.
#define list_for_each_safe |
( |
pos, |
|
|
n, |
|
|
head |
|
) |
|
Value:for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
Iterate over a list safe against removal of list entry.
- Parameters:
-
| pos | The &struct list_head to use as a loop counter. |
| n | Another &struct list_head to use as temporary storage |
| head | The head for your list. |
Definition at line 191 of file mdblist.h.
#define list_for_index |
( |
pos, |
|
|
i, |
|
|
head, |
|
|
index |
|
) |
for (pos = (head)->next, i=0; (pos != (head) && i < index); pos = pos->next,i++) |
Iterate over a list for index.
- Parameters:
-
| pos | The &struct list_head to use as a loop counter. |
| i | The index used to record current position. |
| head | The head for your list. |
| index | The maximum index for your list. |
Definition at line 214 of file mdblist.h.
Typedef Documentation
The structure of double linked list.
Definition at line 53 of file mdblist.h.
Function Documentation
Add a _new entry, insert a _new entry after the specified head. This is good for implementing stacks.
- Parameters:
-
| _new | _new entry to be added |
| head | list head to add it after |
Insert a _new entry after the specified head. This is good for implementing stacks.
Definition at line 95 of file mdblist.h.
Add a _new entry, insert a _new entry before the specified head. This is useful for implementing queues.
- Parameters:
-
| _new | _new entry to be added |
| head | list head to add it before |
Insert a _new entry before the specified head. This is useful for implementing queues.
Definition at line 110 of file mdblist.h.
void list_del |
( |
struct list_head * |
entry |
) |
[inline, static] |
Deletes entry from list. Note: list_empty on entry does not return true after this, the entry is in an undefined state.
Definition at line 136 of file mdblist.h.
void list_del_init |
( |
struct list_head * |
entry |
) |
[inline, static] |
Deletes entry from list and reinitialize it.
- Parameters:
-
| entry | The element to delete from the list. |
Definition at line 147 of file mdblist.h.
int list_empty |
( |
struct list_head * |
head |
) |
[inline, static] |
Tests whether a list is empty.
- Parameters:
-
Definition at line 159 of file mdblist.h.