Handle the attachments command. More...
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "attachments.h"
#include "ncrypt/lib.h"
#include "parse/lib.h"
#include "mview.h"
Go to the source code of this file.
Data Structures | |
struct | AttachMatch |
An attachment matching a regex for attachment counter. More... | |
Functions | |
static void | attachmatch_free (struct AttachMatch **ptr) |
Free an AttachMatch - Implements list_free_t -. | |
static struct AttachMatch * | attachmatch_new (void) |
Create a new AttachMatch. | |
void | attach_cleanup (void) |
Free the attachments lists. | |
void | attach_init (void) |
Set up the attachments lists. | |
static bool | count_body_parts_check (struct ListHead *checklist, struct Body *b, bool dflt) |
Compares mime types to the ok and except lists. | |
static int | count_body_parts (struct Body *b) |
Count the MIME Body parts. | |
int | mutt_count_body_parts (struct Email *e, FILE *fp) |
Count the MIME Body parts. | |
void | mutt_attachments_reset (struct MailboxView *mv) |
Reset the attachment count for all Emails. | |
static enum CommandResult | parse_attach_list (struct Buffer *buf, struct Buffer *s, struct ListHead *head, struct Buffer *err) |
Parse the "attachments" command. | |
static enum CommandResult | parse_unattach_list (struct Buffer *buf, struct Buffer *s, struct ListHead *head, struct Buffer *err) |
Parse the "unattachments" command. | |
static int | print_attach_list (struct ListHead *h, const char op, const char *name) |
Print a list of attachments. | |
enum CommandResult | parse_attachments (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'attachments' command - Implements Command::parse() -. | |
enum CommandResult | parse_unattachments (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'unattachments' command - Implements Command::parse() -. | |
void | mutt_parse_mime_message (struct Email *e, FILE *fp) |
Parse a MIME email. | |
Variables | |
static struct ListHead | AttachAllow = STAILQ_HEAD_INITIALIZER(AttachAllow) |
List of attachment types to be counted. | |
static struct ListHead | AttachExclude = STAILQ_HEAD_INITIALIZER(AttachExclude) |
List of attachment types to be ignored. | |
static struct ListHead | InlineAllow = STAILQ_HEAD_INITIALIZER(InlineAllow) |
List of inline types to counted. | |
static struct ListHead | InlineExclude = STAILQ_HEAD_INITIALIZER(InlineExclude) |
List of inline types to ignore. | |
static struct Notify * | AttachmentsNotify = NULL |
Notifications: NotifyAttach. | |
Handle the attachments command.
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 attachments.c.
|
static |
Create a new AttachMatch.
ptr | New AttachMatch |
Definition at line 84 of file attachments.c.
void attach_cleanup | ( | void | ) |
Free the attachments lists.
Definition at line 92 of file attachments.c.
void attach_init | ( | void | ) |
Set up the attachments lists.
Definition at line 106 of file attachments.c.
|
static |
Compares mime types to the ok and except lists.
checklist | List of AttachMatch |
b | Email Body |
dflt | Log whether the matches are OK, or Excluded |
true | Attachment should be counted |
Definition at line 122 of file attachments.c.
|
static |
Count the MIME Body parts.
b | Body of email |
num | Number of MIME Body parts |
Definition at line 157 of file attachments.c.
int mutt_count_body_parts | ( | struct Email * | e, |
FILE * | fp | ||
) |
Count the MIME Body parts.
e | |
fp | File to parse |
num | Number of MIME Body parts |
Definition at line 251 of file attachments.c.
void mutt_attachments_reset | ( | struct MailboxView * | mv | ) |
Reset the attachment count for all Emails.
mv | Mailbox view |
Definition at line 288 of file attachments.c.
|
static |
Parse the "attachments" command.
buf | Buffer for temporary storage |
s | Buffer containing the attachments command |
head | List of AttachMatch to add to |
err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Definition at line 313 of file attachments.c.
|
static |
Parse the "unattachments" command.
buf | Buffer for temporary storage |
s | Buffer containing the unattachments command |
head | List of AttachMatch to remove from |
err | Buffer for error messages |
MUTT_CMD_SUCCESS | Always |
Definition at line 393 of file attachments.c.
|
static |
Print a list of attachments.
h | List of attachments |
op | Operation, e.g. '+', '-' |
name | Attached/Inline, 'A', 'I' |
0 | Always |
Definition at line 459 of file attachments.c.
void mutt_parse_mime_message | ( | struct Email * | e, |
FILE * | fp | ||
) |
Parse a MIME email.
e | |
fp | File to parse |
Definition at line 596 of file attachments.c.
|
static |
List of attachment types to be counted.
Definition at line 56 of file attachments.c.
|
static |
List of attachment types to be ignored.
Definition at line 57 of file attachments.c.
|
static |
List of inline types to counted.
Definition at line 58 of file attachments.c.
|
static |
List of inline types to ignore.
Definition at line 59 of file attachments.c.
|
static |
Notifications: NotifyAttach.
Definition at line 60 of file attachments.c.