summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/readable.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-16 15:13:07 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-16 15:13:07 +0000
commite967e0cc978d647040ac5616d389e9007d593464 (patch)
tree1f33ce27a77473b2e90b549d42399b73d4123497 /Build/source/texk/kpathsea/readable.c
parent49f1fb6887627cdb7cf524aaef9b92108c894381 (diff)
new reentrant kpathsea API (from Taco)
git-svn-id: svn://tug.org/texlive/trunk@12401 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/readable.c')
-rw-r--r--Build/source/texk/kpathsea/readable.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c
index e25d2aa9d01..fecd305b0f0 100644
--- a/Build/source/texk/kpathsea/readable.c
+++ b/Build/source/texk/kpathsea/readable.c
@@ -69,7 +69,7 @@ READABLE(const_string fn, unsigned int st)
Generic const return warning. See extend-fname.c. */
string
-kpse_readable_file P1C(const_string, name)
+kpathsea_readable_file (kpathsea kpse, const_string name)
{
string ret;
@@ -79,12 +79,12 @@ kpse_readable_file P1C(const_string, name)
struct stat st;
#endif
- kpse_normalize_path((string)name);
+ kpathsea_normalize_path(kpse, (string)name);
if (READABLE (name, st)) {
ret = (string) name;
#ifdef ENAMETOOLONG
} else if (errno == ENAMETOOLONG) {
- ret = kpse_truncate_filename (name);
+ ret = kpathsea_truncate_filename (kpse, name);
/* Perhaps some other error will occur with the truncated name, so
let's call access again. */
@@ -95,7 +95,7 @@ kpse_readable_file P1C(const_string, name)
#endif /* ENAMETOOLONG */
} else { /* Some other error. */
if (errno == EACCES) { /* Maybe warn them if permissions are bad. */
- if (!kpse_tex_hush ("readable")) {
+ if (!kpathsea_tex_hush (kpse, "readable")) {
perror (name);
}
}
@@ -103,3 +103,12 @@ kpse_readable_file P1C(const_string, name)
}
return ret;
}
+
+#if defined (KPSE_COMPAT_API)
+string
+kpse_readable_file (const_string name)
+{
+ return kpathsea_readable_file (kpse_def, name);
+}
+#endif
+