save_skipped_ext_parent(struct ly_set *ext_parents, struct ly_set *ext_par_types,
        struct lys_ext_instance **ext_list, struct unres_ext *ext_data)
{
    int rt;

    if(!ext_list[ext_data->ext_index]) {
        rt = ly_set_add(ext_parents, ext_data->parent, 0);
        LY_CHECK_RETURN(rt == -1, rt);
        if (ext_parents->number != ext_par_types->number) {
            // a new skipped extension instance parent
            rt = ly_set_add(ext_par_types, (void *)ext_data->datatype, 1);
            LY_CHECK_RETURN(rt == -1, rt);
        }
    }

    return 0;
}
save_skipped_ext_parent(struct ly_set *ext_parents, struct ly_set *ext_par_types,
        struct lys_ext_instance **ext_list, struct unres_ext *ext_data)
{
    int rt;

    if(!ext_list[ext_data->ext_index]) {
        rt = ly_set_add(ext_parents, ext_data->parent, 0);
        LY_CHECK_RETURN(rt == -1, rt);
        if (ext_parents->number != ext_par_types->number) {
             
            rt = ly_set_add(ext_par_types, (void *)ext_data->datatype, 1);
            LY_CHECK_RETURN(rt == -1, rt);
        }
    }

    return 0;
}