rationalize list handling in mutt a bit.
[apps/madmutt.git] / lib-mime / mime.c
index fdb2935..95dabad 100644 (file)
@@ -48,30 +48,16 @@ const char *BodyEncodings[] = {
     "x-uuencoded",
 };
 
-void address_wipe(address_t *addr)
-{
-    p_delete(&addr->personal);
-    p_delete(&addr->mailbox);
-    address_delete(&addr->next);
-}
-
-void parameter_wipe(PARAMETER *param)
-{
-    p_delete(&param->attribute);
-    p_delete(&param->value);
-    parameter_delete(&param->next);
-}
-
 void envelope_wipe(ENVELOPE *p)
 {
-    address_delete(&p->return_path);
-    address_delete(&p->from);
-    address_delete(&p->to);
-    address_delete(&p->cc);
-    address_delete(&p->bcc);
-    address_delete(&p->sender);
-    address_delete(&p->reply_to);
-    address_delete(&p->mail_followup_to);
+    address_list_wipe(&p->return_path);
+    address_list_wipe(&p->from);
+    address_list_wipe(&p->to);
+    address_list_wipe(&p->cc);
+    address_list_wipe(&p->bcc);
+    address_list_wipe(&p->sender);
+    address_list_wipe(&p->reply_to);
+    address_list_wipe(&p->mail_followup_to);
 
     p_delete(&p->list_post);
     p_delete(&p->subject);
@@ -89,9 +75,9 @@ void envelope_wipe(ENVELOPE *p)
 #endif
 
     mutt_buffer_free (&p->spam);
-    mutt_free_list(&p->references);
-    mutt_free_list(&p->in_reply_to);
-    mutt_free_list(&p->userhdrs);
+    string_list_wipe(&p->references);
+    string_list_wipe(&p->in_reply_to);
+    string_list_wipe(&p->userhdrs);
 }
 
 void header_wipe(HEADER *h)
@@ -102,7 +88,7 @@ void header_wipe(HEADER *h)
     p_delete(&h->tree);
     p_delete(&h->path);
 #ifdef MIXMASTER
-    mutt_free_list(&h->chain);
+    string_list_wipe(&h->chain);
 #endif
     p_delete(&h->data);
 }
@@ -117,7 +103,7 @@ int url_parse_mailto(ENVELOPE *e, char **body, const char *src)
 
     int taglen;
 
-    LIST **last = &e->userhdrs;
+    string_list_t **last = &e->userhdrs;
 
     if (!(t = strchr (src, ':')))
         return -1;