78 if (!aa || !actx || (rindex < 0) || (rindex >= actx->
idxlen))
106 for (
int i = 0; i < actx->
idxlen; i++)
126 struct Menu *menu,
bool use_tagged,
int count)
128 if (!aa || !actx || !menu)
135 if ((index < 0) || (index >= actx->
vcount))
138 int n = (count > 1) ? count : 1;
139 if ((index + n) > actx->
vcount)
142 for (
int i = 0; i < n; i++)
144 const int rindex = actx->
v2r[index + i];
145 if ((rindex < 0) || (rindex >= actx->
idxlen))
165 struct Menu *menu,
bool use_tagged,
int count)
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
static int aa_add_tagged(struct AttachPtrArray *aa, struct AttachCtx *actx)
Get an array of tagged Attachments.
static void aa_add_folded(struct AttachPtrArray *aa, struct AttachCtx *actx, int rindex)
Add an Attachment, expanding collapsed children.
static bool aa_contains_attach(struct AttachPtrArray *aa, struct AttachPtr *ap)
Does a working set already include an Attachment?
int aa_add_selection(struct AttachPtrArray *aa, struct AttachCtx *actx, struct Menu *menu, bool use_tagged, int count)
Build a working set of Attachments for an action.
int ba_add_selection(struct BodyArray *ba, struct AttachCtx *actx, struct Menu *menu, bool use_tagged, int count)
Build a working set of attachment bodies for an action.
static void aa_add_attach(struct AttachPtrArray *aa, struct AttachPtr *ap)
Add an Attachment to a working set.
Handling of email attachments.
Structs that make up an email.
Convenience wrapper for the library headers.
Routines for managing attachments.
short vcount
The number of virtual attachments.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
short * v2r
Mapping from virtual to real attachment.
An email to which things will be attached.
struct Body * body
Attachment.
bool collapsed
Group is collapsed.
int level
Nesting depth of attachment.
bool tagged
This attachment is tagged.