lys_features_state(const struct lys_module *module, const char *feature)
{
    FUN_IN;

    struct lys_feature *f;
    int i;

    if (!module || !feature) {
        return -1;
    }

    /* search for the specified feature */
    f = lys_features_find(module, feature);
    if (!f) {
        return -1;
    }

    if (!(f->flags & LYS_FENABLED)) {
        /* disabled for sure */
        return 0;
    }

    /* check referenced features if they are enabled */
    for (i = 0; i < f->iffeature_size; ++i) {
        if (!resolve_iffeature(&f->iffeature[i])) {
            /* if-feature disabled */
            return 0;
        }
    }

    return 1;
}
lys_features_state(const struct lys_module *module, const char *feature)
{
    FUN_IN;

    struct lys_feature *f;
    int i;

    if (!module || !feature) {
        return -1;
    }

     
    f = lys_features_find(module, feature);
    if (!f) {
        return -1;
    }

    if (!(f->flags & LYS_FENABLED)) {
         
        return 0;
    }

     
    for (i = 0; i < f->iffeature_size; ++i) {
        if (!resolve_iffeature(&f->iffeature[i])) {
             
            return 0;
        }
    }

    return 1;
}