summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog12
-rw-r--r--Build/source/texk/kpathsea/kdefault.c18
-rw-r--r--Build/source/texk/kpathsea/mingw32.c6
-rw-r--r--Build/source/texk/kpathsea/mingw32.h1
-rw-r--r--Build/source/texk/kpathsea/tex-file.h16
-rw-r--r--Build/source/texk/kpathsea/xopendir.c7
-rw-r--r--Build/source/texk/kpathsea/xopendir.h4
-rw-r--r--Build/source/texk/kpathsea/xputenv.c10
8 files changed, 39 insertions, 35 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 21021e75d96..0ecbbcf1267 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -8,6 +8,18 @@
(<kpathsea/c-pathmx.h>) [__DJGPP__]: change conditional from DJGPP.
Suggestion from Javier Mugica, 13 Feb 2010 20:46:12.
+2010-02-13 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * xopendir.c [WIN32]: Define neither xopendir nor xclosedir.
+ * mingw32.[ch], progname.c: Remove set_home_warning().
+ From Akira.
+
+ * xopendir.[ch] (xopendir): Declare string param as const.
+ Declare prototypes if and only if functions are defined.
+
+ * kdefault.c, tex-file.h, xputenv.c:
+ Formatting, trailing whitespace.
+
2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* dir.c (kpathsea_dir_p), elt-dirs.c (kpathsea_normalize_path),
diff --git a/Build/source/texk/kpathsea/kdefault.c b/Build/source/texk/kpathsea/kdefault.c
index 43b79965ee5..52493d90560 100644
--- a/Build/source/texk/kpathsea/kdefault.c
+++ b/Build/source/texk/kpathsea/kdefault.c
@@ -28,17 +28,17 @@
/* Check for leading colon first, then trailing, then doubled, since
that is fastest. Usually it will be leading or trailing. */
-string
-kpathsea_expand_default (kpathsea kpse, const_string path,
+string
+kpathsea_expand_default (kpathsea kpse, const_string path,
const_string fallback)
{
unsigned path_length;
string expansion;
(void)kpse; /* currenty not used */
-
+
/* The default path better not be null. */
assert (fallback);
-
+
if (path == NULL)
expansion = xstrdup (fallback);
@@ -81,11 +81,11 @@ kpathsea_expand_default (kpathsea kpse, const_string path,
expansion = xstrdup(path);
}
}
-
+
return expansion;
}
#if defined (KPSE_COMPAT_API)
-string
+string
kpse_expand_default (const_string path, const_string fallback)
{
return kpathsea_expand_default (kpse_def, path, fallback);
@@ -99,7 +99,7 @@ void
test_expand_default (const_string path, const_string def)
{
string answer;
-
+
printf ("Expansion of `%s':\t", path ? path : "(nil)");
answer = kpse_expand_default (path, def);
puts (answer);
@@ -117,8 +117,8 @@ main ()
test_expand_default (ENV_SEP_STRING "first", default_path);
test_expand_default ("last" ENV_SEP_STRING, default_path);
test_expand_default ("middle" ENV_SEP_STRING ENV_SEP_STRING "elddim",
- default_path);
-
+ default_path);
+
return 0;
}
diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c
index da08a469437..430c97caf62 100644
--- a/Build/source/texk/kpathsea/mingw32.c
+++ b/Build/source/texk/kpathsea/mingw32.c
@@ -74,12 +74,6 @@ init_user_info (void)
}
}
-/* This function could go away */
-void
-set_home_warning (void)
-{
-}
-
/* Returns the home directory, in external format */
static char *
get_home_directory (void)
diff --git a/Build/source/texk/kpathsea/mingw32.h b/Build/source/texk/kpathsea/mingw32.h
index c8c492a8b94..3d7270a2cd0 100644
--- a/Build/source/texk/kpathsea/mingw32.h
+++ b/Build/source/texk/kpathsea/mingw32.h
@@ -45,7 +45,6 @@
#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */
extern void init_user_info (void);
-extern void set_home_warning (void);
extern BOOL win32_get_long_filename (char *, char *, int);
extern BOOL look_for_cmd (const char *, char **);
extern char *quote_args(char **);
diff --git a/Build/source/texk/kpathsea/tex-file.h b/Build/source/texk/kpathsea/tex-file.h
index f752c399b14..076edcc57b6 100644
--- a/Build/source/texk/kpathsea/tex-file.h
+++ b/Build/source/texk/kpathsea/tex-file.h
@@ -33,8 +33,8 @@ extern void kpathsea_init_fallback_resolutions (kpathsea kpse, string envvar);
#endif /* MAKE_KPSE_DLL */
/* If LEVEL is >= FMT's `program_enable_level', set `program_enabled_p'
- for FMT to VALUE. */
-extern KPSEDLL void kpathsea_set_program_enabled (kpathsea kpse,
+ for FMT to VALUE. */
+extern KPSEDLL void kpathsea_set_program_enabled (kpathsea kpse,
kpse_file_format_type fmt, boolean value, kpse_src_type level);
/* Call kpse_set_program_enabled with VALUE and the format corresponding
@@ -44,13 +44,13 @@ extern KPSEDLL void kpathsea_maketex_option (kpathsea kpse,
/* Change the list of searched suffixes for FORMAT to ... (alternate
suffixes if ALTERNATE is true). */
-extern KPSEDLL void kpathsea_set_suffixes (kpathsea kpse,
+extern KPSEDLL void kpathsea_set_suffixes (kpathsea kpse,
kpse_file_format_type format, boolean alternate, ...);
/* Initialize the info for the given format. This is called
automatically by `kpse_find_file', but the glyph searching (for
example) can't use that function, so make it available. */
-extern KPSEDLL const_string kpathsea_init_format (kpathsea kpse,
+extern KPSEDLL const_string kpathsea_init_format (kpathsea kpse,
kpse_file_format_type format);
/* If FORMAT has a non-null `suffix' member, append it to NAME "."
@@ -68,22 +68,22 @@ extern KPSEDLL string *kpathsea_find_file_generic (kpathsea kpse,
/* Return true if FNAME is acceptable to open for reading or writing.
If not acceptable, write a message to stderr. */
extern KPSEDLL boolean kpathsea_in_name_ok (kpathsea kpse, const_string fname);
-extern KPSEDLL boolean kpathsea_out_name_ok (kpathsea kpse,const_string fname);
+extern KPSEDLL boolean kpathsea_out_name_ok (kpathsea kpse, const_string fname);
/* As above, but no error message. */
extern KPSEDLL boolean kpathsea_in_name_ok_silent
(kpathsea kpse, const_string fname);
extern KPSEDLL boolean kpathsea_out_name_ok_silent
- (kpathsea kpse,const_string fname);
+ (kpathsea kpse, const_string fname);
/* Don't just look up the name, actually open the file. */
-extern KPSEDLL FILE *kpathsea_open_file (kpathsea kpse, const_string name,
+extern KPSEDLL FILE *kpathsea_open_file (kpathsea kpse, const_string name,
kpse_file_format_type format);
/* This function is used to set kpse_program_name (from progname.c) to
a different value. It will clear the path searching information, to
ensure that the search paths are appropriate to the new name. */
-extern KPSEDLL void kpathsea_reset_program_name (kpathsea kpse,
+extern KPSEDLL void kpathsea_reset_program_name (kpathsea kpse,
const_string progname);
diff --git a/Build/source/texk/kpathsea/xopendir.c b/Build/source/texk/kpathsea/xopendir.c
index e948eb90131..adf81d67b87 100644
--- a/Build/source/texk/kpathsea/xopendir.c
+++ b/Build/source/texk/kpathsea/xopendir.c
@@ -1,6 +1,6 @@
/* xopendir.c: opendir and closedir with error checking.
- Copyright 1992, 1993, 1994, 1995, 1996, 2008 Karl Berry.
+ Copyright 1992, 1993, 1994, 1995, 1996, 2008, 2010 Karl Berry.
Copyright 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#if !defined(WIN32) || defined(__MINGW32__)
DIR *
-xopendir (string dirname)
+xopendir (const_string dirname)
{
DIR *d = opendir(dirname);
@@ -31,7 +31,6 @@ xopendir (string dirname)
return d;
}
-#endif /* not WIN32 */
void
xclosedir (DIR *d)
@@ -45,4 +44,4 @@ xclosedir (DIR *d)
FATAL("closedir failed");
#endif
}
-
+#endif /* not WIN32 || __MINGW32__ */
diff --git a/Build/source/texk/kpathsea/xopendir.h b/Build/source/texk/kpathsea/xopendir.h
index aceebffaa40..b786d9a89ee 100644
--- a/Build/source/texk/kpathsea/xopendir.h
+++ b/Build/source/texk/kpathsea/xopendir.h
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <http://www.gnu.org/licenses/>. */
-#if !defined (KPATHSEA_XOPENDIR_H) && !defined (WIN32)
+#if !defined (KPATHSEA_XOPENDIR_H) && (!defined (WIN32) || defined(__MINGW32__))
#define KPATHSEA_XOPENDIR_H
#include <kpathsea/c-dir.h>
@@ -25,7 +25,7 @@
#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */
/* Like opendir and closedir, but abort on error. */
-extern DIR *xopendir (string dirname);
+extern DIR *xopendir (const_string dirname);
extern void xclosedir (DIR *);
#endif /* MAKE_KPSE_DLL */
diff --git a/Build/source/texk/kpathsea/xputenv.c b/Build/source/texk/kpathsea/xputenv.c
index 0455997890d..4d1fb5335e0 100644
--- a/Build/source/texk/kpathsea/xputenv.c
+++ b/Build/source/texk/kpathsea/xputenv.c
@@ -47,12 +47,12 @@ kpathsea_xputenv(kpathsea kpse, const char *var, const char *value)
int cur_loc;
/* kpse_debug2(KPSE_DEBUG_VARS, "kpse_putenv($%s,%s)", var, value); */
-
+
old_item = NULL;
cur_item = concat3(var, "=", value);
/* Include '=' in length. */
var_lim = strlen(var) + 1;
-
+
/* Have we stored something for this value already? */
for (cur_loc = 0; cur_loc != kpse->saved_count; ++cur_loc) {
if (strncmp(kpse->saved_env[cur_loc], cur_item, var_lim) == 0) {
@@ -106,15 +106,15 @@ kpathsea_xputenv_int (kpathsea kpse, const_string var_name, int num)
{
char str[MAX_INT_LENGTH];
sprintf (str, "%d", num);
-
+
kpathsea_xputenv (kpse, var_name, str);
}
#if defined (KPSE_COMPAT_API)
void
-xputenv(const char *var, const char *value)
+xputenv (const char *var, const char *value)
{
- kpathsea_xputenv(kpse_def, var, value);
+ kpathsea_xputenv (kpse_def, var, value);
}
void