tweaks: move another function to before the one that calls it

master
Benno Schulenberg 2020-01-29 10:54:30 +01:00
parent e864107046
commit 67e5913edf
1 changed files with 15 additions and 15 deletions

View File

@ -109,21 +109,6 @@ void splice_node(linestruct *afterthis, linestruct *newnode)
openfile->filebot = newnode;
}
/* Disconnect a node from a linked list of linestructs and delete it. */
void unlink_node(linestruct *line)
{
if (line->prev != NULL)
line->prev->next = line->next;
if (line->next != NULL)
line->next->prev = line->prev;
/* Update filebot when removing a node at the end of file. */
if (openfile && openfile->filebot == line)
openfile->filebot = line->prev;
delete_node(line);
}
/* Free the data structures in the given node. */
void delete_node(linestruct *line)
{
@ -139,6 +124,21 @@ void delete_node(linestruct *line)
free(line);
}
/* Disconnect a node from a linked list of linestructs and delete it. */
void unlink_node(linestruct *line)
{
if (line->prev != NULL)
line->prev->next = line->next;
if (line->next != NULL)
line->next->prev = line->prev;
/* Update filebot when removing a node at the end of file. */
if (openfile && openfile->filebot == line)
openfile->filebot = line->prev;
delete_node(line);
}
/* Make a copy of a linestruct node. */
linestruct *copy_node(const linestruct *src)
{