]> diplodocus.org Git - nmh/commitdiff
Create mhmisc.h with mhmisc.c's global-function prototypes.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 12:25:53 +0000 (13:25 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 12:39:10 +0000 (13:39 +0100)
Delete the many local copies from each caller.

16 files changed:
Makefile.am
h/mhparse.h
h/prototypes.h
uip/mhbuildsbr.c
uip/mhcachesbr.c
uip/mhfixmsg.c
uip/mhlist.c
uip/mhlistsbr.c
uip/mhmisc.c
uip/mhmisc.h [new file with mode: 0644]
uip/mhn.c
uip/mhparse.c
uip/mhshow.c
uip/mhshowsbr.c
uip/mhstore.c
uip/mhstoresbr.c

index caffaabf13ee96132fea13402d22b2c9e6b90895..9781dfd0192501c0e058ca56f5206cfdd6ac7682 100644 (file)
@@ -370,6 +370,7 @@ noinst_HEADERS = \
     sbr/unquote.h \
     thirdparty/jsmn/jsmn.h \
     uip/mhfree.h \
     sbr/unquote.h \
     thirdparty/jsmn/jsmn.h \
     uip/mhfree.h \
+    uip/mhmisc.h \
     uip/mhoutsbr.h \
     uip/mhshowsbr.h \
     #
     uip/mhoutsbr.h \
     uip/mhshowsbr.h \
     #
index 6b7ebebd290e8682713d8827d9afb44818baa24e..42cab7e4f624c4e02bb32438ebd2e0caa6db0206 100644 (file)
@@ -367,16 +367,6 @@ const struct str2init *get_ce_method (const char *) PURE;
 char *content_charset (CT);
 void reverse_alternative_parts (CT);
 
 char *content_charset (CT);
 void reverse_alternative_parts (CT);
 
-/*
- * Given a content structure, return true if the content has a disposition
- * of "inline".
- *
- * Arguments are:
- *
- * ct          - Content structure to examine
- */
-int is_inline(CT ct) PURE;
-
 /*
  * Given a list of messages, display information about them on standard
  * output.
 /*
  * Given a list of messages, display information about them on standard
  * output.
index a0c7806016f47aae2df7fd33ecb4f692b1e95880..e62ea065c68a3eae9cfa3dcc8ba51f73bcf1f029 100644 (file)
@@ -375,7 +375,6 @@ int annotate (char *, char *, char *, bool, bool, int, bool);
 void annolist(char *, char *, char *, int);
 void annopreserve(int);
 void m_pclose(void);
 void annolist(char *, char *, char *, int);
 void annopreserve(int);
 void m_pclose(void);
-int make_intermediates(char *);
 int mhl(int, char **);
 int mhlsbr(int, char **, FILE *(*)(char *));
 int distout (char *, char *, char *);
 int mhl(int, char **);
 int mhlsbr(int, char **, FILE *(*)(char *));
 int distout (char *, char *, char *);
index bccf33a90aa7a3b22ae11f0070a7edca04d71c61..bb68cc5b7323d64bef4f91e2eeed30e842af8906 100644 (file)
@@ -22,6 +22,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/message_id.h"
 #include "../sbr/mime_type.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/message_id.h"
 #include "../sbr/mime_type.h"
@@ -55,9 +56,6 @@ typedef struct convert_list {
 } convert_list;
 
 
 } convert_list;
 
 
-/* mhmisc.c */
-void content_error (char *, CT, char *, ...);
-
 /* mhcachesbr.c */
 int find_cache (CT, int, int *, char *, char *, int);
 
 /* mhcachesbr.c */
 int find_cache (CT, int, int *, char *, char *, int);
 
index 0c61fc0f60415e8fd3fe29e961444ae7cec262d1..4c177d18686b25cd0d1c1fd3503bacd4710b982d 100644 (file)
@@ -14,6 +14,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/lock_file.h"
 #include "../sbr/m_mktemp.h"
 
 #include "../sbr/lock_file.h"
 #include "../sbr/m_mktemp.h"
 
@@ -40,13 +41,6 @@ int wcachesw = CACHE_ASK;
 char *cache_public;
 char *cache_private;
 
 char *cache_public;
 char *cache_private;
 
-
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void content_error (char *, CT, char *, ...);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index fc1b0a6dad25070a973bc862c105cb970d4d1490..d804a6631089e90876e3b995bda7e1ca77862270 100644 (file)
@@ -14,6 +14,7 @@
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/mime_type.h"
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/mime_type.h"
+#include "mhmisc.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
@@ -68,9 +69,6 @@ extern int bogus_mp_content;                  /* flag from InitMultiPart */
 /* flags to/from parse_header_attrs */
 extern int suppress_extraneous_trailing_semicolon_warning;
 
 /* flags to/from parse_header_attrs */
 extern int suppress_extraneous_trailing_semicolon_warning;
 
