Example #1
0
bool is_located_after(Term* term, Term* location)
{
    if (location == term)
        return false;

    Block* commonParent = find_common_parent(location->owningBlock, term->owningBlock);
    ca_assert(commonParent != NULL);

    Term* locationParent = find_parent_term_in_block(location, commonParent);
    Term* termParent = find_parent_term_in_block(term, commonParent);

    return termParent->index > locationParent->index;
}
Example #2
0
File: recvcmd.c Project: 0xAX/muttx
static struct header *find_parent (ATTACHPTR **idx, short idxlen, struct body *cur, short nattach)
{
	short i;
	struct header *parent = NULL;

	if (cur)
	{
		for (i = 0; i < idxlen; i++)
		{
			if (mutt_is_message_type (idx[i]->content->type, idx[i]->content->subtype)
			    && is_parent (i, idx, idxlen, cur))
				parent = idx[i]->content->hdr;
			if (idx[i]->content == cur)
				break;
		}
	}
	else if (nattach)
		parent = find_common_parent (idx, idxlen, nattach);

	return parent;
}