diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-17 21:41:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-17 21:41:51 +0000 |
commit | 487ca4806cc046076293cf6cc5fbba0db282bac7 (patch) | |
tree | 847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/kpathsea/proginit.c | |
parent | a3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff) |
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/proginit.c')
-rw-r--r-- | Build/source/texk/kpathsea/proginit.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/proginit.c b/Build/source/texk/kpathsea/proginit.c new file mode 100644 index 00000000000..8cb9c70506d --- /dev/null +++ b/Build/source/texk/kpathsea/proginit.c @@ -0,0 +1,79 @@ +/* proginit.c: useful initializations for DVI drivers. + + Copyright 1997, 2005 Olaf Weber. + Copyright 1994, 95, 96 Karl Berry. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include <kpathsea/config.h> +#include <kpathsea/c-pathch.h> +#include <kpathsea/proginit.h> +#include <kpathsea/tex-file.h> + + +/* These initializations were common to all the drivers modified for + kpathsea, so a single routine seemed in order. Kind of a bollixed-up + mess, but still better than repeating the code. */ + +void +kpse_init_prog P4C(const_string, prefix, unsigned, dpi, const_string, mode, + const_string, fallback) +{ + string font_var = concat (prefix, "FONTS"); + string header_var = concat (prefix, "HEADERS"); + string makepk_var = concat (prefix, "MAKEPK"); + string size_var = concat (prefix, "SIZES"); + + /* Do both `pk_format' and `any_glyph_format' for the sake of xdvi; in + general, mktexpk might apply to either, and the program will ask + for the one it wants. */ + + /* Might have a program-specific name for mktexpk itself. */ + if (getenv (makepk_var)) { + /* If we did, we want to enable the program, I think. */ + kpse_set_program_enabled (kpse_pk_format, 1, kpse_src_env); + kpse_set_program_enabled (kpse_any_glyph_format, 1, kpse_src_env); + + kpse_format_info[kpse_pk_format].program + = kpse_format_info[kpse_any_glyph_format].program + = getenv (makepk_var); + } + + /* A couple font paths have traditionally had application-specific + environment variables to override all else; namely, XDVIFONTS and + DVIPSHEADERS. So set those if we have them. */ + kpse_format_info[kpse_pk_format].override_path + = kpse_format_info[kpse_gf_format].override_path + = kpse_format_info[kpse_any_glyph_format].override_path + = kpse_format_info[kpse_tfm_format].override_path + = getenv (font_var); + + kpse_format_info[kpse_tex_ps_header_format].override_path + = getenv (header_var); + + kpse_init_fallback_resolutions (size_var); + xputenv_int ("MAKETEX_BASE_DPI", dpi); + kpse_fallback_font = fallback; + + /* Ugliness. See comments in kpse_make_tex in kpathsea/tex-make.c. */ + xputenv ("MAKETEX_MODE", mode ? mode : DIR_SEP_STRING); + + free (font_var); + free (header_var); + free (makepk_var); + free (size_var); +} |