]> diplodocus.org Git - nmh/commitdiff
Create and use header file for uip/mhfree.c's exports.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 15 May 2017 12:13:45 +0000 (13:13 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 15 May 2017 12:13:45 +0000 (13:13 +0100)
Remove all the duplicate inconsistent prototypes from mhfree.c's users.

Makefile.am
uip/mhbuildsbr.c
uip/mhfixmsg.c
uip/mhfree.c
uip/mhfree.h [new file with mode: 0644]
uip/mhlist.c
uip/mhn.c
uip/mhparse.c
uip/mhshow.c
uip/mhstore.c

index da0d288..38fc3e7 100644 (file)
@@ -359,6 +359,7 @@ noinst_HEADERS = \
     mts/smtp/smtp.h \
     sbr/ctype-checked.h \
     thirdparty/jsmn/jsmn.h \
+    uip/mhfree.h \
     #
 
 ##
index b5d88a3..8decc9f 100644 (file)
@@ -21,6 +21,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "mhfree.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
@@ -59,12 +60,6 @@ void content_error (char *, CT, char *, ...);
 /* mhcachesbr.c */
 int find_cache (CT, int, int *, char *, char *, int);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-void free_ctinfo (CT);
-void free_encoding (CT, int);
-
 /*
  * static prototypes
  */
index 615575b..fdeac8d 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/signals.h>
+#include "mhfree.h"
 #include <fcntl.h>
 
 #define MHFIXMSG_SWITCHES \
@@ -67,9 +68,6 @@ int output_message_fp (CT, FILE *, char *);
 /* mhmisc.c */
 void flush_errors (void);
 
-/* mhfree.c */
-extern CT *cts;
-
 /*
  * static prototypes
  */
index de2692a..260214e 100644 (file)
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
+#include "mhfree.h"
 
 /* The list of top-level contents to display */
 CT *cts = NULL;
 
-/*
- * prototypes
- */
-void free_ctinfo (CT);
-void free_encoding (CT, int);
-void freects_done (int);
-
 /*
  * static prototypes
  */
diff --git a/uip/mhfree.h b/uip/mhfree.h
new file mode 100644 (file)
index 0000000..cd80595
--- /dev/null
@@ -0,0 +1,12 @@
+/* mhfree.h -- routines to free MIME-message data structures.
+ *
+ * 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.
+ */
+
+void free_ctinfo(CT);
+void free_encoding(CT, int);
+void freects_done(int) NORETURN;
+
+extern CT *cts;
index 09814b1..0dc142a 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhfree.h"
 
 #define MHLIST_SWITCHES \
     X("check", 0, CHECKSW) \
@@ -82,10 +83,6 @@ int part_ok (CT);
 int type_ok (CT, int);
 void flush_errors (void);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-
 /*
  * static prototypes
  */
index dd3cf87..335d4b2 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhfree.h"
 
 #define MHN_SWITCHES \
     X("auto", 0, AUTOSW) \
@@ -120,10 +121,6 @@ void flush_errors (void);
 /* mhcachesbr.c */
 void cache_all_messages (CT *);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-
 /*
  * static prototypes
  */
index b174951..238fc1a 100644 (file)
@@ -13,6 +13,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "mhfree.h"
 #ifdef HAVE_ICONV
 # include <iconv.h>
 #endif /* HAVE_ICONV */
@@ -115,9 +116,6 @@ int part_ok (CT);
 int type_ok (CT, int);
 void content_error (char *, CT, char *, ...);
 
-/* mhfree.c */
-void free_encoding (CT, int);
-
 /*
  * static prototypes
  */
index 427b14c..ce0d8f6 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhfree.h"
 
 #define MHSHOW_SWITCHES \
     X("check", 0, CHECKSW) \
@@ -101,10 +102,6 @@ int part_ok (CT);
 int type_ok (CT, int);
 void flush_errors (void);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-
 /*
  * static prototypes
  */
index 2b844c2..2fce6c8 100644 (file)
@@ -15,6 +15,7 @@
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
+#include "mhfree.h"
 
 #define MHSTORE_SWITCHES \
     X("auto", 0, AUTOSW) \
@@ -73,10 +74,6 @@ int part_ok (CT);
 int type_ok (CT, int);
 void flush_errors (void);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-
 /*
  * static prototypes
  */