October 2017
Intermediate to advanced
586 pages
14h 8m
English
We have the macro list_for_each_entry(pos, head, member) for list traversal:
struct car *acar; /* loop counter */
int blue_car_num = 0;
/* 'list' is the name of the list_head struct in our data structure */
list_for_each_entry(acar, carlist, list){
if(acar->color == "blue")
blue_car_num++;
}
Why do we need the name of the list_head type field in our data structure? Look at the ...