From: Ralph Corderoy Date: Mon, 28 Aug 2017 18:57:16 +0000 (+0100) Subject: Move read_line.c's prototypes from prototypes.h to new read_line.h. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/777a83b9305f79b18aa1b1e7ef524d0ddf5890cb?ds=inline Move read_line.c's prototypes from prototypes.h to new read_line.h. Add copyright comment to start of read_line.c whilst there. --- diff --git a/Makefile.am b/Makefile.am index 3a3f9a42..1ad96790 100644 --- a/Makefile.am +++ b/Makefile.am @@ -367,6 +367,7 @@ noinst_HEADERS = \ sbr/makedir.h \ sbr/message_id.h \ sbr/mime_type.h \ + sbr/read_line.h \ sbr/terminal.h \ sbr/unquote.h \ thirdparty/jsmn/jsmn.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 0c2d7bdb..1f40f40f 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -118,13 +118,6 @@ struct msgs *folder_read (char *name, int lockflag); struct msgs *folder_realloc (struct msgs *, int, int); -/* - * Flush standard output, read a line from standard input into a static buffer, - * zero out the newline, and return a pointer to the buffer. - * On error, return NULL. - */ -const char *read_line(void); - /* * Print null-terminated PROMPT to and flush standard output. Read answers from * standard input until one matches an entry in SWITCHES. When one matches, diff --git a/sbr/read_line.c b/sbr/read_line.c index c9167ab5..a6367de4 100644 --- a/sbr/read_line.c +++ b/sbr/read_line.c @@ -1,6 +1,19 @@ +/* read_line.c -- read a possibly incomplete line from stdin. + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. + */ + #include #include +#include "read_line.h" +/* + * Flush standard output, read a line from standard input into a static buffer, + * zero out the newline, and return a pointer to the buffer. + * On error, return NULL. + */ const char * read_line(void) { diff --git a/sbr/read_line.h b/sbr/read_line.h new file mode 100644 index 00000000..33ba7620 --- /dev/null +++ b/sbr/read_line.h @@ -0,0 +1,8 @@ +/* read_line.h -- read a possibly incomplete line from stdin. + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. + */ + +const char *read_line(void); diff --git a/sbr/utils.c b/sbr/utils.c index ad8341cc..3be04e7e 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -12,6 +12,7 @@ #include "makedir.h" #include #include +#include "read_line.h" extern char *mhdocdir; diff --git a/uip/install-mh.c b/uip/install-mh.c index 414a4877..b9c69f54 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -10,6 +10,7 @@ #include "../sbr/m_maildir.h" #include "../sbr/makedir.h" #include /* structure for getpwuid() results */ +#include "../sbr/read_line.h" #define INSTALLMH_SWITCHES \ X("auto", 0, AUTOSW) \