From: Ralph Corderoy Date: Tue, 16 May 2017 09:53:17 +0000 (+0100) Subject: sbr/message_id.c: Move duplicate prototypes to new header. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/ebc80d39510fbd9557cbea587e4f969436488746?ds=inline;hp=--cc sbr/message_id.c: Move duplicate prototypes to new header. --- ebc80d39510fbd9557cbea587e4f969436488746 diff --git a/Makefile.am b/Makefile.am index c89b13e0..dfcd6885 100644 --- a/Makefile.am +++ b/Makefile.am @@ -364,6 +364,7 @@ noinst_HEADERS = \ sbr/m_popen.h \ sbr/m_rand.h \ sbr/makedir.h \ + sbr/message_id.h \ thirdparty/jsmn/jsmn.h \ uip/mhfree.h \ uip/mhoutsbr.h \ diff --git a/h/mh.h b/h/mh.h index 77671f8d..af6acf93 100644 --- a/h/mh.h +++ b/h/mh.h @@ -432,13 +432,6 @@ extern char *defpath; /* pathname of user's profile */ extern char *ctxpath; /* pathname of user's context */ extern struct node *m_defs; /* list of profile/context entries */ -/* What style to use for generated Message-ID and Content-ID header - fields. The localname style is pid.time@localname, where time is - in seconds. The random style replaces the localname with some - (pseudo)random bytes and uses microsecond-resolution time. */ -int save_message_id_style (const char *); -char *message_id (time_t, int); - /* * These standard strings are defined in config.c. They are the * only system-dependent parameters in nmh, and thus by redefining diff --git a/h/prototypes.h b/h/prototypes.h index 5859d54d..89ba298f 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -233,7 +233,6 @@ int m_gmprot (void); char *m_name (int); void m_unknown(m_getfld_state_t *, FILE *); -char *message_id (time_t, int); /* * Return a MIME content-type string for the specified file. diff --git a/sbr/message_id.c b/sbr/message_id.c index 78f1c4ea..aaaab322 100644 --- a/sbr/message_id.c +++ b/sbr/message_id.c @@ -8,6 +8,7 @@ #include #include "m_rand.h" +#include "message_id.h" #include /* for gettimeofday() */ diff --git a/sbr/message_id.h b/sbr/message_id.h new file mode 100644 index 00000000..a1021bb0 --- /dev/null +++ b/sbr/message_id.h @@ -0,0 +1,14 @@ +/* message_id.h -- construct the body of a Message-ID or Content-ID. + * + * 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. + */ + +/* What style to use for generated Message-ID and Content-ID header + * fields. The localname style is pid.time@localname, where time is + * in seconds. The random style replaces the localname with some + * (pseudo)random bytes and uses microsecond-resolution time. */ +int save_message_id_style(const char *value); + +char *message_id(time_t tclock, int content_id); diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 139b2e86..7fabd2cb 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -23,6 +23,7 @@ #include #include #include "../sbr/m_mktemp.h" +#include "../sbr/message_id.h" #include "mhfree.h" #include "mhshowsbr.h" diff --git a/uip/post.c b/uip/post.c index 44faf725..681556b3 100644 --- a/uip/post.c +++ b/uip/post.c @@ -16,6 +16,7 @@ #include #include #include "../sbr/m_mktemp.h" +#include "../sbr/message_id.h" #ifdef HAVE_SYS_TIME_H # include diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 4ba55788..c0b8105c 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -26,6 +26,7 @@ #endif #include "../sbr/m_maildir.h" #include "../sbr/m_mktemp.h" +#include "../sbr/message_id.h" #ifdef OAUTH_SUPPORT static int setup_oauth_params(char *[], int *, const char *, const char **);