From 16817a9be74aa62a97934c45b5ff6f946dd76e73 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 11 Nov 2017 14:40:50 +0000 Subject: [PATCH] m_atoi.c: Move interface to own file. --- Makefile.am | 1 + h/prototypes.h | 1 - sbr/folder_addmsg.c | 1 + sbr/folder_read.c | 1 + sbr/m_atoi.c | 1 + sbr/m_atoi.h | 9 +++++++++ sbr/seq_read.c | 1 + uip/new.c | 1 + uip/prompter.c | 1 + uip/rmf.c | 1 + 10 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 sbr/m_atoi.h diff --git a/Makefile.am b/Makefile.am index c9eafa17..1f93bb35 100644 --- a/Makefile.am +++ b/Makefile.am @@ -387,6 +387,7 @@ noinst_HEADERS = \ sbr/geteditor.h \ sbr/getfolder.h \ sbr/lock_file.h \ + sbr/m_atoi.h \ sbr/m_maildir.h \ sbr/m_mktemp.h \ sbr/m_popen.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 40276b95..44601ec1 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -113,7 +113,6 @@ char *get_charset(void); /* Return malloc'd copy of str, or of "" if NULL, exit on failure. */ char *getcpy(const char *str); -int m_atoi (char *) PURE; char *m_backup (const char *); int m_convert (struct msgs *, char *); char *m_draft (char *, char *, int, int *); diff --git a/sbr/folder_addmsg.c b/sbr/folder_addmsg.c index 8666f6ae..898af0d7 100644 --- a/sbr/folder_addmsg.c +++ b/sbr/folder_addmsg.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "m_atoi.h" #include "ext_hook.h" #include "folder_realloc.h" #include "folder_addmsg.h" diff --git a/sbr/folder_read.c b/sbr/folder_read.c index fd75988a..044059fb 100644 --- a/sbr/folder_read.c +++ b/sbr/folder_read.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "m_atoi.h" #include "folder_read.h" #include "error.h" #include "h/utils.h" diff --git a/sbr/m_atoi.c b/sbr/m_atoi.c index 45855caf..74da5c0d 100644 --- a/sbr/m_atoi.c +++ b/sbr/m_atoi.c @@ -8,6 +8,7 @@ */ #include "h/mh.h" +#include "m_atoi.h" int diff --git a/sbr/m_atoi.h b/sbr/m_atoi.h new file mode 100644 index 00000000..4af5ce7a --- /dev/null +++ b/sbr/m_atoi.h @@ -0,0 +1,9 @@ +/* m_atoi.h -- Parse a string representation of a message number, and + * -- return the numeric value of the message. If the string + * -- contains any non-digit characters, then return 0. + * + * 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. */ + +int m_atoi(char *) PURE; diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 5e0e1a85..c4f11a6a 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -7,6 +7,7 @@ */ #include "h/mh.h" +#include "m_atoi.h" #include "brkstring.h" #include "error.h" #include "h/utils.h" diff --git a/uip/new.c b/uip/new.c index a106ce49..5de05d48 100644 --- a/uip/new.c +++ b/uip/new.c @@ -12,6 +12,7 @@ #include #include "h/mh.h" +#include "sbr/m_atoi.h" #include "sbr/context_save.h" #include "sbr/context_replace.h" #include "sbr/context_find.h" diff --git a/uip/prompter.c b/uip/prompter.c index 44d53222..378f2abb 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/m_atoi.h" #include "sbr/context_save.h" #include "sbr/ambigsw.h" #include "sbr/print_version.h" diff --git a/uip/rmf.c b/uip/rmf.c index 2fa33d75..8244a216 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "sbr/m_atoi.h" #include "sbr/getfolder.h" #include "sbr/ext_hook.h" #include "sbr/context_save.h" -- 2.56.0