diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2010-05-15 02:50:43 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2010-05-15 02:50:43 +0000 |
commit | f751cdbc44151416e0e7ad3b8d6e55898f2030ef (patch) | |
tree | 229255ef3578d8bf21cd559f6bb28a1b906c6a81 /Build/source/texk/kpathsea | |
parent | 7c7fd723c7ab7cad6a302ebc0560ced54b5d3d41 (diff) |
avoid late declaration.
git-svn-id: svn://tug.org/texlive/trunk@18279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 10 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/absolute.c | 13 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/db.c | 8 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/debug.c | 8 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/elt-dirs.c | 2 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/lib.h | 10 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/pathsearch.c | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-file.c | 12 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-glyph.c | 2 |
9 files changed, 50 insertions, 19 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 99c404467f5..6e779ac13cc 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,5 +1,15 @@ 2010-05-15 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + *absolute.c: avoid late declaration. add support of UNC names (WIN32). + *db.c: try ls-R only on WIN32. + *debug.c: avoid late declaration. + *elt-dirs.c: remove trailing whitespace. + *lib.h: add variables in prototype. + *pathsearch.c, tex-file.c: remove some spaces. + *tex-glyph.c: add some spaces. + +2010-05-15 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + *absolute.c, access.c, atou.c, c-ctype.h, c-pathch.h, c-std.h, cnf.c, concatn.c, config.h, db.c, db.h, debug.h, default.h, dir.c, elt-dirs.c, expand.c, extend-fname.c, find-suffix.c, fn.c, diff --git a/Build/source/texk/kpathsea/absolute.c b/Build/source/texk/kpathsea/absolute.c index 59f8b103de5..cae7363148d 100644 --- a/Build/source/texk/kpathsea/absolute.c +++ b/Build/source/texk/kpathsea/absolute.c @@ -27,22 +27,31 @@ boolean kpathsea_absolute_p (kpathsea kpse, const_string filename, boolean relative_ok) { +#ifndef VMS + boolean absolute; + boolean explicit_relative; +#endif #ifdef VMS #include <string.h> (void)kpse; /* currenty not used */ return strcspn (filename, "]>:") != strlen (filename); #else /* not VMS */ - boolean absolute = IS_DIR_SEP (*filename) + absolute = IS_DIR_SEP (*filename) #ifdef DOSISH /* Novell allows non-alphanumeric drive letters. */ || (*filename && IS_DEVICE_SEP (filename[1])) #endif /* DOSISH */ +#ifdef WIN32 + /* UNC names */ + || (*filename == '\\' && filename[1] == '\\') + || (*filename == '/' && filename[1] == '/') +#endif #ifdef AMIGA /* Colon anywhere means a device. */ || strchr (filename, ':') #endif /* AMIGA */ ; - boolean explicit_relative + explicit_relative = relative_ok #ifdef AMIGA /* Leading / is like `../' on Unix and DOS. Allow Unix syntax, diff --git a/Build/source/texk/kpathsea/db.c b/Build/source/texk/kpathsea/db.c index a80f4adb212..afacca560a0 100644 --- a/Build/source/texk/kpathsea/db.c +++ b/Build/source/texk/kpathsea/db.c @@ -43,11 +43,19 @@ #define DB_NAME_LC "ls-r" #endif +/* read ls-R only on WIN32 */ +#ifdef WIN32 +static const_string db_names[] = { + DB_NAME, + NULL +}; +#else static const_string db_names[] = { DB_NAME, DB_NAME_LC, NULL }; +#endif #ifndef ALIAS_NAME #define ALIAS_NAME "aliases" diff --git a/Build/source/texk/kpathsea/debug.c b/Build/source/texk/kpathsea/debug.c index 9cddaae3854..5e4af3b6283 100644 --- a/Build/source/texk/kpathsea/debug.c +++ b/Build/source/texk/kpathsea/debug.c @@ -25,10 +25,12 @@ FILE * fopen (const char *filename, const char *mode) { +#if defined (KPSE_COMPAT_API) + kpathsea kpse = kpse_def; +#endif #undef fopen FILE *ret = fopen (filename, mode); #if defined (KPSE_COMPAT_API) - kpathsea kpse = kpse_def; if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret); #endif @@ -38,10 +40,12 @@ fopen (const char *filename, const char *mode) int fclose (FILE * f) { +#if defined (KPSE_COMPAT_API) + kpathsea kpse = kpse_def; +#endif #undef fclose int ret = fclose (f); #if defined (KPSE_COMPAT_API) - kpathsea kpse = kpse_def; if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret); #endif diff --git a/Build/source/texk/kpathsea/elt-dirs.c b/Build/source/texk/kpathsea/elt-dirs.c index 68196d51357..d245e9483ef 100644 --- a/Build/source/texk/kpathsea/elt-dirs.c +++ b/Build/source/texk/kpathsea/elt-dirs.c @@ -185,7 +185,7 @@ do_subdir (kpathsea kpse, str_llist_type *str_list_ptr, const_string elt, not affect the leaf-ness. This is arguably wrong, but the only alternative I know of is to stat every entry in the directory, and that is unacceptably slow. */ - + if (links == 0 || links > 2) /* All criteria are met; find subdirectories. */ do_subdir (kpse, str_list_ptr, FN_STRING (name), diff --git a/Build/source/texk/kpathsea/lib.h b/Build/source/texk/kpathsea/lib.h index 25abea3e41e..ca1644c94fa 100644 --- a/Build/source/texk/kpathsea/lib.h +++ b/Build/source/texk/kpathsea/lib.h @@ -202,11 +202,11 @@ extern KPSEDLL int kpathsea_dir_links (kpathsea kpse, const_string fn, /* Like their stdio counterparts, but abort on error, after calling perror(3) with FILENAME as its argument. */ extern KPSEDLL FILE *xfopen (const_string filename, const_string mode); -extern KPSEDLL void xfclose (FILE *, const_string filename); -extern KPSEDLL void xfseek (FILE *, long, int, const_string filename); -extern KPSEDLL void xfseeko (FILE *, off_t, int, const_string filename); -extern KPSEDLL unsigned long xftell (FILE *, const_string filename); -extern KPSEDLL off_t xftello (FILE *, const_string filename); +extern KPSEDLL void xfclose (FILE *fp, const_string filename); +extern KPSEDLL void xfseek (FILE *fp, long offset, int wherefrom, const_string filename); +extern KPSEDLL void xfseeko (FILE *fp, off_t offset, int wherefrom, const_string filename); +extern KPSEDLL unsigned long xftell (FILE *fp, const_string filename); +extern KPSEDLL off_t xftello (FILE *fp, const_string filename); /* These call the corresponding function in the standard library, and abort if those routines fail. Also, `xrealloc' calls `xmalloc' if diff --git a/Build/source/texk/kpathsea/pathsearch.c b/Build/source/texk/kpathsea/pathsearch.c index 6a95bf492de..0e68414e468 100644 --- a/Build/source/texk/kpathsea/pathsearch.c +++ b/Build/source/texk/kpathsea/pathsearch.c @@ -406,8 +406,8 @@ search (kpathsea kpse, const_string path, const_string original_name, contain just NULL. If ALL is true, the list will be terminated with NULL. */ static string * -search_list (kpathsea kpse, const_string path, const_string* names, - boolean must_exist, boolean all) +search_list (kpathsea kpse, const_string path, const_string* names, + boolean must_exist, boolean all) { str_list_type ret_list; const_string* namep; diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index 73f29ab0d5f..4de7378081d 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -180,7 +180,7 @@ kpse_set_program_enabled (kpse_file_format_type fmt, as well have a common place. */ void -kpathsea_maketex_option (kpathsea kpse, const_string fmtname, boolean value) +kpathsea_maketex_option (kpathsea kpse, const_string fmtname, boolean value) { kpse_file_format_type fmt = kpse_last_format; @@ -363,7 +363,7 @@ kpse_set_suffixes (kpse_file_format_type format, #define FMT_INFO (kpse->format_info[format]) /* Call kpse_set_add_suffixes. */ #define SUFFIXES(args) kpathsea_set_suffixes(kpse, format, false, args, NULL) -#define ALT_SUFFIXES(args) kpathsea_set_suffixes(kpse, format, true, args,NULL) +#define ALT_SUFFIXES(args) kpathsea_set_suffixes(kpse, format, true, args, NULL) /* Call `init_path', including appending the trailing NULL to the envvar list. Also initialize the fields not needed in setting the path. */ @@ -759,7 +759,7 @@ kpathsea_init_format (kpathsea kpse, kpse_file_format_type format) FMT_INFO.suffix_search_only = true; break; case kpse_fea_format: - INIT_FORMAT("font feature files",DEFAULT_FONTFEATURES,FONTFEATURES_ENVS); + INIT_FORMAT("font feature files", DEFAULT_FONTFEATURES, FONTFEATURES_ENVS); SUFFIXES (".fea"); FMT_INFO.suffix_search_only = true; break; @@ -939,7 +939,7 @@ target_suffixed_names (kpathsea kpse, string **target, unsigned *count, string kpathsea_find_file (kpathsea kpse, const_string name, - kpse_file_format_type format, boolean must_exist) + kpse_file_format_type format, boolean must_exist) { string *ret_list = kpathsea_find_file_generic (kpse, name, format, must_exist, false); @@ -962,7 +962,7 @@ kpse_find_file (const_string name, kpse_file_format_type format, string * kpathsea_find_file_generic (kpathsea kpse, const_string const_name, - kpse_file_format_type format, boolean must_exist, boolean all) + kpse_file_format_type format, boolean must_exist, boolean all) { string *target, name; const_string *ext; @@ -1335,7 +1335,7 @@ kpathsea_open_file (kpathsea kpse, const_string name, perror (fullname); exit (1); } else { - LIB_FATAL2 ("%s file `%s' not found", kpse->format_info[type].type,name); + LIB_FATAL2 ("%s file `%s' not found", kpse->format_info[type].type, name); } } diff --git a/Build/source/texk/kpathsea/tex-glyph.c b/Build/source/texk/kpathsea/tex-glyph.c index 6a2000829b5..b3e82371de7 100644 --- a/Build/source/texk/kpathsea/tex-glyph.c +++ b/Build/source/texk/kpathsea/tex-glyph.c @@ -291,7 +291,7 @@ kpathsea_find_glyph (kpathsea kpse, /* If mktex... failed, try any fallback resolutions. */ else { if (kpse->fallback_resolutions) - ret = try_fallback_resolutions (kpse, fontname, dpi,format,glyph_file); + ret = try_fallback_resolutions (kpse, fontname, dpi, format, glyph_file); /* We're down to the font of last resort. */ if (!ret && kpse->fallback_font) { |