| 1 |
/* cnf.h: runtime config files. |
| 2 |
|
| 3 |
Copyright 1994, 1995, 2008, 2012, 2019 Karl Berry. |
| 4 |
Copyright 1999, 2005 Olaf Weber. |
| 5 |
|
| 6 |
This library is free software; you can redistribute it and/or |
| 7 |
modify it under the terms of the GNU Lesser General Public |
| 8 |
License as published by the Free Software Foundation; either |
| 9 |
version 2.1 of the License, or (at your option) any later version. |
| 10 |
|
| 11 |
This library is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
Lesser General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU Lesser General Public License |
| 17 |
along with this library; if not, see <http://www.gnu.org/licenses/>. */ |
| 18 |
|
| 19 |
#ifndef KPATHSEA_CNF_H |
| 20 |
#define KPATHSEA_CNF_H |
| 21 |
|
| 22 |
#include <kpathsea/c-proto.h> |
| 23 |
#include <kpathsea/types.h> |
| 24 |
|
| 25 |
#ifdef __cplusplus |
| 26 |
extern "C" { |
| 27 |
#endif |
| 28 |
|
| 29 |
/* Return the value in the last-read cnf file for VAR, or NULL if none. |
| 30 |
On the first call, also read all the `texmf.cnf' files in the path |
| 31 |
for kpse_cnf_format (and initialize the path). Any error messages are |
| 32 |
written to stderr. */ |
| 33 |
|
| 34 |
extern KPSEDLL const_string kpathsea_cnf_get (kpathsea kpse, const_string var); |
| 35 |
|
| 36 |
|
| 37 |
/* Parse L as a texmf.cnf configuration line for the KPSE instance, |
| 38 |
and insert any <variable> assignment in the environment, both as-is and |
| 39 |
with the value (if all non-NULL) of <variable> "_" KPSE->program_name. |
| 40 |
If <variable>[_<progname>] is already set in the environment, it is |
| 41 |
overwritten. |
| 42 |
|
| 43 |
All of this behavior is because if the user runs tex with |
| 44 |
--cnf-line=TEXINPUTS=/foo:, it's not unreasonable to expect that |
| 45 |
cmdline option to override both environment variables TEXINPUTS and |
| 46 |
TEXINPUTS_tex, and also both configuration values TEXINPUTS and |
| 47 |
TEXINPUTS.tex -- even though ordinarily <var>.<progname> overrides |
| 48 |
plain <var>. |
| 49 |
|
| 50 |
Any error message is written to stderr. */ |
| 51 |
|
| 52 |
extern KPSEDLL void kpathsea_cnf_line_env_progname (kpathsea kpse, |
| 53 |
string l); |
| 54 |
|
| 55 |
#if defined(KPSE_COMPAT_API) |
| 56 |
extern KPSEDLL const_string kpse_cnf_get (const_string var); |
| 57 |
#endif |
| 58 |
|
| 59 |
#ifdef __cplusplus |
| 60 |
} |
| 61 |
#endif |
| 62 |
|
| 63 |
#endif /* not KPATHSEA_CNF_H */ |