更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
shell_list.h 文件参考

浏览源代码.

结构体

struct  SH_List
 

类型定义

typedef size_t bool
 
typedef struct SH_List SH_List
 

函数

static void SH_ListInit (SH_List *list)
 
static void SH_ListAdd (SH_List *list, SH_List *node)
 Insert a new node to a doubly linked list. 更多...
 
static void SH_ListTailInsert (SH_List *list, SH_List *node)
 Insert a node to the tail of a doubly linked list. 更多...
 
static void SH_ListHeadInsert (SH_List *list, SH_List *node)
 Insert a node to the head of a doubly linked list. 更多...
 
static void SH_ListDelete (SH_List *node)
 
static bool SH_ListEmpty (SH_List *list)
 Identify whether a specified doubly linked list is empty. 更多...
 
static void SH_ListAddList (SH_List *oldList, SH_List *newList)
 Insert a new list to a doubly linked list. 更多...
 
static void SH_ListTailInsertList (SH_List *oldList, SH_List *newList)
 Insert a doubly list to the tail of a doubly linked list. 更多...
 
static void SH_ListHeadInsertList (SH_List *oldList, SH_List *newList)
 Insert a doubly list to the head of a doubly linked list. 更多...
 
static void SH_ListDelInit (SH_List *list)
 Delete initialize a doubly linked list. 更多...
 

类型定义说明

◆ bool

typedef size_t bool

在文件 shell_list.h44 行定义.

◆ SH_List

typedef struct SH_List SH_List

Structure of a node in a doubly linked list.

函数说明

◆ SH_ListAdd()

static void SH_ListAdd ( SH_List list,
SH_List node 
)
inlinestatic

Insert a new node to a doubly linked list.

Description:
This API is used to insert a new node to a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
list[IN] Doubly linked list where the new node is inserted.
node[IN] New node to be inserted.
返回值
None
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListDelete

在文件 shell_list.h141 行定义.

142{
143 node->pstNext = list->pstNext;
144 node->pstPrev = list;
145 list->pstNext->pstPrev = node;
146 list->pstNext = node;
147}
struct SH_List * pstPrev
Definition: shell_list.h:51
struct SH_List * pstNext
Definition: shell_list.h:52
这是这个函数的调用关系图:

◆ SH_ListAddList()

static void SH_ListAddList ( SH_List oldList,
SH_List newList 
)
inlinestatic

Insert a new list to a doubly linked list.

Description:
This API is used to insert a new list to a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
oldList[IN] Doubly linked list where the new list is inserted.
newList[IN] New list to be inserted.
返回值
None
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListDelete

在文件 shell_list.h281 行定义.

282{
283 SH_List *oldListHead = oldList->pstNext;
284 SH_List *oldListTail = oldList;
285 SH_List *newListHead = newList;
286 SH_List *newListTail = newList->pstPrev;
287
288 oldListTail->pstNext = newListHead;
289 newListHead->pstPrev = oldListTail;
290 oldListHead->pstPrev = newListTail;
291 newListTail->pstNext = oldListHead;
292}
这是这个函数的调用关系图:

◆ SH_ListDelete()

static void SH_ListDelete ( SH_List node)
inlinestatic
Description:
  • This API is used to delete a specified node from a doubly linked list.
注意
  • The parameter passed in should be ensured to be a legal pointer.
参数
node[IN] Node to be deleted.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListAdd

在文件 shell_list.h224 行定义.

225{
226 node->pstNext->pstPrev = node->pstPrev;
227 node->pstPrev->pstNext = node->pstNext;
228 node->pstNext = NULL;
229 node->pstPrev = NULL;
230}
这是这个函数的调用关系图:

◆ SH_ListDelInit()

static void SH_ListDelInit ( SH_List list)
inlinestatic

Delete initialize a doubly linked list.

Description:
This API is used to delete initialize a doubly linked list.
注意
  • The parameter passed in should be ensured to be s legal pointer.
参数
list[IN] Doubly linked list.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见

在文件 shell_list.h461 行定义.

