static int xps_compare_entries(const void *a0, const void *b0) { xps_entry *a = (xps_entry*) a0; xps_entry *b = (xps_entry*) b0; return xps_strcasecmp(a->name, b->name); }
static fz_font * xps_lookup_font_imp(fz_context *ctx, xps_document *doc, char *name) { xps_font_cache *cache; for (cache = doc->font_table; cache; cache = cache->next) if (!xps_strcasecmp(cache->name, name)) return fz_keep_font(ctx, cache->font); return NULL; }
static xps_entry * xps_find_zip_entry(xps_context *ctx, char *name) { int l = 0; int r = ctx->zip_count - 1; while (l <= r) { int m = (l + r) >> 1; int c = xps_strcasecmp(name, ctx->zip_table[m].name); if (c < 0) r = m - 1; else if (c > 0) l = m + 1; else return &ctx->zip_table[m]; } return NULL; }