!184 feat: add LOS_ListHeadInsert function

Merge pull request !184 from kenneth/LOS_ListHeadInsert
This commit is contained in:
openharmony_ci 2021-06-21 12:39:25 +08:00 committed by Gitee
commit 9fc34614d1
1 changed files with 24 additions and 0 deletions

View File

@ -151,6 +151,30 @@ LITE_OS_SEC_ALW_INLINE STATIC_INLINE VOID LOS_ListTailInsert(LOS_DL_LIST *list,
LOS_ListAdd(list->pstPrev, node); LOS_ListAdd(list->pstPrev, node);
} }
/**
* @ingroup los_list
* @brief Insert a node to the head of a doubly linked list.
*
* @par Description:
* This API is used to insert a new node to the head of a doubly linked list.
* @attention
* <ul>
* <li>The parameters passed in should be ensured to be legal pointers.</li>
* </ul>
*
* @param list [IN] Doubly linked list where the new node is inserted.
* @param node [IN] New node to be inserted.
*
* @retval None.
* @par Dependency:
* <ul><li>los_list.h: the header file that contains the API declaration.</li></ul>
* @see LOS_ListAdd | LOS_ListTailInsert
*/
LITE_OS_SEC_ALW_INLINE STATIC_INLINE VOID LOS_ListHeadInsert(LOS_DL_LIST *list, LOS_DL_LIST *node)
{
LOS_ListAdd(list, node);
}
/** /**
* @ingroup los_list * @ingroup los_list
* @brief Delete a specified node from a doubly linked list. * @brief Delete a specified node from a doubly linked list.