]> diplodocus.org Git - nmh/commitdiff
Moved reverse_alternative_parts() from mhfixmsg.c to mhparse.c
authorDavid Levine <levinedl@acm.org>
Tue, 26 Aug 2014 01:49:39 +0000 (20:49 -0500)
committerDavid Levine <levinedl@acm.org>
Tue, 26 Aug 2014 01:49:39 +0000 (20:49 -0500)
and added declaration to mhparse.h.

h/mhparse.h
uip/mhfixmsg.c
uip/mhparse.c

index 0b0afb0f0f25c5f98616db0de415f13ea43cf3ef..b9e7b90e65169a85187de07a5a81dff60f85ca3c 100644 (file)
@@ -342,6 +342,7 @@ const char *ce_str (int);
 const struct str2init *get_ce_method (const char *);
 char *content_charset (CT);
 int convert_charset (CT, char *, int *);
+void reverse_alternative_parts (CT);
 
 /*
  * Given a content structure, return true if the content has a disposition
index f5488532bfa7df9f6ac05a40cf7b4852a05a9d2d..56253803e96cd7e7fca95029c49997a32edbb065 100644 (file)
@@ -53,7 +53,6 @@ int debugsw; /* Needed by mhparse.c. */
 extern int skip_mp_cte_check;                 /* flag to InitMultiPart */
 extern int suppress_bogus_mp_content_warning; /* flag to InitMultiPart */
 extern int bogus_mp_content;                  /* flag from InitMultiPart */
-void reverse_parts (CT);
 
 /* mhoutsbr.c */
 int output_message (CT, char *);
@@ -78,7 +77,6 @@ typedef struct fix_transformations {
 } fix_transformations;
 
 int mhfixmsgsbr (CT *, const fix_transformations *, char *);
-static void reverse_alternative_parts (CT);
 static int fix_boundary (CT *, int *);
 static int get_multipart_boundary (CT, char **);
 static int replace_boundary (CT, char *, char *);
@@ -459,27 +457,6 @@ mhfixmsgsbr (CT *ctp, const fix_transformations *fx, char *outfile) {
 }
 
 
-/* parse_mime() arranges alternates in reverse (priority) order, so
-   reverse them back.  This will put a text/plain part at the front of
-   a multipart/alternative part, for example, where it belongs. */
-static void
-reverse_alternative_parts (CT ct) {
-    if (ct->c_type == CT_MULTIPART) {
-        struct multipart *m = (struct multipart *) ct->c_ctparams;
-        struct part *part;
-
-        if (ct->c_subtype == MULTI_ALTERNATE) {
-            reverse_parts (ct);
-        }
-
-        /* And call recursively on each part of a multipart. */
-        for (part = m->mp_parts; part; part = part->mp_next) {
-            reverse_alternative_parts (part->mp_part);
-        }
-    }
-}
-
-
 static int
 fix_boundary (CT *ct, int *message_mods) {
     struct multipart *mp;
index 754146674fbe71f88ec7da757133d2956304ed61..14701398ebc4f787fd4e63b8ae89811aa8c6cca5 100644 (file)
@@ -115,7 +115,7 @@ static int get_comment (const char *, const char *, char **, char **);
 static int InitGeneric (CT);
 static int InitText (CT);
 static int InitMultiPart (CT);
-void reverse_parts (CT);
+static void reverse_parts (CT);
 static int InitMessage (CT);
 static int InitApplication (CT);
 static int init_encoding (CT, OpenCEFunc);
@@ -1277,7 +1277,7 @@ last_part:
  * reverse the order of the parts of a multipart/alternative
  */
 
-void
+static void
 reverse_parts (CT ct)
 {
     struct multipart *m = (struct multipart *) ct->c_ctparams;
@@ -1294,6 +1294,30 @@ reverse_parts (CT ct)
 }
 
 
+
+
+/* parse_mime() arranges alternates in reverse (priority) order.  This
+   function can be used to reverse them back.  This will put, for
+   example, a text/plain part before a text/html part in a
+   multipart/alternative part, for example, where it belongs. */
+void
+reverse_alternative_parts (CT ct) {
+    if (ct->c_type == CT_MULTIPART) {
+        struct multipart *m = (struct multipart *) ct->c_ctparams;
+        struct part *part;
+
+        if (ct->c_subtype == MULTI_ALTERNATE) {
+            reverse_parts (ct);
+        }
+
+        /* And call recursively on each part of a multipart. */
+        for (part = m->mp_parts; part; part = part->mp_next) {
+            reverse_alternative_parts (part->mp_part);
+        }
+    }
+}
+
+
 /*
  * MESSAGE
  */