Changeset 2ee1ccc in mainline for kernel/generic/include/adt/list.h
- Timestamp:
- 2012-07-01T05:18:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d71331b
- Parents:
- 49e6c6b4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/list.h
r49e6c6b4 r2ee1ccc 258 258 } 259 259 260 /** Moves items of one list into another after the specified item. 261 * 262 * Inserts all items of @a list after item at @a pos in another list. 263 * Both lists may be empty. 264 * 265 * In order to insert the list at the beginning of another list, use: 266 * @code 267 * list_splice(&list_dest.head, &list_src); 268 * @endcode 269 * 270 * @param list Source list to move after pos. 271 * @param pos Source items will be placed after this item. 272 */ 273 NO_TRACE static inline void list_splice(list_t *list, link_t *pos) 274 { 275 link_t *pos_next = pos->next; 276 277 if (!list_empty(list)) { 278 link_t *first = list->head.next; 279 link_t *last = list->head.prev; 280 281 pos->next = first; 282 first->prev = pos; 283 284 last->next = pos_next; 285 pos_next->prev = last; 286 287 list_initialize(list); 288 } 289 } 290 260 291 /** Get n-th item in a list. 261 292 *
Note:
See TracChangeset
for help on using the changeset viewer.