move all the parameter related functions into the lib-mime.
[apps/madmutt.git] / muttlib.c
index 5ad138c..cffef19 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -108,7 +108,7 @@ int mutt_copy_body (FILE * fp, BODY ** tgt, BODY * src)
   char tmp[_POSIX_PATH_MAX];
   BODY *b;
 
-  PARAMETER *par, **ppar;
+  parameter_t *par, **ppar;
 
   short use_disp;
 
@@ -401,42 +401,6 @@ char *_mutt_expand_path (char *s, ssize_t slen, int rx)
   return (s);
 }
 
-void mutt_set_parameter (const char *attribute, const char *value,
-                         PARAMETER ** p)
-{
-    PARAMETER *q;
-
-    if (!value) {
-        mutt_delete_parameter (attribute, p);
-        return;
-    }
-
-    for (q = *p; q; q = q->next) {
-        if (ascii_strcasecmp (attribute, q->attribute) == 0) {
-            m_strreplace(&q->value, value);
-            return;
-        }
-    }
-
-    q = parameter_new();
-    q->attribute = m_strdup(attribute);
-    q->value = m_strdup(value);
-    parameter_list_push(p, q);
-}
-
-void mutt_delete_parameter (const char *attribute, PARAMETER ** p)
-{
-    while (*p) {
-        if (!ascii_strcasecmp(attribute, (*p)->attribute)) {
-            PARAMETER *q = parameter_list_pop(p);
-            parameter_delete(&q);
-            return;
-        }
-
-        p = &(*p)->next;
-    }
-}
-
 /* returns 1 if Mutt can't display this type of data, 0 otherwise */
 int mutt_needs_mailcap (BODY * m)
 {
@@ -1296,29 +1260,13 @@ int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2)
   }
 }
 
-int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2)
-{
-  while (p1 && p2) {
-    if (m_strcmp(p1->attribute, p2->attribute) ||
-        m_strcmp(p1->value, p2->value))
-      return (0);
-
-    p1 = p1->next;
-    p2 = p2->next;
-  }
-  if (p1 || p2)
-    return (0);
-
-  return (1);
-}
-
 int mutt_cmp_body (const BODY * b1, const BODY * b2)
 {
   if (b1->type != b2->type ||
       b1->encoding != b2->encoding ||
       m_strcmp(b1->subtype, b2->subtype) ||
       m_strcmp(b1->description, b2->description) ||
-      !mutt_cmp_param (b1->parameter, b2->parameter) ||
+      !parameter_equal(b1->parameter, b2->parameter) ||
       b1->length != b2->length)
     return (0);
   return (1);