/*
- * mhoutsbr.c -- routines to output MIME messages
- * -- given a Content structure
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
+** mhoutsbr.c -- routines to output MIME messages
+** -- given a Content structure
+**
+** This code is Copyright (c) 2002, by the authors of nmh. See the
+** COPYRIGHT file in the root directory of the nmh distribution for
+** complete copyright information.
+*/
#include <h/mh.h>
#include <fcntl.h>
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/*
- * prototypes
- */
+** prototypes
+*/
int output_message (CT, char *);
int output_message_fp (CT, FILE *, char *);
int writeBase64aux (FILE *, FILE *);
/*
- * static prototypes
- */
+** static prototypes
+*/
static int output_content (CT, FILE *);
static void output_headers (CT, FILE *);
static int writeExternalBody (CT, FILE *);
/*
- * Main routine to output a MIME message contained
- * in a Content structure, to a file. Any necessary
- * transfer encoding is added.
- */
+** Main routine to output a MIME message contained
+** in a Content structure, to a file. Any necessary
+** transfer encoding is added.
+*/
int
output_message_fp (CT ct, FILE *fp, char *file)
/*
- * Output a Content structure to a file.
- */
+** Output a Content structure to a file.
+*/
static int
output_content (CT ct, FILE *out)
CI ci = &ct->c_ctinfo;
/*
- * Output all header fields for this content
- */
+ ** Output all header fields for this content
+ */
output_headers (ct, out);
/*
- * If this is the internal content structure for a
- * "message/external", then we are done with the
- * headers (since it has no body).
- */
+ ** If this is the internal content structure for a
+ ** "message/external", then we are done with the
+ ** headers (since it has no body).
+ */
if (ct->c_ctexbody)
return OK;
/*
- * Now output the content bodies.
- */
+ ** Now output the content bodies.
+ */
switch (ct->c_type) {
case CT_MULTIPART:
{
break;
/*
- * Handle discrete types (text/application/audio/image/video)
- */
+ ** Handle discrete types (text/application/audio/image/video)
+ */
default:
switch (ct->c_encoding) {
case CE_7BIT:
/*
- * Output all the header fields for a content
- */
+** Output all the header fields for a content
+*/
static void
output_headers (CT ct, FILE *out)
/*
- * Write the phantom body for access-type "mail-server".
- */
+** Write the phantom body for access-type "mail-server".
+*/
static int
writeExternalBody (CT ct, FILE *out)
/*
- * Output a content without any transfer encoding
- */
+** Output a content without any transfer encoding
+*/
static int
write8Bit (CT ct, FILE *out)
/*
- * Output a content using quoted-printable
- */
+** Output a content using quoted-printable
+*/
static int
writeQuoted (CT ct, FILE *out)
/*
- * Output a content using base64
- */
+** Output a content using base64
+*/
static int
writeBase64 (CT ct, FILE *out)