From 0b8537894774336d38e014b9358f65d40c4d48b7 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 11 Nov 2017 23:47:07 +0000 Subject: [PATCH] r1bindex.c: Move interface to own file. --- Makefile.am | 1 + h/prototypes.h | 1 - mts/smtp/smtp.c | 1 + sbr/arglist.c | 1 + sbr/m_backup.c | 1 + sbr/m_mktemp.c | 1 + sbr/r1bindex.c | 1 + sbr/r1bindex.h | 10 ++++++++++ sbr/showfile.c | 1 + sbr/utils.c | 1 + uip/mhbuildsbr.c | 1 + uip/mhlistsbr.c | 1 + uip/mhlsbr.c | 1 + uip/mhparse.c | 1 + uip/mhstoresbr.c | 1 + uip/new.c | 1 + uip/show.c | 1 + uip/whatnowproc.c | 1 + uip/whatnowsbr.c | 1 + 19 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 sbr/r1bindex.h diff --git a/Makefile.am b/Makefile.am index 0a6c39a1..96fcaf51 100644 --- a/Makefile.am +++ b/Makefile.am @@ -415,6 +415,7 @@ noinst_HEADERS = \ sbr/print_sw.h \ sbr/print_version.h \ sbr/push.h \ + sbr/r1bindex.h \ sbr/read_line.h \ sbr/readconfig.h \ sbr/refile.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 55926092..adfa940a 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -64,7 +64,6 @@ void m_unknown2(m_getfld_state_t *); char *nmh_getpass(const char *); int pidwait (pid_t, int); -char *r1bindex(char *, int) PURE; void scan_detect_mbox_style (FILE *); void scan_finished(void); diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 15b2f20c..8270b343 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/client.h" #include "sbr/error.h" #include "smtp.h" diff --git a/sbr/arglist.c b/sbr/arglist.c index bf88eb2d..168e36b7 100644 --- a/sbr/arglist.c +++ b/sbr/arglist.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" #include "brkstring.h" #include "error.h" #include "arglist.h" diff --git a/sbr/m_backup.c b/sbr/m_backup.c index 2342f03d..e8cb84bd 100644 --- a/sbr/m_backup.c +++ b/sbr/m_backup.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" #include "m_backup.h" #include "m_mktemp.h" diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index 61a32f68..1ec94c6e 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" #include "h/utils.h" #include "h/signals.h" #include "m_maildir.h" diff --git a/sbr/r1bindex.c b/sbr/r1bindex.c index 70d650b9..fb4595c0 100644 --- a/sbr/r1bindex.c +++ b/sbr/r1bindex.c @@ -9,6 +9,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" /* Does not return NULL. */ char * diff --git a/sbr/r1bindex.h b/sbr/r1bindex.h new file mode 100644 index 00000000..92f97758 --- /dev/null +++ b/sbr/r1bindex.h @@ -0,0 +1,10 @@ +/* r1bindex.h -- Given a string and a character, return a pointer + * -- to the right of the rightmost occurrence of the + * -- character. If the character doesn't occur, the + * -- pointer will be at the beginning of the string. + * + * 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 *r1bindex(char *, int) PURE; diff --git a/sbr/showfile.c b/sbr/showfile.c index 2985dbed..4a06fd0d 100644 --- a/sbr/showfile.c +++ b/sbr/showfile.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" #include "context_save.h" #include "arglist.h" #include "error.h" diff --git a/sbr/utils.c b/sbr/utils.c index 9640cf1e..9c4b9fdc 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "r1bindex.h" #include "context_foil.h" #include "context_replace.h" #include "context_read.h" diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index fd83155c..e7b9c50b 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -14,6 +14,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/encode_rfc2047.h" #include "sbr/copyip.h" #include "sbr/cpydata.h" diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index e1c3beff..ae1becf4 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -7,6 +7,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/trimcpy.h" #include #include "h/mts.h" diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 94039456..0fbdc6cd 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/snprintb.h" #include "sbr/copyip.h" #include "sbr/discard.h" diff --git a/uip/mhparse.c b/uip/mhparse.c index 7a8e88de..9b72d91f 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/ruserpass.h" #include "sbr/fmt_rfc2047.h" #include "sbr/uprf.h" diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index c93a1dfc..4e4298b0 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/uprf.h" #include "sbr/getcpy.h" #include "sbr/getfolder.h" diff --git a/uip/new.c b/uip/new.c index 18e60ff6..f4e08e7f 100644 --- a/uip/new.c +++ b/uip/new.c @@ -12,6 +12,7 @@ #include #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/trimcpy.h" #include "sbr/vfgets.h" #include "sbr/getcpy.h" diff --git a/uip/show.c b/uip/show.c index 3e708dfb..45bb4f01 100644 --- a/uip/show.c +++ b/uip/show.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/uprf.h" #include "sbr/check_charset.h" #include "sbr/m_draft.h" diff --git a/uip/whatnowproc.c b/uip/whatnowproc.c index 6ea65d4c..8f5b534f 100644 --- a/uip/whatnowproc.c +++ b/uip/whatnowproc.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/geteditor.h" #include "sbr/context_save.h" #include "sbr/error.h" diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 459b89b6..a82b657a 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -38,6 +38,7 @@ */ #include "h/mh.h" +#include "sbr/r1bindex.h" #include "sbr/refile.h" #include "sbr/closefds.h" #include "sbr/copyip.h" -- 2.56.0