51 struct CidMap *cid_map = *ptr;
67 if (!
cid || !filename)
105 if (!b || !cid_map_list)
114 bool has_tempfile =
false;
153 if (!body || !cid_map_list)
156 for (
struct Body *b = body; b; b = b->
next)
172 if (!filename || !cid_map_list)
177 char *searchbuf = NULL;
181 struct CidMap *cid_map = NULL;
192 const char *suffix =
buf_rfind(filename,
".");
193 if (suffix && *(suffix++))
218 while ((cid = strstr(pbuf, cid_map->
cid)) != NULL)
233 fputs(searchbuf, fp_out);
Handling of email attachments.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t buf_addstr_n(struct Buffer *buf, const char *s, size_t len)
Add a string to a Buffer, expanding it if necessary.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
const char * buf_rfind(const struct Buffer *buf, const char *str)
Find last instance of a substring.
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
struct CidMap * cid_map_new(const char *cid, const char *filename)
Initialise a new CidMap.
void cid_map_free(struct CidMap **ptr)
Free a CidMap.
static void cid_save_attachment(struct Body *b, struct CidMapList *cid_map_list)
Save attachment if it has a Content-ID.
void cid_save_attachments(struct Body *body, struct CidMapList *cid_map_list)
Save all attachments in a "multipart/related" group with a Content-ID.
void cid_to_filename(struct Buffer *filename, const struct CidMapList *cid_map_list)
Replace Content-IDs with filenames.
void cid_map_list_clear(struct CidMapList *cid_map_list)
Empty a CidMapList.
Attachment Content-ID header functions.
Convenience wrapper for the core headers.
Structs that make up an email.
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_sanitize_filename(char *path, bool slash)
Replace unsafe characters in a filename.
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.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG2
Log at debug level 2.
void mailcap_expand_filename(const char *nametemplate, const char *oldfile, struct Buffer *newfile)
Expand a new filename from a template or existing filename.
RFC1524 Mailcap routines.
#define MUTT_MEM_CALLOC(n, type)
char * mutt_str_dup(const char *str)
Copy a string, safely.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
int mutt_save_attachment(FILE *fp, struct Body *b, const char *path, enum SaveAttach opt, struct Email *e)
Save an attachment.
void mutt_add_temp_attachment(const char *filename)
Add file to list of temporary attachments.
Handling of email attachments.
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.
#define STAILQ_REMOVE_HEAD(head, field)
#define STAILQ_FIRST(head)
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_INSERT_TAIL(head, elm, field)
#define STAILQ_EMPTY(head)
FILE * fp
Used in the recvattach menu.
char * content_id
Content-Id (RFC2392)
struct AttachPtr * aptr
Menu information, used in recvattach.c.
struct Body * next
next attachment in the list
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
List of Content-ID to filename mappings.
#define buf_mktemp_pfx_sfx(buf, prefix, suffix)