]> diplodocus.org Git - nmh/commitdiff
read_switch_multiword.c: Move interface to own file.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 12 Nov 2017 00:31:18 +0000 (00:31 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 12 Nov 2017 12:25:35 +0000 (12:25 +0000)
Makefile.am
h/prototypes.h
sbr/read_switch_multiword.c
sbr/read_switch_multiword.h [new file with mode: 0644]
uip/comp.c
uip/dist.c
uip/forw.c
uip/mhstoresbr.c
uip/repl.c
uip/send.c

index e17cd54..5db1235 100644 (file)
@@ -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 \
index acf51d9..c08b645 100644 (file)
@@ -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.
  */
index 72f4372..ff75a01 100644 (file)
@@ -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 (file)
index 0000000..98205e9
--- /dev/null
@@ -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 *);
index 069e9fb..2143625 100644 (file)
@@ -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"
index ba1ae41..7e1b2de 100644 (file)
@@ -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"
index 6985888..63b902e 100644 (file)
@@ -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"
index 4cdd3d5..d9091a8 100644 (file)
@@ -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"
index 8ee26b8..976c7a6 100644 (file)
@@ -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"
index b9d3bcf..98d353d 100644 (file)
@@ -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"