]> diplodocus.org Git - nmh/commitdiff
sbr/mime_type.c: Move prototype from h/prototypes.h to new header.
authorRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 09:59:07 +0000 (10:59 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 09:59:07 +0000 (10:59 +0100)
Makefile.am
h/prototypes.h
sbr/mime_type.c
sbr/mime_type.h [new file with mode: 0644]
uip/mhbuildsbr.c
uip/mhfixmsg.c
uip/whatnowsbr.c

index dfcd688506ca63f6ac65765ef4d673ea462112d2..53eb99e7cda499aed81a50879f2f6a41c6ce7b87 100644 (file)
@@ -365,6 +365,7 @@ noinst_HEADERS = \
     sbr/m_rand.h \
     sbr/makedir.h \
     sbr/message_id.h \
     sbr/m_rand.h \
     sbr/makedir.h \
     sbr/message_id.h \
+    sbr/mime_type.h \
     thirdparty/jsmn/jsmn.h \
     uip/mhfree.h \
     uip/mhoutsbr.h \
     thirdparty/jsmn/jsmn.h \
     uip/mhfree.h \
     uip/mhoutsbr.h \
index 89ba298fc9173ffabb02cfcd68fbdf79367218e7..9a2b41a426bb6a5dcf46e2418f35f6160b677134 100644 (file)
@@ -234,26 +234,6 @@ char *m_name (int);
 
 void m_unknown(m_getfld_state_t *, FILE *);
 
 
 void m_unknown(m_getfld_state_t *, FILE *);
 
-/*
- * Return a MIME content-type string for the specified file.
- *
- * If the system supports it, will use the "file" command to determine
- * the appropriate content-type.  Otherwise it will try to determine the
- * content-type from the suffix.  If that fails, the file will be scanned
- * and either assigned a MIME type of text/plain or application/octet-stream
- * depending if binary content is present.
- *
- * Arguments:
- *
- * filename    - The name of the file to determine the MIME type of.
- *
- * Returns a pointer to a content-type string (which may include MIME
- * parameters, such as charset).  Returns a NULL if it cannot determine
- * the MIME type of the file.  Returns allocated storage that must be
- * free'd.
- */
-char *mime_type(const char *filename);
-
 /*
  * Clear the screen, using the appropriate entry from the terminfo database
  */
 /*
  * Clear the screen, using the appropriate entry from the terminfo database
  */
index 379c248df6a0712b6e7d3dbe0b4e7a1958c60b60..f1b96fe591c001ca6ac3885a11701ea4dec3c03a 100644 (file)
@@ -8,6 +8,7 @@
 #include <h/mh.h>
 #include <h/utils.h>
 #include <h/tws.h>
 #include <h/mh.h>
 #include <h/utils.h>
 #include <h/tws.h>
+#include "mime_type.h"
 
 #ifdef MIMETYPEPROC
 static char *get_file_info(const char *, const char *);
 
 #ifdef MIMETYPEPROC
 static char *get_file_info(const char *, const char *);
diff --git a/sbr/mime_type.h b/sbr/mime_type.h
new file mode 100644 (file)
index 0000000..242125f
--- /dev/null
@@ -0,0 +1,25 @@
+/* mime_type.h -- determine the MIME Content-Type of a file.
+ *
+ * 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.
+ */
+
+/* Return a MIME content-type string for the specified file.
+ *
+ * If the system supports it, will use the "file" command to determine
+ * the appropriate content-type.  Otherwise it will try to determine the
+ * content-type from the suffix.  If that fails, the file will be scanned
+ * and either assigned a MIME type of text/plain or application/octet-stream
+ * depending if binary content is present.
+ *
+ * Arguments:
+ *
+ * filename    - The name of the file to determine the MIME type of.
+ *
+ * Returns a pointer to a content-type string (which may include MIME
+ * parameters, such as charset).  Returns a NULL if it cannot determine
+ * the MIME type of the file.  Returns allocated storage that must be
+ * free'd.
+ */
+char *mime_type(const char *filename);
index 7fabd2cb1f36be76b1b0017bed4c2522fefb837d..982d1047a505ea810af2ec6de8555bb0dc7945d1 100644 (file)
@@ -24,6 +24,7 @@
 #include <h/utils.h>
 #include "../sbr/m_mktemp.h"
 #include "../sbr/message_id.h"
 #include <h/utils.h>
 #include "../sbr/m_mktemp.h"
 #include "../sbr/message_id.h"
+#include "../sbr/mime_type.h"
 #include "mhfree.h"
 #include "mhshowsbr.h"
 
 #include "mhfree.h"
 #include "mhshowsbr.h"
 
index 4b880b47a53b59436b44382dbcdf7796c6d6649b..aed480eadf33168901cb9b30bbf38babbff96429 100644 (file)
@@ -13,6 +13,7 @@
 #include <h/signals.h>
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #include <h/signals.h>
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
+#include "../sbr/mime_type.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
index cd7011c0e83fdf6fa9d46dac44cc8dc031e31f61..164a552a855ca64b63827e6caac741d7344ead3b 100644 (file)
@@ -46,6 +46,7 @@
 #endif
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #endif
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
+#include "../sbr/mime_type.h"
 
 #define WHATNOW_SWITCHES \
     X("draftfolder +folder", 0, DFOLDSW) \
 
 #define WHATNOW_SWITCHES \
     X("draftfolder +folder", 0, DFOLDSW) \