| 42 | } |
| 43 | |
| 44 | void AddToListHead(List* list, ListItem* item) { |
| 45 | if (!list || !item) { |
| 46 | return; |
| 47 | } |
| 48 | if (list->head) { |
| 49 | list->head->prev = item; |
| 50 | } |
| 51 | else { |
| 52 | list->tail = item; |
| 53 | } |
| 54 | item->next = list->head; |
| 55 | item->prev = NULL; |
| 56 | list->head = item; |
| 57 | list->size++; |
| 58 | } |
| 59 | |
| 60 | ListItem* FirstItem(List* list) { |
| 61 | return list->head; |
no outgoing calls
no test coverage detected