mutt_get_send_charset (charset, sizeof (charset), aptr->content, 0))
mutt_get_body_charset (charset, sizeof (charset), aptr->content))
const char *mutt_attach_fmt (char *dest,    size_t destlen,    char op,    const char *src,    const char *prefix,    const char *ifstring,    const char *elsestring,    unsigned long data,    format_flag flags){  char fmt[16];  char tmp[SHORT_STRING];  char charset[SHORT_STRING];  ATTACHPTR *aptr = (ATTACHPTR *) data;  int optional = (flags & M_FORMAT_OPTIONAL);  size_t l;    switch (op)  {    case 'C':      if (!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	if (mutt_is_text_type (aptr->content->type, aptr->content->subtype) &&	    mutt_get_send_charset (charset, sizeof (charset), aptr->content, 0))	  snprintf (dest, destlen, fmt, charset);	else	  snprintf (dest, destlen, fmt, "");      }      else if (!mutt_is_text_type (aptr->content->type, aptr->content->subtype) ||	       !mutt_get_send_charset (charset, sizeof (charset), aptr->content, 0))        optional = 0;      break;    case 'c':      /* XXX */      if (!optional)      {	snprintf (fmt, sizeof (fmt), "%%%sc", prefix);	snprintf (dest, destlen, fmt, aptr->content->type != TYPETEXT ||		  aptr->content->noconv ? 'n' : 'c');      }      else if (aptr->content->type != TYPETEXT || aptr->content->noconv)        optional = 0;      break;    case 'd':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	if (aptr->content->description)	{	  snprintf (dest, destlen, fmt, aptr->content->description);	  break;	}	if (mutt_is_message_type(aptr->content->type, aptr->content->subtype) &&	    MsgFmt && aptr->content->hdr)	{	  char s[SHORT_STRING];	  _mutt_make_string (s, sizeof (s), MsgFmt, NULL, aptr->content->hdr,			     M_FORMAT_FORCESUBJ | M_FORMAT_MAKEPRINT | M_FORMAT_ARROWCURSOR);	  if (*s)	  {	    snprintf (dest, destlen, fmt, s);	    break;	  }	}	if (!aptr->content->filename)	{	  snprintf (dest, destlen, fmt, "<no description>");	  break;	}      }      else if(aptr->content->description || 	      (mutt_is_message_type (aptr->content->type, aptr->content->subtype)	      && MsgFmt && aptr->content->hdr))        break;    /* FALLS THROUGH TO 'f' */    case 'f':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	if (aptr->content->filename && *aptr->content->filename == '/')	{	  char path[_POSIX_PATH_MAX];	  	  strfcpy (path, aptr->content->filename, sizeof (path));	  mutt_pretty_mailbox (path);	  snprintf (dest, destlen, fmt, path);	}	else	  snprintf (dest, destlen, fmt, NONULL (aptr->content->filename));      }      else if(!aptr->content->filename)        optional = 0;      break;    case 'D':      if(!optional)	snprintf (dest, destlen, "%c", aptr->content->deleted ? 'D' : ' ');      else if(!aptr->content->deleted)        optional = 0;      break;    case 'e':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	snprintf (dest, destlen, fmt, ENCODING (aptr->content->encoding));      }      break;    case 'I':      if (!optional)      {	  snprintf (dest, destlen, "%c",		  (aptr->content->disposition == DISPINLINE) ? 'I' : 'A');      }      break;    case 'm':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	snprintf (dest, destlen, fmt, TYPE (aptr->content));      }      break;    case 'M':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);	snprintf (dest, destlen, fmt, aptr->content->subtype);      }       else if(!aptr->content->subtype)        optional = 0;      break;    case 'n':      if(!optional)      {	snprintf (fmt, sizeof (fmt), "%%%sd", prefix);	snprintf (dest, destlen, fmt, aptr->num + 1);      }      break;    case 's':      if (flags & M_FORMAT_STAT_FILE)      {	struct stat st;	stat (aptr->content->filename, &st);	l = st.st_size;      }      else        l = aptr->content->length;            if(!optional)      {	mutt_pretty_size (tmp, sizeof(tmp), l);	snprintf (fmt, sizeof(fmt), "%%%ss", prefix);	snprintf (dest, destlen, fmt, tmp);      }      else if (l == 0)        optional = 0;      break;    case 't':      if(!optional)        snprintf (dest, destlen, "%c", aptr->content->tagged ? '*' : ' ');      else if(!aptr->content->tagged)        optional = 0;      break;    case 'T':      if(!optional)      {	snprintf (fmt, sizeof(fmt), "%%%ss", prefix);        snprintf (dest, destlen, fmt, NONULL (aptr->tree));      }       else if (!aptr->tree)        optional = 0;      break;    case 'u':      if(!optional)        snprintf (dest, destlen, "%c", aptr->content->unlink ? '-' : ' ');      else if (!aptr->content->unlink)        optional = 0;      break;    default:      *dest = 0;  }    if (optional)    mutt_FormatString (dest, destlen, ifstring, mutt_attach_fmt, data, 0);  else if (flags & M_FORMAT_OPTIONAL)    mutt_FormatString (dest, destlen, elsestring, mutt_attach_fmt, data, 0);  return (src);}