Exemplo n.º 1
0
const_string *
kpathsea_fontmap_lookup (kpathsea kpse, const_string key)
{
  const_string *ret;
  string suffix = find_suffix (key);

  if (kpse->map.size == 0) {
    read_all_maps (kpse);
  }

  ret = (const_string *) hash_lookup (kpse->map, key);
  if (!ret) {
    /* OK, the original KEY didn't work.  Let's check for the KEY without
       an extension -- perhaps they gave foobar.tfm, but the mapping only
       defines `foobar'.  */
    if (suffix) {
      string base_key = remove_suffix (key);
      ret = (const_string *) hash_lookup (kpse->map, base_key);
      free (base_key);
    }
  }

  /* Append any original suffix.  */
  if (ret && suffix) {
    const_string *elt;
    for (elt = ret; *elt; elt++) {
      *elt = extend_filename (*elt, suffix);
    }
  }

  return ret;
}
Exemplo n.º 2
0
Arquivo: nif.c Projeto: valekhz/aliter
int load(ErlNifEnv *env,
         void **priv_data,
         ERL_NIF_TERM load_info) {
    debug("erl_nif loading.\n");
    read_all_maps("/Users/Alex/Projects/aliter/priv/maps");
    return 0;
}