In Linux, list is a universal system linked list, which is widely used in various places of the system, such as system message queues and process lists. It can be said that this list will be used as long as there is a table.
Http://download1.csdn.net/down3/20070530/30164350798.h
Today, we will first parse the information related to initialization.Code:
1. header node Structure
Struct list_head {
Struct list_head * Next, * Prev;
};
This is the same as writing a linked list to define a header node.
We can see from next and Prev that this is a two-way linked list.
However, the difference is that there is no content in this node structure, that is, the type data we often say;
This is the embodiment of "General.
2. # define list_head_init (name) {& (name), & (name )}
Define a macro initialized by list_head. The content in the braces below does not seem to be readable currently.
# Define list_head (name )/
Struct list_head name = list_head_init (name)
In this way, we can understand the combination of the two nodes. When we execute the list_head (name) Macro, we will create a header node and use & name to initialize the two member pointers of this node.
3. static inline void init_list_head (struct list_head * List)
{< br> list-> next = List;
list-> Prev = List;
}< br> This Is An initialization header node function that points next and Prev to itself.