ctors/dtors for BODY's
[apps/madmutt.git] / muttlib.c
index cffef19..fc9606d 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
 
 #define SW              (option(OPTMBOXPANE)?SidebarWidth:0)
 
-BODY *mutt_new_body (void)
-{
-  BODY *p = p_new(BODY, 1);
-
-  p->disposition = DISPATTACH;
-  p->use_disp = 1;
-  return (p);
-}
-
-
 /* Modified by blong to accept a "suggestion" for file name.  If
  * that file exists, then construct one with unique name but 
  * keep any extension.  This might fail, I guess.
@@ -125,7 +115,7 @@ int mutt_copy_body (FILE * fp, BODY ** tgt, BODY * src)
   if (mutt_save_attachment (fp, src, tmp, 0, NULL) == -1)
     return -1;
 
-  *tgt = mutt_new_body ();
+  *tgt = body_new();
   b = *tgt;
 
   memcpy (b, src, sizeof (BODY));
@@ -167,45 +157,6 @@ int mutt_copy_body (FILE * fp, BODY ** tgt, BODY * src)
   return 0;
 }
 
-
-static void body_wipe(BODY *b)
-{
-    if (b->parameter)
-        parameter_list_wipe(&b->parameter);
-
-    if (b->unlink && b->filename) {
-        unlink (b->filename);
-    }
-
-    p_delete(&b->filename);
-    p_delete(&b->content);
-    p_delete(&b->xtype);
-    p_delete(&b->subtype);
-    p_delete(&b->description);
-    p_delete(&b->form_name);
-
-    if (b->hdr) {
-        /* Don't free twice (b->hdr->content = b->parts) */
-        b->hdr->content = NULL;
-        header_delete(&b->hdr);
-    }
-
-    if (b->parts)
-        mutt_free_body(&b->parts);
-}
-
-DO_DELETE(BODY, body);
-
-void mutt_free_body(BODY **p)
-{
-    while (*p) {
-        BODY *b = *p;
-        *p = b->next;
-
-        body_delete(&b);
-    }
-}
-
 HEADER *mutt_dup_header (HEADER * h)
 {
   HEADER *hnew;