wizapp-stdlib/codegen/dbl_list/snippets/node_to_list
2025-04-16 08:13:31 +01:00

14 lines
308 B
Plaintext

{T}List output = {{.first = node, .last = node, .node_count = 1}};
while (output.first->prev != NULL) {{
output.first = output.first->prev;
++(output.node_count);
}}
while (output.last->next != NULL) {{
output.last = output.last->next;
++(output.node_count);
}}
return output;