1 /*===============================================================================================* 2 * * 3 * MMMMMMMM MMMMMMM MMMMMMM MMMMMMMM MMMMMMMM MM MM MMMMMMMMMMMMM * 4 * MMM MMM MMM MMM MM MM . MM MMM MM * 5 * MMM MMM MMM MMM MM MM MM MMM MM. * 6 * MMM MMM MMM MMM MM . MM MM MMM MMMM * 7 * MMM MMM MMM MMM MM MMMM MMM MM * 8 * MMMMMMMMMMMM MMM MMM MM MMMM MMMMMMMMMMM * 9 * MMM MMM MMM MMM MM MMMM MMM . * 10 * MMM MMM MMM MMM MM . MM MMM MM * 11 * MMM MMM MMM MMM . MM MMMM MMM MMMM * 12 * MMM MMM MM MM MM MM. MMM MM * 13 * MMM MMM . MM MM. MMMM MM MMM MM * 14 * MMMMMMMM MMMMMMM MM. MMMMM MM MMMM MMMMMMMMMMMMM. * 15 * * 16 *================================================================================================ 17 * 18 * usb host module 19 * 20 * Copyright(C), 2006-2008, SoftWinners Co., Ltd. 21 * All Rights Reserved 22 * 23 * File Name : 24 * 25 * Author : GLHuang(HoLiGun) 26 * 27 * Version : 1.0 28 * 29 * Date : 2008.06.12 30 * 31 * Description : 32 * 对list_head的extention 33 * History : 34 *================================================================================================ 35 */ 36 #ifndef __LIST_HEAD_UTILS_H__ 37 #define __LIST_HEAD_UTILS_H__ 38 #include "usb_list.h" 39 40 //从list_header_input中删除某个node 41 //return : 0 //表示找到了改node,且成功删除了 42 //对list的操作有critical保护 43 //int list_head_ext_remov_node_from_list(void *node_data, struct usb_list_head *list_header_input); 44 45 //遍历的init,先申明两个变量。 46 #define list_head_ext_for_each_entry_init() \ 47 struct usb_list_head * list_head_ext_start_ = NULL; \ 48 struct usb_list_head * list_head_ext_now_ = NULL ; 49 50 //遍历的主体,当前的为list_head_ext_now_ 51 #define list_head_ext_for_each_entry_process( p_start_list_head) \ 52 for(list_head_ext_start_ = (p_start_list_head),list_head_ext_now_ = (p_start_list_head)->next;\ 53 list_head_ext_now_ != list_head_ext_start_ ;\ 54 list_head_ext_now_ = list_head_ext_now_->next) 55 56 /* 遍历list, 看是否存在值为data的node */ 57 int32_t list_node_exist(void *data, struct usb_list_head *list_head); 58 int32_t list_del_node_by_data(void *data, struct usb_list_head *list); 59 int32_t list_destroy_whole_list(struct usb_list_head *list); 60 int list_head_ext_remov_node_from_list(void *node_data, struct usb_list_head *list_header_input); 61 62 63 #endif 64 65 66 67 68 69