annotate kpathsea/proginit.c @ 4337:d56e0d75e7c9 ss-2-1-45

[project @ 2003-02-19 21:20:19 by jwe]
author jwe
date Wed, 19 Feb 2003 21:20:19 +0000
parents 1f0b06020e36
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2999
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
1 /* proginit.c: useful initializations for DVI drivers.
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
2
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 1994, 95, 96 Karl Berry.
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
4
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
6 modify it under the terms of the GNU Library General Public
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
7 License as published by the Free Software Foundation; either
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
8 version 2 of the License, or (at your option) any later version.
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
9
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
13 Library General Public License for more details.
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
14
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
15 You should have received a copy of the GNU Library General Public
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
18
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
19 #include <kpathsea/config.h>
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
20 #include <kpathsea/c-pathch.h>
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
21 #include <kpathsea/proginit.h>
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
22 #include <kpathsea/tex-file.h>
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
23
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
24
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
25 /* These initializations were common to all the drivers modified for
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
26 kpathsea, so a single routine seemed in order. Kind of a bollixed-up
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
27 mess, but still better than repeating the code. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
28
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
29 void
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
30 kpse_init_prog P4C(const_string, prefix, unsigned, dpi, const_string, mode,
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
31 const_string, fallback)
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
32 {
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
33 string font_var = concat (prefix, "FONTS");
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
34 string header_var = concat (prefix, "HEADERS");
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
35 string makepk_var = concat (prefix, "MAKEPK");
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
36 string size_var = concat (prefix, "SIZES");
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
37
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
38 /* Do both `pk_format' and `any_glyph_format' for the sake of xdvi; in
3172
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 2999
diff changeset
39 general, mktexpk might apply to either, and the program will ask
2999
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
40 for the one it wants. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
41
3172
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 2999
diff changeset
42 /* Might have a program-specific name for mktexpk itself. */
2999
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
43 if (getenv (makepk_var)) {
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
44 /* If we did, we want to enable the program, I think. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
45 kpse_set_program_enabled (kpse_pk_format, 1, kpse_src_env);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
46 kpse_set_program_enabled (kpse_any_glyph_format, 1, kpse_src_env);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
47
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
48 kpse_format_info[kpse_pk_format].program
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
49 = kpse_format_info[kpse_any_glyph_format].program
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
50 = getenv (makepk_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
51 }
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
52
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
53 /* A couple font paths have traditionally had application-specific
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
54 environment variables to override all else; namely, XDVIFONTS and
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
55 DVIPSHEADERS. So set those if we have them. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
56 kpse_format_info[kpse_pk_format].override_path
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
57 = kpse_format_info[kpse_gf_format].override_path
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
58 = kpse_format_info[kpse_any_glyph_format].override_path
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
59 = kpse_format_info[kpse_tfm_format].override_path
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
60 = getenv (font_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
61
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
62 kpse_format_info[kpse_tex_ps_header_format].override_path
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
63 = getenv (header_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
64
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
65 kpse_init_fallback_resolutions (size_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
66 xputenv_int ("MAKETEX_BASE_DPI", dpi);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
67 kpse_fallback_font = fallback;
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
68
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
69 /* Ugliness. See comments in kpse_make_tex in kpathsea/tex-make.c. */
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
70 xputenv ("MAKETEX_MODE", mode ? mode : DIR_SEP_STRING);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
71
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
72 free (font_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
73 free (header_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
74 free (makepk_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
75 free (size_var);
faa5d0421460 [project @ 1997-05-23 03:02:09 by jwe]
jwe
parents:
diff changeset
76 }