forked from neomutt/neomutt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattach.h
77 lines (66 loc) · 2.72 KB
/
attach.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* @file
* Handling of email attachments
*
* @authors
* Copyright (C) 1996-2000 Michael R. Elkins <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* 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/>.
*/
#ifndef MUTT_EMAIL_ATTACH_H
#define MUTT_EMAIL_ATTACH_H
#include <stdbool.h>
#include <stdio.h>
struct Body;
/**
* struct AttachPtr - An email to which things will be attached
*/
struct AttachPtr
{
struct Body *content; ///< Attachment
FILE *fp; ///< Used in the recvattach menu
int parent_type; ///< Type of parent attachment, e.g. #TYPE_MULTIPART
char *tree; ///< Tree characters to display
int level; ///< Nesting depth of attachment
int num; ///< Attachment index number
bool unowned : 1; ///< Don't unlink on detach
bool decrypted : 1; ///< Not part of message as stored in the email->content
};
/**
* struct AttachCtx - A set of attachments
*/
struct AttachCtx
{
struct Email *email; ///< Used by recvattach for updating
FILE *fp_root; ///< Used by recvattach for updating
struct AttachPtr **idx; ///< Array of attachments
short idxlen; ///< Number of attachmentes
short idxmax; ///< Size of attachment array
short *v2r; ///< Mapping from virtual to real attachment
short vcount; ///< The number of virtual attachments
FILE **fp_idx; ///< Extra FILE* used for decryption
short fp_len; ///< Number of FILE handles
short fp_max; ///< Size of FILE array
struct Body **body_idx; ///< Extra struct Body* used for decryption
short body_len; ///< Number of Body parts
short body_max; ///< Size of Body array
};
void mutt_actx_add_attach (struct AttachCtx *actx, struct AttachPtr *attach);
void mutt_actx_add_body (struct AttachCtx *actx, struct Body *new_body);
void mutt_actx_add_fp (struct AttachCtx *actx, FILE *fp_new);
void mutt_actx_free (struct AttachCtx **ptr);
void mutt_actx_entries_free(struct AttachCtx *actx);
struct AttachCtx *mutt_actx_new (void);
#endif /* MUTT_EMAIL_ATTACH_H */