68 while (p && (*p ==
'>'))
96 return c_reflow_space_quotes;
118 if (!ql && !state->
prefix)
123 if (!c_text_flowed && !ql && state->
prefix)
155 for (
int i = 0; i < ql; i++)
167 return ql + add_suffix + wid;
231 size_t width, w, words = 0;
235 if (!line || (*line ==
'\0'))
248 (
long) width, fst->
spaces);
271 if (!(!fst->
spaces && fst->
delsp && (last !=
' ')) && (w < width) &&
287 if (!words && !fst->
width)
326 unsigned int quotelevel = 0;
349 if (newql != quotelevel)
356 if (buf[buf_off] ==
' ')
364 const bool fixed = (buflen == buf_off) || (buf[buflen - 1] !=
' ') || sigsep;
368 if ((fixed && ((fst.
width == 0) || (buflen == 0))) || sigsep)
378 buf[buflen - 1] =
'\0';
441 fputs(buf + 1, fp_out);
462 if ((truncate(filename, 0) == -1) || ((fp_out =
mutt_file_fopen(filename,
"a")) == NULL))
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Structs that make up an email.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
void mutt_file_set_mtime(const char *from, const char *to)
Set the modification time of one file from another.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
#define MUTT_RL_NO_FLAGS
No flags are set.
int rfc3676_handler(struct Body *b_email, struct State *state)
Handler for format=flowed - Implements handler_t -.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG5
Log at debug level 5.
@ TYPE_TEXT
Type: 'text/*'.
Convenience wrapper for the library headers.
#define state_puts(STATE, STR)
#define STATE_DISPLAY
Output is displayed to the user.
#define state_putc(STATE, STR)
#define STATE_REPLYING
Are we replying?
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
char * mutt_str_sep(char **stringp, const char *delim)
Find first occurrence of any of delim characters in *stringp.
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
static void print_fixed_line(const char *line, struct State *state, int ql, struct FlowedState *fst)
Print a fixed format line.
static void rfc3676_space_stuff(const char *filename, bool unstuff)
Perform required RFC3676 space stuffing.
static size_t print_indent(int ql, struct State *state, int add_suffix)
Print indented text.
void mutt_rfc3676_space_unstuff(struct Email *e)
Remove RFC3676 space stuffing.
static bool add_quote_suffix(struct State *state, int ql)
Should we add a trailing space to quotes.
static int quote_width(struct State *state, int ql)
Calculate the paragraph width based upon the quote level.
void mutt_rfc3676_space_stuff_attachment(struct Body *b, const char *filename)
Stuff attachments.
static int space_quotes(struct State *state)
Should we add spaces between quote levels.
static int get_quote_level(const char *line)
Get the quote level of a line.
void mutt_rfc3676_space_unstuff_attachment(struct Body *b, const char *filename)
Unstuff attachments.
static void print_flowed_line(char *line, struct State *state, int ql, struct FlowedState *fst, bool term)
Print a format-flowed line.
static void flush_par(struct State *state, struct FlowedState *fst)
Write out the paragraph.
bool mutt_rfc3676_is_format_flowed(struct Body *b)
Is the Email "format-flowed"?
void mutt_rfc3676_space_stuff(struct Email *e)
Perform RFC3676 space stuffing on an Email.
RFC3676 Format Flowed routines.
struct ParameterList parameter
Parameters of the content-type.
char * subtype
content-type subtype
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
The envelope/body of an email.
struct Body * body
List of MIME parts.
State of a Format-Flowed line of text.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Keep track when processing files.
int wraplen
Width to wrap lines to (when flags & STATE_DISPLAY)
StateFlags flags
Flags, e.g. STATE_DISPLAY.
FILE * fp_in
File to read from.
const char * prefix
String to add to the beginning of each output line.