static void mobi_opf_copy_meta(const MOBIData *m, const MOBIExthHeader *exth, OPFmeta **meta, const char *name) {
    MOBIExthMeta exth_tag = mobi_get_exthtagmeta_by_tag(exth->tag);
    char *content = NULL;
    if (exth_tag.tag == EXTH_COVEROFFSET) {
        content = malloc(13 + 1);
        if (content) {
            const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
            snprintf(content, 14, "resource%05d", val32);
        }
    } else if (exth_tag.type == EXTH_NUMERIC) {
        content = malloc(10 + 1);
        if (content) {
            const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
            snprintf(content, 11, "%d", val32);
        }
    } else if (exth_tag.type == EXTH_STRING) {
        char *string = mobi_decode_exthstring(m, exth->data, exth->size);
        content = string;
    }
    if (content) {
        mobi_opf_set_meta(meta, name, content);
        free(content);
    }
}
static void mobi_opf_copy_meta(const MOBIData *m, const MOBIExthHeader *exth, OPFmeta **meta, const char *name) {
    MOBIExthMeta exth_tag = mobi_get_exthtagmeta_by_tag(exth->tag);
    char *content = NULL;
    if (exth_tag.tag == EXTH_COVEROFFSET) {
        content = malloc(13 + 1);
        if (content) {
            const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
            snprintf(content, 14, "resource%05d", val32);
        }
    } else if (exth_tag.type == EXTH_NUMERIC) {
        content = malloc(10 + 1);
        if (content) {
            const uint32_t val32 = mobi_decode_exthvalue(exth->data, exth->size);
            snprintf(content, 11, "%d", val32);
        }
    } else if (exth_tag.type == EXTH_STRING) {
        char *string = mobi_decode_exthstring(m, exth->data, exth->size);
        content = string;
    }
    if (content) {
        mobi_opf_set_meta(meta, name, content);
        free(content);
    }
}