| 26 | } |
| 27 | |
| 28 | void AddToList(List* list, ListItem* item) { |
| 29 | if (!list || !item) { |
| 30 | return; |
| 31 | } |
| 32 | if (list->tail) { |
| 33 | list->tail->next = item; |
| 34 | } |
| 35 | else { |
| 36 | list->head = item; |
| 37 | } |
| 38 | item->prev = list->tail; |
| 39 | item->next = NULL; |
| 40 | list->tail = item; |
| 41 | list->size++; |
| 42 | } |
| 43 | |
| 44 | void AddToListHead(List* list, ListItem* item) { |
| 45 | if (!list || !item) { |
no outgoing calls
no test coverage detected