1268
|
1 /* proginit.c: useful initializations for DVI drivers. |
|
2 |
|
3 Copyright (C) 1994 Karl Berry. |
|
4 |
|
5 This program is free software; you can redistribute it and/or modify |
|
6 it under the terms of the GNU General Public License as published by |
|
7 the Free Software Foundation; either version 2, or (at your option) |
|
8 any later version. |
|
9 |
|
10 This program is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 GNU General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU General Public License |
|
16 along with this program; if not, write to the Free Software |
1315
|
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
1268
|
18 |
|
19 #include <kpathsea/config.h> |
|
20 #include <kpathsea/c-pathch.h> |
|
21 #include <kpathsea/proginit.h> |
|
22 #include <kpathsea/progname.h> |
|
23 #include <kpathsea/tex-file.h> |
|
24 |
|
25 |
|
26 /* These initializations were common to all the drivers modified for |
|
27 kpathsea, so a single routine seemed in order. Kind of a bollixed-up |
|
28 mess, but still better than repeating the code. */ |
|
29 |
|
30 void |
|
31 kpse_init_prog P5C(const_string, prefix, unsigned, dpi, const_string, mode, |
|
32 boolean, make_tex_pk, const_string, fallback) |
|
33 { |
|
34 string makepk_var = concat (prefix, "MAKEPK"); |
|
35 string font_var = concat (prefix, "FONTS"); |
|
36 string size_var = concat (prefix, "SIZES"); |
|
37 |
|
38 /* Do both `pk_format' and `any_glyph_format' for the sake of xdvi; in |
|
39 general, MakeTeXPK might apply to either, and the program will ask |
|
40 for the one it wants. */ |
|
41 |
|
42 /* Might have a program-specific name for MakeTeXPK itself. */ |
|
43 kpse_format_info[kpse_pk_format].program |
|
44 = kpse_format_info[kpse_any_glyph_format].program |
|
45 = getenv (makepk_var); |
|
46 |
|
47 /* If we did, we want to enable the program, I think. */ |
|
48 kpse_format_info[kpse_pk_format].program_enabled_p |
|
49 = kpse_format_info[kpse_any_glyph_format].program_enabled_p |
|
50 = getenv (makepk_var) || make_tex_pk; |
|
51 |
|
52 kpse_font_override_path = getenv (font_var); |
|
53 kpse_init_fallback_resolutions (size_var); |
|
54 xputenv_int ("MAKETEX_BASE_DPI", dpi); |
|
55 kpse_fallback_font = fallback; |
|
56 |
|
57 /* See comments in kpse_make_tex in kpathsea/tex-make.c. */ |
|
58 xputenv ("MAKETEX_MODE", mode ? mode : DIR_SEP_STRING); |
|
59 |
|
60 free (makepk_var); |
|
61 free (font_var); |
|
62 free (size_var); |
|
63 } |