23 lines
412 B
Plaintext
23 lines
412 B
Plaintext
assert(list != NULL);
|
|
|
|
{NodeType} *output = NULL;
|
|
|
|
if (list->node_count == 0) {{
|
|
goto RETURN_{Tupper}_LIST_POP_FRONT;
|
|
}}
|
|
|
|
output = list->first;
|
|
|
|
if (list->node_count == 1) {{
|
|
*list = ({ListType}){{0}};
|
|
goto RETURN_{Tupper}_LIST_POP_FRONT;
|
|
}}
|
|
|
|
--(list->node_count);
|
|
list->first = output->next;
|
|
|
|
output->prev = output->next = NULL;
|
|
|
|
RETURN_{Tupper}_LIST_POP_FRONT:
|
|
return output;
|