]> diplodocus.org Git - nmh/commitdiff
sbr/message_id.c: Move duplicate prototypes to new header.
authorRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 09:53:17 +0000 (10:53 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 09:53:17 +0000 (10:53 +0100)
Makefile.am
h/mh.h
h/prototypes.h
sbr/message_id.c
sbr/message_id.h [new file with mode: 0644]
uip/mhbuildsbr.c
uip/post.c
uip/sendsbr.c

index c89b13e06594e38266021a3cd0f2d2c8c83d213b..dfcd688506ca63f6ac65765ef4d673ea462112d2 100644 (file)
@@ -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 77671f8d39bd896552f8fda8459410a6e1adbf59..af6acf93c65684d53a2d6acf555d1ba82ed8b256 100644 (file)
--- 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
index 5859d54d30dbad67d3248cc57fbaa4563c935d67..89ba298fc9173ffabb02cfcd68fbdf79367218e7 100644 (file)
@@ -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.
index 78f1c4ea35e33e68b9f153fd75f7070846301b97..aaaab322efbca4870da1023bc5b41ae68bb33ea3 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <h/mh.h>
 #include "m_rand.h"
+#include "message_id.h"
 #include <sys/time.h>  /* for gettimeofday() */
 
 
diff --git a/sbr/message_id.h b/sbr/message_id.h
new file mode 100644 (file)
index 0000000..a1021bb
--- /dev/null
@@ -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);
index 139b2e861e6ded5477eef24eac6fe9d01b05e934..7fabd2cb1f36be76b1b0017bed4c2522fefb837d 100644 (file)
@@ -23,6 +23,7 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include "../sbr/m_mktemp.h"
+#include "../sbr/message_id.h"
 #include "mhfree.h"
 #include "mhshowsbr.h"
 
index 44faf725f841929c8ca9d5f4592757f6fd0f4604..681556b38ea61f0ba9b2e880b7db49e655a01057 100644 (file)
@@ -16,6 +16,7 @@
 #include <h/tws.h>
 #include <h/mts.h>
 #include "../sbr/m_mktemp.h"
+#include "../sbr/message_id.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
index 4ba5578829f2f2f92293e565295ec372f9f11bd4..c0b8105c827dd80b852c00668b64b9bad184a2a8 100644 (file)
@@ -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 **);