From: Ralph Corderoy Date: Sun, 12 Nov 2017 00:31:18 +0000 (+0000) Subject: read_switch_multiword.c: Move interface to own file. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/600d446465259dea809dd1223d0e727585ddac6b?hp=4b388ae408c2056043f1a28cdf480743092253b0 read_switch_multiword.c: Move interface to own file. --- diff --git a/Makefile.am b/Makefile.am index e17cd540..5db12359 100644 --- a/Makefile.am +++ b/Makefile.am @@ -420,6 +420,7 @@ noinst_HEADERS = \ sbr/r1bindex.h \ sbr/read_line.h \ sbr/read_switch.h \ + sbr/read_switch_multiword.h \ sbr/read_yes_or_no_if_tty.h \ sbr/readconfig.h \ sbr/refile.h \ diff --git a/h/prototypes.h b/h/prototypes.h index acf51d93..c08b645e 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -15,14 +15,6 @@ char *etcpath(char *) NONNULL(1); struct msgs_array; -/* - * Print null-terminated PROMPT to and flush standard output. Read multi-word - * answers from standard input until a first word matches an entry in SWITCHES. - * When one matches, return a pointer to an array of pointers to the words. - * Return NULL on EOF, interrupt, or other error. - */ -char **read_switch_multiword(const char *PROMPT, const struct swit *SWITCHES); - /* * Same as read_switch_multiword but using readline(3) for input. */ diff --git a/sbr/read_switch_multiword.c b/sbr/read_switch_multiword.c index 72f43726..ff75a016 100644 --- a/sbr/read_switch_multiword.c +++ b/sbr/read_switch_multiword.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "read_switch_multiword.h" #include "smatch.h" #include "brkstring.h" #include "ambigsw.h" diff --git a/sbr/read_switch_multiword.h b/sbr/read_switch_multiword.h new file mode 100644 index 00000000..98205e9f --- /dev/null +++ b/sbr/read_switch_multiword.h @@ -0,0 +1,13 @@ +/* read_switch_multiword.h -- get an answer from the user and return a string array + * + * 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. */ + +/* + * Print null-terminated PROMPT to and flush standard output. Read multi-word + * answers from standard input until a first word matches an entry in SWITCHES. + * When one matches, return a pointer to an array of pointers to the words. + * Return NULL on EOF, interrupt, or other error. + */ +char **read_switch_multiword(const char *, const struct swit *); diff --git a/uip/comp.c b/uip/comp.c index 069e9fbf..21436251 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" #include "sbr/showfile.h" diff --git a/uip/dist.c b/uip/dist.c index ba1ae41a..7e1b2de0 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/forw.c b/uip/forw.c index 69858884..63b902ec 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 4cdd3d53..d9091a88 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/r1bindex.h" diff --git a/uip/repl.c b/uip/repl.c index 8ee26b86..976c7a65 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/send.c b/uip/send.c index b9d3bcf2..98d353d3 100644 --- a/uip/send.c +++ b/uip/send.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/read_switch_multiword.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h"