50 char *buf,
size_t buflen)
68 for (; buflen; buf++, buflen--)
117 else if ((ch ==
'\t') || (ch ==
'\f'))
127 else if ((ch < 32) || (ch == 127))
135 if ((ch ==
'F') || (ch ==
'f'))
146 if ((linelen == 2) && (ch !=
'r'))
150 else if ((linelen == 3) && (ch !=
'o'))
154 else if (linelen == 4)
168 if ((ch !=
' ') && (ch !=
'\t'))
194 char *fromcode = NULL;
196 char buf[100] = { 0 };
199 struct stat st = { 0 };
206 if (stat(fname, &st) == -1)
208 mutt_error(
_(
"Can't stat %s: %s"), fname, strerror(errno));
212 if (!S_ISREG(st.st_mode))
235 (c_attach_charset ? c_attach_charset : c_charset_slist) :
240 if (c_charset && (chs || c_send_charset) &&
246 char chsbuf[256] = { 0 };
264 while ((r = fread(buf, 1,
sizeof(buf), fp)))
273 (!info->
hibin ?
"us-ascii" :
const struct Slist * cs_subset_slist(const struct ConfigSubset *sub, const char *name)
Get a string-list config item by name.
Convenience wrapper for the config headers.
const char * cc_charset(void)
Get the cached value of $charset.
void mutt_update_content_info(struct Content *info, struct ContentState *s, char *buf, size_t buflen)
Cache some info about an email.
struct Content * mutt_get_content_info(const char *fname, struct Body *b, struct ConfigSubset *sub)
Analyze file to determine MIME encoding to use.
size_t mutt_convert_file_from_to(FILE *fp, const struct Slist *fromcodes, const struct Slist *tocodes, char **fromcode, char **tocode, struct Content *info)
Convert a file between encodings.
Convenience wrapper for the core headers.
Structs that make up an email.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
#define MUTT_MEM_CALLOC(n, type)
@ TYPE_TEXT
Type: 'text/*'.
void mutt_ch_canonical_charset(char *buf, size_t buflen, const char *name)
Canonicalise the charset of a string.
#define mutt_ch_is_us_ascii(str)
#define ICONV_ILLEGAL_SEQ
Error value for iconv() - Illegal sequence.
Convenience wrapper for the library headers.
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
void slist_free(struct Slist **ptr)
Free an Slist object.
char * mutt_str_dup(const char *str)
Copy a string, safely.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
void mutt_param_set(struct ParameterList *pl, const char *attribute, const char *value)
Set a Parameter.
bool noconv
Don't do character set conversion.
char * charset
Send mode: charset of attached file as stored on disk.
struct ParameterList parameter
Parameters of the content-type.
bool use_disp
Content-Disposition uses filename= ?
bool force_charset
Send mode: don't adjust the character set when in send-mode.
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
A set of inherited config items.
Info about the body of an email.
bool was_cr
Was the last character CR?
int whitespace
Number of trailing whitespaces.
bool from
Is the current line a prefix of "From "?
int linelen
Length of the current line.
bool dot
Was the last character a dot?
Info about an attachment.
long crlf
\r and \n characters
long hibin
8-bit characters
bool cr
Has CR, even when in a CRLF pair.
bool space
Whitespace at the end of lines?
long ascii
Number of ascii chars.
bool binary
Long lines, or CR not in CRLF pair.
bool from
Has a line beginning with "From "?
long nulbin
Null characters (0x0)
long linemax
Length of the longest line in the file.
long lobin
Unprintable 7-bit chars (eg., control chars)
bool dot
Has a line consisting of a single dot?
#define D_SLIST_SEP_COLON
Slist items are colon-separated.