NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 *b_email, struct State *state)
 Handler for format=flowed - Implements handler_t -.
 
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.
 
void mutt_rfc3676_space_unstuff (struct Email *e)
 Remove RFC3676 space stuffing.
 
void mutt_rfc3676_space_unstuff_attachment (struct Body *b, const char *filename)
 Unstuff attachments.
 
void mutt_rfc3676_space_stuff_attachment (struct Body *b, const char *filename)
 Stuff attachments.
 

Detailed Description

RFC3676 Format Flowed routines.

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

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 394 of file rfc3676.c.

395{
396 if (b && (b->type == TYPE_TEXT) && mutt_istr_equal("plain", b->subtype))
397 {
398 const char *format = mutt_param_get(&b->parameter, "format");
399 if (mutt_istr_equal("flowed", format))
400 return true;
401 }
402
403 return false;
404}
@ 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:672
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
Definition: parameter.c:85
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:63
char * subtype
content-type subtype
Definition: body.h:61
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 486 of file rfc3676.c.

487{
488 if (!e || !e->body || !e->body->filename)
489 return;
490
493}
static void rfc3676_space_stuff(const char *filename, bool unstuff)
Perform required RFC3676 space stuffing.
Definition: rfc3676.c:419
bool mutt_rfc3676_is_format_flowed(struct Body *b)
Is the Email "format-flowed"?
Definition: rfc3676.c:394
char * filename
When sending a message, this is the file to which this structure refers.
Definition: body.h:59
struct Body * body
List of MIME parts.
Definition: email.h:69
+ 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 499 of file rfc3676.c.

500{
501 if (!e || !e->body || !e->body->filename)
502 return;
503
506}
+ 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 518 of file rfc3676.c.

519{
520 if (!filename)
521 return;
522
524 return;
525
526 rfc3676_space_stuff(filename, true);
527}
+ 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 539 of file rfc3676.c.

540{
541 if (!filename)
542 return;
543
545 return;
546
547 rfc3676_space_stuff(filename, false);
548}
+ Here is the call graph for this function:
+ Here is the caller graph for this function: