tweaks: move another function, to group the deleting ones together

This commit is contained in:
Benno Schulenberg 2020-01-29 10:56:03 +01:00
parent 67e5913edf
commit a197ccf12d
1 changed files with 14 additions and 14 deletions

View File

@ -139,6 +139,20 @@ void unlink_node(linestruct *line)
delete_node(line);
}
/* Free an entire linked list of linestructs. */
void free_lines(linestruct *src)
{
if (src == NULL)
return;
while (src->next != NULL) {
src = src->next;
delete_node(src->prev);
}
delete_node(src);
}
/* Make a copy of a linestruct node. */
linestruct *copy_node(const linestruct *src)
{
@ -177,20 +191,6 @@ linestruct *copy_buffer(const linestruct *src)
return head;
}
/* Free an entire linked list of linestructs. */
void free_lines(linestruct *src)
{
if (src == NULL)
return;
while (src->next != NULL) {
src = src->next;
delete_node(src->prev);
}
delete_node(src);
}
/* Renumber the lines in a buffer, from the given line onwards. */
void renumber_from(linestruct *line)
{