summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-15 18:15:35 +0000
committerKarl Berry <karl@freefriends.org>2010-04-15 18:15:35 +0000
commitbaa0fe4cefaf104803fb55e441d20cab2f4d1fbe (patch)
tree92c399cf845c6b65867930d309a3e79f81879821 /Build/source/texk/kpathsea
parentd5879f23bbdd249c0e8ebfba28f1b58d24b00e4b (diff)
support one-word abbreviations of format names where useful
git-svn-id: svn://tug.org/texlive/trunk@17881 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog11
-rw-r--r--Build/source/texk/kpathsea/doc/kpathsea.info241
-rw-r--r--Build/source/texk/kpathsea/doc/kpathsea.texi50
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c225
-rw-r--r--Build/source/texk/kpathsea/tex-file.c2
5 files changed, 322 insertions, 207 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 16219c2160d..302a4591ce7 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,12 @@
+2010-04-15 Karl Berry <karl@tug.org>
+
+ * kpsewhich.c (format_abbr_type): new type.
+ (format_abbrs): new array.
+ (format_abbr): new fn to use them.
+ (find_format): call it.
+
+ (help_message): new fn, including the abbreviations.
+
2010-04-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (EXTRA_DIST): Add bsnl.awk.
@@ -1337,7 +1346,7 @@
has been rewritten not to need this.
* tex-file.c (kpse_init_format): Add uppercase versions of the
- .ttf and .ttc suffixes for truetype fonts. Dont require a
+ .ttf and .ttc suffixes for truetype fonts. Don't require a
recognized suffix.
* types.h: Don't #define true if it is already defined. From Karl
diff --git a/Build/source/texk/kpathsea/doc/kpathsea.info b/Build/source/texk/kpathsea/doc/kpathsea.info
index de65f5a3bb0..6c2a9885016 100644
--- a/Build/source/texk/kpathsea/doc/kpathsea.info
+++ b/Build/source/texk/kpathsea/doc/kpathsea.info
@@ -4,7 +4,7 @@ makeinfo version 4.13 from ../../../../texk/kpathsea/doc/kpathsea.texi.
This file documents the Kpathsea library for path searching.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2007, 2008, 2009 Karl Berry & Olaf Weber.
+2005, 2007, 2008, 2009, 2010 Karl Berry & Olaf Weber.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -39,8 +39,8 @@ Kpathsea library
****************
This manual documents how to install and use the Kpathsea library for
-filename lookup. It corresponds to version 5.1.0, released in
-June 2009.
+filename lookup. It corresponds to version 6.0.0, released in
+April 2010.
* Menu:
@@ -60,8 +60,8 @@ File: kpathsea.info, Node: Introduction, Next: Installation, Prev: Top, Up:
1 Introduction
**************
-This manual corresponds to version 5.1.0 of the Kpathsea library,
-released in June 2009.
+This manual corresponds to version 6.0.0 of the Kpathsea library,
+released in April 2010.
The library's fundamental purpose is to return a filename from a
list of directories specified by the user, similar to what shells do
@@ -2613,6 +2613,7 @@ in administrative scripts. It is used heavily in the distributed
`mktex...' scripts.
Synopsis:
+
kpsewhich OPTION... FILENAME...
The options and filename(s) to look up can be intermixed. Options
@@ -2678,9 +2679,14 @@ filename, and returns the first file found.
suffixes. *Note Supported file formats::, for more information on
each of these.
+ The strings in parentheses are abbreviations recognized only by
+ `kpsewhich' (not the underlying library calls). They are provided
+ when it would otherwise require an argument containing a space to
+ specify the format, to simplify quoting of calls from shells.
+
gf: gf
pk: pk
- bitmap font:
+ bitmap font (bitmapfont):
tfm: .tfm
afm: .afm
base: .base
@@ -2696,42 +2702,45 @@ filename, and returns the first file found.
mft: .mft
mp: .mp
mppool: .pool
- MetaPost support:
+ MetaPost support (mpsupport):
ocp: .ocp
ofm: .ofm .tfm
- opl: .opl
+ opl: .opl .pl
otp: .otp
- ovf: .ovf
- ovp: .ovp
+ ovf: .ovf .vf
+ ovp: .ovp .vpl
graphic/figure: .eps .epsi
tex: .tex .sty .cls .fd .aux .bbl .def .clo .ldf
- TeX system documentation:
+ TeX system documentation (doc):
texpool: .pool
- TeX system sources: .dtx .ins
+ TeX system sources (source): .dtx .ins
PostScript header: .pro
- Troff fonts:
+ Troff fonts (trofffont):
type1 fonts: .pfa .pfb
vf: .vf
- dvips config:
+ dvips config (dvipsconfig):
ist: .ist
truetype fonts: .ttf .ttc .TTF .TTC
type42 fonts: .t42 .T42
- web2c files:
- other text files:
- other binary files:
- misc fonts:
+ web2c files (web2c):
+ other text files (othertext):
+ other binary files (otherbin):
+ misc fonts (miscfont):
web: .web .ch
cweb: .w .web .ch
enc files: .enc
- cmap files:
+ cmap files (cmap):
subfont definition files: .sfd
opentype fonts: .otf
- pdftex config:
+ pdftex config (pdftexconfig):
lig files: .lig
texmfscripts:
lua: .luc .luctex .texluc .lua .luatex .texlua
font feature files: .fea
cid maps: .cid .cidmap
+ mlbib: .mlbib .bib
+ mlbst: .mlbst .bst
+ clua: .dll .so
This option and `--path' are mutually exclusive.
@@ -2946,9 +2955,11 @@ File: kpathsea.info, Node: Standard options, Prev: Auxiliary tasks, Up: Invok
Kpsewhich accepts the standard GNU options:
- * `--help' prints a help message on standard output and exits.
+ * `--help' prints a help message on standard output and exits
+ successfully.
- * `--version' prints the Kpathsea version number and exits.
+ * `--version' prints the Kpathsea version number and exits
+ successfully.

File: kpathsea.info, Node: TeX support, Next: Programming, Prev: Path searching, Up: Top
@@ -3729,30 +3740,30 @@ Index
(line 38)
* --help: Standard options. (line 8)
* --interactive: Path searching options.
- (line 110)
+ (line 118)
* --mktex=FILETYPE: Path searching options.
- (line 115)
+ (line 123)
* --mode=STRING: Path searching options.
- (line 121)
+ (line 129)
* --must-exist: Path searching options.
- (line 126)
+ (line 134)
* --no-mktex=FILETYPE: Path searching options.
- (line 115)
+ (line 123)
* --path=STRING: Path searching options.
- (line 131)
+ (line 139)
* --progname=NAME: Path searching options.
- (line 140)
+ (line 148)
* --safe-in-name=NAME: Path searching options.
- (line 146)
+ (line 154)
* --safe-out-name=NAME: Path searching options.
- (line 146)
+ (line 154)
* --show-path=NAME: Auxiliary tasks. (line 41)
* --srcdir, for building multiple architectures: configure scenarios.
(line 18)
* --subdir=STRING: Path searching options.
- (line 152)
+ (line 160)
* --var-value=VARIABLE: Auxiliary tasks. (line 12)
-* --version: Standard options. (line 10)
+* --version: Standard options. (line 11)
* --with options: configure options. (line 16)
* --with-mktextex-default: mktex configuration. (line 12)
* --without-mktexfmt-default: mktex configuration. (line 12)
@@ -4243,7 +4254,7 @@ Index
* installation, simple: Simple installation. (line 6)
* installing files: Installing files. (line 6)
* interactive query: Path searching options.
- (line 110)
+ (line 118)
* interface, not frozen: Introduction. (line 27)
* introduction: Introduction. (line 6)
* kdebug:: Debugging. (line 105)
@@ -4845,86 +4856,86 @@ Index

Tag Table:
-Node: Top1609
-Node: Introduction2252
-Node: History4074
-Node: Installation8166
-Node: Simple installation8956
-Node: Custom installation12539
-Node: Disk space13713
-Node: Kpathsea application distributions14597
-Node: Changing search paths15712
-Node: Default path features16894
-Node: Default path generation18977
-Node: Running configure20420
-Node: configure shells21471
-Node: configure options22523
-Node: configure environment24030
-Node: configure scenarios25832
-Node: Shared library27418
-Node: Running make28432
-Node: Installing files30479
-Node: Cleaning up32426
-Node: Filename database generation33474
-Node: mktex scripts34041
-Node: mktex configuration35318
-Node: mktex script names41137
-Node: mktex script arguments42528
-Node: Installation testing43418
-Node: Security43782
-Node: TeX directory structure46349
-Node: unixtex.ftp50771
-Node: Electronic distribution52781
-Node: CD-ROM distribution55546
-Node: Other TeX packages56361
-Node: Reporting bugs57657
-Node: Bug checklist58392
-Node: Mailing lists62089
-Node: Debugging63298
-Node: Logging68376
-Node: Common problems70246
-Node: Unable to find files71077
-Node: Slow path searching73488
-Node: Unable to generate fonts74865
-Node: TeX or Metafont failing77374
-Node: Empty Makefiles79253
-Node: XtStrings80483
-Node: dlopen81319
-Node: ShellWidgetClass82137
-Node: Pointer combination warnings83769
-Node: Path searching84158
-Node: Searching overview84805
-Node: Path sources88201
-Node: Config files89272
-Node: Path expansion92917
-Node: Default expansion93866
-Node: Variable expansion95936
-Node: Tilde expansion97339
-Node: Brace expansion98319
-Node: KPSE_DOT expansion99424
-Node: Subdirectory expansion99937
-Node: Filename database102288
-Node: ls-R103342
-Node: Filename aliases106236
-Node: Database format107414
-Node: Invoking kpsewhich108427
-Node: Path searching options109372
-Node: Specially-recognized files117033
-Node: Auxiliary tasks118389
-Node: Standard options120214
-Node: TeX support120534
-Node: Supported file formats121825
-Node: File lookup129341
-Node: Glyph lookup131073
-Node: Basic glyph lookup132197
-Node: Fontmap133076
-Node: Fallback font135693
-Node: Suppressing warnings136606
-Node: Programming137711
-Node: Programming overview138224
-Node: Calling sequence140918
-Node: Program-specific files147441
-Node: Programming with config files148483
-Node: Index149795
+Node: Top1615
+Node: Introduction2259
+Node: History4082
+Node: Installation8174
+Node: Simple installation8964
+Node: Custom installation12547
+Node: Disk space13721
+Node: Kpathsea application distributions14605
+Node: Changing search paths15720
+Node: Default path features16902
+Node: Default path generation18985
+Node: Running configure20428
+Node: configure shells21479
+Node: configure options22531
+Node: configure environment24038
+Node: configure scenarios25840
+Node: Shared library27426
+Node: Running make28440
+Node: Installing files30487
+Node: Cleaning up32434
+Node: Filename database generation33482
+Node: mktex scripts34049
+Node: mktex configuration35326
+Node: mktex script names41145
+Node: mktex script arguments42536
+Node: Installation testing43426
+Node: Security43790
+Node: TeX directory structure46357
+Node: unixtex.ftp50779
+Node: Electronic distribution52789
+Node: CD-ROM distribution55554
+Node: Other TeX packages56369
+Node: Reporting bugs57665
+Node: Bug checklist58400
+Node: Mailing lists62097
+Node: Debugging63306
+Node: Logging68384
+Node: Common problems70254
+Node: Unable to find files71085
+Node: Slow path searching73496
+Node: Unable to generate fonts74873
+Node: TeX or Metafont failing77382
+Node: Empty Makefiles79261
+Node: XtStrings80491
+Node: dlopen81327
+Node: ShellWidgetClass82145
+Node: Pointer combination warnings83777
+Node: Path searching84166
+Node: Searching overview84813
+Node: Path sources88209
+Node: Config files89280
+Node: Path expansion92925
+Node: Default expansion93874
+Node: Variable expansion95944
+Node: Tilde expansion97347
+Node: Brace expansion98327
+Node: KPSE_DOT expansion99432
+Node: Subdirectory expansion99945
+Node: Filename database102296
+Node: ls-R103350
+Node: Filename aliases106244
+Node: Database format107422
+Node: Invoking kpsewhich108435
+Node: Path searching options109381
+Node: Specially-recognized files117550
+Node: Auxiliary tasks118906
+Node: Standard options120731
+Node: TeX support121087
+Node: Supported file formats122378
+Node: File lookup129894
+Node: Glyph lookup131626
+Node: Basic glyph lookup132750
+Node: Fontmap133629
+Node: Fallback font136246
+Node: Suppressing warnings137159
+Node: Programming138264
+Node: Programming overview138777
+Node: Calling sequence141471
+Node: Program-specific files147994
+Node: Programming with config files149036
+Node: Index150348

End Tag Table
diff --git a/Build/source/texk/kpathsea/doc/kpathsea.texi b/Build/source/texk/kpathsea/doc/kpathsea.texi
index a76efe8aa4c..f19ca9ffcff 100644
--- a/Build/source/texk/kpathsea/doc/kpathsea.texi
+++ b/Build/source/texk/kpathsea/doc/kpathsea.texi
@@ -2,14 +2,14 @@
@setfilename kpathsea.info
@settitle Kpathsea: A library for path searching
-@set version 5.1.0
-@set month-year June 2009
+@set version 6.0.0
+@set month-year April 2010
@copying
This file documents the Kpathsea library for path searching.
Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2007, 2008, 2009 Karl Berry & Olaf Weber.
+2004, 2005, 2007, 2008, 2009, 2010 Karl Berry & Olaf Weber.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -1038,6 +1038,7 @@ perhaps in administrative scripts. It is used heavily in the
distributed @samp{mktex@dots{}} scripts.
Synopsis:
+
@example
kpsewhich @var{option}@dots{} @var{filename}@dots{}
@end example
@@ -1113,10 +1114,15 @@ sake of the shell.)
Here's the current list of recognized names and the associated suffixes.
@xref{Supported file formats}, for more information on each of these.
+The strings in parentheses are abbreviations recognized only by
+@code{kpsewhich} (not the underlying library calls). They are
+provided when it would otherwise require an argument containing a
+space to specify the format, to simplify quoting of calls from shells.
+
@example
gf: gf
pk: pk
-bitmap font:
+bitmap font (bitmapfont):
tfm: .tfm
afm: .afm
base: .base
@@ -1132,42 +1138,45 @@ mfpool: .pool
mft: .mft
mp: .mp
mppool: .pool
-MetaPost support:
+MetaPost support (mpsupport):
ocp: .ocp
ofm: .ofm .tfm
-opl: .opl
+opl: .opl .pl
otp: .otp
-ovf: .ovf
-ovp: .ovp
+ovf: .ovf .vf
+ovp: .ovp .vpl
graphic/figure: .eps .epsi
tex: .tex .sty .cls .fd .aux .bbl .def .clo .ldf
-TeX system documentation:
+TeX system documentation (doc):
texpool: .pool
-TeX system sources: .dtx .ins
+TeX system sources (source): .dtx .ins
PostScript header: .pro
-Troff fonts:
+Troff fonts (trofffont):
type1 fonts: .pfa .pfb
vf: .vf
-dvips config:
+dvips config (dvipsconfig):
ist: .ist
truetype fonts: .ttf .ttc .TTF .TTC
type42 fonts: .t42 .T42
-web2c files:
-other text files:
-other binary files:
-misc fonts:
+web2c files (web2c):
+other text files (othertext):
+other binary files (otherbin):
+misc fonts (miscfont):
web: .web .ch
cweb: .w .web .ch
enc files: .enc
-cmap files:
+cmap files (cmap):
subfont definition files: .sfd
opentype fonts: .otf
-pdftex config:
+pdftex config (pdftexconfig):
lig files: .lig
texmfscripts:
lua: .luc .luctex .texluc .lua .luatex .texlua
font feature files: .fea
cid maps: .cid .cidmap
+mlbib: .mlbib .bib
+mlbst: .mlbst .bst
+clua: .dll .so
@end example
This option and @samp{--path} are mutually exclusive.
@@ -1447,11 +1456,12 @@ Kpsewhich accepts the standard GNU options:
@itemize @bullet
@item
@opindex --help
-@samp{--help} prints a help message on standard output and exits.
+@samp{--help} prints a help message on standard output and exits
+successfully.
@item
@opindex --version
-@samp{--version} prints the Kpathsea version number and exits.
+@samp{--version} prints the Kpathsea version number and exits successfully.
@end itemize
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
index 0aece91390e..ad6a340551e 100644
--- a/Build/source/texk/kpathsea/kpsewhich.c
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -72,6 +72,55 @@ str_list_type subdir_paths;
kpse_file_format_type user_format = kpse_last_format;
string user_format_string;
string user_path;
+
+
+
+/* Define one-word abbreviations for those format types which
+ can otherwise only be specified by strings containing spaces. */
+
+typedef struct
+{
+ const_string abbr;
+ kpse_file_format_type format;
+} format_abbr_type;
+
+static format_abbr_type format_abbrs[]
+ = { { "bitmapfont", kpse_any_glyph_format },
+ { "mpsupport", kpse_mpsupport_format },
+ { "doc", kpse_texdoc_format },
+ { "source", kpse_texsource_format },
+ { "trofffont", kpse_troff_font_format },
+ { "dvipsconfig", kpse_dvips_config_format },
+ { "web2c", kpse_web2c_format },
+ { "othertext", kpse_program_text_format },
+ { "otherbin", kpse_program_binary_format },
+ { "miscfont", kpse_miscfonts_format },
+ { "cmap", kpse_cmap_format },
+ { "pdftexconfig", kpse_pdftex_config_format },
+ { NULL, kpse_last_format } };
+
+/* The function to look up STR in the abbr table above.
+ This is called only on a user-specified format string.
+ Return `kpse_last_format' if no match. */
+
+static kpse_file_format_type
+format_abbr (const_string str)
+{
+ kpse_file_format_type ret = kpse_last_format;
+ unsigned a = 0;
+
+ while (format_abbrs[a].abbr != NULL) {
+ if (STREQ (str, format_abbrs[a].abbr)) {
+ ret = format_abbrs[a].format;
+ break;
+ }
+ a++;
+ }
+
+ return ret;
+}
+
+
/* Return the <number> substring in `<name>.<number><stuff>', if S has
that form. If it doesn't, return 0. */
@@ -87,11 +136,13 @@ find_dpi (string s)
return dpi_number;
}
+
+
-/* Use the file type from -format if that was specified (i.e., the
- user_format global variable), else guess dynamically from NAME.
- Return kpse_last_format if undeterminable. This function is also
- used to parse the -format string, a case which we distinguish by
+/* Use the file type from -format if that was previously determined
+ (i.e., the user_format global variable), else guess dynamically from
+ NAME. Return kpse_last_format if undeterminable. This function is
+ also used to parse the -format string, a case which we distinguish by
setting is_filename to false.
A few filenames have been hard-coded for format types that
@@ -100,10 +151,11 @@ find_dpi (string s)
static kpse_file_format_type
find_format (kpathsea kpse, string name, boolean is_filename)
{
- kpse_file_format_type ret;
+ kpse_file_format_type ret = kpse_last_format;
if (is_filename && user_format != kpse_last_format) {
- ret = user_format;
+ ret = user_format; /* just return what we already computed */
+
} else if (FILESTRCASEEQ (name, "config.ps")) {
ret = kpse_dvips_config_format;
} else if (FILESTRCASEEQ (name, "fmtutil.cnf")) {
@@ -125,8 +177,14 @@ find_format (kpathsea kpse, string name, boolean is_filename)
} else if (FILESTRCASEEQ (name, "XDvi")) {
ret = kpse_program_text_format;
} else {
- int f = 0; /* kpse_file_format_type */
- unsigned name_len = strlen (name);
+ if (!is_filename) {
+ /* Look for kpsewhich-specific format abbreviations. */
+ ret = format_abbr (name);
+ }
+
+ if (ret == kpse_last_format) {
+ int f = 0; /* kpse_file_format_type */
+ unsigned name_len = strlen (name);
/* Have to rely on `try_len' being declared here, since we can't assume
GNU C and statement expressions. */
@@ -135,36 +193,35 @@ find_format (kpathsea kpse, string name, boolean is_filename)
(ftry) && try_len <= name_len \
&& FILESTRCASEEQ (ftry, name + name_len - try_len))
- while (f != kpse_last_format) {
- unsigned try_len;
- const_string *ext;
- const_string ftry;
- boolean found = false;
-
- if (!kpse->format_info[f].type)
- kpathsea_init_format (kpse, (kpse_file_format_type) f);
-
- if (!is_filename) {
- /* Allow the long name, but only in the -format option. We don't
- want a filename confused with a format name. */
- ftry = kpse->format_info[f].type;
- found = TRY_SUFFIX (ftry);
- }
- for (ext = kpse->format_info[f].suffix; !found && ext && *ext; ext++) {
- found = TRY_SUFFIX (*ext);
- }
- for (ext=kpse->format_info[f].alt_suffix; !found && ext && *ext; ext++) {
- found = TRY_SUFFIX (*ext);
- }
+ while (f != kpse_last_format) {
+ unsigned try_len;
+ const_string *ext;
+ const_string ftry;
+ boolean found = false;
- if (found)
- break;
- f++;
- }
+ if (!kpse->format_info[f].type)
+ kpathsea_init_format (kpse, (kpse_file_format_type) f);
+
+ if (!is_filename) {
+ /* Allow the long name, but only in the -format option. We don't
+ want a filename confused with a format name. */
+ ftry = kpse->format_info[f].type;
+ found = TRY_SUFFIX (ftry);
+ }
+ for (ext = kpse->format_info[f].suffix; !found && ext && *ext; ext++) {
+ found = TRY_SUFFIX (*ext);
+ }
+ for (ext=kpse->format_info[f].alt_suffix; !found && ext && *ext;ext++){
+ found = TRY_SUFFIX (*ext);
+ }
- ret = f;
+ if (found)
+ break;
+ f++;
+ }
+ ret = f;
+ }
}
-
return ret;
}
@@ -304,7 +361,7 @@ lookup (kpathsea kpse, string name)
return ret == NULL;
}
-/* Reading the options. */
+/* Help message. */
#define USAGE "\n\
Standalone path lookup and expansion for Kpathsea.\n\
@@ -312,8 +369,8 @@ The default is to look up each FILENAME in turn and report its\n\
first match (if any) to standard output.\n\
\n\
When looking up format (.fmt/.base/.mem) files, it is usually necessary\n\
-to also use -engine, or nothing will be returned; in particular, -engine=/\n\
-will return matching format files for any engine.\n\
+to also use -engine, or nothing will be returned; in particular,\n\
+-engine=/ will return matching format files for any engine.\n\
\n\
-all output all matches, one per line.\n\
-debug=NUM set debugging flags.\n\
@@ -338,7 +395,64 @@ will return matching format files for any engine.\n\
-version print version number and exit.\n \
"
-/* Test whether getopt found an option ``A''.
+static void
+help_message (kpathsea kpse, string *argv)
+{
+ int f; /* kpse_file_format_type */
+
+ printf ("Usage: %s [OPTION]... [FILENAME]...\n", argv[0]);
+ fputs (USAGE, stdout);
+ putchar ('\n');
+ fputs (kpathsea_bug_address, stdout);
+
+ /* Have to set this for init_format to work. */
+ kpathsea_set_program_name (kpse, argv[0], progname);
+
+ puts ("\nRecognized format names and their (abbreviations) and suffixes:");
+ for (f = 0; f < kpse_last_format; f++) {
+ const_string *ext;
+ kpathsea_init_format (kpse, (kpse_file_format_type)f);
+ printf ("%s", kpse->format_info[f].type);
+
+ /* Show abbreviation if we accept one. We repeatedly go through the
+ abbr list here, but it's so short, it doesn't matter. */
+ {
+ unsigned a = 0;
+ while (format_abbrs[a].abbr != NULL) {
+ if (f == format_abbrs[a].format) {
+ printf (" (%s)", format_abbrs[a].abbr);
+ break;
+ }
+ a++;
+ }
+ }
+
+ /* Regular suffixes. */
+ putchar (':');
+ for (ext = kpse->format_info[f].suffix; ext && *ext; ext++) {
+ putchar (' ');
+ fputs (*ext, stdout);
+ }
+
+ if (kpse->format_info[f].alt_suffix) {
+ /* leave extra space between default and alt suffixes */
+ putchar (' ');
+ }
+ for (ext = kpse->format_info[f].alt_suffix; ext && *ext; ext++) {
+ putchar (' ');
+ fputs (*ext, stdout);
+ }
+
+ putchar ('\n');
+ }
+
+ exit (0);
+}
+
+
+/* Reading the options. */
+
+/* This macro tests whether getopt found an option ``A''.
Assumes the option index is in the variable `option_index', and the
option table in a variable `long_options'. */
#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
@@ -371,7 +485,7 @@ static struct option long_options[]
{ 0, 0, 0, 0 } };
static void
-read_command_line (kpathsea kpse, int argc, string *argv)
+read_command_line (kpathsea kpse, int argc, string *argv)
{
int g; /* `getopt' return code. */
int option_index;
@@ -409,36 +523,7 @@ read_command_line (kpathsea kpse, int argc, string *argv)
user_format_string = optarg;
} else if (ARGUMENT_IS ("help")) {
- int f; /* kpse_file_format_type */
-
- printf ("Usage: %s [OPTION]... [FILENAME]...\n", argv[0]);
- fputs (USAGE, stdout);
- putchar ('\n');
- fputs (kpathsea_bug_address, stdout);
-
- /* Have to set this for init_format to work. */
- kpathsea_set_program_name (kpse, argv[0], progname);
-
- puts ("\nRecognized format names and their suffixes:");
- for (f = 0; f < kpse_last_format; f++) {
- const_string *ext;
- kpathsea_init_format (kpse, (kpse_file_format_type)f);
- printf ("%s:", kpse->format_info[f].type);
- for (ext = kpse->format_info[f].suffix; ext && *ext; ext++) {
- putchar (' ');
- fputs (*ext, stdout);
- }
- if (kpse->format_info[f].alt_suffix) {
- /* leave extra space between default and alt suffixes */
- putchar (' ');
- }
- for (ext = kpse->format_info[f].alt_suffix; ext && *ext; ext++) {
- putchar (' ');
- fputs (*ext, stdout);
- }
- putchar ('\n');
- }
- exit (0);
+ help_message (kpse, argv);
} else if (ARGUMENT_IS ("mktex")) {
kpathsea_maketex_option (kpse, optarg, true);
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index d31e55dce1f..03f8a142b7e 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -86,11 +86,11 @@
#define LIG_ENVS "LIGFONTS", "TEXFONTS"
#define TEXMFSCRIPTS_ENVS "TEXMFSCRIPTS"
#define LUA_ENVS "LUAINPUTS"
-#define CLUA_ENVS "CLUAINPUTS"
#define FONTFEATURES_ENVS "FONTFEATURES"
#define FONTCIDMAPS_ENVS "FONTCIDMAPS"
#define MLBIB_ENVS "MLBIBINPUTS", BIB_ENVS
#define MLBST_ENVS "MLBSTINPUTS", BST_ENVS
+#define CLUA_ENVS "CLUAINPUTS"
/* The compiled-in default list, DEFAULT_FONT_SIZES, is intended to be
set from the command line (presumably via the Makefile). */