tweaks: move a function to the file where it is used

master
Benno Schulenberg 2019-06-01 10:52:38 +02:00
parent 9369af77ce
commit 2003413989
3 changed files with 20 additions and 25 deletions

View File

@ -642,6 +642,26 @@ void switch_to_next_buffer(void)
redecorate_after_switch();
}
/* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr)
{
if (fileptr == startfile)
startfile = startfile->next;
fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev;
free(fileptr->filename);
free_lines(fileptr->filetop);
#ifndef NANO_TINY
free(fileptr->current_stat);
free(fileptr->lock_filename);
/* Free the undo stack. */
discard_until(NULL, fileptr, TRUE);
#endif
free(fileptr);
}
/* Remove the current buffer from the circular list of buffers. */
void close_buffer(void)
{

View File

@ -453,28 +453,6 @@ void copy_from_buffer(linestruct *somebuffer)
ingraft_buffer(the_copy);
}
#ifdef ENABLE_MULTIBUFFER
/* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr)
{
if (fileptr == startfile)
startfile = startfile->next;
fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev;
free(fileptr->filename);
free_lines(fileptr->filetop);
#ifndef NANO_TINY
free(fileptr->current_stat);
free(fileptr->lock_filename);
/* Free the undo stack. */
discard_until(NULL, fileptr, TRUE);
#endif
free(fileptr);
}
#endif /* ENABLE_MULTIBUFFER */
/* Display a warning about a key disabled in view mode. */
void print_view_warning(void)
{

View File

@ -398,9 +398,6 @@ void unpartition_buffer();
void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
void ingraft_buffer(linestruct *somebuffer);
void copy_from_buffer(linestruct *somebuffer);
#ifdef ENABLE_MULTIBUFFER
void unlink_opennode(openfilestruct *fileptr);
#endif
void print_view_warning(void);
void show_restricted_warning(void);
#ifndef ENABLE_HELP