462{
463 list->pstNext->pstPrev = list->pstPrev;
464 list->pstPrev->pstNext = list->pstNext;
465 SH_ListInit(list);
466}
static void SH_ListInit(SH_List *list)
Definition: shell_list.h:72
函数调用图:

◆ SH_ListEmpty()

static bool SH_ListEmpty ( SH_List list)
inlinestatic

Identify whether a specified doubly linked list is empty.

Description:
  • This API is used to return whether a doubly linked list is empty.
注意
  • The parameter passed in should be ensured to be a legal pointer.
参数
list[IN] Doubly linked list.
返回值
TRUEThe doubly linked list is empty.
FALSEThe doubly linked list is not empty.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见

在文件 shell_list.h253 行定义.

254{
255 if (list == NULL) {
256 return FALSE;
257 }
258
259 return (bool)(list->pstNext == list);
260}
这是这个函数的调用关系图:

◆ SH_ListHeadInsert()

static void SH_ListHeadInsert ( SH_List list,
SH_List node 
)
inlinestatic

Insert a node to the head of a doubly linked list.

Description:
This API is used to insert a new node to the head of a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
list[IN] Doubly linked list where the new node is inserted.
node[IN] New node to be inserted.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListAdd | SH_ListTailInsert

在文件 shell_list.h196 行定义.

197{
198 if ((list == NULL) || (node == NULL)) {
199 return;
200 }
201
202 SH_ListAdd(list, node);
203}
static void SH_ListAdd(SH_List *list, SH_List *node)
Insert a new node to a doubly linked list.
Definition: shell_list.h:141
函数调用图:

◆ SH_ListHeadInsertList()

static void SH_ListHeadInsertList ( SH_List oldList,
SH_List newList 
)
inlinestatic

Insert a doubly list to the head of a doubly linked list.

Description:
This API is used to insert a new doubly list to the head of a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
oldList[IN] Doubly linked list where the new list is inserted.
newList[IN] New list to be inserted.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListAddList | SH_ListTailInsertList

在文件 shell_list.h337 行定义.

338{
339 SH_ListAddList(oldList, newList);
340}
static void SH_ListAddList(SH_List *oldList, SH_List *newList)
Insert a new list to a doubly linked list.
Definition: shell_list.h:281
函数调用图:

◆ SH_ListInit()

static void SH_ListInit ( SH_List list)
inlinestatic
Description:
This API is used to initialize a doubly linked list.
注意
  • The parameter passed in should be ensured to be a legal pointer.
参数
list[IN] Node in a doubly linked list.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见

在文件 shell_list.h72 行定义.

73{
74 list->pstNext = list;
75 list->pstPrev = list;
76}
这是这个函数的调用关系图:

◆ SH_ListTailInsert()

static void SH_ListTailInsert ( SH_List list,
SH_List node 
)
inlinestatic

Insert a node to the tail of a doubly linked list.

Description:
This API is used to insert a new node to the tail of a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
list[IN] Doubly linked list where the new node is inserted.
node[IN] New node to be inserted.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListAdd | SH_ListHeadInsert

在文件 shell_list.h168 行定义.

169{
170 if ((list == NULL) || (node == NULL)) {
171 return;
172 }
173
174 SH_ListAdd(list->pstPrev, node);
175}
函数调用图:
这是这个函数的调用关系图:

◆ SH_ListTailInsertList()

static void SH_ListTailInsertList ( SH_List oldList,
SH_List newList 
)
inlinestatic

Insert a doubly list to the tail of a doubly linked list.

Description:
This API is used to insert a new doubly list to the tail of a doubly linked list.
注意
  • The parameters passed in should be ensured to be legal pointers.
参数
oldList[IN] Doubly linked list where the new list is inserted.
newList[IN] New list to be inserted.
返回值
None.
Dependency:
  • shell_list.h: the header file that contains the API declaration.
参见
SH_ListAddList | SH_ListHeadInsertList

在文件 shell_list.h313 行定义.

314{
315 SH_ListAddList(oldList->pstPrev, newList);
316}
函数调用图: