]> diplodocus.org Git - nmh/blobdiff - uip/mhmisc.c
Removed export of most of the variables in test/common.sh.in. The
[nmh] / uip / mhmisc.c
index 86b8ad804f52212f070e261bf123d14ba6183246..f4b89168f7f1cbc314a819a7390006cca14239c5 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include <h/mh.h>
-#include <errno.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
@@ -69,13 +68,36 @@ type_ok (CT ct, int sP)
 
     snprintf (buffer, sizeof(buffer), "%s/%s", ci->ci_type, ci->ci_subtype);
     for (ap = types; *ap; ap++)
-       if (!mh_strcasecmp (*ap, ci->ci_type) || !mh_strcasecmp (*ap, buffer))
+       if (!strcasecmp (*ap, ci->ci_type) || !strcasecmp (*ap, buffer))
            return 1;
 
     return 0;
 }
 
 
+/*
+ * Returns true if this content is marked as "inline".
+ *
+ * Technically we should check parent content to see if they have
+ * disposition to use as a default, but we don't right now.  Maybe
+ * later ....
+ */
+
+int
+is_inline(CT ct)
+{
+    /*
+     * If there isn't any disposition at all, it's "inline".  Obviously
+     * if it's "inline", then it's inline.  RFC 2183 says if it's an unknown
+     * disposition, treat it as 'attachment'.
+     */
+
+    if (! ct->c_dispo_type || strcasecmp(ct->c_dispo_type, "inline") == 0)
+       return 1;
+    else
+       return 0;
+}
+
 int
 make_intermediates (char *file)
 {