From 4eb3c86131807ffa6d36047df51ddad3b5d67a48 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sun, 12 Nov 2017 12:31:05 +0000 Subject: [PATCH] getarguments.c: Move interface to own file. --- Makefile.am | 1 + h/prototypes.h | 2 -- sbr/getarguments.c | 1 + sbr/getarguments.h | 7 +++++++ uip/ali.c | 1 + uip/anno.c | 1 + uip/ap.c | 1 + uip/burst.c | 1 + uip/comp.c | 1 + uip/dist.c | 1 + uip/dp.c | 1 + uip/flist.c | 1 + uip/fmtdump.c | 1 + uip/fmttest.c | 1 + uip/folder.c | 1 + uip/forw.c | 1 + uip/imaptest.c | 1 + uip/inc.c | 1 + uip/install-mh.c | 1 + uip/mark.c | 1 + uip/mhbuild.c | 1 + uip/mhfixmsg.c | 1 + uip/mhical.c | 1 + uip/mhlist.c | 1 + uip/mhlogin.c | 1 + uip/mhlsbr.c | 1 + uip/mhn.c | 1 + uip/mhparam.c | 1 + uip/mhpath.c | 1 + uip/mhshow.c | 1 + uip/mhstore.c | 1 + uip/mkstemp.c | 1 + uip/msgchk.c | 1 + uip/new.c | 1 + uip/packf.c | 1 + uip/pick.c | 1 + uip/post.c | 1 + uip/prompter.c | 1 + uip/rcvdist.c | 1 + uip/rcvpack.c | 1 + uip/rcvstore.c | 1 + uip/rcvtty.c | 1 + uip/refile.c | 1 + uip/repl.c | 1 + uip/rmf.c | 1 + uip/rmm.c | 1 + uip/scan.c | 1 + uip/send.c | 1 + uip/show.c | 1 + uip/slocal.c | 1 + uip/sortm.c | 1 + uip/viamail.c | 1 + uip/whatnowsbr.c | 1 + uip/whom.c | 1 + 54 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 sbr/getarguments.h diff --git a/Makefile.am b/Makefile.am index 65f519c9..68ec278b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -395,6 +395,7 @@ noinst_HEADERS = \ sbr/folder_pack.h \ sbr/folder_read.h \ sbr/folder_realloc.h \ + sbr/getarguments.h \ sbr/getcpy.h \ sbr/geteditor.h \ sbr/getfolder.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 0c52e910..d3f05ace 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -15,8 +15,6 @@ char *etcpath(char *) NONNULL(1); struct msgs_array; -char **getarguments (char *, int, char **, int); - m_getfld_state_t m_getfld_state_init(FILE *iob); void m_getfld_state_reset (m_getfld_state_t *); void m_getfld_state_destroy (m_getfld_state_t *); diff --git a/sbr/getarguments.c b/sbr/getarguments.c index a7ac1bea..1ab11634 100644 --- a/sbr/getarguments.c +++ b/sbr/getarguments.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "getarguments.h" #include "context_find.h" #include "brkstring.h" #include "h/utils.h" diff --git a/sbr/getarguments.h b/sbr/getarguments.h new file mode 100644 index 00000000..74fa8c77 --- /dev/null +++ b/sbr/getarguments.h @@ -0,0 +1,7 @@ +/* getarguments.h -- Get the argument vector ready to go. + * + * 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. */ + +char **getarguments(char *, int, char **, int); diff --git a/uip/ali.c b/uip/ali.c index 6e94f8c1..d14b38a4 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/getcpy.h" #include "sbr/context_find.h" diff --git a/uip/anno.c b/uip/anno.c index 8671ff6c..0207d472 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -42,6 +42,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/ap.c b/uip/ap.c index 0a09a213..83295af9 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/getcpy.h" #include "sbr/ambigsw.h" diff --git a/uip/burst.c b/uip/burst.c index 6e401d42..5048e4db 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/comp.c b/uip/comp.c index 21436251..34d46bb2 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" diff --git a/uip/dist.c b/uip/dist.c index 7e1b2de0..0dc2cca8 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/dp.c b/uip/dp.c index 94586269..00edef02 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/context_save.h" #include "sbr/ambigsw.h" diff --git a/uip/flist.c b/uip/flist.c index c420b944..aedfd884 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -14,6 +14,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ssequal.h" #include "sbr/getfolder.h" diff --git a/uip/fmtdump.c b/uip/fmtdump.c index c43b412d..0545c0df 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" #include "sbr/print_version.h" diff --git a/uip/fmttest.c b/uip/fmttest.c index 030e80a1..21e6de68 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/folder.c b/uip/folder.c index 9072246a..13a9c46d 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -8,6 +8,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/forw.c b/uip/forw.c index 63b902ec..2886d052 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/imaptest.c b/uip/imaptest.c index 2aa9e164..9009159f 100644 --- a/uip/imaptest.c +++ b/uip/imaptest.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/client.h" #include "sbr/getcpy.h" diff --git a/uip/inc.c b/uip/inc.c index 1066801f..36926479 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -31,6 +31,7 @@ #endif #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/seq_setunseen.h" #include "sbr/seq_setcur.h" diff --git a/uip/install-mh.c b/uip/install-mh.c index 97e1ac46..ac2c5c98 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch.h" #include "sbr/concat.h" #include "sbr/smatch.h" diff --git a/uip/mark.c b/uip/mark.c index b0c91d18..72328bac 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -8,6 +8,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" #include "sbr/snprintb.h" diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 212d8e6e..1ef84211 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/m_backup.h" #include "sbr/context_find.h" diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index aabe1c59..5312fd1a 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/mhical.c b/uip/mhical.c index b2cd5b0f..d0ebd137 100644 --- a/uip/mhical.c +++ b/uip/mhical.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" diff --git a/uip/mhlist.c b/uip/mhlist.c index f4aa532c..ec6c5a83 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/mhlogin.c b/uip/mhlogin.c index ba48f4c1..5e6d1615 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -10,6 +10,7 @@ #include #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index cfd80748..1a7125e7 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/r1bindex.h" diff --git a/uip/mhn.c b/uip/mhn.c index 4cd99d72..c6f861a0 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/mhparam.c b/uip/mhparam.c index caf72c1d..65082a0b 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -9,6 +9,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/context_find.h" #include "sbr/ambigsw.h" diff --git a/uip/mhpath.c b/uip/mhpath.c index 27a8ec63..46b24361 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/mhshow.c b/uip/mhshow.c index 8b07cb92..9367f008 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setunseen.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/mhstore.c b/uip/mhstore.c index 56b186af..a1837bfd 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/mkstemp.c b/uip/mkstemp.c index 0a44a5f1..b7fa5ae0 100644 --- a/uip/mkstemp.c +++ b/uip/mkstemp.c @@ -120,6 +120,7 @@ build_template(const char *directory, const char *prefix, const char *suffix) #if NMH #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" #include "sbr/print_version.h" diff --git a/uip/msgchk.c b/uip/msgchk.c index 4998353d..411686e4 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" #include "sbr/print_version.h" diff --git a/uip/new.c b/uip/new.c index 03d89a3b..67367900 100644 --- a/uip/new.c +++ b/uip/new.c @@ -12,6 +12,7 @@ #include #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/r1bindex.h" diff --git a/uip/packf.c b/uip/packf.c index 19ab1d47..727e00df 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_yes_or_no_if_tty.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" diff --git a/uip/pick.c b/uip/pick.c index 3290330f..6ca9eaac 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/post.c b/uip/post.c index 2a2d8141..27f7ad83 100644 --- a/uip/post.c +++ b/uip/post.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/cpydata.h" diff --git a/uip/prompter.c b/uip/prompter.c index d91173f2..b5fb93a0 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/cpydata.h" #include "sbr/m_atoi.h" diff --git a/uip/rcvdist.c b/uip/rcvdist.c index 89d07305..85e877dc 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/cpydata.h" #include "sbr/context_find.h" diff --git a/uip/rcvpack.c b/uip/rcvpack.c index 31a18b0e..a6efb625 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/ambigsw.h" #include "sbr/print_version.h" diff --git a/uip/rcvstore.c b/uip/rcvstore.c index e01a5a26..2484aaa9 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setunseen.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 22edfb6b..77fa8bdd 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -11,6 +11,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/closefds.h" #include "sbr/ambigsw.h" diff --git a/uip/refile.c b/uip/refile.c index c985d38f..68202ae8 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -7,6 +7,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/repl.c b/uip/repl.c index 976c7a65..7581c17f 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" diff --git a/uip/rmf.c b/uip/rmf.c index 1e7f90c0..37e7162f 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_yes_or_no_if_tty.h" #include "sbr/concat.h" #include "sbr/smatch.h" diff --git a/uip/rmm.c b/uip/rmm.c index 38ff284d..df28926f 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/smatch.h" #include "sbr/m_convert.h" diff --git a/uip/scan.c b/uip/scan.c index ea6f0fc2..65347680 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" diff --git a/uip/send.c b/uip/send.c index 98d353d3..08c87b45 100644 --- a/uip/send.c +++ b/uip/send.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword.h" #include "sbr/concat.h" #include "sbr/seq_setprev.h" diff --git a/uip/show.c b/uip/show.c index f77b8f0a..99a66081 100644 --- a/uip/show.c +++ b/uip/show.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setunseen.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" diff --git a/uip/slocal.c b/uip/slocal.c index 28e403d7..cc1aa7bc 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -20,6 +20,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/strindex.h" #include "sbr/closefds.h" diff --git a/uip/sortm.c b/uip/sortm.c index 79e53fd3..e8a0f4dc 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" diff --git a/uip/viamail.c b/uip/viamail.c index 6e889b6a..88567023 100644 --- a/uip/viamail.c +++ b/uip/viamail.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/concat.h" #include "sbr/smatch.h" #include "sbr/context_find.h" diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index a2f872c4..68a56ba3 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -38,6 +38,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/read_switch_multiword_via_readline.h" #include "sbr/concat.h" #include "sbr/showfile.h" diff --git a/uip/whom.c b/uip/whom.c index e6487394..9b03e162 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/getarguments.h" #include "sbr/smatch.h" #include "sbr/closefds.h" #include "sbr/m_draft.h" -- 2.56.0