]> diplodocus.org Git - nmh/commitdiff
read_switch.c: Move interface declaration to own file.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 12 Nov 2017 00:26:11 +0000 (00:26 +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.c
sbr/read_switch.h [new file with mode: 0644]
sbr/read_yes_or_no_if_tty.c
uip/install-mh.c
uip/replsbr.c

index 3db6bfa..fb982b1 100644 (file)
@@ -419,6 +419,7 @@ noinst_HEADERS = \
     sbr/push.h \
     sbr/r1bindex.h \
     sbr/read_line.h \
+    sbr/read_switch.h \
     sbr/readconfig.h \
     sbr/refile.h \
     sbr/remdir.h \
index 970cd21..dff1a03 100644 (file)
@@ -15,13 +15,6 @@ char *etcpath(char *) NONNULL(1);
 
 struct msgs_array;
 
-/*
- * Print null-terminated PROMPT to and flush standard output.  Read answers from
- * standard input until one matches an entry in SWITCHES.  When one matches,
- * return its swret field.  Return 0 on EOF.
- */
-int read_switch(const char *PROMPT, const struct swit *SWITCHES);
-
 /*
  * If standard input is not a tty, return 1 without printing anything.  Else,
  * print null-terminated PROMPT to and flush standard output.  Read answers from
index 8cdbfe4..1c3e851 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "read_switch.h"
 #include "smatch.h"
 
 
diff --git a/sbr/read_switch.h b/sbr/read_switch.h
new file mode 100644 (file)
index 0000000..2ee51ce
--- /dev/null
@@ -0,0 +1,12 @@
+/* read_switch.h -- prompt the user for an answer from the list
+ *
+ * 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 answers from
+ * standard input until one matches an entry in SWITCHES.  When one matches,
+ * return its swret field.  Return 0 on EOF.
+ */
+int read_switch(const char *, const struct swit *);
index 8d7dac6..15450c5 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "read_switch.h"
 
 
 int
index ee05102..97e1ac4 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/read_switch.h"
 #include "sbr/concat.h"
 #include "sbr/smatch.h"
 #include "sbr/context_save.h"
index 9308897..e9f250b 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/read_switch.h"
 #include "sbr/concat.h"
 #include "sbr/closefds.h"
 #include "sbr/uprf.h"