fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype);
if (a->parameter) {
fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype);
if (a->parameter) {
len = 25 + m_strlen(a->subtype); /* approximate len. of content-type */
for (p = a->parameter; p; p = p->next) {
len = 25 + m_strlen(a->subtype); /* approximate len. of content-type */
for (p = a->parameter; p; p = p->next) {
if (a->type == TYPEMULTIPART) {
/* First, find the boundary to use */
if (a->type == TYPEMULTIPART) {
/* First, find the boundary to use */
-#define BOUNDARYLEN 16
-void mutt_generate_boundary (PARAMETER ** parm)
-{
- char rs[BOUNDARYLEN + 1];
- char *p = rs;
- int i;
-
- rs[BOUNDARYLEN] = 0;
- for (i = 0; i < BOUNDARYLEN; i++)
- *p++ = __m_b64chars[lrand48() % sizeof(__m_b64chars)];
- *p = 0;
-
- mutt_set_parameter ("boundary", rs, parm);
-}
-
cd[i] = mutt_iconv_open (tocodes[i], "UTF-8", 0);
else
/* Special case for conversion to UTF-8 */
cd[i] = mutt_iconv_open (tocodes[i], "UTF-8", 0);
else
/* Special case for conversion to UTF-8 */
ub = bufu, ubl = ubl1;
ob = bufo, obl = sizeof (bufo);
n = my_iconv(cd[i], (ibl || ubl) ? &ub : 0, &ubl, &ob, &obl);
ub = bufu, ubl = ubl1;
ob = bufo, obl = sizeof (bufo);
n = my_iconv(cd[i], (ibl || ubl) ? &ub : 0, &ubl, &ob, &obl);
update_content_info (&infos[i], &states[i], bufo, ob - bufo);
}
}
update_content_info (&infos[i], &states[i], bufo, ob - bufo);
}
}
/* Special case for conversion to UTF-8 */
update_content_info (&infos[i], &states[i], bufu, ubl1);
/* Special case for conversion to UTF-8 */
update_content_info (&infos[i], &states[i], bufu, ubl1);
char *fchs = b->use_disp ? ((FileCharset && *FileCharset) ?
FileCharset : Charset) : Charset;
if (Charset && (chs || SendCharset) &&
convert_file_from_to (fp, fchs, chs ? chs : SendCharset,
&fromcode, &tocode, info) != -1) {
if (!chs) {
char *fchs = b->use_disp ? ((FileCharset && *FileCharset) ?
FileCharset : Charset) : Charset;
if (Charset && (chs || SendCharset) &&
convert_file_from_to (fp, fchs, chs ? chs : SendCharset,
&fromcode, &tocode, info) != -1) {
if (!chs) {
- mutt_canonical_charset (chsbuf, sizeof (chsbuf), tocode);
- mutt_set_parameter ("charset", chsbuf, &b->parameter);
+ charset_canonicalize (chsbuf, sizeof (chsbuf), tocode);
+ parameter_setval(&b->parameter, "charset", chsbuf);
- mutt_set_parameter ("charset", (!info->hibin ? "us-ascii" :
- Charset
- && !mutt_is_us_ascii (Charset) ? Charset :
- "unknown-8bit"), &b->parameter);
+ parameter_setval(&b->parameter, "charset",
+ (!info->hibin ? "us-ascii"
+ : Charset && !charset_is_us_ascii(Charset) ? Charset : "unknown-8bit"));
body->type = TYPEMESSAGE;
body->subtype = m_strdup("rfc822");
body->filename = m_strdup(buffer);
body->type = TYPEMESSAGE;
body->subtype = m_strdup("rfc822");
body->filename = m_strdup(buffer);
att->filename = m_strdup(path);
/* Attempt to determine the appropriate content-type based on the filename
att->filename = m_strdup(path);
/* Attempt to determine the appropriate content-type based on the filename
new->type = TYPEMULTIPART;
new->subtype = m_strdup("mixed");
new->encoding = get_toplevel_encoding (b);
new->type = TYPEMULTIPART;
new->subtype = m_strdup("mixed");
new->encoding = get_toplevel_encoding (b);
if (b->type == TYPEMESSAGE || b->type == TYPEMULTIPART)
set_noconv_flags (b->parts, flag);
else if (b->type == TYPETEXT && b->noconv) {
if (b->type == TYPEMESSAGE || b->type == TYPEMULTIPART)
set_noconv_flags (b->parts, flag);
else if (b->type == TYPETEXT && b->noconv) {
- if (flag)
- mutt_set_parameter ("x-mutt-noconv", "yes", &b->parameter);
- else
- mutt_delete_parameter ("x-mutt-noconv", &b->parameter);
+ parameter_setval(&b->parameter, "x-mutt-noconv", flag ? "yes" : NULL);