void free_ctinfo (CT);
void free_encoding (CT, int);
-/*
- * prototypes
- */
-CT build_mime (char *, int);
-
/*
* static prototypes
*/
*/
CT
-build_mime (char *infile, int directives)
+build_mime (char *infile, int directives, int header_encoding)
{
int compnum, state;
char buf[BUFSIZ], name[NAMESZ];
struct part **pp;
CT ct;
FILE *in;
+ HF hp;
m_getfld_state_t gstate = 0;
directive_init(directives);
}
m_getfld_state_destroy (&gstate);
+ /*
+ * Iterate through the list of headers and call the function to MIME-ify
+ * them if required.
+ */
+
+ for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
+ if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) {
+ adios(NULL, "Unable to encode header \"%s\"", hp->name);
+ }
+ }
+
/*
* Now add the MIME-Version header field
* to the list of header fields.