简介

nothing

API

  1. LIST_HEAD(linked_list);
  2. INIT_LIST_HEAD(struct list_head *list);
  3. inline void list_add(struct list_head *new, struct list_head *head);
  4. inline void list_add_tail(struct list_head *new, struct list_head *head);
  5. inline void list_del(struct list_head *entry);
  6. inline void list_del_init(struct list_head *entry);
  7. inline void list_replace(struct list_head *old, struct list_head *new);
  8. inline void list_replace_init(struct list_head *old, struct list_head *new);
  9. inline void list_move(struct list_head *list, struct list_head *head);
  10. inline void list_move_tail(struct list_head *list, struct list_head *head);
  11. inline void list_rotate_left(struct list_head *head);
  12. inline int list_is_last(const struct list_head *list, const struct list_head *head);
  13. inline int list_empty(const struct list_head *head);
  14. inline int list_is_singular(const struct list_head *head);
  15. inline void list_cut_position(struct list_head *list, struct list_head *head, struct list_head *entry);
  16. inline void list_splice(const struct list_head *list, struct list_head *head);

遍历链表

  1. list_entry(ptr, type, member);
  2. list_for_each(pos, head);
  3. list_for_each_entry(pos, head, member);
  4. list_for_each_entry_safe ( pos, n, head, member);
  5. list_for_each_prev(pos, head);
  6. list_for_each_entry_reverse(pos, head, member);