static void mobi_opf_fill_tag(const MOBIData *m, const MOBIExthHeader *exth, char ***array) {
    if (*array == NULL) {
        *array = calloc(OPF_META_MAX_TAGS, sizeof(**array));
        if (*array == NULL) {
            return;
        }
    }
    size_t i = 0;
    while (i < OPF_META_MAX_TAGS) {
        /* find first free slot */
        if((*array)[i] != NULL) { i++; continue; }
        MOBIExthMeta exth_tag = mobi_get_exthtagmeta_by_tag(exth->tag);
        char *value = NULL;
        if (exth_tag.type == EXTH_NUMERIC) {
            value = malloc(10 + 1);
            if (value) {
                const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
                snprintf(value, 10 + 1, "%d", val32);
            }
        } else if (exth_tag.type == EXTH_STRING) {
            value = mobi_decode_exthstring(m, exth->data, exth->size);
        }
        if (value) {
            (*array)[i] = value;
        }
        return;
    }
    /* not enough tags */
    debug_print("OPF_META_MAX_TAGS = %i reached\n", OPF_META_MAX_TAGS);
}
static void mobi_opf_fill_tag(const MOBIData *m, const MOBIExthHeader *exth, char ***array) {
    if (*array == NULL) {
        *array = calloc(OPF_META_MAX_TAGS, sizeof(**array));
        if (*array == NULL) {
            return;
        }
    }
    size_t i = 0;
    while (i < OPF_META_MAX_TAGS) {
         
        if((*array)[i] != NULL) { i++; continue; }
        MOBIExthMeta exth_tag = mobi_get_exthtagmeta_by_tag(exth->tag);
        char *value = NULL;
        if (exth_tag.type == EXTH_NUMERIC) {
            value = malloc(10 + 1);
            if (value) {
                const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
                snprintf(value, 10 + 1, "%d", val32);
            }
        } else if (exth_tag.type == EXTH_STRING) {
            value = mobi_decode_exthstring(m, exth->data, exth->size);
        }
        if (value) {
            (*array)[i] = value;
        }
        return;
    }
     
    debug_print("OPF_META_MAX_TAGS = %i reached\n", OPF_META_MAX_TAGS);
}