beta-0.89.2
[luatex.git] / source / texk / kpathsea / variable.h
blobab4a22a6924c9e278d5317d7db3b475a19b5e07b
1 /* variable.h: declare variable expander.
3 Copyright 1993, 1995, 2008 Karl Berry.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library 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 GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this library; if not, see <http://www.gnu.org/licenses/>. */
18 #ifndef KPATHSEA_VARIABLE_H
19 #define KPATHSEA_VARIABLE_H
21 #include <kpathsea/c-proto.h>
22 #include <kpathsea/types.h>
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 /* Return the (variable-expanded) environment variable value or config
30 file value, or NULL. */
31 extern KPSEDLL string kpathsea_var_value (kpathsea kpse, const_string var);
33 /* Expand $VAR, ${VAR}, and ~ references in SRC, returning the (always newly
34 dynamically-allocated) result. An unterminated ${ or any other
35 character following $ produce error messages, and that part of SRC is
36 ignored. In the $VAR form, the variable name consists of consecutive
37 letters, digits, and underscores. In the ${VAR} form, the variable
38 name consists of whatever is between the braces.
40 In any case, ``expansion'' means calling `getenv'; if the variable is not
41 set, look in texmf.cnf files for a definition. If not set there, either,
42 the expansion is the empty string (no error). */
43 extern KPSEDLL string kpathsea_var_expand (kpathsea kpse, const_string src);
45 #if defined (KPSE_COMPAT_API)
46 extern KPSEDLL string kpse_var_value (const_string var);
47 extern KPSEDLL string kpse_var_expand (const_string src);
48 #endif
50 #ifdef __cplusplus
52 #endif
54 #endif /* not KPATHSEA_VARIABLE_H */