-/* mhmisc.c */
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index 0f9a51ee11cfebc99039d94de4e340d236bc917d..9fc42b0f9d71b7bc7edc3bf8d89837dbe7bdcfa6 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 
@@ -73,11 +74,6 @@ int debugsw = 0;
 /* mhparse.c */
 CT parse_mime (char *);
 
 /* mhparse.c */
 CT parse_mime (char *);
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index 968229c6641e5f14fcdd8c717b7630ec9daffc46..d58d43f9caedc36b1e2b69b8996d10012ad4aa5d 100644 (file)
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
-
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
+#include "mhmisc.h"
 
 /*
  * static prototypes
 
 /*
  * static prototypes
index a20c186e5804e2c00e93693a865b9c0702095d96..778d80556fd81c63de281e07dd372ca94a96ac80 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include "../sbr/makedir.h"
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include "../sbr/makedir.h"
+#include "mhmisc.h"
 
 extern int debugsw;
 
 
 extern int debugsw;
 
@@ -26,16 +27,6 @@ int userrs = 0;
 static char *errs = NULL;
 
 
 static char *errs = NULL;
 
 
-/*
- * prototypes
- */
-int part_ok (CT) PURE;
-int part_exact(CT ct) PURE;
-int type_ok (CT, int);
-void content_error (char *, CT, char *, ...) CHECK_PRINTF(3, 4);
-void flush_errors (void);
-
-
 int
 part_ok (CT ct)
 {
 int
 part_ok (CT ct)
 {
@@ -103,7 +94,7 @@ type_ok (CT ct, int sP)
 
 
 /*
 
 
 /*
- * Returns true if this content is marked as "inline".
+ * Returns true if the content has a disposition of "inline".
  *
  * Technically we should check parent content to see if they have
  * disposition to use as a default, but we don't right now.  Maybe
  *
  * Technically we should check parent content to see if they have
  * disposition to use as a default, but we don't right now.  Maybe
diff --git a/uip/mhmisc.h b/uip/mhmisc.h
new file mode 100644 (file)
index 0000000..bdf9baa
--- /dev/null
@@ -0,0 +1,14 @@
+/* mhmisc.h -- misc routines to process MIME messages
+ *
+ * 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 part_ok(CT) PURE;
+int part_exact(CT) PURE;
+int type_ok(CT, int);
+int is_inline(CT) PURE;
+int make_intermediates(char *);
+void content_error(char *, CT, char *, ...) CHECK_PRINTF(3, 4);
+void flush_errors(void);
index 70da652b0faa5b8b838e01def858d2dd367dcb86..1283a1ab96981cf60250b193897e0cd6754aeb7f 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -16,6 +16,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 #include "mhshowsbr.h"
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 #include "mhshowsbr.h"
@@ -104,11 +105,6 @@ static int storesw = 0;
 /* mhparse.c */
 CT parse_mime (char *);
 
 /* mhparse.c */
 CT parse_mime (char *);
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index 08d2240734ade1a54337b63d3a32c9d2f0526f38..b4e97d3dca85f48db839bdfb51c3eff12b218d20 100644 (file)
@@ -13,6 +13,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include <h/mhcachesbr.h>
 #include "../sbr/m_mktemp.h"
 #include "mhfree.h"
 #include <h/mhcachesbr.h>
 #include "../sbr/m_mktemp.h"
 #include "mhfree.h"
@@ -106,11 +107,6 @@ static struct k2v EncodingType[] = {
 };
 
 
 };
 
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void content_error (char *, CT, char *, ...);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index 146b8bf298a4267c696a61e9e2a9aa06a0a6e8f5..5cc3b4355ed3f8bf806571264235a3eb8daed5e9 100644 (file)
@@ -16,6 +16,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_popen.h"
 #include "mhfree.h"
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_popen.h"
 #include "mhfree.h"
@@ -86,11 +87,6 @@ int verbosw = 0;
 /* mhparse.c */
 CT parse_mime (char *);
 
 /* mhparse.c */
 CT parse_mime (char *);
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index 99bb406777376d75136c544087fa02445180c5dd..c0c3f2191817e6e3f0f12af929025057e37ece7f 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/fmt_scan.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/fmt_scan.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "mhshowsbr.h"
 #include "../sbr/m_mktemp.h"
 #ifdef HAVE_ICONV
 #include "mhshowsbr.h"
 #include "../sbr/m_mktemp.h"
 #ifdef HAVE_ICONV
@@ -40,13 +41,6 @@ char *headerform;
 int headersw = -1;
 
 
 int headersw = -1;
 
 
-/* mhmisc.c */
-int part_ok (CT);
-int part_exact (CT);
-int type_ok (CT, int);
-void content_error (char *, CT, char *, ...);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index d151df568a57aab87a04b895b7b5fcee26eb8493..850cabe07d52694e3a490669c6b4c3b132c22944 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 
 #include "../sbr/m_maildir.h"
 #include "mhfree.h"
 
@@ -64,11 +65,6 @@ extern int npreferred;
 int debugsw = 0;
 CT parse_mime (char *);
 
 int debugsw = 0;
 CT parse_mime (char *);
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
index c0398518352f5ae8a9f57b572146cb2e944e7533..46574a13a029021b8112f5eb85d36ea44e8a60ae 100644 (file)
@@ -14,6 +14,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "mhmisc.h"
 #include "mhshowsbr.h"
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #include "mhshowsbr.h"
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
@@ -80,11 +81,6 @@ mhstoreinfo_files_not_clobbered (const mhstoreinfo_t info) {
 typedef int (*qsort_comp) (const void *, const void *);
 
 
 typedef int (*qsort_comp) (const void *, const void *);
 
 
-/* mhmisc.c */
-int part_ok (CT);
-int type_ok (CT, int);
-void flush_errors (void);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */