Exemplo n.º 1
0
bool
REL_matchS(REL_t rT, REL_t rM1)
{
    bool match = false;
    if (rM1 == REL_any_ or /* any relation (short-circuit) */
        rT == rM1) {	/* a specific type of relation */
        match = true;
    } else {
        switch (rM1) {
        case REL_TEXT: if (REL_is_TEXT(rT)) { match = true; } break;
        case REL_LETTER: if (REL_is_LETTER(rT)) { match = true; } break;
        case REL_LETTER_EOL: if (REL_is_LETTER_EOL(rT)) { match = true; } break;
        case REL_LETTER_WS: if (REL_is_LETTER_WS(rT)) { match = true; } break;

        case REL_PARENT: if (REL_is_PARENT(rT)) { match = true; } break;
        case REL_CHILD: if (REL_is_CHILD(rT)) { match = true; } break;

        case REL_MASTER: if (REL_is_MASTER(rT)) { match = true; } break;
        case REL_SLAVE: if (REL_is_SLAVE(rT)) { match = true; } break;
        case REL_SLAVE_AXTICK: if (REL_is_SLAVE_AXTICK(rT)) { match = true; } break;
        case REL_SLAVE_LAYHINT: if (REL_is_SLAVE_LAYHINT(rT)) { match = true; } break;
        case REL_SLAVE_LAYHINT_CADJ: if (REL_is_SLAVE_CADJ(rT)) { match = true; } break;
        case REL_SIBLING: if (REL_is_SIBLING(rT)) { match = true; } break;

        case REL_PRODUCER: if (REL_is_PRODUCER(rT)) { match = true; } break;
        case REL_CONSUMER: if (REL_is_CONSUMER(rT)) { match = true; } break;

        case REL_ALIGNER: if (REL_is_ALIGNER(rT)) { match = true; } break;
        case REL_ALIGNEE: if (REL_is_ALIGNEE(rT)) { match = true; } break;
        default: break;
        }
    }
    return match;
}
Exemplo n.º 2
0
/*!
 * Return non-zero if \p rel belongs to the SLAVE-group.
 */
inline bool
REL_is_SLAVE(REL_t rel)
{
    return (rel == REL_SLAVE or
            rel == REL_SLAVE_TITLENAME or
            rel == REL_SLAVE_TYPENAME or
            rel == REL_SLAVE_DOC or
            rel == REL_SLAVE_KCOMB or
            rel == REL_SLAVE_ICON or
            rel == REL_SLAVE_ATTR or
            rel == REL_SLAVE_TALKBUBBLE or
            rel == REL_SLAVE_PROGRESS or
            rel == REL_SLAVE_RELSYM_FWD or
            rel == REL_SLAVE_RELSYM_BWD or
            REL_is_SLAVE_SELSYM(rel) or
            REL_is_SLAVE_CADJ(rel) or
            REL_is_SLAVE_AXTICK(rel));
}