Exemplo n.º 1
0
PJ_DEF(void) pj_cis_del_str( pj_cis_t *cis, const char *str)
{
    while (*str) {
        PJ_CIS_CLR(cis, *str);
	++str;
    }
}
Exemplo n.º 2
0
PJ_DEF(void) pj_cis_del_range( pj_cis_t *cis, int cstart, int cend)
{
    while (cstart != cend) {
        PJ_CIS_CLR(cis, cstart);
        cstart++;
    }
}
Exemplo n.º 3
0
PJ_DEF(void) pj_cis_invert( pj_cis_t *cis )
{
    unsigned i;
    /* Can not set zero. This is the requirement of the parser. */
    for (i=1; i<256; ++i) {
	if (PJ_CIS_ISSET(cis,i))
            PJ_CIS_CLR(cis,i);
        else
            PJ_CIS_SET(cis,i);
    }
}
PJ_DEF(pj_status_t) pj_cis_dup( pj_cis_t *new_cis, pj_cis_t *existing)
{
    pj_status_t status;
    unsigned i;

    /* Warning: typecasting here! */
    status = pj_cis_init((pj_cis_buf_t*)existing->cis_buf, new_cis);
    if (status != PJ_SUCCESS)
        return status;

    for (i=0; i<256; ++i) {
        if (PJ_CIS_ISSET(existing, i))
            PJ_CIS_SET(new_cis, i);
        else
            PJ_CIS_CLR(new_cis, i);
    }

    return PJ_SUCCESS;
}