-
-/*
- * mhfree.c -- routines to free the data structures used to
+/* mhfree.c -- routines to free the data structures used to
* -- represent MIME messages
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
#include <h/utils.h>
#include <h/mime.h>
#include <h/mhparse.h>
+#include "../sbr/m_mktemp.h"
+#include "mhfree.h"
/* The list of top-level contents to display */
CT *cts = NULL;
-/*
- * prototypes
- */
-void free_header (CT);
-void free_ctinfo (CT);
-void free_encoding (CT, int);
-void freects_done (int);
-
/*
* static prototypes
*/
+static void free_header (CT);
static void free_text (CT);
static void free_multi (CT);
static void free_partial (CT);
}
break;
- case CT_TEXT:
+ default:
+ /* Assume that the ct is for text. mhfixmsg(1) uses it for
+ decoding application content. */
free_text (ct);
break;
}
* for this content.
*/
-void
+static void
free_header (CT ct)
{
HF hp1, hp2;
if (!(t = (struct text *) ct->c_ctparams))
return;
- free ((char *) t);
+ free(t);
ct->c_ctparams = NULL;
}
for (part = m->mp_parts; part; part = next) {
next = part->mp_next;
free_content (part->mp_part);
- free ((char *) part);
+ free(part);
}
m->mp_parts = NULL;
- free ((char *) m);
+ free(m);
ct->c_ctparams = NULL;
}
mh_xfree(p->pm_partid);
- free ((char *) p);
+ free(p);
ct->c_ctparams = NULL;
}
free_content (e->eb_content);
mh_xfree(e->eb_body);
mh_xfree(e->eb_url);
- free ((char *) e);
+ free(e);
ct->c_ctparams = NULL;
}
}
-void
+void NORETURN
freects_done (int status)
{
CT *ctp;