From: Ralph Corderoy Date: Mon, 15 May 2017 12:13:45 +0000 (+0100) Subject: Create and use header file for uip/mhfree.c's exports. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d1797eb2b2d5f3aa1b653e6a2562bf79c559eeb2 Create and use header file for uip/mhfree.c's exports. Remove all the duplicate inconsistent prototypes from mhfree.c's users. --- diff --git a/Makefile.am b/Makefile.am index da0d2881..38fc3e7c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -359,6 +359,7 @@ noinst_HEADERS = \ mts/smtp/smtp.h \ sbr/ctype-checked.h \ thirdparty/jsmn/jsmn.h \ + uip/mhfree.h \ # ## diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index b5d88a3f..8decc9fe 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -21,6 +21,7 @@ #include #include #include +#include "mhfree.h" #ifdef HAVE_SYS_TIME_H # include @@ -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 */ diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 615575b6..fdeac8d6 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -10,6 +10,7 @@ #include #include #include +#include "mhfree.h" #include #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 */ diff --git a/uip/mhfree.c b/uip/mhfree.c index de2692ae..260214ed 100644 --- a/uip/mhfree.c +++ b/uip/mhfree.c @@ -10,17 +10,11 @@ #include #include #include +#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 index 00000000..cd805956 --- /dev/null +++ b/uip/mhfree.h @@ -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; diff --git a/uip/mhlist.c b/uip/mhlist.c index 09814b1d..0dc142a3 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -15,6 +15,7 @@ #include #include #include +#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 */ diff --git a/uip/mhn.c b/uip/mhn.c index dd3cf871..335d4b29 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -15,6 +15,7 @@ #include #include #include +#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 */ diff --git a/uip/mhparse.c b/uip/mhparse.c index b1749515..238fc1a3 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -13,6 +13,7 @@ #include #include #include +#include "mhfree.h" #ifdef HAVE_ICONV # include #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 */ diff --git a/uip/mhshow.c b/uip/mhshow.c index 427b14ce..ce0d8f6a 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -15,6 +15,7 @@ #include #include #include +#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 */ diff --git a/uip/mhstore.c b/uip/mhstore.c index 2b844c2a..2fce6c8d 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -15,6 +15,7 @@ #include #include #include +#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 */