NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
rfc3676.h File Reference

RFC3676 Format Flowed routines. More...

#include <stdbool.h>
+ Include dependency graph for rfc3676.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int rfc3676_handler (struct Body *a, struct State *s)
 Body handler implementing RFC3676 for format=flowed - Implements handler_t -. More...
 
bool mutt_rfc3676_is_format_flowed (struct Body *b)
 Is the Email "format-flowed"? More...
 
void mutt_rfc3676_space_stuff (struct Email *e)
 Perform RFC3676 space stuffing on an Email. More...
 
void mutt_rfc3676_space_unstuff (struct Email *e)
 Remove RFC3676 space stuffing. More...
 
void mutt_rfc3676_space_unstuff_attachment (struct Body *b, const char *filename)
 Unstuff attachments. More...
 
void mutt_rfc3676_space_stuff_attachment (struct Body *b, const char *filename)
 Stuff attachments. More...
 

Detailed Description

RFC3676 Format Flowed routines.

Authors
  • Andreas Krennmair
  • Peter J. Holzer
  • Rocco Rutte

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file rfc3676.h.

Function Documentation

◆ mutt_rfc3676_is_format_flowed()

bool mutt_rfc3676_is_format_flowed ( struct Body b)

Is the Email "format-flowed"?

Parameters
bEmail Body to examine
Return values
trueEmail is "format-flowed"

Definition at line 389 of file rfc3676.c.

390{
391 if (b && (b->type == TYPE_TEXT) && mutt_istr_equal("plain", b->subtype))
392 {
393 const char *format = mutt_param_get(&b->parameter, "format");
394 if (mutt_istr_equal("flowed", format))
395 return true;
396 }
397
398 return false;
399}
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:819
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
Definition: parameter.c:84
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:62
char * subtype
content-type subtype
Definition: body.h:60
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_rfc3676_space_stuff()

void mutt_rfc3676_space_stuff ( struct Email e)

Perform RFC3676 space stuffing on an Email.

Parameters
eEmail
Note
We don't check the option $text_flowed because we want to stuff based the actual content type. The option only decides whether to set format=flowed on new messages.

Definition at line 481 of file rfc3676.c.

482{
483 if (!e || !e->body || !e->body->filename)
484 return;
485
488}
static void rfc3676_space_stuff(const char *filename, bool unstuff)
Perform required RFC3676 space stuffing.
Definition: rfc3676.c:414
bool mutt_rfc3676_is_format_flowed(struct Body *b)
Is the Email "format-flowed"?
Definition: rfc3676.c:389
char * filename
When sending a message, this is the file to which this structure refers.
Definition: body.h:58
struct Body * body
List of MIME parts.
Definition: email.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_rfc3676_space_unstuff()

void mutt_rfc3676_space_unstuff ( struct Email e)

Remove RFC3676 space stuffing.

Parameters
eEmail

Definition at line 494 of file rfc3676.c.

495{
496 if (!e || !e->body || !e->body->filename)
497 return;
498
501}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_rfc3676_space_unstuff_attachment()

void mutt_rfc3676_space_unstuff_attachment ( struct Body b,
const char *  filename 
)

Unstuff attachments.

Parameters
bEmail Body (OPTIONAL)
filenameAttachment file

This routine is used when saving/piping/viewing rfc3676 attachments.

If b is provided, the function will verify that the Email is format-flowed. The filename will be unstuffed, not b->filename or b->fp.

Definition at line 513 of file rfc3676.c.

514{
515 if (!filename)
516 return;
517
519 return;
520
521 rfc3676_space_stuff(filename, true);
522}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_rfc3676_space_stuff_attachment()

void mutt_rfc3676_space_stuff_attachment ( struct Body b,
const char *  filename 
)

Stuff attachments.

Parameters
bEmail Body (OPTIONAL)
filenameAttachment file

This routine is used when filtering rfc3676 attachments.

If b is provided, the function will verify that the Email is format-flowed. The filename will be unstuffed, not b->filename or b->fp.

Definition at line 534 of file rfc3676.c.

535{
536 if (!filename)
537 return;
538
540 return;
541
542 rfc3676_space_stuff(filename, false);
543}
+ Here is the call graph for this function:
+ Here is the caller graph for this function: