Mercurial > hg > octave-terminal
changeset 4378:7d48a8fba1d4
[project @ 2003-04-19 00:03:47 by jwe]
author | jwe |
---|---|
date | Sat, 19 Apr 2003 00:03:50 +0000 |
parents | ced2ac0cff7b |
children | 0cbcb9d8b4ff |
files | ChangeLog Makeconf.in Makefile.in README.kpathsea configure.in kpathsea/AUTHORS kpathsea/BUGS kpathsea/ChangeLog kpathsea/HIER kpathsea/INSTALL kpathsea/Makefile.in kpathsea/NEWS kpathsea/PROJECTS kpathsea/README kpathsea/README.CONFIGURE kpathsea/absolute.c kpathsea/absolute.h kpathsea/access.c kpathsea/access.man kpathsea/acconfig.h kpathsea/acklibtool.m4 kpathsea/atou.c kpathsea/basename.c kpathsea/bugs.texi kpathsea/c-auto.in kpathsea/c-ctype.h kpathsea/c-dir.h kpathsea/c-errno.h kpathsea/c-fopen.h kpathsea/c-limits.h kpathsea/c-memstr.h kpathsea/c-minmax.h kpathsea/c-namemx.h kpathsea/c-pathch.h kpathsea/c-pathmx.h kpathsea/c-proto.h kpathsea/c-stat.h kpathsea/c-std.h kpathsea/c-unistd.h kpathsea/c-vararg.h kpathsea/cnf.c kpathsea/cnf.h kpathsea/common.ac kpathsea/concat.c kpathsea/concat3.c kpathsea/concatn.c kpathsea/concatn.h kpathsea/config.guess kpathsea/config.h kpathsea/config.sub kpathsea/configure.in kpathsea/db.c kpathsea/db.h kpathsea/debug.c kpathsea/debug.h kpathsea/default.h kpathsea/depend.make kpathsea/dir.c kpathsea/elt-dirs.c kpathsea/expand.c kpathsea/expand.h kpathsea/extend-fname.c kpathsea/file-p.c kpathsea/find-suffix.c kpathsea/fn.c kpathsea/fn.h kpathsea/fontmap.c kpathsea/fontmap.h kpathsea/getopt.c kpathsea/getopt.h kpathsea/getopt1.c kpathsea/hash.c kpathsea/hash.h kpathsea/hier.texi kpathsea/install-sh kpathsea/install.texi kpathsea/kdefault.c kpathsea/klibtool kpathsea/kpathsea.cps kpathsea/kpathsea.h kpathsea/kpathsea.info kpathsea/kpathsea.texi kpathsea/kpathsea.version kpathsea/kpsestat.c kpathsea/kpsestat.man kpathsea/kpsewhich.c kpathsea/kpsewhich.man kpathsea/lib.h kpathsea/line.c kpathsea/line.h kpathsea/magstep.c kpathsea/magstep.h kpathsea/make-suffix.c kpathsea/make/ChangeLog kpathsea/make/README kpathsea/make/clean.make kpathsea/make/common.make kpathsea/make/config.make kpathsea/make/dist.make kpathsea/make/library.make kpathsea/make/makevars.make kpathsea/make/man.make kpathsea/make/paths.make kpathsea/make/programs.make kpathsea/make/rdepend.make kpathsea/make/texi.make kpathsea/make/tkpathsea.make kpathsea/mktex.cnf kpathsea/mktex.opt kpathsea/mktexdir kpathsea/mktexdir.opt kpathsea/mktexlsr kpathsea/mktexlsr.man kpathsea/mktexmf kpathsea/mktexmf.man kpathsea/mktexnam kpathsea/mktexnam.opt kpathsea/mktexpk kpathsea/mktexpk.man kpathsea/mktextfm kpathsea/mktextfm.man kpathsea/mktexupd kpathsea/path-elt.c kpathsea/pathsearch.c kpathsea/pathsearch.h kpathsea/proginit.c kpathsea/proginit.h kpathsea/progname.c kpathsea/progname.h kpathsea/putenv.c kpathsea/readable.c kpathsea/readable.h kpathsea/readlink.c kpathsea/readlink.man kpathsea/rm-suffix.c kpathsea/stamp-auto.in kpathsea/str-list.c kpathsea/str-list.h kpathsea/str-llist.c kpathsea/str-llist.h kpathsea/strcasecmp.c kpathsea/strstr.c kpathsea/strtol.c kpathsea/systypes.h kpathsea/tex-file.c kpathsea/tex-file.h kpathsea/tex-glyph.c kpathsea/tex-glyph.h kpathsea/tex-hush.c kpathsea/tex-hush.h kpathsea/tex-make.c kpathsea/tex-make.h kpathsea/texmf.in kpathsea/tilde.c kpathsea/tilde.h kpathsea/truncate.c kpathsea/truncate.h kpathsea/types.h kpathsea/unixtex.texi kpathsea/uppercasify.c kpathsea/variable.c kpathsea/variable.h kpathsea/version.c kpathsea/win32lib.c kpathsea/win32lib.h kpathsea/withenable.ac kpathsea/xcalloc.c kpathsea/xfopen.c kpathsea/xfseek.c kpathsea/xftell.c kpathsea/xgetcwd.c kpathsea/xmalloc.c kpathsea/xopendir.c kpathsea/xopendir.h kpathsea/xputenv.c kpathsea/xrealloc.c kpathsea/xstat.c kpathsea/xstat.h kpathsea/xstrdup.c kpathsea/xt.ac liboctave/ChangeLog liboctave/Makefile.in liboctave/getopt.c liboctave/getopt.h liboctave/getopt1.c liboctave/kpse-config.h liboctave/kpse-lib.h liboctave/kpse-xfns.c liboctave/kpse.cc liboctave/kpse.h liboctave/oct-getopt.c liboctave/oct-kpse.c liboctave/oct-kpse.h liboctave/pathsearch.cc liboctave/pathsearch.h octMakefile.in src/ChangeLog src/oct-conf.h.in src/octave.cc src/toplev.cc |
diffstat | 200 files changed, 6620 insertions(+), 39048 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2003-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in octMakefile.in: Delete kpathsea targets. + + * kpathsea: Delete all files and directory. + + * configure.in: Don't run configure in kpathsea subdirectory. + + * README.kpathsea: New file. + * octMakefile.in (DISTFILES): Include it in the list. + + * Makeconf.in (do-subst-config-vals): Don't substitute it. + + * configure.in: Also check for basename. + Don't substitute LIBKPATHSEA. + 2003-04-17 John W. Eaton <jwe@bevo.che.wisc.edu> * configure.in (AH_BOTTOM): Don't assume that __WIN32__ will be
--- a/Makeconf.in +++ b/Makeconf.in @@ -160,7 +160,6 @@ LIBDLFCN = @LIBDLFCN@ LIBGLOB = @LIBGLOB@ LIBPLPLOT = @LIBPLPLOT@ -LIBKPATHSEA = @LIBKPATHSEA@ LIBOCTINTERP = @LIBOCTINTERP@ LIBOCTAVE = @LIBOCTAVE@ LIBCRUFT = @LIBCRUFT@ @@ -413,7 +412,6 @@ -e "s;%OCTAVE_CONF_LIBEXT%;\"${LIBEXT}\";" \ -e "s;%OCTAVE_CONF_LIBFLAGS%;\"${LIBFLAGS}\";" \ -e "s;%OCTAVE_CONF_LIBGLOB%;\"${LIBGLOB}\";" \ - -e "s;%OCTAVE_CONF_LIBKPATHSEA%;\"${LIBKPATHSEA}\";" \ -e "s;%OCTAVE_CONF_LIBOCTAVE%;\"${LIBOCTAVE}\";" \ -e "s;%OCTAVE_CONF_LIBOCTINTERP%;\"${LIBOCTINTERP}\";" \ -e "s;%OCTAVE_CONF_LIBPLPLOT%;\"${LIBPLPLOT}\";" \
--- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ # Department of Chemical Engineering TARGETS = octave-bug octave-config mkoctfile libcruft liboctave \ - kpathsea dlfcn readline src scripts doc check octave.info \ + dlfcn readline src scripts doc check octave.info \ INSTALL.OCTAVE BUGS install install-strip uninstall \ tags TAGS dist conf-dist snapshot snapshot-version @@ -94,7 +94,6 @@ @echo "" @echo " dlfcn make all in subdirectory dlfcn" @echo " doc make all in subdirectory doc" - @echo " kpathsea make all in subdirectory kpathsea" @echo " libcruft make all in subdirectory libcruft" @echo " liboctave make all in subdirectory liboctave" @echo " scripts make all in subdirectory scripts"
new file mode 100644 --- /dev/null +++ b/README.kpathsea @@ -0,0 +1,167 @@ +The code in the files + + liboctave/kpse.h + liboctave/kpse.cc + liboctave/kpse-xfns.h + liboctave/kpse-xfns.cc + liboctave/kpse-config.h + +was adapted from the kpathsearch library. We don't use kpathsearch +directly now because it has too many TeX-specific things that are not +necessary for Octave, and it also does not implement all the special +kinds of file searches that Octave needs (mainly for compatibility +with Matlab). + +Original authors of the kpathsearch library +------------------------------------------- + +Karl Berry wrote all files not otherwise marked, with help from Kathryn +Hargreaves on some of the original versions. + +Thomas Esser originated most of the MakeTeX... scripts. + +The brace expansion code in expand.c was written by Brian Fox and Chet +Ramey for Bash, the GNU shell. + +The implementation of the link trick in pathsearch.c is taken from GNU +find, implemented by David MacKenzie from Matthew Farwell's suggestion. + +Debugging +--------- + + Kpathsea provides a number of runtime debugging options, detailed +below by their names and corresponding numeric values. When the files +you expect aren't being found, the thing to do is enable these options +and examine the output. + + You can set these with some runtime argument (e.g., `-d') to the +program; in that case, you should use the numeric values described in +the program's documentation (which, for Dvipsk and Xdvik, are different +than those below). It's best to give the `-d' (or whatever) option +first, for maximal output. Dvipsk and Xdvik have additional +program-specific debugging options as well. + + You can also set the environment variable `KPATHSEA_DEBUG'; in this +case, you should use the numbers below. If you run the program under a +debugger and set the variable `kpathsea_debug', also use the numbers +below. + + In any case, by far the simplest value to use is `-1', which will +turn on all debugging output. This is usually better than guessing +which particular values will yield the output you need. + + Debugging output always goes to standard error, so you can redirect it +easily. For example, in Bourne-compatible shells: + dvips -d -1 ... 2>/tmp/debug + + It is sometimes helpful to run the standalone Kpsewhich utility +(*note Invoking kpsewhich::.), instead of the original program. + + In any case, you can *not* use the *names* below; you must always use +somebody's numbers. (Sorry.) To set more than one option, just sum +the corresponding numbers. + +`KPSE_DEBUG_STAT (1)' + Report `stat'(2) calls. This is useful for verifying that your + directory structure is not forcing Kpathsea to do many additional + file tests (*note Slow path searching::., and *note Subdirectory + expansion::.). If you are using an up-to-date `ls-R' database + (*note Filename database::.), this should produce no output unless + a nonexistent file that must exist is searched for. + +`KPSE_DEBUG_HASH (2)' + Report lookups in all hash tables: `ls-R' and `aliases' (*note + Filename database::.); font aliases (*note Fontmap::.); and config + file values (*note Config files::.). Useful when expected values + are not being found, e.g.., file searches are looking at the disk + instead of using `ls-R'. + +`KPSE_DEBUG_FOPEN (4)' + Report file openings and closings. Especially useful when your + system's file table is full, for seeing which files have been + opened but never closed. In case you want to set breakpoints in a + debugger: this works by redefining `fopen' (`fclose') to be + `kpse_fopen_trace' (`kpse_fclose_trace'). + +`KPSE_DEBUG_PATHS (8)' + Report general path information for each file type Kpathsea is + asked to search. This is useful when you are trying to track down + how a particular path got defined--from `texmf.cnf', `config.ps', + an environment variable, the compile-time default, etc. This is + the contents of the `kpse_format_info_type' structure defined in + `tex-file.h'. + +`KPSE_DEBUG_EXPAND (16)' + Report the directory list corresponding to each path element + Kpathsea searches. This is only relevant when Kpathsea searches + the disk, since `ls-R' searches don't look through directory lists + in this way. + +`KPSE_DEBUG_SEARCH (32)' + Report on each file search: the name of the file searched for, the + path searched in, whether or not the file must exist (when drivers + search for `cmr10.vf', it need not exist), and whether or not we + are collecting all occurrences of the file in the path (as with, + e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with + most lookups). This can help you correlate what Kpathsea is doing + with what is in your input file. + +`KPSE_DEBUG_VARS (64)' + Report the value of each variable Kpathsea looks up. This is + useful for verifying that variables do indeed obtain their correct + values. + +`GSFTOPK_DEBUG (128)' + Activates debugging printout specific to `gsftopk' program. + +`MAKETEX_DEBUG (512)' + If you use the optional `mktex' programs instead of the + traditional shell scripts, this will report the name of the site + file (`mktex.cnf' by default) which is read, directories created by + `mktexdir', the full path of the `ls-R' database built by + `mktexlsr', font map searches, `MT_FEATURES' in effect, parameters + from `mktexnam', filenames added by `mktexupd', and some + subsidiary commands run by the programs. + +`MAKETEX_FINE_DEBUG (1024)' + When the optional `mktex' programs are used, this will print + additional debugging info from functions internal to these + programs. + + Debugging output from Kpathsea is always written to standard error, +and begins with the string `kdebug:'. (Except for hash table buckets, +which just start with the number, but you can only get that output +running under a debugger. See comments at the `hash_summary_only' +variable in `kpathsea/db.c'.) + +Logging +------- + + Kpathsea can record the time and filename found for each successful +search. This may be useful in finding good candidates for deletion when +your filesystem is full, or in discovering usage patterns at your site. + + To do this, define the environment or config file variable +`TEXMFLOG'. The value is the name of the file to append the +information to. The file is created if it doesn't exist, and appended +to if it does. + + Each successful search turns into one line in the log file: two words +separated by a space. The first word is the time of the search, as the +integer number of seconds since "the epoch", i.e., UTC midnight 1 +January 1970 (more precisely, the result of the `time' system call). +The second word is the filename. + + For example, after `setenv TEXMFLOG /tmp/log', running Dvips on +`story.dvi' appends the following lines: + + 774455887 /usr/local/share/texmf/dvips/config.ps + 774455887 /usr/local/share/texmf/dvips/psfonts.map + 774455888 /usr/local/share/texmf/dvips/texc.pro + 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk + 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk + 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk + 774455889 /usr/local/share/texmf/dvips/texc.pro + +Only filenames that are absolute are recorded, to preserve some +semblance of privacy.
--- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ ### 02111-1307, USA. AC_INIT -AC_REVISION($Revision: 1.423 $) +AC_REVISION($Revision: 1.424 $) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -136,12 +136,6 @@ AC_SUBST(LIBPLPLOT) AC_SUBST(PLPLOT_DIR) -### Don't change the definition of LIBKPATHSEA without understanding -### the way it is used in liboctave/Makefile. - -LIBKPATHSEA='$(TOPDIR)/kpathsea/libkpathsea.$(LIBEXT)' -AC_SUBST(LIBKPATHSEA) - ### Make it possible to have Octave's array and matrix classes do bounds ### checking on element references. This slows some operations down a ### bit, so it is turned off by default. @@ -954,7 +948,7 @@ ### Checks for functions and variables. -AC_CHECK_FUNCS(atexit bcopy bzero dup2 endgrent endpwent execvp \ +AC_CHECK_FUNCS(atexit basename bcopy bzero dup2 endgrent endpwent execvp \ fcntl fork getcwd getegid geteuid getgid getgrent getgrgid \ getgrnam getpgrp getpid getppid getpwent getpwuid gettimeofday \ getuid getwd _kbhit kill link localtime_r lstat memmove mkdir \ @@ -1310,7 +1304,7 @@ export CXX export F77 -AC_CONFIG_SUBDIRS(kpathsea scripts) +AC_CONFIG_SUBDIRS(scripts) # autoconf 2.50 deprecates the use of variables (e.g. $GLOB_DIR) # in AC_CONFIG_SUBDIRS; the following form is recommended instead:
deleted file mode 100644 --- a/kpathsea/AUTHORS +++ /dev/null @@ -1,10 +0,0 @@ -Karl Berry wrote all files not otherwise marked, with help from Kathryn -Hargreaves on some of the original versions. - -Thomas Esser originated most of the MakeTeX... scripts. - -The brace expansion code in expand.c was written by Brian Fox and Chet -Ramey for Bash, the GNU shell. - -The implementation of the link trick in pathsearch.c is taken from GNU -find, implemented by David MacKenzie from Matthew Farwell's suggestion.
deleted file mode 100644 --- a/kpathsea/BUGS +++ /dev/null @@ -1,545 +0,0 @@ -Contents: - - Reporting bugs - Bug checklist - Mailing lists - Debugging - Logging - Common problems - Unable to find files - Slow path searching - Unable to generate fonts - TeX or Metafont failing - Empty Makefiles - `XtStrings' - `dlopen' - `ShellWidgetClass' - Pointer combination warnings - - -Reporting bugs -============== - - If you have problems or suggestions, please report them to -<tex-k@mail.tug.org> using the bug checklist below. - - Please report bugs in the documentation; not only factual errors or -inconsistent behavior, but unclear or incomplete explanations, typos, -wrong fonts, ... - -Bug checklist -------------- - - Before reporting a bug, please check below to be sure it isn't already -known (*note Common problems::.). - - Bug reports should be sent via electronic mail to -<tex-k@mail.tug.org>, or by postal mail to 135 Center Hill Road / -Plymouth, MA 02360 / USA. - - The general principle is that a good bug report includes all the -information necessary for reproduction. Therefore, to enable -investigation, your report should include the following: - - * The version number(s) of the program(s) involved, and of Kpathsea - itself. You can get the former by giving a sole option `--version' - to the program, and the latter by running `kpsewhich --version'. - The `NEWS' and `ChangeLog' files also contain the version number. - - * The hardware, operating system (including version number), - compiler, and `make' program you are using (the output of `uname - -a' is a start on the first two, though often incomplete). If the - bug involves the X window system, include X version and supplier - information as well (examples: X11R6 from MIT; X11R4 from HP; - OpenWindows 3.3 bundled with SunOS 4.1.4). - - * Any options you gave to `configure'. This is recorded in the - `config.status' files. - - If you are reporting a bug in `configure' itself, it's probably - system-dependent, and it will be unlikely the maintainers can do - anything useful if you merely report that thus-and-such is broken. - Therefore, you need to do some additional work: for some bugs, you - can look in the file `config.log' where the test that failed should - appear, along with the compiler invocation and source program in - question. You can then compile it yourself by hand, and discover - why the test failed. Other `configure' bugs do not involve the - compiler; in that case, the only recourse is to inspect the - `configure' shell script itself, or the Autoconf macros that - generated `configure'. - - * The log of all debugging output, if the bug is in path searching. - You can get this by setting the environment variable - `KPATHSEA_DEBUG' to `-1' before running the program. Please look - at the log yourself to make sure the behavior is really a bug - before reporting it; perhaps "old" environment variable settings - are causing files not to be found, for example. - - * The contents of any input files necessary to reproduce the bug. - For bugs in DVI-reading programs, for example, this generally - means a DVI file (and any EPS or other files it uses)--TeX source - files are helpful, but the DVI file is necessary, because that's - the actual program input. - - GNU `shar', available from `ftp://ftp.gnu.org/pub/gnu/shar' is a - convenient way of packaging multiple (possibly binary) files for - electronic mail. If you feel your input files are too big to send - by email, you can ftp them to `ftp://ftp.tug.org/incoming' (that - directory is writable, but not readable). - - * If you are sending a patch (do so if you can!), please do so in - the form of a context diff (`diff -c') against the original - distribution source. Any other form of diff is either not as - complete or harder for me to understand. Please also include a - `ChangeLog' entry. - - * If the bug involved is an actual crash (i.e., core dump), it is - easy and useful to include a stack trace from a debugger (I - recommend the GNU debugger GDB, available from - `ftp://ftp.gnu.org/pub/gnu/gdb'). If the cause is apparent (a - `NULL' value being dereferenced, for example), please send the - details along. If the program involved is TeX or Metafont, and - the crash is happening at apparently-sound code, however, the bug - may well be in the compiler, rather than in the program or the - library (*note TeX or Metafont failing: TeX or Metafont failing.). - - * Any additional information that will be helpful in reproducing, - diagnosing, or fixing the bug. - -Mailing lists -------------- - - Web2c and Kpathsea in general are discussed on the mailing list -<tex-k@mail.tug.org>. To join, email <tex-k-request@mail.tug.org> with -a line consisting of - - subscribe YOU@YOUR.PREFERRED.EMAIL.ADDRESS - -in the body of the message. - - You do not need to join to submit a report, nor will it affect whether -you get a response. There is no Usenet newsgroup equivalent (if you can -be the one to set this up, email `tex-k-request'). Traffic on the list -is fairly light, and is mainly bug reports and enhancement requests to -the software. The best way to decide if you want to join or not is -read some of the archives from `ftp://ftp.tug.org/mail/archives/tex-k/'. - - Be aware that large data files are sometimes included in bug reports. -If this is a problem for you, do not join the list. - - If you only want announcements of new releases, not bug reports and -discussion, join <tex-archive@math.utah.edu> (via mail to -<tex-archive-request@math.utah.edu>). - - If you are looking for general TeX help, such as how to use LaTeX, -please use the mailing list <info-tex@shsu.edu> mailing list, which is -gatewayed to the `comp.text.tex' Usenet newsgroup (or post to the -newsgroup; the gateway is bidirectional). - -Debugging ---------- - - Kpathsea provides a number of runtime debugging options, detailed -below by their names and corresponding numeric values. When the files -you expect aren't being found, the thing to do is enable these options -and examine the output. - - You can set these with some runtime argument (e.g., `-d') to the -program; in that case, you should use the numeric values described in -the program's documentation (which, for Dvipsk and Xdvik, are different -than those below). It's best to give the `-d' (or whatever) option -first, for maximal output. Dvipsk and Xdvik have additional -program-specific debugging options as well. - - You can also set the environment variable `KPATHSEA_DEBUG'; in this -case, you should use the numbers below. If you run the program under a -debugger and set the variable `kpathsea_debug', also use the numbers -below. - - In any case, by far the simplest value to use is `-1', which will -turn on all debugging output. This is usually better than guessing -which particular values will yield the output you need. - - Debugging output always goes to standard error, so you can redirect it -easily. For example, in Bourne-compatible shells: - dvips -d -1 ... 2>/tmp/debug - - It is sometimes helpful to run the standalone Kpsewhich utility -(*note Invoking kpsewhich::.), instead of the original program. - - In any case, you can *not* use the *names* below; you must always use -somebody's numbers. (Sorry.) To set more than one option, just sum -the corresponding numbers. - -`KPSE_DEBUG_STAT (1)' - Report `stat'(2) calls. This is useful for verifying that your - directory structure is not forcing Kpathsea to do many additional - file tests (*note Slow path searching::., and *note Subdirectory - expansion::.). If you are using an up-to-date `ls-R' database - (*note Filename database::.), this should produce no output unless - a nonexistent file that must exist is searched for. - -`KPSE_DEBUG_HASH (2)' - Report lookups in all hash tables: `ls-R' and `aliases' (*note - Filename database::.); font aliases (*note Fontmap::.); and config - file values (*note Config files::.). Useful when expected values - are not being found, e.g.., file searches are looking at the disk - instead of using `ls-R'. - -`KPSE_DEBUG_FOPEN (4)' - Report file openings and closings. Especially useful when your - system's file table is full, for seeing which files have been - opened but never closed. In case you want to set breakpoints in a - debugger: this works by redefining `fopen' (`fclose') to be - `kpse_fopen_trace' (`kpse_fclose_trace'). - -`KPSE_DEBUG_PATHS (8)' - Report general path information for each file type Kpathsea is - asked to search. This is useful when you are trying to track down - how a particular path got defined--from `texmf.cnf', `config.ps', - an environment variable, the compile-time default, etc. This is - the contents of the `kpse_format_info_type' structure defined in - `tex-file.h'. - -`KPSE_DEBUG_EXPAND (16)' - Report the directory list corresponding to each path element - Kpathsea searches. This is only relevant when Kpathsea searches - the disk, since `ls-R' searches don't look through directory lists - in this way. - -`KPSE_DEBUG_SEARCH (32)' - Report on each file search: the name of the file searched for, the - path searched in, whether or not the file must exist (when drivers - search for `cmr10.vf', it need not exist), and whether or not we - are collecting all occurrences of the file in the path (as with, - e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with - most lookups). This can help you correlate what Kpathsea is doing - with what is in your input file. - -`KPSE_DEBUG_VARS (64)' - Report the value of each variable Kpathsea looks up. This is - useful for verifying that variables do indeed obtain their correct - values. - -`GSFTOPK_DEBUG (128)' - Activates debugging printout specific to `gsftopk' program. - -`MAKETEX_DEBUG (512)' - If you use the optional `mktex' programs instead of the - traditional shell scripts, this will report the name of the site - file (`mktex.cnf' by default) which is read, directories created by - `mktexdir', the full path of the `ls-R' database built by - `mktexlsr', font map searches, `MT_FEATURES' in effect, parameters - from `mktexnam', filenames added by `mktexupd', and some - subsidiary commands run by the programs. - -`MAKETEX_FINE_DEBUG (1024)' - When the optional `mktex' programs are used, this will print - additional debugging info from functions internal to these - programs. - - Debugging output from Kpathsea is always written to standard error, -and begins with the string `kdebug:'. (Except for hash table buckets, -which just start with the number, but you can only get that output -running under a debugger. See comments at the `hash_summary_only' -variable in `kpathsea/db.c'.) - -Logging -------- - - Kpathsea can record the time and filename found for each successful -search. This may be useful in finding good candidates for deletion when -your filesystem is full, or in discovering usage patterns at your site. - - To do this, define the environment or config file variable -`TEXMFLOG'. The value is the name of the file to append the -information to. The file is created if it doesn't exist, and appended -to if it does. - - Each successful search turns into one line in the log file: two words -separated by a space. The first word is the time of the search, as the -integer number of seconds since "the epoch", i.e., UTC midnight 1 -January 1970 (more precisely, the result of the `time' system call). -The second word is the filename. - - For example, after `setenv TEXMFLOG /tmp/log', running Dvips on -`story.dvi' appends the following lines: - - 774455887 /usr/local/share/texmf/dvips/config.ps - 774455887 /usr/local/share/texmf/dvips/psfonts.map - 774455888 /usr/local/share/texmf/dvips/texc.pro - 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk - 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk - 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk - 774455889 /usr/local/share/texmf/dvips/texc.pro - -Only filenames that are absolute are recorded, to preserve some -semblance of privacy. - -Common problems ---------------- - - Here are some common problems with configuration, compilation, -linking, execution, ... - -Unable to find files -.................... - - If a program complains it cannot find fonts (or other input files), -any of several things might be wrong. In any case, you may find the -debugging options helpful. *Note Debugging::. - - * Perhaps you simply haven't installed all the necessary files; the - basic fonts and input files are distributed separately from the - programs. *Note unixtex.ftp::. - - * You have (perhaps unknowingly) told Kpathsea to use search paths - that don't reflect where the files actually are. One common cause - is having environment variables set from a previous installation, - thus overriding what you carefully set in `texmf.cnf' (*note - Supported file formats::.). System `/etc/profile' or other files - such may be the culprit. - - * Your files reside in a directory that is only pointed to via a - symbolic link, in a leaf directory and is not listed in `ls-R'. - - Unfortunately, Kpathsea's subdirectory searching has an - irremediable deficiency: If a directory D being searched for - subdirectories contains plain files and symbolic links to other - directories, but no true subdirectories, D will be considered a - leaf directory, i.e., the symbolic links will not be followed. - *Note Subdirectory expansion::. - - You can work around this problem by creating an empty dummy - subdirectory in D. Then D will no longer be a leaf, and the - symlinks will be followed. - - The directory immediately followed by the `//' in the path - specification, however, is always searched for subdirectories, - even if it is a leaf. Presumably you would not have asked for the - directory to be searched for subdirectories if you didn't want it - to be. - - * If the fonts (or whatever) don't already exist, `mktexpk' (or - `mktexmf' or `mktextfm') will try to create them. If these rather - complicated shell scripts fail, you'll eventually get an error - message saying something like `Can't find font FONTNAME'. The best - solution is to fix (or at least report) the bug in `mktexpk'; the - workaround is to generate the necessary fonts by hand with - Metafont, or to grab them from a CTAN site (*note unixtex.ftp::.). - - * There is a bug in the library. *Note Reporting bugs::. - -Slow path searching -................... - - If your program takes an excessively long time to find fonts or other -input files, but does eventually succeed, here are some possible -culprits: - - * Most likely, you just have a lot of directories to search, and that - takes a noticeable time. The solution is to create and maintain a - separate `ls-R' file that lists all the files in your main TeX - hierarchy. *Note Filename database::. Kpathsea always uses `ls-R' - if it's present; there's no need to recompile or reconfigure any - of the programs. - - * Your recursively-searched directories (e.g., - `/usr/local/share/texmf/fonts//'), contain a mixture of files and - directories. This prevents Kpathsea from using a useful - optimization (*note Subdirectory expansion::.). - - It is best to have only directories (and perhaps a `README') in the - upper levels of the directory structure, and it's very important - to have *only* files, and no subdirectories, in the leaf - directories where the dozens of TFM, PK, or whatever files reside. - - In any case, you may find the debugging options helpful in determining -precisely when the disk or network is being pounded. *Note Debugging::. - -Unable to generate fonts -........................ - - This can happen if either `mktexpk' hasn't been installed properly, -or if the local installation of Metafont isn't correct. - - If `mf' is a command not found by `mktexpk', then you need to install -Metafont (*note unixtex.ftp::.). - - If Metafont runs, but generates fonts at the wrong resolution, you -need to be sure the `M' and `D' lines in your Dvips configuration file -match (*note Config files: (dvips)Config files.). For example, if -`mktexpk' is generating 300dpi fonts, but you need 600dpi fonts, you -should have: - M ljfour - D 600 - - If Metafont runs but generates fonts at a resolution of 2602dpi (and -prints out the name of each character as well as just a character -number, and maybe tries to display the characters), then your Metafont -base file probably hasn't been made properly. (It's using the default -`proof' mode, instead of an actual device mode.) To make a proper -`plain.base', assuming the local mode definitions are contained in a -file `modes.mf', run the following command (assuming Unix): - - inimf "plain; input modes; dump" - -Then copy the `plain.base' file from the current directory to where the -base files are stored on your system (`/usr/local/share/texmf/web2c' by -default), and make a link (either hard or soft) from `plain.base' to -`mf.base' in that directory. *Note inimf invocation: (web2c)inimf -invocation. - -TeX or Metafont failing -....................... - - If TeX or Metafont get a segmentation fault or otherwise fail while -running a normal input file, the problem is usually a compiler bug -(unlikely as that may sound). Even if the trip and trap tests are -passed, problems may lurk. Optimization occasionally causes trouble in -programs other than TeX and Metafont themselves, too. - - Insufficient swap space may also cause core dumps or other erratic -behavior. - - For a workaround, if you enabled any optimization flags, it's best to -omit optimization entirely. In any case, the way to find the facts is -to run the program under the debugger and see where it's failing. - - Also, if you have trouble with a system C compiler, I advise trying -the GNU C compiler. And vice versa, unfortunately; but in that case I -also recommend reporting a bug to the GCC mailing list; see *Note Bugs: -(gcc)Bugs. - - To report compiler bugs effectively requires perseverance and -perspicacity: you must find the miscompiled line, and that usually -involves delving backwards in time from the point of error, checking -through TeX's (or whatever program's) data structures. Things are not -helped by all-too-common bugs in the debugger itself. Good luck. - - One known cause of trouble is the way arrays are handled. Some of the -Pascal arrays have a lower index other than 0, and the C code will take -the pointer to the allocated memory, subtract the lower index, and use -the resulting pointer for the array. While this trick often works, ANSI -C doesn't guarantee that it will. It it known to fail on HP-UX 10 -mchines when the native compiler is used, unless the `+u' compiler -switch was specified. Using GCC will work on this platform as well. - -Empty Makefiles -............... - - On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), `configure' -may fail to properly create the Makefiles. Instead, you get an error -which looks something like this: - - prompt$ ./configure - ... - creating Makefile - sed: 1: "\\@^ac_include make/pat ...": \ can not be used as a string delimiter - - So far as I know, the bug here is in `/bin/sh' on these systems. I -don't have access to a machine running any of them, so if someone can -find a workaround that avoids the quoting bug, I'd be most grateful. -(Search for `ac_include' in the `configure' script to get to the -problematic code.) - - It should work to run `bash configure', instead of using `/bin/sh'. -You can get Bash from `ftp://ftp.gnu.org/pub/gnu/bash' and mirrors. - - Another possible cause (reported for NeXT) is a bug in the `sed' -command. In that case the error may look like this: - - Unrecognized command: \@^ac_include make/paths.make@r make/paths.make - - In this case, installing GNU `sed' should solve the problem. You can -get GNU `sed' from the same places as Bash. - -`XtStrings' -........... - - You may find that linking X programs results in an error from the -linker that `XtStrings' is undefined, something like this: - - gcc -o virmf ... - .../x11.c:130: undefined reference to `XtStrings' - - This generally happens because of a mismatch between the X include -files with which you compiled and the X libraries with which you linked; -often, the include files are from MIT and the libraries from Sun. - - The solution is to use the same X distribution for compilation and -linking. Probably `configure' was unable to guess the proper -directories from your installation. You can use the `configure' -options `--x-includes=PATH' and `--x-libraries=PATH' to explicitly -specify them. - -`dlopen' -........ - - (This section adapted from the file `dlsym.c' in the X distribution.) - - The `Xlib' library uses the standard C function `wcstombs'. Under -SunOS 4.1, `wcstombs' uses the `dlsym' interface defined in `libdl.so'. -Unfortunately, the SunOS 4.1 distribution does not include a static -`libdl.a' library. - - As a result, if you try to link an X program statically under SunOS, -you may get undefined references to `dlopen', `dlsym', and `dlclose'. -One workaround is to include these definitions when you link: - - void *dlopen() { return 0; } - void *dlsym() { return 0; } - int dlclose() { return -1; } - -These are contained in the `dlsym.c' file in the MIT X distribution. - -`ShellWidgetClass' -.................. - - (This section adapted from the comp.sys.sun.admin FAQ.) - - If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x, -you may get undefined symbols `_get_wmShellWidgetClass' and -`_get_applicationShellWidgetClass' when linking. This problem does not -arise using the standard MIT X libraries under SunOS. - - The cause is bugs in the `Xmu' shared library as shipped from Sun. -There are several fixes: - - * Install the free MIT distribution from `ftp.x.org' and mirrors. - - * Get the OpenWindows patches listed below. - - * Statically link the `Xmu' library into the executable. - - * Avoid using `Xmu' at all. If you are compiling Metafont, see *Note - Online Metafont graphics: (web2c)Online Metafont graphics. If you - are compiling Xdvi, see the `-DNOTOOL' option in `xdvik/INSTALL'. - - * Ignore the errors. The binary runs fine regardless. - - Here is the information for getting the two patches: - - Patch ID: 100512-02 - Bug ID's: 1086793, 1086912, 1074766 - Description: 4.1.x OpenWindows 3.0 `libXt' jumbo patch - - Patch ID: 100573-03 - Bug ID: 1087332 - Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared `libXmu'. - - The way to statically link with `libXmu' depends on whether you are -using a Sun compiler (e.g., `cc') or `gcc'. If the latter, alter the -`x_libs' Make variable to include - - -static -lXmu -dynamic - - If you are using the Sun compiler, use `-Bstatic' and `-Bdynamic'. - -Pointer combination warnings -............................ - - When compiling with old C compilers, you may get some warnings about -"illegal pointer combinations". These are spurious; just ignore them. -I decline to clutter up the source with casts to get rid of them. -
deleted file mode 100644 --- a/kpathsea/ChangeLog +++ /dev/null @@ -1,4321 +0,0 @@ -2003-01-05 John W. Eaton <jwe@bevo.che.wisc.edu> - - * db.c: Define _GNU_SOURCE. - -2003-01-04 John W. Eaton <jwe@bevo.che.wisc.edu> - - * Makefile.in ($(kpathsea)): Build object files only. - - * acklibtool.m4: Enable shared/static lib options again. - Build only the type of objects we ask for (default is static). - -2002-12-26 John W. Eaton <jwe@bevo.che.wisc.edu> - - * pathsearch.c (path_find_first_of, find_first_of, - kpse_path_find_first_of, kpse_all_path_find_first_of): - New functions. - * pathsearch.h (kpse_path_find_first_of, kpse_all_path_find_first_of): - Provide declarations. - -2002-11-23 John W. Eaton <jwe@bevo.che.wisc.edu> - - * Makefile.in (objects): Include basename.lo in the list. - -2002-11-08 John W. Eaton <jwe@bevo.che.wisc.edu> - - * Makefile.in (default all): Build the libarary only. - -2002-09-26 Paul Kienzle <pkienzle@users.sf.net> - - * config.h: Remove MINGW32 conflicts with win32lib.h. - * c-stat.h: Ditto. - -2002-09-03 John W. Eaton <jwe@bevo.che.wisc.edu> - - * xstat.c: Delete forward decl for lstat. It apparently causes - trouble on some systems with gcc 3.x. - -2002-04-12 John W. Eaton <jwe@bevo.che.wisc.edu> - - * config.guess, config.sub: Update from FSF sources. - -2002-04-03 Steven G. Johnson <stevenj@alum.mit.edu> - - * configure.in, c-auto.in: Update for autoconf 2.5x. - -2001-11-27 Trond Eivind Glomsrød <teg@redhat.com> - - * progname.c (kpse_set_program_name): Fix typo. - -2000-02-25 John W. Eaton <jwe@bevo.che.wisc.edu> - - * config.guess: Update to latest from subversions.gnu.org. - * config.sub: Likewise. Recognize sv1-cray as a basic_machine. - -Fri Nov 13 08:24:34 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * kdefault.c (kpse_expand_default): In loop that checks for - doubled colon, just break out of the inner loop when a match is - found. Don't check for expansion == path because we've already - duplicated path to avoid memory problems (see previous change). - From Rafael Laboissiere <rafael@icp.inpg.fr>. - -Fri Oct 23 22:05:46 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * kdefault.c (kpse_expand_default): Always return newly allocated - storage. - -Fri Sep 25 13:28:54 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * elt-dirs.c (kpse_clear_dir_cache): New function. - * pathsearch.h (kpse_clear_dir_cache): Provide declaration. - -Mon Aug 31 12:07:02 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * config.sub: Accept armv4 everywhere arm is allowed. - -Thu May 14 12:20:47 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * acklibtool.m4: For use with Octave, disable support for shared - libraries. - -Thu Apr 23 15:08:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - - * withenable.ac (texmfmain): Don't print warning if main temf - directory tree can't be found. - - * version.c (kpse_bug_address): Change address as requested. - - * Makefile.in: Do acincludes by hand. - * common.ac: Require autoconf 2.12, not 2.12.1. - Include acklibtool.m4, not ../akclibtool.m4. - Include withenable.ac, not ../kpathsea/withenable.ac. - * acklibtool.m4, config.guess, config.sub, install-sh, klibtool, - klibtool.config: Files for `standalone' distribution'. - * make: Directory for `standalone' distribution'. - * withenable.ac: Don't use AC_MAINTAINER_MODE. - - * pathsearch.c: Avoid memory leak. - -Mon Mar 16 19:25:15 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * configure.in (KPSEVERSION): version 3.2. - - * mktex.opt: Set MT_MKTEXNAM_OPT, MT_MKTEXDIR_OPT here. - - * mktexnam: Move setting of MT_MKTEXNAM_OPT to mktex.opt. - -Sun Mar 15 19:55:30 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * c-proto.h: Add P7H and P7C macros. - -Sat Mar 14 00:10:20 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * win32lib.h: Patch from Fabrice. - - * c-dir.h [WIN32]: Patch from Fabrice. - -Fri Mar 13 23:23:33 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * texmf.in: Added XDVIINPUTS and TEX4HTINPUTS. - -Thu Mar 12 08:04:50 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * win32lib.c: New version from Fabrice Popineau. - -Wed Mar 11 19:55:10 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * install.texi: Correction for description of dosnames behaviour - on MS-DOS. From Eli Zaretskii. - -Mon Mar 9 07:22:23 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * mktexlsr: exit 0 if we succeeded. - - * withenable.ac: Remove double slashes from texmfmain variable. - Strictly speaking, it is a user fault when this occurs, but... - From Thomas Esser. - -Sun Mar 8 18:23:33 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * tex-file.c: omkocp, omkofm -> mkocp, mkofm. - - * texmf.in: OMKOFM, OMKOCP -> MKOFM, MKOCP. - - * withenable.ac: omkofm, omkocp -> mkofm, mkocp. - -Thu Mar 5 15:32:48 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * texmf.in: Add OMKOCP and OMKOFM analogous to MKTEXPK. - - * c-fopen.h [DOS]: Don't open files read-write if read suffices. - -Wed Mar 4 23:55:35 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * withenable.ac: Add options for enabling/disabling - omkocp/omkofm. From John Plaice. - - * tex-file.c (init_format): Support omkocp and omkofm instead of - MakeOmegaOCP and MakeOmegaOFM programs. From John Plaice. - (kpse_maketex_option): Some changes to handle ofm/ocp as well. - -Tue Mar 3 09:02:09 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * tex-make.c (kpse_make_tex): Make same exception for AMIGA as for - WIN32 and MSDOS. From Andreas Scherer. - - * PROJECTS: Update mail address. - - * mktex.opt: Print message if VARTEXMF is not defined, then - default to '$KPSE_DOT'. - - * mktexnam: Remove use of "shell !" from tests involving varfonts - feature. Simplify the code a bit. - -Fri Feb 27 19:55:11 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * withenable.ac: Replace use of -a in test with && and second - test. From Thomas Esser <te@informatik.uni-hannover.de>. - -Tue Feb 24 13:16:56 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * Makefile.in: Corrections for building/installing outside source - dir. From Vladimir Volovich <vvv@vvv.vsu.ru>. - - * mktexnam.opt: Correction MT_PKNAME -> MT_PKBASE to get dosnames - feature to work. From Eli Zaretskii. - -Mon Feb 23 10:17:22 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * mktex.opt, mktexlsr: Use test ... || test ... instead of test - ... -o ... . - - * mktexnam.opt: Remove use of MT_PKPART, MT_MFPART, and MT_TFMPART - variables, since they're no longer defined. - - * expand.c (kpse_expand_kpse_dot [MSDOS]): A very ugly hack to - deal with a very broken feature on some MSDOS systems. After Eli - Zaretskii. - -Fri Feb 20 17:18:19 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * Makefile.in (texmf.sed): Remove VARTEXMF. - - * install.texi: Update for changes to varfonts. - - * kpathsea.texi: Remove references to format numbers. - - * kpsewhich.c (read_command_line): Remove printing of and support - for format numbers. - - * mktex.opt: Remove VARTEXMF and related stuff, set dosnames for - DOS. - - * mktexnam: Remove use of VARTEXMF, introduce SYSTEXMF, change - semantics of varfonts. - - * mktexnam.opt: Remove reference to VARTEXMF, move setting of - dosnames for DOS to mktex.opt. - - * mktexpk: Boilerplate tests. - - * mktexupd: Boilerplate tests. - - * progname.c: Move kpse_reset_program_name to tex-file.c. This - move means progname.o doesn't use a common object from tex-file.o - anymore. The NeXT linker would omit tex-file.o, then complain - about an undefined symbol. Thanks to Gregor Hoffleit - <flight@thefly.mathi.uni-heidelberg.de> and Melissa O'Neill - <oneill@cs.sfu.ca> for their help solving this. - - * progname.h: Move kpse_reset_progname to tex-file.h. - - * tex-file.c: Move kpse_reset_program_name here from progname.c. - - * tex-file.h: Move kpse_reset_program_name here from progname.h. - - * texmf.in: Remove VARTEXMF, add SYSTEXMF. - - * withenable.ac: Boilerplating, a correction of the default case - of the --enable-multiplatform test. - -Mon Feb 16 09:46:47 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * mktexpk: Dropped a $ in the wrong place, which made chmod look - for a non-existent file. - - * Makefile.in (texmf.sed): Include the substitution for @web2c@ in - TEXMFCNF. - - * Makefile.in (texmf.sed): Remove traling / from VARTEXMF - substitution. - (stamp-paths): Replace @ with % as sed delimiter. The @ causes - problems because it used in afs filenames. Spotted by Matthias - Clasen. - - * bugs.texi: Since the NeXT(step) problem is likely to be solved - now, make description of bug less definite. - - * common.ac: Remove check for readlink. - - * kpathsea.texi: Document changes to search algorithm. - - * mktexlsr: Use % not @ as sed delimiter. - - * mktexmf: Correct permissions problem. - - * mktexnam: Use % not @ as sed delimiter. - - * mktexpk: Use % not @ as sed delimiter. Correct permissions - problem. Set permissions before the file is moved into place. - - * mktextfm: Use % not @ as sed delimiter. Correct permissions - problem. Set permissions before the file is moved into place. - - * mktexupd: Use % not @ as delimiter for sed. - - * readlink.c (main): Use S_ISLNK instead of HAVE_READLINK to test - whether readlink is a known function. - - * tex-file.c (kpse_init_format): Make changes corresponding to the - movement of kpse_tfm_format. - (kpse_find_file): Reorganize searches; fold code of search #3 into - #1 and #2; fold #5 into #2. We now have two searches, plus an - attempt to create missing files. - - * tex-file.h: Move kpse_tfm_format before kpse_ofm_format. Might - as well put it near the front then, because it is an often-used - format. - - * texmf.in: VARTEXFONTS uses @vartexfonts@ so it can be filled in - from the Makefile. OFMFONTS changed to explicitly use TFMFONTS. - TEXMCNF uses @web2c@ rather than @web2cdir@. - - * withenable.ac: Do not force default for --enable-multiplatform, - so that we can inherit one from a script that calls us. - -Tue Feb 10 17:59:26 1998 Olaf Weber <infovore@xs4all.nl> - - * withenable.ac: Don't abort configure run if the main texmf tree - isn't found. - - * acconfig.h: Add EPSFWIN to the undefs. - - * install.texi: Update section on the handling of options by - mktexpk. - - * mktex.opt: Comment on the duplication of the ls_R_magic string. - - * mktexlsr: Copy code from mktex.opt to mktexlsr, so the latter - can run without the need to find the former. - - * mktextfm, mktexpk: Replace positional options with normal option - handling. - - * mktextfm.man, mktexpk.man: Update documentation for the new - option handling. - - * tex-file.c: Update the MKTEXPK_ARGS string for the new - option-handling of mktexpk. - - * tex-make.c (kpse_make_tex): We pass the raw / to mktexpk in the - --mfmode switch when appropriate; remove unset_mode variable. - Update comments to reflect new situation. - - * kpathsea.texi: Note that empty path components are now ignored - in stead of expanded to cwd. - - * line.c: Add prototype and clean up headers. - - * mktex.opt, mktexlsr, mktexmf, mktexnam, mktexpk, mktextfm, - mktexdir, mktexupd: Make "caching" of some variables and file - names in the environment possible. Provide defaults in case the - 'web2c files' format doesn't work for finding files. Suggested by - Thomas Esser. - - * withenable.ac: Give a better message when the main texmf tree - isn't found. - -Sat Feb 7 01:00:49 1998 Olaf Weber <infovore@xs4all.nl> - - * elt-dirs.c (kpse_element_dirs): Return NULL, not the cwd, if - we're given an empty string. - - * mktex.opt: Determine VARTEXFONTS here. - - * mktexnam: Move determination of VARTEXFONTS to mktex.opt. - -Fri Feb 6 17:59:59 1998 Olaf Weber <infovore@xs4all.nl> - - * config.h: Update definition of KPATHSEA to 32. - - * expand.c (kpse_path_expand): Do not recursively expand a leading - //, as in pathsearch.c. - - * kpsewhich.man: Update for --epxand-braces option. - - * texmf.in: Put texmf.local before texmf in the TEXMFCNF path. - - * withenable.ac: Make code for finding texmfmain more robust. - -Wed Feb 4 20:39:10 1998 Olaf Weber <infovore@xs4all.nl> - - * readable.c: Correct typo: '#elsif' -> '#elif'. - -Tue Feb 3 17:08:34 1998 Olaf Weber <infovore@xs4all.nl> - - * kpathsea.texi: Update for changes to kpsewhich. - -Mon Feb 2 21:12:06 1998 Olaf Weber <infovore@xs4all.nl> - - * xputenv.c: Undid last patch from Fabrice -- it was a "fix" that - suppresses warnings on his compiler, and engenders them on mine. - -Sun Feb 1 16:08:49 1998 Olaf Weber <infovore@xs4all.nl> - - * lib.h [!DOSISH]: Correct definition of FILESTRNCASEEQ. - - * mktexmf: Correct call to mktexnam. - - * kpsewhich.c: New option --expand-braces. - (expand_path): Removed. - (main): Add code for --expand-braces, account for new definition of - kpse_path_expand. - - * expand.h: Rename kpse_path_expand to kpse_brace_expand. Add new - kpse_path_expand. - - * expand.c (kpse_path_expand): New implementation, based on - path_expand from kpsesewhich.c. - (kpse_brace_expand): The old kpse_path_expand. Change calls to - kpse_brace_expand to kpse_brace_expand_element. - (kpse_brace_expand_element): The old kpse_brace_expand, but with - static linkage. Changes calls to kpse_brace_expand to - kpse_brace_expand_element. - - * tex-file.c (init_path): Replace kpse_path_expand with - kpse_brace_expand. - - * texmf.in: Correct input variables for mltex variants. Add pdftex - to TEXPSHEADERS path. - -Thu Jan 29 16:15:44 1998 Olaf Weber <infovore@xs4all.nl> - - * Makefile.in: Update for readlink. - - * common.ac: Test for readlink function. - - * access.c, kpsestat.c: No need to explicitly include c-auto.h. - - * mktex.opt: Adapt to new way of finding the script. Do the - actual lookup for mktexnam, mktexdir, and mktexupd here. Make a - bit more robust. - - * mktexlsr: Make file handling more robust, use kpsewhich to find - supporting scripts like mktex.opt and mktexnam, use readlink to - trace symlinks. - - * mktexupd, mktexpk, mktextfm, mktexmf, mktexdir, mktexnam: Make - file handling more robust, use kpsewhich to find supporting - scripts like mktex.opt and mktexnam, simplify somewhat. - - * mktexnam.opt: Make handling of names more robust. - - * readlink.c, readlink.man: New files. - - * withenable.ac: Add --enable-multiplatform option. Attempt to - find the texmf directory, and complain if we fail to do so. - - * Makefile.in (texmf.sed): Remove sed for dbtex, dbfonts, change - VARTEXFONTS to comply with texmf.in, and update comment. - - * c-vararg.h: Comment update from Peter Breitenlohner. - -Wed Jan 28 20:36:56 1998 Olaf Weber <infovore@xs4all.nl> - - * Makefile.in: Keep c-auto.h out of kpathsea.h. - - * c-stat.h [WIN32]: Modification from Fabrice. - - * dir.c [WIN32]: Extensive modifications from Fabrice. - - * kpsestat.c, kpsewhich.c: Replace exit with return from main. - From Fabrice. - - * readable.c [WIN32]: Separate definition of READABLE. From - Fabrice Popineau. - - * texmf.in: Remove almost all @var@ stuff, and just assume TDS for - all. - - * win32lib.h: Modifications from Fabrice. - - * xputenv.c (xputenv): Minor fix from Fabrice. - - * win32lib.c: New file from Fabrice Popineau. Replacement - functions for Win32. - -Sun Jan 25 20:02:21 1998 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Increase buf_size to 50000 (from 10000). - - * tex-file.c (kpse_find_file): In the first search, postpone - pounding the disk until all possible suffixes have been tried. - - * line.c (read_line): Accept any of NL, CR, and CRLF as - end-of-line. - -Fri Jan 23 14:45:19 1998 Olaf Weber <infovore@xs4all.nl> - - * access.c: Use return instead of exit to get rid of some compiler - warnings. From Fabrice. - - * c-fopen.h: Changes for CYGWIN32. - - * c-proto.h: Patch from Fabrice Popineau for Win32. - - * kpathsea.texi: Document kpse_web2c_format, - kpse_program_text_format, kpse_program_binary_format. - - * mktex.opt, mktexdir, mktexlsr, mktexmf, mktexnam, mktexpk, - mktextfm, mktexupd: Use -expand-path instead of -expand-var where - possible. This makes the handling of !! more robust. - - * tex-file.c (kpse_find_file): Handle other cases than precisely - one extension in search number 3. - (kpse_init_format): Add kpse_web2c_format, kpse_program_text_format, - kpse_program_binary_format. - - * tex-file.h: Add kpse_web2c_format, kpse_program_text_format, - kpse_program_binary_format. - - * tex-hush.c: Test the "path element" h, not the whole hush. - - * texmf.in: Add a definition for WEB2C. Add some Omega-related - parameters, from John Plaice. - -Tue Jan 13 19:46:58 1998 Olaf Weber <infovore@xs4all.nl> - - * mktexpk, mktextfm: Only move $NAME.log file if it exists and is - not empty. - -Mon Jan 12 06:22:59 1998 Olaf Weber <infovore@xs4all.nl> - - * kpathsea.texi: Fixes from Gerd Neugebauer <gerd@uni-koblenz.de>. - -Sun Jan 11 18:26:56 1998 Olaf Weber <infovore@xs4all.nl> - - * mktexupd: Two changes: absence of the current tree in the ls-R - path is not an error; create an ls-R file if the current tree is - in the ls-R path and the file doesn't yet exist. - -Sat Jan 10 09:55:47 1998 Olaf Weber <infovore@xs4all.nl> - - * tex-hush.c: A null pointer could be fed to strcmp. - -Fri Jan 9 21:08:45 1998 Olaf Weber <infovore@xs4all.nl> - - * mktexnam: Add $COMSPEC test, and use $SEP for path separator when - splitting paths. From Eli Zaretskii. - - * mktexlsr: Correct usage for determining absolute paths. From - Eli Zaretskii. - - * common.ac: Correct code in HAVE_PROTOTYPES test. - -Sun Jan 4 15:59:08 1998 Olaf Weber <infovore@xs4all.nl> - - * Manual pages for access, kpsestat, kpsewhich, mktexlsr, mktexpk, - mktexmf, mktextfm. - - * Makefile.in: Changes for manual pages. - -Thu Jan 1 10:11:49 1998 Olaf Weber <infovore@xs4all.nl> - - * mktex.opt: Remove definition of $SEP; it is now needed before - this script is sourced. - - * mktexlsr: If necessary, add location of script to PATH. - - * mktexupd: Put $SEP definition in script itself. - - * xputenv.c (xputenv): Move some declarations into the "not - SMART_PUTENV" block to prevent "unused" warnings. - -Tue Dec 30 17:55:45 1997 Olaf Weber <infovore@xs4all.nl> - - * install.texi, bugs.texi: Add comment about the need to use - special compiler options in HP-UX. - - * mktexpk: Use nonstopmode for mf, in case of failure move log - file to working directory. - - * mktextfm: Use nonstopmode for mf, in case of failure move log - files to working directory. - - * mktexlsr: Add comment about use in cron scripts, use SEP - variable for path separator. - - * mktexupd: Check for both new and old magic string in ls-R files, - use SEP variable for path separator. - - * mktex.opt: Pick the correct path separator for MS-DOS and UNIX. - Add a more appropriate magic string for ls-R files, but keep the - old one around for compatibility. - - * Makefile.in (install-exec): Add check for original mktexlsr. - -Thu Dec 18 20:33:56 1997 Olaf Weber <infovore@xs4all.nl> - - * tex-file.c (init_path): Rewrite test whether we're initializing - the kpse_cnf_format paths. - - * tex-file.c (kpse_init_format): Initialise the binmode fields. - (kpse_open_file): Use binmode field. - - * tex-file.h: Add binmode field to kpse_format_info_type. - - * kpsewhich.c: Correct option string. - - * tex-file.c (kpse_open_file): Assume kpse_truetype_format and - kpse_type42_format are for binary files. - -Tue Dec 16 19:13:14 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Don't make PKFONTS.xdvi a special case. Let all - programs look in modeless. If a program shouldn't look there, - give it a special PKFONTS line. - -Mon Dec 15 18:58:01 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Add TTFONTS and T42FONTS. - - * Makefile.in (stamp-paths): The regular expression for variables - had to be amended for T42FONTS. - - * tex-file.c (kpse_init_format): Add kpse_truetype_format and - kpse_type42_format. - - * tex-file.h: Add kpse_truetype_format and kpse_type42_format to - kpse_file_format_type. - -Sat Dec 13 11:24:23 1997 Olaf Weber <infovore@xs4all.nl> - - * xputenv.c (xputenv [WIN32]): This system deletes an environment - variable if it is set to "", with consequences for the code that - reclaims the space. From Fabrice Popineau. - -Fri Dec 12 10:44:02 1997 Olaf Weber <infovore@xs4all.nl> - - * acconfig.h: Add HAVE_PROTOTYPES. - - * c-proto.h, c-vararg.h: Test for HAVE_PROTOTYPES. - - * common.ac: Add explicit test for prototypes, instead of relying - on __STDC__. - - * hash.c, hash.h (hash_remove): New function. - - * install.texi: Rewritten passage on font destinations, corrected - reference to Triptrap node in web2c. - - * mktexpk, mktextfm: When mv fails, try cp. Matters on MS-DOS. - - * progname.c (selfdir): Test whether we are a directory, rather - than whether we are not a link or file. - - * texmf.in: Change openout_any to paranoid. - -Tue Dec 9 19:08:04 1997 Olaf Weber <infovore@xs4all.nl> - - * mktexpk: Restored test-and-move, which turns out not to be a - no-op for fonts generated with gsftopk. - -Thu Dec 4 12:53:52 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Add TEXINPUTS.mltex and TEXINPUTS.mllatex. - -Tue Dec 2 12:58:04 1997 Olaf Weber <infovore@xs4all.nl> - - * Makefile.in (distclean): Add stamp-paths. From Sebastian Rahtz - <s.rahtz@elsevier.co.uk>. - - * progname.c (kpse_set_program_name [!HAVE_PROGRAM_INVOCATION_NAME - && !WIN32 && !__DJGPP__]): Remember to set - program_invocation_name. - - * getopt.c: A few changes for WIN32. From Fabrice Popineau. - -Mon Dec 1 19:08:07 1997 Olaf Weber <infovore@xs4all.nl> - - * kpathsea.texi: Updated for absence of alternate TeX suffixes. - - * kpsewhich.c: Don't complain about unkown suffixes: it's all - kpse_tex_format to us. - - * tex-file.c: Remove the interminable list of alternate TeX - suffixes. - - * Makefile.in ($(library).h): Take win32lib.h into account: it - should not be included by this file, as config.h will do so if - needed. - - * progname.c (kpse_set_program_name [WIN32, __DJGPP__]): Changes - from Fabrice Popineau. - - * win32lib.h: New file. From Fabrice Popineau. - - * config.h: Include <kpathsea/win32lib.h> instead of - "../win32/win32-compat.h". From Fabrice Popineau. - - * access.c: Include <kpathsea/config.h>. From Fabrice Popineau. - - * absolute.c (kpse_absolute_p [WIN32]): Filenames starting with \\ - are absolute on this platform. From Fabrice Popineau. - - * tex-glyph.c (try_format): Oops, kpse_format_info[format].suffix - is now a list of strings. - -Sun Nov 30 13:23:54 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in, mktex.opt, mktexdir, mktexdir.opt, mktexlsr, mktexmf, - mktexnam, mktexnam.opt, mktexpk, mktextfm, mktexupd: Add a - MKTEXSCRIPT variable, which is the directory where supporting - scripts are found. Defaults to $TEXMFMAIN/web2c if not defined. - - * Makefile.in, bugs.texi, db.h, install.texi, kpathsea.texi, - kpsewhich.c, proginit.c, tex-file.c, tex-file.h, tex-glyph.c, - tex-make.c, tex-make.h, texmf.in, withenable.ac, mktex.opt, - mktexdir, mktexdir.opt, mktexlsr, mktexmf, mktexnam, mktexnam.opt, - mktexpk, mktextfm, mktexupd: Changes for the great renaming... - -Sat Nov 29 13:10:42 1997 Olaf Weber <infovore@xs4all.nl> - - * The great renaming of the MakeTeX* scripts. - MakeTeXPK -> mktexpk - MakeTeXTFM -> mktextfm - MakeTeXMF -> mktexmf - MakeTeXls-R -> mktexlsr - - MakeTeX.site -> mktex.cnf - MakeTeXcommon -> mktex.opt - MakeTeXmkdir -> mktexdir - MakeTeXmkdir.opt -> mktexdir.opt - MakeTeXnames -> mktexnam - MakeTeXnames.opt -> mktexnam.opt - MakeTeXupdate -> mktexupd - - * Makefile.in (install-exec): Adapted for removal MakeTeX.cnf. - - * MakeTeX.cnf: Removed. - - * MakeTeXcommon: Fold MakeTeX.cnf into MakeTeXcommon. - - * tex-file.c (kpse_init_format): Add kpse_fmt_format add ".efmt" - and ".efm" to additional suffixes. - - * db.c [DB_HASH_SIZE]: From 7603 increased to 15991. - - * tex-file.c: Yet more suffixes for kpse_tex_format. - -Tue Nov 25 18:19:17 1997 Olaf Weber <infovore@xs4all.nl> - - * progname.c (kpse_set_program_name): Ensure that - kpse_program_name doesn't get an .exe suffix. The - program_invocation*name variables retain it. - -Mon Nov 24 22:03:12 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXls-R: When creating the ls-R file from scratch, derive - its permissions from the $db_dir, not from the current dir. - -Sun Nov 23 13:17:16 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Update to use : instead of , in braces. - - * kpathsea.texi: Document use of path separator in brace - expansion, note that the comma is deprecated. - - * path-elt.c (element): Dont split within braces. - - * expand.c (expand_amble): Break text in pieces at ENV_SEP as well - as commas. - -Sat Nov 22 19:35:30 1997 Olaf Weber <infovore@xs4all.nl> - - * tex-file.c: Correction of description "PostScript header/font" - to "PostScript header". - - * db.c (kpse_db_insert): Add cast for const correctness. - - * kpathsea.texi: Document kpse_set_program_name; updates. - - * kpsewhich.c: Many changes to support multiple standard suffixes. - - * progname.c (kpse_set_program_name): Add a few casts for const - correctness. - - * tex-file.c: Many changes to support lists of standard suffixes. - - * tex-file.h: kpse_format_info_type: change type of suffix from - const_string to const_string*. - -Fri Nov 21 15:17:35 1997 Olaf Weber <infovore@xs4all.nl> - - * c-proto.h: Restored AA macro, needed by revised web2c. - -Thu Nov 20 14:23:33 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXPK: Removed a test-and-move that is always a no-op. - - * MakeTeXnames: A shell on FreeBSD didn't like the ${foo:=`bar`} - construct. - -Wed Nov 19 17:24:08 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXls-R, MakeTeXMF, MakeTeXPK: Make temporary names fit into - the 8.3 pattern. After Eli Zaretskii. - - * MakeTeXTFM: Make temporary names fit into the 8.3 pattern. - Allow a second optional argument. Update usage message. After - Eli Zaretskii. - - * MakeTeXcommon: Make temporary names fit into the 8.3 pattern. - Do a 'cd /' before we cd to $KPSE_DOT, for MS-DOS' sake. After - Eli Zaretskii. - - * MakeTeXnames: If $DEST starts with "letter-colon-slash", it - still indicates an absolute path. After Eli Zaretskii. - - * MakeTeXnames.opt: Enable dosnames if we find COMSPEC set in the - environment. This is apparently the canonical test for this kind - of thing. After Eli Zaretskii. - - * Makefile.in: Numerous small changes to make building on MS-DOS - easier. In particular to the rule for texmf.sed. - - * install.texi: Add table headers. After Eli Zaretskii. - - * tex-file.c (kpse_open_file): Open kpse_tex_ps_header_format and - kpse_pict_format files in binary mode. After Eli Zaretskii. - -Tue Nov 18 11:50:35 1997 Olaf Weber <infovore@xs4all.nl> - - * install.texi, README, Makefile.in: Changed the name of CONFIGURE - to README.CONFIGURE. - - * Makefile.in (mostlyclean): delete klibtool.version. - -Sat Nov 15 21:13:46 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXPK: Use quotes to ensure that test "$mf_bdpi" != $BDPI - has a first argument. This occurs only in pathological - circumstances, but is nevertheless annoying. - - * texmf.in: Add TEXINPUTS.foo for omega and lambda. - -Fri Nov 14 16:35:46 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Add TEXINPUTS.foo definitions for e-TeX and PDFTeX. - - * tex-file.h: Add kpse_find_ofm and kpse_find_ovf macros. - - * tex-file.c (kpse_find_file): Add a search for Omega. - -Thu Nov 13 22:43:06 1997 Olaf Weber <infovore@xs4all.nl> - - * progname.c (expand_symlinks): Don't call fclose on a NULL - pointer. After Gary Jennejohn <garyj@peedub.muc.de>. - -Wed Nov 12 16:20:02 1997 Olaf Weber <infovore@xs4all.nl> - - * kpsewhich.c: Use kpse_set_program_name instead of - kpse_set_progname. - - * tex-file.c, cnf.c: Use kpse_program_name instead of - program_invocation_short_name. - - * progname.h (kpse_set_program_name, kpse_reset_program_name): New - functions. - (kpse_program_name): New global. - - * progname.c (kpse_set_program_name): New function, to replace - kpse_set_progname. This fixes the problem the we may want to - pretend to be a different program, but need the name by which we - were called because that is the one for an executable is - guaranteed to exist. The pretend-name is stored in - kpse_program_name. - (kpse_reset_program_name): To reset kpse_program_name to a - different value. It makes a half-hearted attempt to clear the - search path information, so that the new name is used there as - well. - -Mon Nov 10 13:14:01 1997 Olaf Weber <infovore@xs4all.nl> - - * configure.in (KPSEVERSION): version 3.1. - -Thu Nov 6 20:25:49 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.in: Corrected comment on size of max_print_line: it must - at least be 60. - -Tue Nov 4 19:08:37 1997 Olaf Weber <infovore@xs4all.nl> - - * Makefile.in (install-data): Handle a split kpathsea.info. - - * common.ac: Add a test to ensure that autoconf 2.12.1 -- the one - with our own hacks -- is used. - -Wed Oct 29 11:49:46 1997 Olaf Weber <infovore@xs4all.nl> - - * c-fopen.h [!DOSISH]: Guard against redefining O_BINARY. From - Andreas Scherer <andreas.scherer@pobox.com>. - -Mon Oct 27 17:25:19 1997 Olaf Weber <infovore@xs4all.nl> - - * install.texi: Update for new MakeTeX* scripts. - - * MakeTeXnames: Handling of empty namepart. - -Fri Oct 24 14:23:58 1997 Olaf Weber <infovore@xs4all.nl> - - * getopt.[hc]: Changes for WIN32, which are likely to be a pain if - these files are ever updated wholesale. After Fabrice Popineau. - -Thu Oct 23 11:16:26 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXnames: Corrected bug in assignemnt to stdfontpath. - -Wed Oct 22 17:36:57 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXmkdir: Added a bit of boilerplate to the use of - MT_APPEND_MASK. - - * Makefile.in: It's acconfig.h, not c-auto.h, that we do not want - to install. - - * lib.h: Remove kpathsea/config.h from the includes. Note that - lib.h is itself included by config.h. - - * Makefile.in: Change generation of kpathsea.h to put config.h - first. - -Tue Oct 21 23:15:28 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeX.site, MakeTeX.cnf: Remove MT_FILE_PERMS, MT_DIR_PERMS. - - * MakeTeXmkdir: Use kpsestat to obtain suitable directory - permissions. - - * MakeTeXnames, MakeTeXnames.opt: Include code that infers - destination directories from where the sources are found. Make - use of fontmaps an option, move that part of the code to - MakeTeXnames.opt. - - * MakeTeXls-R: Use kpsestat to obtain suitable file permissions; - this means we no longer use unset. Use access rather than test to - determine whether we can write the ls-R database. - - * MakeTeXTFM, MakeTeXMF, MakeTeXPK: Use kpsestat to obtain - suitable file permissions. - - * Makefile.in: Minor changes, because of the new files and - renaming. - - * MakeTeXnames.opt, MakeTeXmkdir.opt: renamed from - MakeTeXnames.cnf and MakeTeXmkdir.cnf respectively. Now - MakeTeX.cnf contains the standard configuration, and MakeTeX.site - the local adjustments. - - * kpsestat.c, access.c: New files. - -Mon Oct 20 07:22:33 1997 Olaf Weber <infovore@xs4all.nl> - - * common.ac, Makefile.in, acconfig.in, config.h, install.texi, - kpathsea.texi: Rename texmf.cnf.in to texmf.in / c-auto.h.in to - - * Renamed texmf.cnf.in to texmf.in. - - * bugs.texi: Add descriptions of GSFTOPK_DEBUG, MAKETEX_DEBUG, and - MAKETEX_FINE_DEBUG. From Fabrice Popineau. - - * c-fopen.h [WIN32]: Use setmode in stead of _setmode. From - Fabrice Popineau. - - * c-pathch.h, absolute.c [NAME_BEGINS_WITH_DEVICE]: Corrected - definition. From Fabrice Popineau. - - * c-proto.h: Cosmetic change in definition DllImport. From - Fabrice Popineau. - - * debug.h [WIN32 && _DEBUG]: Extra debugging code for WIN32. From - Fabrice Popineau. - - * install.texi: Extend description of the dosnames feature. After - Fabrice Popineau. - - * lib.h: Add kpathsea/config.h to the includes. New macro STRNEQ. - From Fabrice Popineau. - - * progname.c (kpse_set_progname [WIN32]): New environment variable - KPSE_DEBUG_OUTPUT. If defined, it names a file to which stderr - will be redirected. From Fabrice Popineau. - - * tex-make.c: Various cosmetic changes for WIN32/MS-DOS. From - Fabrice Popineau. - -Fri Oct 17 10:41:08 1997 Olaf Weber <infovore@xs4all.nl> - - * db.c (kpse_db_insert): Remove dubious cast of result of basename. - - * progname.c (kpse_set_progname [!HAVE_PROGRAM_INVOCATION_NAME]): - Removed dubious cast of basename. - - * tex-file.c (kpse_find_file): Reorganize searches, so that - foo.bar.tex is found before foo.bar. - - * tex-make.c (maketex) [MSDOS]: Redirect stderr to the null device - without using the shell (which requires users to install a port of - a Unixy shell, since stock DOS shells don't allow redirecting - stderr). - (kpse_make_tex) [MSDOS]: Don't use the shell to redirect stderr. - From Eli Zaretskii <eliz@is.elta.co.il>. - - * readable.c (READABLE) [__DJGPP__]: Use `access' instead of - `stat', since `stat' is expensive on MS-DOS. Eli Zaretskii - <eliz@is.elta.co.il>. - - * pathsearch.c (search) [__DJGPP__]: Make `stat' work in the - fastest possible way, since it can be very expensive on MS-DOS. - (main): Use ENV_SEP_STRING instead of explicit ":". - From Eli Zaretskii <eliz@is.elta.co.il>. - - * path-elt.c (main): Use ENV_SEP_STRING instead of explicit ":". - From Eli Zaretskii <eliz@is.elta.co.il>. - - * kpsewhich.c (path_expand): Handle file names with device - letters. - (read_command_line): Use ENV_SEP_STRING instead of explicit ":". - After Eli Zaretskii <eliz@is.elta.co.il>. - - * kdefault.c (main): Use ENV_SEP_STRING instead of explicit ":" - (which is only true on Unix). From Eli Zaretskii - <eliz@is.elta.co.il>. - - * cnf.c (do_line) [__DJGPP__]: Don't convert semi-colons to - colons, even though DJGPP defines `unix'. From Eli Zaretskii - <eliz@is.elta.co.il>. - - * absolute.c (kpse_absolute_p) [DOSISH]: Don't assume the drive - letter is alphanumeric. From Eli Zaretskii <eliz@is.elta.co.il>. - - * xgetcwd.c (xgetcwd) [DOSISH]: Prepend drive letter before path. - From Eli Zaretskii <eliz@is.elta.co.il>. - - * progname.c (kpse_set_progname) [__DJGPP__]: Compute the long - file name of the program given its 8+3 alias. - (kpse_set_progname) Compute SELFAUTOLOC before removing the - ".exe" suffix, if any, because `selfdir' might look along the PATH - for the file. - After Eli Zaretskii <eliz@is.elta.co.il>. - - * config.h (DOSISH): Move the definition to the top, so we could - define MONOCASE_FILENAMES right there. - [__DJGPP__]: Include DJGPP-specific headers. - [DOSISH]: Let DJGPP use ST_NLINK_TRICK, since it supports it. - From Eli Zaretskii <eliz@is.elta.co.il>. - - * lib.h (FILESTRNCASEEQ): New macro, for partial compares of - filenames. From Eli Zaretskii <eliz@is.elta.co.il>. - - * c-fopen.h (FOPEN_RBIN_MODE, FOPEN_WBIN_MODE): Let MS-DOS use - these also. - (FOPEN_ABIN_MODE): New macro, defines how to open a binary file for - appending. - (SET_BINARY): New macro, switches an already open file to binary - mode (required for stdin/stdout on MS-DOS/MS-Windows). - From Eli Zaretskii <eliz@is.elta.co.il>. - - * c-pathch.h (NAME_BEGINS_WITH_DEVICE): Don't assume the drive - letter is A-Z only (DOS allows 6 characters beyond Z). After Eli - Zaretskii <eliz@is.elta.co.il>. - -Thu Oct 16 10:22:42 1997 Olaf Weber <infovore@xs4all.nl> - - * configure.in: Update stamp-auto after creating c-auto.h. From - Peter Breitenlohner. - - * Makefile.in: Don't rewrite paths.h if it was not changed. After - Peter Breitenlohner. - -Wed Oct 15 15:33:43 1997 Olaf Weber <infovore@xs4all.nl> - - * xputenv.c (xputenv): Don't do anything if the old and new values - of the environment variables are identical, because some libraries - (DJGPP) will will optimize away such no-ops, and therefore freeing - the old value will lead to disaster. Free new_item if it was - copied by the library `putenv'. From Eli Zaretskii - <eliz@is.elta.co.il> - - * tex-file.c (kpse_open_file): Open - kpse_{pk,base,fmt,mem,type1}_format files in binary mode. - - * install.texi: Remove description of the feature that (say) - MAKETEXPK in the environment can be used to provide a - specification of the argument list of MakeTeXPK. Reason: the - feature isn't implemented. - -Tue Oct 14 17:08:22 1997 Olaf Weber <infovore@xs4all.nl> - - * xgetcwd.c: Rename DO_NOT_USE_GETCWD to GETCWD_FORKS. - * common.ac: Add a test for GETCWD_FORKS. - * acconfig.h: Include GETCWD_FORKS. - -Mon Oct 13 19:42:58 1997 Olaf Weber <infovore@xs4all.nl> - - * path-elt.c (element): Always return a new string rather than a - part of the path, as the returned string may be modified. - - * tex-file.c (remove_dbonly): Replaced hard-coded ':' with - ENV_SEP. From Fabrice Popineau. - - * common.ac, configure.in: Move definition of KPSEVERSION from - common.ac to configure.in. - - * common.ac: Check for presence of getcwd. - - * xgetcwd.c: Use getcwd in preference to getwd, unless - DO_NOT_USE_GETCWD is defined. - - * MakeTeX.cnf: Made varfonts the default. - - * elt-dirs.c, path-elt.c, tilde.c, variable.c: Print (nil) instead - of (null), so we can distinguish *printf being fed a null pointer. - - * tex-file.c: remove_dbonly: Corrected off-by-one error in - allocation. - -Sat Oct 11 13:48:33 1997 Olaf Weber <infovore@xs4all.nl> - - * elt-dirs.c (main) [TEST, AMIGA]: Changed test code for Amiga. - From Andreas Scherer <Scherer@physik.rwth-aachen.de>. - -Mon Oct 6 16:36:50 1997 Olaf Weber <infovore@xs4all.nl> - - * install.texi: Document --enable-maintainer-mode switch. - -Sat Oct 4 19:27:22 1997 Olaf Weber <infovore@xs4all.nl> - - * MakeTeXnames.cnf: Add "strip" feature for backwards - compatibility with 7.0. - * Use a new set of MakeTeX* scripts, from Thomas Esser. - -Fri Oct 3 09:54:47 1997 Olaf Weber <infovore@xs4all.nl> - - * kpsewhich.c (path_expand): Don't scribble in the datastructures - of the system to get rid of trailing slash, use "%.*s" format of - printf instead. - - * Makefile.in (texmf.sed, paths.h): Take the changes to texmf.cnf.in - into account. - * texmf.cnf.in: Redo variable definitions for the sake of clarity. - - * hash.c (hash_create): Make ret static to work around a gcc - optimizer bug on the Alpha. - - * elt-dirs.c (do_subdir,expand_elt): Cleanup by Greg Hudson - <ghudson@MIT.EDU>, which might fix the '//' in path problem on the - Amiga as well. - - * xrealloc.c: Get prototype for realloc from config.h, give - prototype for xmalloc, prototype xrealloc itself. After Fabrice - Popineau. - - * xmalloc.c: Give xmalloc a prototype, get prototype for malloc - from config.h. After Fabrice Popineau. - - * tex-file.c [TEX_SUFFIXES]: Brought into sync with tex.ch. - - * install.texi: Extend comments on shared library support. - -Thu Oct 2 00:14:57 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.cnf.in [buf_size]: Increased from 3000 to 10000. - - * tex-file.h (enum kpse_src_type): removed trailing comma. From - Ezra Peisach <epeisach@auriga.rose.brandeis.edu>. - - * c-proto.h [AA]: Obsolete due to changes to web2c.y; removed. - - * bugs.texi: Document KPSE_DEBUG_VARS. - * debug.h [KPSE_DEBUG_VARS]: New #define for debugging. From - Nicolai Langfeldt <janl@math.uio.no>. - * variable.c (kpse_var_value): Add code to report how variables - were expanded. From Nicolai Langfeldt <janl@math.uio.no>. - - * progname.c (selfdir) [!AMIGA]: Directories were mistaken for - executables. From Matthias Clasen - <mclasen@sun2.mathematik.uni-freiburg.de> - - * tex-file.c (remove_dbonly): New function that strips the !! from - path specifications. Called when creating the path for - kpse_db_format. From Thomas Esser <te@informatik.uni-hannover.de> - - * install.texi: The default installation directory is not always - /usr/local, as configure will pick the location of an existing tex - installation. - -Wed Oct 1 13:43:18 1997 Olaf Weber <infovore@xs4all.nl> - - * texmf.cnf.in: Various definitions have changed to take advantage - of the new brace expansion code. The various intermediate - variables (fontdir, web2cdir, ...) have been removed because you - could burn yourself severely by accidentally setting these - undocumented variables -- this happened with some versions of make - during compilation. - -Tue Sep 30 16:14:48 1997 Olaf Weber <infovore@xs4all.nl> - - * kpathsea.texi: Document changes in brace expansion. - * expand.c (array_concat): reversed the order concatenation, which - result in more usable brace expansion. - (kpse_expand_kpse_dot): new function. - (kpse_path_expand): call kpse_expand_kpse_dot to expand relative - components using KPSE_DOT, if the latter is defined. - - * common.ac: Define the version string. - * version.c: Replaced version string with a define. - * acconfig.h: Added defines for version strings. - * Makefile.in: Let version = @KPSEVERSION@. - * common.ac: Introduce KPSEVERSION for version. - - * tex-file.c (kpse_maketex_option): choose proper mf and tfm - formats rather than tex. - -Mon Sep 29 22:47:23 1997 Olaf Weber <infovore@xs4all.nl> - - * db.c (match): Repaired several off-by-one bugs. - -Wed Sep 17 21:09:56 1997 Olaf Weber <infovore@xs4all.nl> - - * withenable.ac: Added the --enable-maintainer-mode option. - -Tue Aug 5 17:26:16 1997 Karl Berry <karl@cs.umb.edu> - - * config.h (KPATHSEA): Define for the sake of kpathsea code - getting merged back into original distributions. - -Sun Aug 3 17:14:47 1997 Karl Berry <karl@cs.umb.edu> - - * install.texi: simple.tex doesn't exist in LaTeX 2e; it's sample2e. - From: "Jonathan I. Kamens" <jik@cam.ov.com> and others. - - * db.c (kpse_db_search): Preprocessor # commands must start in - column 1 for DEC OSF/1 2.0 cc. - From: Andrew Komornicki <komornic@maxwell.mps.nsf.gov>. - - * common.ac (program_inv_name): Correct usage of AC_TRY_LINK. - From: "John W. Eaton" <jwe@bevo.che.wisc.edu>. - - * Makefile.in (.SUFFIXES): Put before the .c.lo rule for the sake - of FreeBSD 2.1.7 make. - From: Hiroto Kagotani <kagotani@in.it.okayama-u.ac.jp>. - -Thu Apr 17 17:35:37 1997 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (paths.h): Replace $web2cdir too, - for the sake of DEFAULT_TEXMFCNF. - From: M G Berberich <berberic@forwiss.uni-passau.de>. - -Tue Apr 1 17:48:18 1997 Karl Berry <karl@cs.umb.edu> - - * fontmap.c: Doc fix. - * kpsewhich.c (find_format): Try the long name if the file format - has no suffix, e.g., `dvips config'. - From: "Tomasz J. Cholewo" <tjchol01@mecca.spd.louisville.edu> - -Sun Mar 23 16:44:21 1997 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Don't assert that `name' is empty, - only NULL, so \input\relax doesn't crash. - From: "Tomasz J. Cholewo" <T.Cholewo@ieee.org>. - -Fri Mar 21 16:09:47 1997 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK, MakeTeXcommon: Support a redirect option to MTPK, - from Thomas via Paul V. - - * progname.c (selfdir) [AMIGA]: Fix from Andreas. - -Sun Feb 16 15:49:07 1997 Karl Berry <karl@cs.umb.edu> - - * withenable.ac: `enableval' should have been `withval', - and value must be quoted. - - * MakeTeXTFM: Exit if mf fails, a la MakeTeXPK. - From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>. - -Thu Feb 13 16:08:30 1997 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (latex2*_inputs): Put $dbtex/generic before the - ``other'' latex version. - From: Olaf Weber <Olaf.Weber@cwi.nl>. - - * progname.c (selfdir): Protect against argv0 being dir/exename, - not found in PATH. Happens under Solaris. - From: Ross Alexander <r.alexander@auckland.ac.nz> (and many others). - -Sun Feb 09 15:27:15 1997 Fabrice POPINEAU <popineau@ese-metz.fr> - - * progname.c (kpse_set_progname): Added braces around Win32 code, - because of variables declaration. - -Fri Feb 7 11:53:09 1997 Karl Berry <karl@cs.umb.edu> - - * Version 3.0. - - * MakeTeXMF: Syntax problems with dc*. Fix from Thomas. - - * MakeTeX*: sed command to strip off all but the first of multiple - trees in $TEXMF was faulty. - - * c-pathch.h (ENV_SEP, ENV_SEP_STRING) [AMIGA]: Change to ; - for Andreas. Then Amiga binaries may be able to share - the same texmf.cnf with Unix and NT. - - * texmf.cnf.in (main_memory): Decrease back to 263,000. - It's not worth allocating 7MB on everyone's machine just - to do xy-pic samples. Add a comment about it. - -Thu Feb 6 10:27:50 1997 Karl Berry <karl@cs.umb.edu> - - * db.c (kpse_db_search): If an alias exists on disk, and the - original entry in ls-R doesn't, use the alias. Idea, sample code - from Fabrice. - - * cnf.c (do_line): Add awful kludge to translate ; to : - when reading texmf.cnf values under Unix. The idea is - to be able to write a single texmf.cnf that will work - under both NT and Unix. - - * db.c: Doc fixes. - - * MakeTeXcommon: Set ps_to_pk. - * MakeTeXPK: Use ps_to_pk instead of hardwiring gsftopk. - * MakeTeX.site: Include ps_to_pk comment. - - * texmf.cnf.in (TEXMFCNF): Include SELFAUTOLOC (at the front). - * progname.c (kpse_set_progname): Include SELFAUTOLOC for the real - directory. It may be useful. Suggested by Andreas. - - * MakeTeXcommon: Add case for fc. - * MakeTeX.site: Add comment for fc. - * MakeTeXMF: Add case for fc, generated like Sauter. - From Francois and Thomas. - - * progname.c [WIN32]: SELFAUTODIR fix from Fabrice. - - * kpathsea.h: Do not #include <kpathsea.h> (infinite loop). - From Fabrice and Richard. - -Tue Feb 4 13:20:09 1997 Karl Berry <karl@cs.umb.edu> - - * tilde.c: xstrdup the result from getenv, - since we end up freeing it with a path element of `~'. - - * MakeTeX.site: Include RCS id. - - * MakeTeX.site: Replace sample dc assignment with ec. - - * MakeTeXMF: Handle ec, use exbase for tc. - - * MakeTeXcommon (ecfontdir,tcfontdir): New variables. - -Tue Feb 04 15:11:29 1997 Fabrice POPINEAU <popineau@ese-metz.fr> - - * progname.c: argv[0] under Win95 is set to the short - filename of the executable run. Changed the way - program_invocatio_name is retrieved : used the SearchPath() win32 - call, next FindFirstFile() to get the long filename. The selfdir - stuff is not used any more for win32. - -Mon Feb 3 18:01:02 1997 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (read_command_line): Check for -1, not EOF, - per new getopt. - -Sun Feb 2 16:06:42 1997 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (PKFONTS.xdvi): Replace `gsftopk,ps2pk' by `modeless'. - * MakeTeXPK (mode): Use `modeless' instead of `gsftopk'. - - * tex-file.c: Look for TEXINDEXSTYLE before INDEXSTYLE. - -Sat Feb 1 16:31:39 1997 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in: Doc fix. - - * progname.c (my_dirname): Check for device separators at the - beginning fo the string. From Andreas. - - * c-pathch.h (IS_DIR_SEP) [AMIGA]: New definition from Andreas. - (NAME_BEGINS_WITH_DEVICE): Remove. - - * tex-make.c (maketex) [AMIGA]: Have to call system instead of popen - due to different interface. From Andreas. - - * progname.c (selfdir): Check self, not ret, for exiting the loop. - (remove_dots): Missing indirection on ret. - From Fabrice. - -Tue Jan 21 08:26:17 1997 Karl Berry <karl@cs.umb.edu> - - * elt-dirs.c: Doc fixes. - - * db.c (match): Don't return false just because the path element - ended in /. - Bug from: Richard Walker <Richard.Walker@cs.anu.edu.au>. - - * expand.c (kpse_path_expand): Do variable expansion before - splitting on path elements. - Bug from: Richard Walker <Richard.Walker@cs.anu.edu.au>. - - * tilde.c [TEST]: Function name changed. - From: Richard Walker <Richard.Walker@cs.anu.edu.au>. - - * texmf.cnf.in (MAILCAPLIBDIR): Rename from MAILCAPDIR. - From Ulrik. - -Tue Jan 21 09:34:20 1997 Fabrice POPINEAU <popineau@ese-metz.fr> - - * c-pathch.h: NAME_BEGINS_WITH_DEVICE(string) new macro testing - for the presence of a device name in front of the string. - - * progname.c (remove dots): stop before device name if - present. When building the filename, do not add leading DIR_SEP if - there is a device. - - * pathsearch.c (path_search): avoid searching the whole disk - adapted for win32. - - * db.c: support aliases file along with db files. An alias file is - named with ALIAS_NAME and the hashtable size is - ALIAS_HASH_SIZE. When a name looked for has an alias, the alias is - searched instead of the original name. The format of the aliases - file is "real_name alias_name", one pair per line. Currently only - for WIN32. - -Mon Jan 20 12:01:14 1997 Karl Berry <karl@cs.umb.edu> - - * progname.c: Amiga patch from Andreas. - -Sun Jan 19 14:29:00 1997 Karl Berry <karl@cs.umb.edu> - - * pathsearch.c (path_search): Strip off all but one of leading /'s. - We never want to search the whole disk. - - * progname.c: Expand symlinks off the final filename, not the - directory name. - -Sat Jan 18 14:39:00 1997 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (param_size): Increase to 500 for the chemical - formula macro package. From Thomas. - - * progname.c (expand_symlinks, ReadSymLink, CopyFirst, StripFirst, - StripLast): New functions to expand symbolic links for SELFAUTO*. - Noted by Thomas. - - * texmf.cnf.in (PKFONTS.xdvi): Fix tpyo. - Document that memory changes - (trie_size): Increase to 64000. - -Fri Jan 17 13:08:08 1997 Karl Berry <karl@cs.umb.edu> - - * progname.c (remove_dots): Don't free the constant null string. - From Andreas. - - * texmf.cnf.in (dbfontdir): Change to dbfonts (the commented-out one). - -Thu Jan 16 10:13:19 1997 Karl Berry <karl@cs.umb.edu> - - * cnf.c (kpse_cnf_get): Avoid recursive init, due to new - $TETEXDIR and other variables in default TEXMFCNF value. - - * getopt*, strtol.c: New versions from /gd/gnu/lib. - - * c-std.h (ALLOC_RETURN_TYPE): Only define if we're going to use it. - - * acconfig.h (EDITOR): Oops, %s not +%s. - From: tim@maths.tcd.ie. - - * progname.c (kpse_set_progname): One more my_dirname call - to get the parent and the grandparent in the environment variables. - - * texmf.cnf.in (texdir): Rename from tex, to avoid clash with - TEX used by makempx -- win32 doesn't distinguish case on envvars. - From Fabrice. - (WEB2CDIR): Lowercase, so it doesn't end up in paths.h, just - for cleanliness. - - * progname.c (kpse_set_progname): Pass program_invocation_name - to selfdir instead of progname, just in case we - HAVE_PROGRAM_INVOCATION_NAME and it's something different. - From Fabrice. - - * tex-file.c (kpse_open_file): ocp, ofm and ovf should use - FOPEN_RBIN_MODE. From Fabrice and John Plaice. - - * progname.c [AMIGA]: Fix syntax errors, remove_dots not necessary. - From Andreas Scherer. - - * MakeTeXupdate: MakeTeXls-R isn't in the conf dir anymore, just - in the regular path. - From Thomas. - -Sun Jan 12 17:22:35 1997 Karl Berry <karl@cs.umb.edu> - - * cnf.c (read_all_cnf): Do not test unallocated memory on empty - lines; crashed on Alphas. - - * progname.c (dirname): Rename to my_dirname to avoid clash on Alphas. - -Sat Jan 11 16:28:54 1997 Karl Berry <karl@cs.umb.edu> - - * c-std.h (calloc, malloc, realloc) [!STDC_HEADERS]: Only declare - in this case. - -Tue Jan 7 17:44:01 1997 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK: Doc fix. - - * texmf.cnf.in (KPSE_DOT): Define. - - * c-memstr.h: Doc fix. - -Wed Jan 1 16:58:02 1997 Karl Berry <karl@cs.umb.edu> - - * pathsearch.h (kpse_filename_component): Declare this. - * path-elt.c: Define it. - * progname.c (remove_dots): New function to remove . and .. - filename components. Subsumes slashify, it turns out. - - * Makefile.in (install-exec): Install MakeTeXls-R in $(scriptdir). - -Mon Dec 30 16:22:42 1996 Karl Berry <karl@cs.umb.edu> - - * progname.c (kpse_set_progname): Strip off .exe if present. - - * cnf.c: Doc fix. - - * progname.c (slashify): New function, to translate \ into / for WIN32. - (selfdir): Call it. - - * lib.h (FILE{STR,CHAR}CASEEQ) [MONOCASE_FILENAMES]: Define these, - continuing yesterday's changes. - From Fabrice. - -Sun Dec 29 13:26:09 1996 Karl Berry <karl@cs.umb.edu> - - * db.c (match, elt_in_db), - * elt-dirs.c (cached), - * hash.c (hash_lookup), - * kpsewhich.c (find_format, TRY_SUFFIX), - * tex-file.c, - * cnf.c (do_line): Compare filenames with FILESTRCASEEQ or - FILECHARCASEEQ to support monocase filesystems. - * hash.c (hash) [MONOCASE_FILENAMES]: Transform keys to uppercase. - From Fabrice. - - * basename.c (basename): Consider device separators; - if given 'e:foo.tex', should return 'foo.tex'. - From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>. - - * types.h (boolean): Protect with #ifndef HAVE_BOOLEAN, for NeXT. - From: Raf Schietekat <flexus!rfschtkt@colds.ruca.ua.ac.be> - -Sat Dec 28 07:18:48 1996 Karl Berry <karl@cs.umb.edu> - - * progname.c [AMIGA]: Add code for this case from Andreas S. - -Fri Dec 27 17:38:43 1996 Karl Berry <karl@cs.umb.edu> - - * progname.c (S_IX{USR,GRP,OTH}): Define if not defined, for the NeXT. - From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>. - - * texmf.cnf.in (TEXMFCNF): Rewrite using /.'s etc. From Thomas. - -Sun Dec 15 06:21:22 1996 Karl Berry <karl@cs.umb.edu> - - * common.ac (AC_CHECK_FUNCS): Add getwd. - - * lib.h (xgetcwd): Declare. - * Makefile.in (objects): Add xgetcwd.lo. - * xgetcwd.c: New file from xdvik. - - * texmf.cnf.in (TEXMFCNF): Add $SELFAUTODIR:$SELFAUTOPARENT. - * progname.c (selfdir, dirname, etc.): New functions. - (kpse_set_progname): Set SELFAUTODIR and SELFAUTOPARENT. - -Sat Dec 14 14:41:39 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_src_type): New types kpse_tex{doc,source}_format. - * tex-file.c (TEXDOC_ENVS, TEXSOURCE_ENVS): New envvars. - (kpse_init_format): Handle them. - * texmf.cnf.in (TEXDOCS, TEXSOURCES): New values. - * kpathsea.texi: Document them. - -Fri Dec 13 16:46:00 1996 Karl Berry <karl@cs.umb.edu> - - * expand.h: Doc fix. - -Thu Dec 12 17:25:25 1996 Karl Berry <karl@cs.umb.edu> - - * xputenv.c [WIN32]: Work around putenv ("FOO=") unsetting - FOO under NT. From Fabrice. - -Mon Dec 9 23:27:45 MET 1996 Thomas Esser <te@informatik.uni-hannover.de> - - * kpsewhich.c: add option -show-path to display the search path for a - given file type. - -Mon Dec 9 17:23:32 1996 Karl Berry <karl@cs.umb.edu> - - * readable.c (READABLE): Check !S_ISDIR instead of S_ISREG, - to allow fifo's. - Suggestion from: Krzysio Leszczynski <chris@camk.edu.pl>. - - * tex-file.c (kpse_open_file): Open VF files in binary mode. - From Fabrice. - - * types.h (boolean) [WIN32]: Remove this case, Fabrice - has found another solution. - - * elt-dirs.c (expand_elt): Do not check for a device separator. - From Fabrice. - - * texmf.cnf.in (OTPINPUTS, OCPINPUTS): These use a subdirectory omega/. - From John P. - -Sun Dec 8 17:15:43 1996 Karl Berry <karl@cs.umb.edu> - - * c-proto.h (DllImport): Define here. - * config.h (DllImport): Instead of here. - * kpsewhich.c: Other DllImport changes. - * line.c [WIN32]: Include <malloc.h>. - * tex-file.c: Oops, had FOPEN_RBIN_MODE vs. R reversed. - * tex-make.c (kpse_make_tex_discard_errors): Add Dllimport. - * types.h (boolean): Bizarre WIN32 definition. - From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>. - -Sat Dec 7 22:12:26 MET 1996 Thomas Esser <te@informatik.uni-hannover.de> - - * MakeTeXnames: Ensure that cmr1234 will be mapped to - jknappen/sauter while cmr12 will still be mapped to public/cm. - -Fri Dec 6 15:08:35 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (OFMFONTS, etc.): New definitions for Omega. - * tex-file.h (kpse_file_format_type): Define kpse_ocp_format, etc. - * acconfig.h (MAKE_OMEGA_{OFM,OCP}_BY_DEFAULT): Include these. - * tex-file.c (kpse_init_format): New cases for the Omega types. - (OCP_ENVS, etc.): New environment variable lists. - From: John Plaice <plaice@iad.ift.ulaval.ca>. - - * texmf.cnf.in: Use fonts//<format> consistently, - instead of fonts/<format>. - - * lib.h (itoa): Remove, it seems we don't use this function any more. - * itoa.c: Remove. - * acconfig.h (HAVE_ITOA): Remove this. - * Makefile.in (objects): Remove. - - * cnf.c (do_line): Oops, tested prog after freeing it, - should have tested prog2. - From: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>. - -Tue Dec 3 14:57:52 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (objects): Remove strtol.lo, that's generated by - configure. - From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>. - -Mon Dec 2 09:05:54 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXcommon: Set KPSE_DOT before the trap. From Thomas. - -Tue Dec 3 18:02:08 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de> - - * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost - indepent of $prefix. - -Mon Dec 9 00:28:58 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de> - - * MakeTeXcommon: Use `basename $0` in usage and version messages - for consistency with other programs and scripts. - Also accept -help, -version in addition to --help, --version. - - * MakeTeX{MF,PK,TFM,ls-R,mkdir,names,update}: - Use `basename $0` in usage messages for consistency. - -Tue Dec 3 18:02:08 1996 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de> - - * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost - indepent of $prefix. - -Thu Nov 28 16:33:35 1996 Karl Berry <karl@cs.umb.edu> - - * common.ac (AC_ISC_POSIX): Remove this; it causes warnings from - Autoconf that make no sense, isn't cached, and is probably of - dubious value today. - * configure.in: Move the klibtool stuff to common.ac, so the - program configure.in's can find it. - -Wed Nov 27 14:43:41 1996 Karl Berry <karl@cs.umb.edu> - - * configure.in: Doc fix. - * acconfig.h (HAVE_BASENAME, etc.): #undef these symbols so - Autoheader can replace them; we use a non-standard macro to test - for them, since they're part of the possibly-shared library. - -Mon Nov 25 14:04:42 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (texmf.sed): Replace all $(texmf) with `$TEXMF' - except on the TEXMF line itself. - -Sun Nov 24 10:06:35 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (texmf.sed): Insert missing quote. - (distdir): Use doc instead of listing all the targets (we were - missing unixtex.ftp). - - * kpsewhich.c (read_command_line): Print the integer equivalent of - each format. - -Sat Nov 23 15:38:31 1996 Karl Berry <karl@cs.umb.edu> - - * xt.ac (with_x): Remove spurious ;;. - -Fri Nov 22 18:00:41 1996 Karl Berry <karl@cs.umb.edu> - - * cnf.c (do_line): Let var.prog lines work if we're running prog.exe. - This happens with --enable-shared. - From Ulrik. - -Mon Nov 18 16:10:48 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_troff_font_format): Change to DEFAULT_TRFONTS - to make texmf.cnf.in change. - -Fri Nov 15 14:13:36 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (texmf.sed): Get $TEXMF back into the paths. - Noted by Andreas Scherer. - (distdir): Add klibtool.version to the distribution. - From Ulrik. - (install-exec): Use INSTALL_SCRIPT for scripts. - -Mon Nov 11 16:16:50 1996 Karl Berry <karl@cs.umb.edu> - - * various .c: Print (nil) instead of (null) so we can possibly - detect printf of a null pointer. - -Sun Nov 10 16:22:43 1996 Karl Berry <karl@cs.umb.edu> - - * xt.ac: New file so web2c and xdvi treat --with-x-toolkit uniformly. - From Ulrik. - -Thu Oct 31 15:38:48 1996 Karl Berry <karl@cs.umb.edu> - - * expand.c (kpse_path_expand): Do brace expansion first. - (kpse_brace_expand): Expand each element of the brace expansion, so - {~a,~b} expands. Suggested by Thomas. - -Fri Oct 25 16:51:14 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (install-data): Install an empty dir file if none exists. - (mostlyclean: Remove PROF etc. subdirs here. - -Tue Oct 22 13:56:20 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in ($(library).h): Make the modtime of the file the - same as the latest other .h; otherwise, we think kpathsea always - has to be remade. - -Sun Oct 20 18:06:36 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (distdir): No need to distribute copying.texi. - -Mon Oct 14 11:32:51 1996 Karl Berry <karl@cs.umb.edu> - - * Changes for NT from: Fabrice POPINEAU <popineau@esemetz.ese-metz.fr>. - - * xputenv.c (putenv) [WIN32]: #include <stdlib.h> instead of declaring. - - * tex-file.c (kpse_open_file): Use FOPEN_RBIN_MODE for tfm and gf - formats. - - * xopendir.h [!WIN32]: Conditionalize whole file. - * xopendir.c (xopendir) [!WIN32]: Conditionalize defn. - - * kpsewhich.c (DllImport) [_WIN32]: Define. - (path_sep): Use ENV_SEP_STRING. - - * progname.h, - * lib.h, - * debug.h (kpathsea_debug), - * concatn.h (concatn): Give DllImport kludge. - - * config.h (DOSISH) [WIN32]: #define. - Also include <windows.h>, etc. - - * c-std.h (getenv, popen, pclose) [WIN32]: Conditionalize decls. - * c-fopen.h [WIN32]: Use rb and wb. - * c-limits.h [HAVE_SYS_PARAM_H]: Conditionalize #ifdef. - * common.ac: Check for <sys/param.h> - * c-stat.h [WIN32]: #include <io.h> and #define stat _stat. - -Sat Oct 12 11:10:45 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Include a suffix in what we pass to - kpse_fontmap_lookup. - - * Makefile.in (paths.h): Remove extra $ when replacing $VARFONTS. - -Tue Oct 8 16:40:07 1996 Karl Berry <karl@cs.umb.edu> - - * tex-glyph.c (try_fontmap): Do not return the first alias if it - itself is an alias. Also, if a particular alias succeeds, - return that. - -Sun Oct 6 17:52:58 1996 Karl Berry <karl@cs.umb.edu> - - * version.c: Doc fix. - -Sat Oct 5 17:06:54 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (-must-exist): New option. - (must_exist): New global. - - * Makefile.in (install-data): Call install-info. - * kpathsea.texi, *.texi: Use @url, @email, and @dircategory/@direntry. - -Sat Sep 21 19:02:17 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames.cnf: Doc fix. - - * texmf.cnf.in (latex{2e,209}_inputs): Replace spurious `latex2e'. - (TEXINPUTS.fontinst): New definition, including AFM files. - (MFINPUTS, TFMFONTS, PKFONTS): Use $VARFONTS. - From Thomas. - -Sat Sep 7 16:00:53 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXupdate, - * MakeTeXnames, - * MakeTeXmkdir, - * MakeTeXls-R, - * MakeTeXTFM, - * MakeTeXPK, - * MakeTeXMF (version): Call kpsewhich in MakeTeXcommon, not here. - - * version.c: Doc fix. - - * kpsewhich.c (read_command_line): Improve formatting of --help - message. - -Fri Sep 6 19:16:20 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (read_command_line): Print the bug reporting address. - * version.c (kpse_bug_address): New global. - -Thu Sep 5 19:08:04 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in: Doc fix. - - * configure.in: Include ../acklibtool.m4 here. - * common.ac: Not here. Move calls to kb_*LIBTOOL* functions, too. - -Sun Sep 1 17:34:17 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (.c.lo): Put filename right after $(CC), for Klibtool. - (KPATHSEA_CC): Do not include ALL_CFLAGS here. - (paths.h): Instead of deleting definitions with lowercase variable - names, don't include them in the first place. - -Sat Aug 31 16:15:33 1996 Karl Berry <karl@cs.umb.edu> - - * common.ac: Call kb_KLIBTOOL_REPLACE_FUNCS and kb_PROG_LIBTOOL - instead of the AM_* versions. - Also, include acklibtool.m4 instead of aclibtool.m4. - - * Makefile.in (liblobjs): Change to use @LTLIBOBJS@. - -Sat Aug 17 17:22:18 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (PKFONTS*, GFFONTS): Need another / to match TDS. - -Sat Aug 10 15:46:46 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (TFMFONTS, VFFONTS): Update with trailing // for TDS. - - * MakeTeXupdate, - * MakeTeXnames.cnf, - * MakeTeXnames, - * MakeTeXTFM, - * MakeTeXMF, - * MakeTeXmkdir, - * MakeTeXls-R, - * MakeTeXPK: Change --expand to -expand-var. - - * tex-glyph.c (try_fontmap): Return the real name of the first - alias as the font name. - (kpse_find_glyph): Change call, free string if necessary, etc. - Basic idea from a patch sent by wls@astro.umd.edu. - -Fri Aug 9 15:42:40 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (paths.h): Substitute for dbtex, dbfonts, and prefix. - Also, do not define lowercase variables. - -Thu Aug 8 14:50:29 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (TEXCONFIG, INDEXSTYLE): Use //, just in case there - are subdirectories. From Thomas. - -Tue Aug 6 13:59:03 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (lookup): Handle user_path case. - -Mon Aug 5 17:23:56 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c: Rename -expand to -expand-var, - -path to -expand-path, and add new -path option to specify - explicit path for lookups. - - * tex-file.h (kpse_ist_format): New format. - * tex-file.c (kpse_init_format): Initialize it. - (IST_ENVS): New #define. - * texmf.cnf.in (INDEXSTYLE): Set the default path. - - * tilde.c (kpse_tilde_expand): If $HOME starts with //, only use - one of the slashes. - -Sat Aug 3 17:18:00 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (read_command_line): Change Usage: line to conform. - -Fri Aug 2 11:57:23 1996 Karl Berry <karl@cs.umb.edu> - - * db.c (db_build): Test len > 0 before evaluating len - 1. - From: "Peter Henderson, Syrinx Speech Systems P/L, Tel: (+61-2) - 956-6540" <peterh@syrinx.com.au>. - -Sat Jul 27 14:35:17 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (paths.h): Change target name to - $(kpathsea_dir)/paths.h, for rdepend.make dependency. - - * Makefile.in (liblobjs): New variable, gets @LIBTOOL_LIBOBJS@. - * common.ac (kbAC_LIBTOOL_REPLACE_FUNCS): Use this new macro instead - of AC_REPLACE_FUNCS. - -Fri Jul 26 15:51:55 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (KPATHSEA_CC): Include $(compile). - (.c.lo): Change suffix rule for libtool 0.5. - (install-exec): Use new variables INSTALL_LIBTOOL_*. - -Mon Jul 8 17:21:34 1996 Karl Berry <karl@laurie> - - * unixtex.texi: Rename from obtain.texi. - -Fri Jun 7 19:10:52 1996 K. Berry <kb@cs.umb.edu> - - * common.ac: Include ../kpathsea/withenable.ac. - -Thu Jun 6 16:34:43 1996 K. Berry <kb@cs.umb.edu> - - * Makefile.in (kpsewhich): Use libtool commands etc. instead of - our shared lib stuff. - * common.ac: Replace our shared lib stuff with gm_PROG_LIBTOOL. - * withenable.ac: Remove --enable-shared stuff. - -Sat Jun 1 15:05:42 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeX*: Add RCS info for version strings. - -Thu May 30 13:46:46 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK: Doc fix; we're called with the base font name - (pplr8r), not the user font name (pplr). - - * db.c (ignore_dir_p): Remove the dot_pos != dirname test, - since it's always true. It caused directory names containing .'s - (e.g., `dc-1.2') to be ignored. - From Thomas Esser and Frank Mittelbach. - -Sun May 26 16:06:41 1996 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (kpse_make_tex): If called kpse_init_form, reassign - our local variable, too. - -Thu May 23 16:20:53 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames: Doc fix. - -Fri May 3 13:34:51 1996 Karl Berry <karl@cs.umb.edu> - - * withenable.ac: Use AC_ARG_WITH instead of AC_ARG_ENABLE for - maketex*. - - * tex-file.c (kpse_find_file): Oops, testing for kpse_pk_format - twice, when meant to test for kpse_gf_format. - - * cnf.c (do_line): Allow whitespace in variable values. - - * texmf.cnf.in: Finish adding easier support for !!. From Joachim. - -Wed May 1 16:30:56 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (TEXCONFIG): Take $HOME back out again, we're going - to hardwire a seach for dvipsrc in $HOME. - -Mon Apr 29 14:02:03 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (latex2e_inputs): Use just `latex', not `latex2e'. - From: David Carlisle <carlisle@cs.man.ac.uk>. - (TEXINPUTS, etc.): Also rewrite to make !! support easier to add. - From: Joachim Schrod <schrod@iti.informatik.th-darmstadt.de>. - - * install.texi: Document ksh/ash/Ultrix sh lossage, in favor of - bash/bsh/sh5. - -Sun Apr 28 15:02:55 1996 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (ASM_NEEDS_UNDERSCORE): New define. - From: Peter Breitenlohner <peb@MPPMU.MPG.DE>. - - * Makefile.in (sharedlib_version): Remove unused variable. - -Sat Apr 27 17:15:14 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (hyph_size): Add this. - -Tue Apr 23 07:34:05 1996 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (MIMELIBDIR, MAILCAPDIR): Add these. - (MPXCOMMAND): And these. - - * MakeTeX.site: New file, just an example. - -Mon Apr 22 17:31:27 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames.conf: Rename to MakeTeXnames.cnf. - * MakeTeXnames: Change call. - * Makefile.in (install-exec): Change install. - -Sun Apr 21 12:09:06 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_set_program_enabled, kpse_maketex_option): - Declare new functions. - (kpse_src_type): Define new type. - * tex-file.c (kpse_set_program_enabled): New function, so we can - set this at all the various levels and get the overrides right. - (kpse_maketex_option): Handle MakeTeX options in a common place. - * proginit.c (kpse_init_prog): Call it, and remove the make_tex_pk - argument. - * proginit.h (kpse_init_prog): Likewise. - * kpsewhich.c (parse_options): New options -maketex and -nomaketex, - just calls kpse_maketex_option. - - * Makefile.in ($(library).h): New target, made at dist time. - -Sat Apr 20 17:21:24 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Do not pound the disk on the first - search if we might be trying the second. - -Tue Mar 12 15:21:16 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK: Restore check for mismatched mode and bdpi. From Thomas. - -Sun Mar 10 14:17:14 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames.conf: Rename VARFONTS to VARTEXFONTS. - - * MakeTeXcommon (trap): Oops, cd $KPSE_DOT before testing $STDOUT. - -Sat Mar 9 17:57:02 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXcommon (trap): cd back to KPSE_DOT before removing - TEMPDIR, in case $TMPDIR is relative. Reported by Thomas. - -Fri Mar 8 11:41:22 1996 Karl Berry <karl@cs.umb.edu> - - * db.c (kpse_db_search): Add debug statement with the result of - the match. - - * tex-make.c (kpse_make_tex): Don't look for the arg spec here. - * tex-file.c (init_maketex): Do it here. Check for disbaling in - the config file, too. - - * tex-make.c (misstex): Look for TEXMFOUTPUT in texmf.cnf. - * texmf.cnf.in (TEXMFOUTPUT): Define this. - - * kpathsea.texi (Suppressing warnings): New node to describe TEX_HUSH. - - * tex-file.c (kpse_init_format): Include the numeric value of the - format for use with kpsewhich --format. - - * tex-hush.c: Support `all' to suppress everything. - -Thu Mar 7 11:24:51 1996 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c: Change --program to --progname, for compatibility - with TeX & co. - - * texmf.cnf.in (TEXCONFIG): Remove ~ from default path, for - consistency with everything else. - - * readable.c: Let's call it TEX_HUSH instead of KPSE_NOWARN_PERM, - so we can use it for checksum warnings, too. And for similarity - with xdvi. - * kpathsea.texi: Corresponding change. - * tex-hush.[ch]: New files. - -Wed Feb 28 15:16:32 1996 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (misstex): Let the name missfont.log be configurable. - * texmf.cnf.in (MISSFONT_LOG): Add this definition. - * kpathsea.texi: Document this. - -Sun Feb 25 16:55:35 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c: Reverse order of alias & suffix searches, so we look - for the original TFM name before aliases. - -Sun Feb 18 16:24:50 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (xopenfile): Move this function to here and rename to - kpse_open_file. - * xopenfile.c: Remove this. - * Makefile.in (objects): Remove xopenfile.o. - -Thu Feb 15 12:57:56 1996 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (maketex): Do not print the `kpathsea: Running ...' - message if we're discarding output. - (misstex): Do not log the missing file in missfont.log, either. - -Sat Feb 10 14:59:23 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (sharedlib): Add new command here $(shared_postlink) - so we can make the necessary symlink. - (shared_postlink): New variable - -Fri Feb 9 15:46:55 1996 Karl Berry <karl@cs.umb.edu> - - * withenable.ac (maketex{mf,pk,tfm}-default): Move here from - web2c/withenable.ac. - -Wed Feb 7 16:52:08 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames.conf: Extract this new script from MakeTeXcommon, sigh. - * MakeTeX*: Other updates from Thomas -- - - replace the exec 3>&1 1>&2 by trap/subshell construction. The - 3>&1 may cause the 'open fd bug' with bash. - - ts is a typo. tc are the text companion fonts - - replace >&3 by >$STDOUT where $STDOUT is a filename. Its content is - displayed by the trap command in MTcommon. - - added missing ;; in case/esac - - use : ${VAR=VAL} where possible - - added mt_min_args - - removed psfonts.map parsing (was only needed for ps2pk) - - removed >&2 where redirection stdout->stderr is active anyway - - removed </dev/null where redirection stdin<-/dev/null is active - anyway - - Oops: MakeTeXTFM still used old code: >$TEMPDIR/mtout.$$ - - add line - trap 'test -f $STDOUT && cat $STDOUT; cd /; rm -rf $TEMPDIR; exit 0' 0 1 2 15 - to MakeTeXcommon - - MT_FEATURES now in MakeTeXnames.conf since we need to read it - later than MakeTeXcommon - -Tue Feb 6 17:04:25 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_file_format_type): Add afm and type1 support. - * tex-file.c: Likewise. - (kpse_init_format): In tex_ps_header_format, no longer need to - recognize .pfa and .pfb. - * texmf.cnf.in (AFMFONTS, T1FONTS): Likewise. - * Makefile.in (paths.h): Include 0-9 in the regexp for the sake of - T1FONTS. - -Sat Feb 3 15:45:00 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (DEFS): Move to common.make. - -Mon Jan 29 17:01:44 1996 Karl Berry <karl@cs.umb.edu> - - * MakeTeXls-R: Doc fix. - -Mon Jan 8 17:17:42 1996 Karl Berry <karl@cs.umb.edu> - - * tex-file.c: Doc fix. - - * fontmap.c (MAP_NAME, MAP_HASH_SIZE): Conditionalize these #defines. - -Sun Jan 7 17:38:00 1996 Karl Berry <karl@cs.umb.edu> - - * db.c (DB_HASH_SIZE, DB_NAME): Conditionalize these. - - * MakeTeXcommon (dcfontdir, tsfontdir): Use supplier `jknappen'. - -Mon Jan 1 15:14:42 1996 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (distdir): Don't bother including freedom.texi. - -Fri Dec 29 17:17:08 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in: misc.make is now clean.make. - -Tue Dec 26 14:21:08 1995 Karl Berry <karl@cs.umb.edu> - - * withenable.ac: New file with --enable option extracted from - common.ac, for the top level to include. - - * acconfig.h (MAKE_TEX_PK_BY_DEFAULT): Add this. - - * readable.c (kpse_readable_file): Omit warning if - KPSE_NOREAD_WARN is set to 1. - -Wed Dec 13 14:14:09 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c: Call kpse_init_format when necessary in the - --format case. - -Mon Dec 11 14:42:13 1995 Karl Berry <karl@cs.umb.edu> - - * common.ac: --disable-shared should not act like --enable-shared. - From Ulrik. - -Sun Dec 10 15:35:15 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_mft_format): New format. - * tex-file.c (MFT_ENVS): New variable. - (kpse_init_format): Initialize it. - * texmf.cnf.in (MFTINPUTS): New variable. - -Fri Dec 8 08:54:58 1995 Karl Berry <karl@cs.umb.edu> - - * xopenfile.c: Doc fix. - -Mon Dec 4 17:23:34 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (check): Extra $ missing. - -Sun Dec 3 13:42:54 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (TEX_SUFFIXES): Add .dtx. - -Sun Nov 19 16:19:37 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeX*: Use MakeTeXupdate, mkdir, etc. in $TEXMFCNF_DIR, not - along PATH. From John I. - -Sat Nov 18 17:03:46 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (TEX_SUFFIXES): Add .txi. - -Fri Nov 17 15:12:03 1995 Karl Berry <karl@cs.umb.edu> - - * common.ac (kb_AC_SYS_SHAREDLIB): Add the kb_ prefix. - - * Makefile.in ({un,}install-exec): Use sharedlibname and - staticlibname instead of `basename`. - Also, pass no arguments to $(shared_postinstall); let the Autoconf - macro set this completely. - - * expand.c: Bash code remains under the GPL, per rms. - -Thu Nov 16 16:14:14 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (uninstall-exec): Needs same `basename` treatment as - install-exec. From Ulrik. - - * config.h [AMIGA] (pclose): Must be #defined as 0, not just - empty. From Andreas Scherer. - -Tue Nov 14 14:04:57 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_fallback_resolutions_string): New global. - * tex-file.c: Define it. - (kpse_init_fallback_resolutions): Use it instead of - DEFAULT_FONT_SIZES, if set. - -Mon Nov 13 10:43:11 1995 Kathy Hargreaves <karl@cs.umb.edu> - - * find-suffix.c: Remove spurious + 1. - -Sun Nov 12 13:42:51 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c: Improve warning message if last resort sizes are not - sorted. Suggested by Kathy. - - * texmf.cnf.in (trie_size, main_memory): Doc improvements from Wayne. - -Sat Nov 11 16:58:37 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXnames: Correct too many left quotes. - - * tex-make.c (kpse_make_tex): Initialize the format if necessary. - -Mon Oct 30 16:49:05 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK (GFNAME): Do not assume $cmd produced $GFNAME. From Tim. - - * texmf.cnf.in (trie_size): Increase to 32000 so common language - combinations will require no change. Suggested by Ulrik. - - * MakeTeXls-R: Missing s in sed cmd. - * MakeTeXTFM (TFM_NAME): Should be TFMNAME. - * MakeTeXnames (FONTNAME): Missing `. - * MakeTeXcommon: If the caller requires no args (i.e., - MakeTeXls-R), don't complain if given no. - Missing } in varfonts case. - All from Thomas. - -Sun Oct 22 17:02:25 1995 Karl Berry <karl@cs.umb.edu> - - * c-std.h (hypot): Remove this declaration. It was only needed for - fontutils, and it conflicts under Linux 1.2.10. From Tim Murphy. - -Sat Oct 14 10:55:26 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (EDITOR): Missing %. From Tim Murphy. - -Sat Oct 7 17:44:41 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (install-exec): Use basename to get the real name so - we don't install in $(libdir)/../kpathsea/etc. - From Ulrik. - -Sat Sep 30 12:16:05 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXls-R (db_file_tmp): Replace double slashes with single, - for the sake of NetBSD/FreeBSD. From Thomas. - -Fri Sep 29 11:29:08 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (tex-file.o): CPPFLAGS is now ALL_CPPFLAGS. - -Mon Sep 25 15:05:32 1995 Karl Berry <karl@cs.umb.edu> - - * lib.h (FATAL_PERROR): Avoid using the formal parameter `s' since - cc gets confused with %s. - - * MakeTeXls-R: Include subtleties from Thomas. - * MakeTeXcommon: Rename stickydir to appendonlydir. - -Sun Sep 24 13:15:51 1995 Karl Berry <karl@cs.umb.edu> - - * cnf.c (kpse_cnf_get): Call kpse_init_db here. - * pathsearch.c (search): Instead of here. - - * tex-file.c (init_format): The override path may be null, so use - MAYBE to print it. - - * MakeTeXPK: Don't use unset, as Ultrix sh doesn't support it. - -Sat Sep 23 15:07:12 1995 Karl Berry <karl@cs.umb.edu> - - * common.ac (basename strstr putenv): Use AC_REPLACE_FUNCS instead - of AC_CHECK_FUNCS. Add strtol and strcasecmp from web2c/lib and xdvik. - * Makefile.in (objects): Use @LIBOBJS@ instead of corresponding .o's. - -Fri Sep 22 13:34:51 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (MAKE_TEX_*): #define as 0/1, instead of #undef, - since we now pass this as a default argument to init_maketex. - - * tex-file.c (init_path): Look for environment variables PATH.prog - and PATH_prog before PATH. - -Thu Sep 21 13:53:38 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (USAGE): Avoid bare newline. - - * xfseek.c, xftell.c: Add unprototypification. - - * common.ac (library_cflags): AC_SUBST for this depending on - --enable-shared. - * Makefile.in (shared_cflags, sharedlib_cflags): Rewrite - accordingly, so the shared flags aren't always used. - -Wed Sep 20 17:06:53 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c: Add .ltx, .texi, and .texinfo as alternate suffices - for kpse_tex_format. - -Tue Sep 19 17:12:10 1995 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in: Changes for TDS. - - * MakeTeX*: New scripts from Thomas. - -Sat Sep 16 17:30:46 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c: Do not print extra `kdebug:'s when printing the - alt_suffixes. - - * expand.c: Incorporate brace expansion code from bash. - * texmf.cnf.in (PKFONTS.xdvi): Use it here, and document the - possibility for $TEXMF. - -Thu Sep 14 12:59:17 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_init_format): For any_glyph_format, do not - initialize a suffix. - - * kpsewhich.c (main): Initialize all the formats. - (find_format): psfonts.map => dvips_config_format. - -Tue Sep 12 16:19:44 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeX{MF,TFM}: New scripts from te. - * Makefile.in (install-exec, distdir): Install and dist them. - -Sun Sep 10 15:11:07 1995 Karl Berry <karl@cs.umb.edu> - - * pathsearch.c (search): Doc fix. - - * tex-file.h (kpse_format_info_type): Add alt_suffix member. - * tex-file.c (init_format): Set it for PS headers and picts, and - print it if it exists. - * kpsewhich.c: Use the new alt suffixes and also the regular - suffixes to allow for -format names as well as numbers, and for - file format guessing. - -Sat Sep 9 14:27:48 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK: If the MODE and BDPI don't match, ignore the mode. - Suggested by Thomas. - - * tex-file.[ch] (kpse_font_override_path): Remove this. - (kpse_format_info_type): Replace the `override_p' member with a - general `override_path'. - * proginit.c: Set the override path for both fonts and headers. - - * acconfig.h (NOTOOL): Add this. - -Fri Sep 8 14:52:42 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (HYPERXDVI): Don't need this after all, Autoconf's - default actions are better. - -Thu Sep 7 15:11:17 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (HYPERXDVI): Define this. - -Mon Sep 4 17:14:25 1995 Karl Berry <karl@cs.umb.edu> - - * debug.h (KPSE_LAST_DEBUG): Define this, for use with gsftopk. - - * Makefile.in (objects): Add xopenfile.o. - * xopenfile.c: New file. - * lib.h (xopenfile): Declare it. - -Sat Sep 2 13:49:53 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_file_format): Rename kpse_ps_header_format to - tex_ps_header_format. - * tex-file.c (TEX_PS_HEADER_ENVS): Rename likewise, etc. - * kpsewhich.c (suffixes): Likewise. - * texmf.cnf: Likewise. - - * tex-file.c: Never set must_exist on the first search. Is this - really correct? - -Fri Sep 1 13:24:49 1995 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (maketex): Give perror if the popen fails. - - * db.c (db_dir_list): Keep track of the directories we found db's in. - (kpse_db_search): If no db directories are relevant to this path - elt, return NULL. - * db.h: Doc fix. - * pathsearch.c (path_search): Doc fix. - - * Makefile.in (shared_ext, etc.): Move to common.make. - -Thu Aug 31 14:40:32 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c: Install suffix rewrite from Yves. - - * common.ac: Move AC_SYS_SHAREDLIB etc. here. - - * acconfig.h (ASM_SCALED_FRACTION): Add this. - -Wed Aug 30 17:02:58 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Call kpse_make_tex. - * tex-make.c (kpse_make_tex): Only call set_maketex_mag if we are - doing MakeTeX-PK or GF-ing. - From Greg. - -Tue Aug 29 13:58:59 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (texmf.sed): Depend on paths.make. Should we avoid - creating a new file unless it changes, a la c-auto.h? - - * configure.in: Check for --enable-shared. - -Mon Aug 28 17:50:06 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in: Add sharedlib variables. - -Sun Aug 27 13:27:01 1995 Karl Berry <karl@cs.umb.edu> - - * hash.c (hash_print): New option summary_only, and always print - the summary. Also, output to stderr, not stdout. - * hash.h: Change decl. - - * db.c (kpse_init_db): Oops, have to make it external, so rename - again. - * db.h: Declare it. - * pathsearch.c (search): Call it. - - * cnf.c (read_all_cnf): Rename from read_files. - * db.c (read_all_lsR): Rename from read_all_dbs. - * fontmap.c (read_all_maps): Rename from map_create. - - * tex-file.h (kpse_db_format): Another new type. - * tex-file.c (kpse_init_path): Case for it. - (DB_ENVS): Envvar list. - * texmf.cnf.in (TEXMFDBS): Default path. - * kpsewhich.c (suffix): Add new element. - -Sat Aug 26 14:49:28 1995 Karl Berry <karl@cs.umb.edu> - - * cnf.c (CNF_NAME): #define this. - * tex-file.c (kpse_init_path): Instead of setting the .program - element to texmf.cnf here. - - * db.c (db_insert): Rename to kpse_db_insert. - * db.h: Change decl. - * tex-make.c (maketex): Change call. - - * cnf.c, cnf.h, db.c, db.h, pathsearch.c: Remove references to - kpse_db_dir. - * pathsearch.c (first_search): New static. - (path_search): Do not do ls-R search if first_search. - (search): Do not log if first_search. - - * pathsearch.c (path_search): Don't bother calling elt_in_db -- - the match function in db.c will catch the irrelevant hits. - Pointed out by te. - -Fri Aug 25 14:01:24 1995 Karl Berry <karl@cs.umb.edu> - - * cnf.c (kpse_cnf_get): Look for NAME.PROGRAM before NAME. - (do_line): Save NAME.PROGRAM separately from NAME. - * texmf.cnf.in: Put the usual definitions of TEXINPUTS and PKFONTS - first now, before the .prog variants. - - * fontmap.c: Use ISSPACE instead of just checking for space and tab. - -Thu Aug 24 13:46:19 1995 Karl Berry <karl@cs.umb.edu> - - * lib.h (strstr) [!HAVE_STRSTR]: Declare this. - * Makefile.in (objects): Add strstr.o. - * common.ac (AC_CHECK_FUNCS): Remove memmove; we seem to never use - this. And add strstr. - - * fontmap.c (map_file_parse): Comments at the last % or @c, not at - the first %. Also, implement the include feature. - And thus, don't give up if the map file can't be opened. - (token): New routine, since we can no longer use strtok. - - * tex-file.h (kpse_file_format_type): New format kpse_fontmap_format. - * tex-file.c (kpse_init_format): Initialize it. - (FONTMAP_ENVS): Define it. - * texmf.cnf.in (TEXFONTMAPS): Define the default. - * kpsewhich.c (suffix): Add .map. - -Tue Aug 22 13:28:46 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK.in: No >&/dev/null, source.map is now supplier.map. - - * tex-file.c: Doc fix. - -Mon Aug 21 15:52:42 1995 Karl Berry <karl@cs.umb.edu> - - * c-memstr.h (SYSV): OK, omit this definition in the never-ending - battle to appease the X headers. - From: neal@ctd.comsat.com (Neal Becker). - -Sun Aug 20 12:58:28 1995 Karl Berry <karl@cs.umb.edu> - - * cnf.c (read_files): Concatenate consecutive lines that end in \. - - * types.h (boolean) [__cplusplus]: Don't define true and false for C++. - From: Johannes Sixt <Johannes.Sixt@risc.uni-linz.ac.at>. - - * db.c (db_build): Call absolute_p to determine if the possible - directory really is one. - Also, allow relative names in the ls-R file. - - * kpsewhich.c: New options -path, -separator. - From: David Aspinall <da@dcs.ed.ac.uk>. - - * MakeTeXPK.in: Unset DISPLAY and MFTERM. - From: Yves Arrouye <Yves.Arrouye@imag.fr>. - - * db.c (ignored_dir_p): New function to ignore . directories. - (db_build): Call it, and do the ignoring. Report on how many - directories were ignored. - - * Makefile.in (MakeTeXPK): Remove dcfontdir substitution. - * MakeTeXPK.in: Play redirection games so regular echo's will work. - (dcfontdir): Remove this; it's unused. - From: te@informatik.uni-hannover.de (Thomas Esser). - - * pathsearch.c (path_search): Free more garbage. - From: John Eaton <jwe@che.utexas.edu>. - -Sat Aug 19 12:57:54 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (USAGE): Document -format and -program. - - * tex-make.c (maketex): Give warning if MTPK output a string that - wasn't a filename. From Pierre. - - * kpsewhich.c (read_command_line): Execute -expand right - - * tilde.c (kpse_tilde_expand): If HOME is /, don't start path with //. - From: Andreas Schott <andreas@mpa-garching.mpg.de>. - - * db.c (match): Make /// (or more) like //. - * elt-dirs.c (do_subdir): Likewise. Also, skip over as many - slashes as we found. - - * variable.c (expanding_p, expanding, expansions, expansion_type): - New functions, variables, type. - (expand): Check for recursively expanded variables. - Reported by Nicolai Langfeldt <janl@math.uio.no>. - - * cnf.c (kpse_cnf_get): Free temporary list after extracting the - first element (the one we return). - -Fri Aug 18 17:39:29 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK.in (1270): The guess here should be linohi, not linolo. - From pwa. - - * kpsewhich.c (suffix): Update for new MetaPost stuff. - * tex-file.h: Doc fix. - -Mon Aug 14 17:49:05 1995 Karl Berry <karl@cs.umb.edu> - - * debug.h: Define KPSE_DEBUG, not DEBUG. - * hash.c, hash.h, tex-file.c, elt-dirs.c, dir.c, db.c: Change - #ifdef's accordingly. From John I. - -Sun Aug 13 16:03:51 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_file_format_type): Rename kpse_dvips_headers to - just kpse_ps_headers. xdvik uses this too, now. - * tex-file.c (kpse_init_format, KPSE_DVIPS_HEADER_ENVS): Likewise. - Also, look for the PSHEADERS envvar, not DVIPSHEADERS. - * texmf.cnf.in: Likewise. - -Thu Aug 10 19:31:14 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_init_fallback_resolutions): Complain if sizes - aren't sorted, and ignore offending sizes. - From: Manuel Fahndrich <manuel@CS.Berkeley.EDU>. - -Tue Aug 1 13:53:53 1995 Karl Berry <karl@cs.umb.edu> - - * variable.[ch] (kpse_var_value): Use const_string. - - * texmf.cnf.in (string_vacancies): Decrease to 25000. From Bernd. - (font_max): Add this. From Wayne. - -Mon Jul 31 15:47:01 1995 Karl Berry <karl@cs.umb.edu> - - * db.h (KPSE_DB_DIR): Remove $. - * cnf.c (read_files): Call kpse_var_value instead of kpse_var_expand. - - * tex-file.[ch]: Add mpsupport and troff_font formats. - * texmf.cnf.in: Likewise. - -Sat Jul 29 09:21:44 1995 Karl Berry <karl@cs.umb.edu> - - * variable.h (kpse_var_value): Declare this. - * variable.c (kpse_var_value): New routine. - - * tex-file.c: Check TEXMFINI for pool/fmt/base/mem lookups - -Tue Jul 25 11:22:25 1995 Karl Berry <karl@cs.umb.edu> - - * concatn.c (concatn): Free the intermediate result, not the final - version. - - * texmf.cnf.in (TEXMFLOG): Don't mention this, as we need to log - the finding of the .cnf file itself, thus it must be an - environment variable. - -Sat Jul 22 17:09:58 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (KPSE_{MEM,MP,MPPOOL}_ENVS): Define envvars. - * tex-file.h (kpse_file_format_type): Add kpse_{mem,mp,mppool}_formats. - * texmf.cnf.in (MPPOOL, MPMEMS, MPINPUTS): New variables. - Adapted from: vieth@xerxes.thphy.uni-duesseldorf.de (Ulrik Vieth). - -Fri Jul 21 15:26:42 1995 Karl Berry <karl@cs.umb.edu> - - * *.c, *.h: The FSF has a new address. - - * kpsewhich.c: Give error if no args. - -Wed Jul 19 17:34:26 1995 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in: Document limits on error_line et al. - -Mon Jul 17 13:09:05 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (NO_FMTBASE_SHARE): Rename to NO_DUMP_SHARE. - -Sun Jul 16 14:17:16 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (IPC, FUNNY_CORE_DUMP, NO_FMTBASE_SHARE): Include these. - -Sat Jul 15 12:45:51 1995 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (HAVE_ITOA): Remove extraneous #define. - - * texmf.cnf.in (hash_extra): New TeX array variable, 0 by default. - - * tex-file.c (KPSE_BIB_ENVS): Include TEXBIB. - -Thu Jul 13 15:04:52 1995 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (TEXPOOL, MFPOOL): Include . after all, now that we - use TEXPOOL to search for tcx files. - -Sun Jul 9 15:30:59 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Don't go through the - mapped_name_list if it's null. - -Wed Jun 21 19:47:33 1995 Karl Berry <karl@cs.umb.edu> - - * lib.h (FATAL5): Define this. - -Sat Jun 10 15:52:41 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Use texfonts.map aliases for TFM - searches. - * tex-file.h: Doc fix. - * fontmap.c (kpse_fontmap_lookup): New name. Fault in the map - table as needed, instead of initializing. Make map_create static. - * fontname.h: New name; remove map_create. - * tex-glyph.c (try_fontmap): Just call kpse_fontmap_lookup, no - need to create it. - - * fontmap.c (map_lookup): Don't let return value fall off the end - in the suffix-appending case. - From: "Heading, Anthony" <heading_anthony@jpmorgan.com>. - -Fri Jun 9 19:11:34 1995 Karl Berry <karl@cs.umb.edu> - - * tilde.c: Only assume PWD_H for looking up ~user, not for ~ or ~/. - * make-suffix.c: Use IS_DIR_SEP instead of assuming /. - * concatn.c: Free the in-between concatenations to avoid garbage. - * absolute.c [OS2]: Use same conventions as for DOS. - * c-std.h, c-pathch.h, c-fopen.h: Likewise. - From: rs@purple.in-ulm.de (Ralph Schleicher). - -Tue Jun 6 13:11:46 1995 Karl Berry <karl@cs.umb.edu> - - * lib.h (itoa) [!HAVE_ITOA]: Define conditionally. - * itoa.c: Likewise. - * acconfig.h (HAVE_ITOA): Add this. - - * c-pathch.h, c-fopen.h [DOS]: Changes from web2pc from Wayne. - - * xputenv.c: Doc fix. - - * truncate.c (kpse_truncate_filename): Check for a device separator. - - * elt-dirs.c (main): Tests for Amiga. - -Mon Jun 5 13:12:10 1995 Karl Berry <karl@cs.umb.edu> - - * absolute.c: Add Amiga support. From Andreas Scherer. - * c-pathch.h: Ditto. - * elt-dirs.c (dir_list_add): Ditto. Check for device separators, too. - -Sun Jun 4 11:29:18 1995 Karl Berry <karl@cs.umb.edu> - - * c-proto.h (AA): New macro to throw away (or keep) any number of - arguments, used with an extra set of parens. - - * Makefile.in (distdir): Put PROJECTS in the distribution. - -Sat Jun 3 11:53:45 1995 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (main_memory): Add definitions for TeX array sizes. - - * config.h (progname.h): Include this. - * prog{init,name}.c, kpsewhich.c: No longer need to include it. - * lib.h (START_FATAL, FATAL_PERROR): Use program_invocation_name - in the error message. - - * variable.h: Doc fix. - -Fri Jun 2 13:41:29 1995 Karl Berry <karl@cs.umb.edu> - - * config.h (DOSISH) [DOS || OS2]: Define this. - -Tue May 30 15:43:56 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Don't look for foo.sty.tex before - foo.sty. Suggested by worsch@ira.uka.de. - -Mon May 29 15:24:38 1995 Karl Berry <karl@cs.umb.edu> - - * db.c (db_insert): If DOS, don't check that first character on a - line IS_DIR_SEP. From Sebastian. - -Sat May 27 13:51:47 1995 Karl Berry <karl@cs.umb.edu> - - * pathsearch.c (log_search): Cast time_t arg to avoid printf warning. - - * lib.h (atou): Declare it. - * Makefile.in (objects): Add atou.o. - * atou.c: New file. - -Sun May 21 10:58:31 1995 Karl Berry <karl@cs.umb.edu> - - * xfopen.c: Assert non-null filenames. - -Mon May 15 17:40:27 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (USAGE): Add one-line description to the help message. - -Sun Apr 16 14:25:06 1995 Karl Berry <karl@cs.umb.edu> - - * line.c (BLOCK_SIZE): Increase to 56, to avoid realloc's. - -Fri Apr 14 15:56:13 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (objects): Add xfseek and xftell, from fontutils. - -Mon Mar 13 20:05:02 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK.in: Don't egrep in a file that doesn't exist. - -Fri Mar 10 10:49:28 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_find_file): Abort if the name passed in is null - or empty. - -Thu Mar 9 15:23:07 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_init_format): Only do suffix searches for GF files. - - * acconfig.h: Warn that this is not the right thing to edit to fix - configuration problems. - -Thu Mar 2 15:58:11 1995 Karl Berry <karl@cs.umb.edu> - - * texmf.cnf.in (TEXFORMATS): Doc fix. - -Fri Feb 24 16:40:23 1995 Karl Berry <karl@cs.umb.edu> - - * MakeTeXPK.in: `generate rootname' with no trailing punctuation - for the dc fonts. - -Mon Feb 20 15:23:05 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_find_mf): New abbreviation. - -Sat Feb 11 13:06:23 1995 Karl Berry <karl@cs.umb.edu> - - * putenv.c: Include c-auto.h instead of kpathsea/c-auto.h, so the - sed commands don't transform it into - $(kpathsea_srcdir)/c-auto.h. From Andreas. - - * tex-make.c (maketex): Don't make a bad return from pclose a - fatal error. Reported most recently by Wayne Sullivan, also by - Andy Piper in the past. - - * MakeTeXPK.in (sauterdir): Only try this if we have the right - b-foo.mf file. And correct $DESTDIR=... mistake. - From Nick Cropper <nickc@dcs.st-andrews.ac.uk>. - -Fri Feb 10 15:49:49 1995 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (INIT_MT): If the .program member has already been - set, don't reset it. - -Wed Jan 18 15:47:07 1995 Karl Berry <karl@cs.umb.edu> - - * xopendir.c (xclosedir): Use CLOSEDIR_VOID, not VOID_CLOSEDIR. - From tim@maths.tcd.ie. - - * db.c (db_insert): Don't assert db.size>0, since we may not have - called kpse_db_search. From te@informatik.uni-hannover.de. - - * MakeTeXPK.in (dc fonts): Don't put a trailing period in the - filename. From Tor Lillqvist <tml@hemuli.tte.vtt.fi>. - -Sun Jan 8 12:14:47 1995 Karl Berry <karl@cs.umb.edu> - - * Version 2.6. - -Wed Jan 4 14:44:34 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (mostlyclean): Remove kpsewhich. - -Tue Jan 3 11:48:40 1995 Karl Berry <karl@cs.umb.edu> - - * kpsewhich.c (long_options): Can't make this automatic. - - * basename.c: Include <kpathsea/config.h> before testing - HAVE_BASENAME. - - * Makefile.in (kpsewhich): Make the library before kpsewhich.o. - (paths.h): No need for the $(kpathsea_dir)/ any more, now make - depend gets rid of it. - - * rm-suffix.c: Doc fix. - - * kpsewhich.c: Extract the dpi from the filename if possible. - -Mon Jan 2 09:45:17 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (kpsexpand): Replace with kpsewhich. - - * proginit.h: Doc fix. - - * texmf.cnf.in (TEXMFCNF): Rename from TEXMF_CNF. - * tex-file.c (kpse_init_format): Likewise. - -Sun Jan 1 14:04:41 1995 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (MakeTeXPK): Substitute for web2cdir. - * MakeTeXPK.in: Use it for MakeTeXPK.site. - (install-data): Install texmf.cnf in web2cdir instead of texmf. - * texmf.cnf.in (TEXMF_CNF): Default path includes web2cdir. - -Sat Dec 31 14:26:48 1994 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (objects): No more @LIBOBJS@. - * common.ac: Use AC_CHECK_FUNCS for basename, not REPLACE_FUNCS. - The latter doesn't define HAVE_BASENAME. - * basename.c [!HAVE_BASENAME]: Conditionalize whole file. - - * Makefile.in (uninstall-exec): Remove kpsexpand. - (MakeTeXPK): New target. - (install-exec): Install MTPK. - (install-library): New target to replace install-headers. - (install): Don't install-library by default. - -Fri Dec 30 15:53:04 1994 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (objects): Don't put @LIBOBJS@ on a line by itself. - From Joachim. - -Mon Dec 26 07:55:40 1994 Karl Berry <karl@cs.umb.edu> - - * common.ac (AC_FUNC_CLOSEDIR_VOID): Call this. Reported by - Timothy Murphy <tim@maths.tcd.ie>. - - * tex-file.c (init_path): If a variable is set to an empty value, - ignore it. Suggested by Stephen Gildea <gildea@x.org>. - - * proginit.c: If passed a NULL mode, put / in the environment here. - * tex-make.c (kpse_make_tex): Don't do STREQ on NULL (though it - should never be NULL in the first place), and properly restore - MAKETEX_MODE if it was /. - -Tue Dec 20 09:57:21 1994 Karl Berry <karl@cs.umb.edu> - - * install.texi: Mention how to do optimization. - -Mon Dec 19 13:18:04 1994 Karl Berry <karl@cs.umb.edu> - - * tex-file.h: Doc fix. - -Wed Dec 14 14:46:47 1994 Karl Berry <karl@cs.umb.edu> - - * Version 2.5. - - * pathsearch.c (log_search): Don't prepend the `kdebug:' to the - search result. - -Sat Dec 10 16:49:12 1994 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (set_maketex_mag): Make case of magstep -1 work - properly. From a bug report by - heiko@lotte.sax.de (Heiko Schlittermann). - -Mon Dec 5 11:58:08 1994 Karl Berry <karl@cs.umb.edu> - - * Makefile.in (objects): Add @LIBOBJS@. - * common.ac: Check for basename. - - * db.c (db_insert): Include trailing / in directory part, and pass - the key and the value in the right order. From - te@informatik.uni-hannover.de. - -Sun Dec 4 14:26:44 1994 Karl Berry <karl@cs.umb.edu> - - * kpsexpand.c: Add extra filename argument. From - ware@cis.ohio-state.edu. - - * common.ac: Use AC_TRY_RUN to test for SMART_PUTENV, not - AC_TRY_LINK. From parkes@sierravista.com. - - * acconfig.h: Use #undef instead of commented-out `/* #define'. - -Sun Nov 27 13:47:06 1994 Karl Berry <karl@cs.umb.edu> - - * db.c (db_insert): Don't try to insert into an empty hash table. - From dc@cobi.gsfc.nasa.gov (and others). - - * pathsearch.c (log_search): Call DEBUGF, not printf, for the - filenames. From John I. - - * tex-make.c (kpse_make_tex): If MAKETEX_MODE is /, unset it and - reset it around the command expansion. - (maketex): Back to calling db_insert. - -Sat Nov 26 11:44:09 1994 Karl Berry <karl@cs.umb.edu> - - * cnf.c (read_file): If expansion of $TEXMF (KPSE_DB_DIR) fails, - expand DEFAULT_TEXMF. From te@informatik.uni-hannover.de. - -Thu Nov 24 13:41:15 1994 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (KPSE_BST_ENVS): Do not look at TEXINPUTS. - - * tex-file.h: Doc fix. - -Tue Nov 15 14:06:56 1994 Karl Berry <karl@cs.umb.edu> - - * progname.c (kpse_set_progname): Use basename. - -Fri Nov 11 19:12:23 1994 Karl Berry <karl@cs.umb.edu> - - * acconfig.h (HAVE_SIGIO): Add this. - -Tue Nov 8 19:14:12 1994 Karl Berry <karl@cs.umb.edu> - - * tex-make.c (kpse_make_tex): Change argument name from - `basename', since now we have a fn by that name. - * magstep.c (kpse_magstep_fix): Initialize mdpi. - * basename.c (basename): Initalize base. - -Mon Nov 7 15:46:21 1994 Karl Berry <karl@cs.umb.edu> - - * common.ac: Run autoupdate. - * c-dir.h: Change #if names and NLENGTH to new style. - -Fri Oct 28 21:28:02 1994 K. Berry (karl@terminus.cs.umb.edu) - - * Version 2.4. - - * tex-make.c (maketex): Don't call db_insert, that routine is - buggy. I'll fix it later. In the meantime, trying to get a - semi-stable release. - -Tue Oct 25 16:43:31 1994 Karl Berry <karl@cs.umb.edu> - - * Version 2.3. - - * progname.c (kpse_set_progname): Initialize kpathsea_debug from - the KPATHSEA_DEBUG envvar. From neal@ctd.comsat.com. - -Mon Oct 24 13:41:24 1994 Karl Berry <karl@cs.umb.edu> - - * db.c (db_insert): New function. - * db.h: Declare it. - * tex-make.c (maketex): db_insert the result if we succeeded. - - * basename.c: New file to define basename. - * lib.h (basename): Declare it. - * Makefile.in (objects): Include basename.o. - - * tex-file.h (kpse_file_format_type): Add missing enum values for - base/fmt/pool files. - * tex-file.c (kpse_init_format): Add cases for these. - From te@informatik.uni-hannover.de. - - * lib.h (WARNING, FATAL): Use fputs instead of fprintf. - * Many files: Use DEBUGF instead of printf ("kdebug". - * debug.h (DEBUGF) [DEBUG]: Define this. - - * xputenv.c (xputenv): Initialize that static saved_env_items to - null, just for documentation's sake. - -Tue Oct 18 13:19:06 1994 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (KPSE_*_ENVS): Move environment variable list here. - * tex-file.h: Move them from here. - - * tex-glyph.h: Doc fix. - - * tex-file.c (kpse_find_file): Correct off-by-one in suffix - comparison. From toy@rtp.ericsson.se. - -Mon Oct 17 14:01:02 1994 Karl Berry <karl@cs.umb.edu> - - * elt-dirs.c (do_subdir): Find a top-level subdir if it matches - the POST. - - * db.c (kpse_db_search): Allow for the passed name including a - directory part, as in dpi600/cmr10.pk. - * tex-glyph.c (try_format): First search all specs with - must_exist=false. - - * kpsexpand.c: New file, from te@informatik.uni-hannover.de. - * Makefile.in (kpsexpand): New target (a program). - (install-exec): Depend on, and install, kpsexpand. - - * common.ac: Doc fix. - - * cnf.c (do_line): Don't quit just because the variable is in the - environment. From te@informatik.uni-hannover.de. - - * tex-glyph.c (PXL_BITMAP_SPEC): Remove this, we're not going to - support pxl1500. - -Sun Oct 16 20:46:26 1994 Karl Berry <karl@cs.umb.edu> - - * kpathsea.texi: Make it clear that names of debugging bits can - never be used. - -Fri Oct 14 10:31:35 1994 Karl Berry <karl@cs.umb.edu> - - * Version 2.2. - - * hash.c (hash_lookup) [DEBUG]: Cast to long, not int. - -Thu Oct 13 15:39:34 1994 Karl Berry <karl@owl> - - * db.c (db_build): Warn if ls-R contains nothing useful. - - * debug.c (fopen, fclose) [DEBUG]: fflush stdout. - * dir.c (dir_links), - * hash.c (hash_lookup), - * tex-file.c (kpse_init_format), - * elt-dirs.c (kpse_element_dirs): Likewise. - -Thu Oct 13 09:02:56 1994 Karl Berry <karl@cs.umb.edu> - - * hash.c (kpse_debug_hash_lookup_int) [DEBUG]: New global. - (hash_lookup): Use it. - * hash.h [DEBUG]: Declare it. - * dir.c (dir_links) [DEBUG]: Set it and reset it. - - * tex-glyph.c (PXL_BITMAP_SPEC): Add this (pxlNNN/cmr10.pk) for - the Bitstream utilities. From abrahams@acm.org. - (try_format): Search for this. - -Tue Oct 11 15:15:49 1994 Karl Berry <karl@cs.umb.edu> - - * db.c (db_build): Use kpse_db_dir instead of KPSE_DB_DIR. This - avoids one variable expansion, and te@informatik.uni-hannover.de - says otherwise TeX sometimes can't find ls-R. - -Sun Oct 9 17:18:23 1994 Karl Berry <karl@cs.umb.edu> - - * kdefault.c: Rename from default.c. - * Makefile.in (objects): Likewise. - -Fri Oct 7 12:58:33 1994 Karl Berry <karl@cs.umb.edu> - - * tex-file.c (kpse_init_format): Call INIT_MT for the any_glyph - case. From carson@lehman.com. - -Sun Oct 2 14:11:20 1994 Karl Berry <karl@cs.umb.edu> - - * magstep.c: Doc fix. - -Sun Sep 25 17:11:40 1994 Karl Berry <karl@cs.umb.edu> - - * Makefile.in: Include library.make. - -Thu Sep 22 15:34:40 1994 Karl Berry <karl@cs.umb.edu> - - * tex-file.h (kpse_file_format_type): Don't make equal to the last - element index, make one more. From Eric Auborg. - -Thu Sep 15 19:24:30 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (distdir): Include install.texi in the distribution. - -Mon Sep 12 11:05:18 1994 Karl Berry (karl@cs.umb.edu) - - * Version 2.1. - -Sun Sep 11 15:03:18 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (install-data): Install texmf.cnf if it didn't exist. - -Sat Sep 10 13:28:29 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (texmf.sed, paths.h): Use tr 012 instead of \n. - From John Interrante. - - * Makefile.in (distdir): Include the .aux and .cps files in the - distribution. Don't include paths.h (from John Interrante). - - * kpathsea.texi: Fix overfull boxes and other TeX errors. - -Wed Sep 7 16:28:37 1994 Karl Berry (karl@cs.umb.edu) - - * Version 2.0. - -Tue Sep 6 10:33:18 1994 Karl Berry (karl@cs.umb.edu) - - * dir.c (dir_links): Use %ld for ret, since it's now a long. - -Sat Sep 3 09:01:25 1994 Karl Berry (karl@cs.umb.edu) - - * dir.c (dir_links): Use long instead of int for the cast and the - variable, to avoid warnings on the Alpha. - - * c-std.h (SYSV, X_NOT_STDC_ENV): Don't define these here. - * c-memstr.h (SYSV): Define this. - (_XFUNCS_H_): And this. - - * Makefile.in (distclean): Add texmf.cnf and texmf.sed. - -Thu Sep 1 14:22:48 1994 Karl Berry (karl@cs.umb.edu) - - * xputenv.c (putenv): Declare this to avoid a warning. - * xstat.c (lstat): And this. - - * common.ac (SMART_PUTENV): Use program to test for this. From - mike@cs.utah.edu. - - * tex-glyph.c (try_fallback_resolutions): Quit early if there's no - resolutions in the list. From sanjoy@dope.caltech.edu. - -Tue Aug 30 14:26:48 1994 Karl Berry (karl@cs.umb.edu) - - * acconfig.h (FOIL_X_WCHAR_T): New definition. - - * c-std.h (hypot) [!hypot]: Conditionalize declaration. - -Fri Aug 26 09:00:24 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (install-data): Install headers into - $(includedir)/kpathsea, not just $(includedir). From john@wpi.edu. - - * pathsearch.c (search): Show results of the search as well as the - start of it. - -Thu Aug 25 13:40:29 1994 Karl Berry (karl@cs.umb.edu) - - * proginit.c (kpse_init_prog): Newline at end of fputs. - - * pathsearch.c (search): Add debug statement. - * debug.h (KPSE_DEBUG_SEARCH): New bit. - - * tex-file.h (kpse_format_info_type): Rename `font_override_p' from - `font_p'. Also `program_enabled' => `program_enabled_p'. - Also new member `suffix_search_only'. - * tex-file.c (kpse_find_file): Avoid searching for foo.tex.tex, etc. - -Tue Aug 16 09:29:59 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (maketex): Announce that we are running the script - before running it. - -Mon Aug 15 11:18:19 1994 Karl Berry (karl@cs.umb.edu) - - * texmf.cnf.in (PKFONTS.xdvi): Write program-specific definition - to include gsftopk and ps2pk ``modes''. - -Sat Aug 13 16:34:43 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (lib): Rename to program to simplify rules. - - * magstep.h: Doc fix. - - * common.ac (AC_HAVE_FUNCS): Test for bcopy. - -Tue Aug 9 14:18:56 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (misstex): Prepend kpathsea: to the missfont.log - message. - -Mon Aug 8 17:53:58 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (set_maketex_mag): Rewrite to call kpse_magstep_fix. - * magstep.[ch]: New files. - -Fri Aug 5 14:07:51 1994 Karl Berry (karl@cs.umb.edu) - - * db.c (match): Allow a trailing component in the filename. - -Tue Aug 2 08:55:21 1994 Karl Berry (karl@cs.umb.edu) - - * Change `debug:' to `kdebug:'. - * hash.c (hash_lookup): Print results of lookup if DEBUG_HASH. - * debug.h (KPSE_DEBUG_HASH): New bit, replacing DB_BUILD. - * db.c (db_build): Don't print the built hash table. - - * db.c (match): Implement this. Petr Sojka and Zdenek Salvet(?) - supplied code for this, but I wound up writing my own. - * variable.c (expand): Do variable expansion on the value. - - * texmf.cnf.in (TEXINPUTS): Put this after the .prog-specific entries. - - * tex-file.c (kpse_pict_format): Remember to break after setting - the type. - (EXPAND_DEFAULT, init_path): Keep raw_path as pre-default expansion. - -Sun Jul 31 14:18:09 1994 Karl Berry (karl@cs.umb.edu) - - * debug.c: Don't include debug.h, it's already in debug.h. - - * Makefile.in (db.o,pathsearch.o): Don't need these special cases - since tossed db_dir from paths.make. - * db.h (DB_DIR): Change default to $TEXMF, rename to KPSE_DB_DIR. - (kpse_db_dir): New global variable (sigh). - * db.c (kpse_db_dir): Define. - * cnf.c: Include db.h for KPSE_DB_DIR. - (read_files): Set kpse_db_dir after all have been read. - * pathsearch.c (elt_in_db): Check if kpse_db_dir is null. - (path_search): Do not initialize db_dir. - -Sat Jul 30 06:12:12 1994 Karl Berry (karl@cs.umb.edu) - - * c-dir.h [_POSIX_VERSION]: Remove this condition; just use DIRENT. - -Fri Jul 29 11:36:25 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c (init_path): Look up cnf file value if no suffix. - - * xstat.h (SAME_FILE_P): Move here. - * c-stat.h (SAME_FILE_P): From here. - * file-p.c: Change include. - * lib.h (dir_p, dir_links): Declare here. - * dir.h: Split into xopendir.h and c-dir.h; Sun 3 include files - get confused otherwise, according to john@minster.york.ac.uk. - * xopendir.c: Include xopendir.h. - * elt-dirs.c, dir.c: Change includes. - -Sun Jul 17 10:21:16 1994 Karl Berry (karl@cs.umb.edu) - - * hash.c (hash_insert): Put new elements in at the end of the - list, instead of the beginning. - * hash.h: Document this. - - * texmf.cnf.in (TEXMFROOT): Change to TEXMF. - * kpathsea.texi: Likewise. - - * cnf.c (do_line): assert program_invocation_short_name. - * progname.c: Doc fix. - - * absolute.[ch] (kpse_absolute_p): Take additional arg relative_ok. - * pathsearch.c (log_search): Call it (with false). - * tex-glyph.c: Change call. - - * pathsearch.c (path_search): Initialize db_dir here. - (elt_in_db): Not here. - -Fri Jul 15 11:44:15 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.h: Doc fix. - - * pathsearch.c (log_search): Pass in the whole str_list; anything - else is unreliable. - - * proginit.[ch] (kpse_init_prog): Don't pass in argv0; we need it - earlier. - -Tue Jul 12 11:56:54 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c (init_path): Use the first envvar that's *set*, not - the first in the list. - - * tex-file.h (kpse_format_info_type): New member `type'. - * tex-file.c (kpse_init_format): Initialize it. - - * pathsearch.c (log_search): New fn. - (search): Call it. - -Fri Jul 1 11:54:29 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c: Doc fix. - -Mon Jun 27 10:18:59 1994 Karl Berry (karl@cs.umb.edu) - - * db.c (db_build): Call kpse_var_expand on the db filename. - * pathsearch.c (elt_in_db): Likewise. - - * tex-glyph.h (kpse_find_gf): By analogy with kpse_find_pk. - -Sat Jun 25 16:09:05 1994 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (try_format): Try both Unix and DOS bitmap specs, - instead of just one or the other. - (bitmap_name): No longer needed. - -Fri Jun 24 11:52:32 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c (kpse_find_file): Don't try the suffix if it doesn't - exist. - - * tex-file.h (kpse_find_{dvips_header,pict}): New definition. - -Thu Jun 23 16:57:58 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.h (kpse_{pict,dvips_header}_format): New consts. - (KPSE_{PICT,DVIPS_HEADER}_ENVS): Likewise. - -Tue Jun 21 11:53:09 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c (kpse_find_file): Try the name as given if the name - concatenated with the suffix fails, for the sake of, e.g., EPS files. - - * tex-file.h (kpse_find_tex): New definition. - - * absolute.[ch]: Make arg const. - - * tex-glyph.[ch]: (kpse_bitmap_tolerance): Move here from tex-make. - - * c-proto.h (P6[CH]): New definitions. - - * Makefile.in (objects): Add proginit.o. - * proginit.[ch]: New files. - -Mon Jun 20 14:55:57 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.c (kpse_init_format): Make override path not apply to - TFM and VF files. - - * tex-glyph.c (kpse_find_glyph_format): Rename to kpse_find_glyph, - and don't call MakeTeXPK if the filename is absolute. - * tex-glyph.h: Likewise. - -Sun Jun 19 11:00:50 1994 Karl Berry (karl@cs.umb.edu) - - * common.ac (HAVE_PROGRAM_INVOCATION_NAME): Test for this. - * acconfig.h: #undef this by default. - * progname.[ch]: New files. - * Makefile.in (objects): Add progname.o. - * cnf.c (do_line): Check for .<progname> qualification. - -Sat Jun 18 16:55:36 1994 Karl Berry (karl@cs.umb.edu) - - * elt-dirs.c (kpse_element_dirs): Avoid stats in leaf directories - found via a non-null post. - -Fri Jun 17 14:25:08 1994 Karl Berry (karl@cs.umb.edu) - - * elt-dirs.c (kpse_element_dirs) [DEBUG]: Print the directory - expansion of the path element. - - * str-llist.h: Doc fix. - - * elt-dirs.c (do_subdir): Ignore anything beginning with ., not - just `.' and `..'. - -Tue Jun 14 11:53:49 1994 Karl Berry (karl@cs.umb.edu) - - * dir.c (dir_links): Cache the lookups. - - * elt-dirs.c (kpse_element_dirs): Don't expand the argument. - * expand.h (kpse_path_expand): New routine. - * expand.c: Define it. - * pathsearch.h: Doc fix. - - * db.c, tex-file.c [DEBUG]: Prefix output lines with `debug:'. - - * tex-file.h (kpse_format_info_type): Add cnf_path to the struct. - * tex-file.c (kpse_init_path): Print the cnf_path. - (init_path): Set it, instead of a local variable. - - * pathsearch.c (path_search): Use !! for no-disk-search instead of - %%, because now % is the comment char in cnf files. - * kpathsea.texi: Document this. Also change all `Kpathsearch' to - `kpathsea'. - -Mon Jun 13 10:15:49 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.h (kpse_set_maketex_mag): Remove. - * tex-make.c (kpse_set_maketex_mag): Make static, remove kpse_ - prefix, and use KPATHSEA_DPI and MAKETEX_BASE_DPI instead of args. - -Sun Jun 12 13:49:15 1994 Karl Berry (karl@cs.umb.edu) - - * db.c (db_build): Put a header on the hash table. - - * tex-glyph.c (try_format): Set extension and path after - kpse_init_format, natch. - -Sat Jun 11 14:26:34 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (objects): Add cnf.o. - * variable.c (expand): Call kpse_cnf_get if no envvar value. - -Fri Jun 10 11:20:23 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.h: Remove spec type and variable. - -Thu Jun 9 13:42:21 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (objects): Remove init-path.o. - * tex-file.c (kpse_find_file): Rewrite to initialize the paths - only once, and keep all path info in a structure. - * tex-file.h: Vastly simplify. - * tex-glyph.h (kpse_font_file_type): Move here, since it's really - only for glyphs. - * tex-glyph.c: Corresponding changes. - * debug.h (KPSE_DEBUG_PATHS): New debug bit. - - * default.h, str-list.h: Doc fix. - -Tue May 31 10:06:51 1994 Karl Berry (karl@cs.umb.edu) - - * debug.c: Doc fix. - -Mon May 23 11:50:03 1994 Karl Berry (karl@cs.umb.edu) - - * c-fopen.h (FOPEN_A_MODE): Define this. - * tex-make.c (misstex, maketex): Split up kpse_make_tex into - these, and create missfont.log if appropriate. - -Sun May 22 17:39:52 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.h: Doc fix. - -Wed May 11 13:25:58 1994 Karl Berry (karl@cs.umb.edu) - - * configure.in (AC_OUTPUT): Use just `Makefile' instead of - `./Makefile', to avoid a bug in Autoconf (through 1.10). - -Sun Apr 17 16:18:00 1994 Karl Berry (karl@ra.cs.umb.edu) - - * debug.h: Prefix macros with KPSE_. - * db.c, dir.c: Change calls. - - * common.ac: Remove :: VPATH stuff; that made it in to Autoconf 1.8. - - * Makefile.in (top_srcdir): Define this for configure to substitute. - -Thu Apr 7 17:52:05 1994 Karl Berry (karl@ra.cs.umb.edu) - - * debug.[ch]: Implement fopen/fclose tracing. - -Thu Mar 31 07:25:49 1994 Karl Berry (karl@cs.umb.edu) - - * Version 1.8. - -Thu Mar 24 10:01:20 1994 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c: Doc fix. - - * pathsearch.c (path_search): Don't search the disk if there is - magic in the path spec. - - * db.c: Doc fix. - -Wed Mar 16 13:50:17 1994 Karl Berry (karl@cs.umb.edu) - - * readable.c (kpse_readable_file): Complain if errno == EPERM. - -Sun Mar 13 11:14:19 1994 Karl Berry (karl@cs.umb.edu) - - * pathsearch.h (kpse_path_search): Take an extra arg must_exist. - * pathsearch.c (kpse_path_search, search, path_search): Likewise. - * tex-file.c (kpse_find_file): Change call. - * tex-file.h (kpse_find_*): Change these calls, too. - - * hash.c (hash_create): Don't use xcalloc to init pointers to null. - - * db.c (kpse_db_search): Don't free the pointer after incrementing it. - From Frank Jensen. - -Sat Mar 12 17:55:36 1994 Karl Berry (karl@cs.umb.edu) - - * db.h (kpse_db_search): Returns a pointer. - * db.c (kpse_db_search): If db can't be built, return NULL, else a - pointer to the (possibly empty) list. - (db_build): Return whether we found the file. - * pathsearch.c (path_search): Change call. - -Thu Mar 10 07:45:13 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (install-info): New target. - -Fri Mar 4 08:06:16 1994 Karl Berry (karl@cs.umb.edu) - - * hash.c (hash): Change hash function to spread out the values a - bit better. - - * debug.h (DEBUG_DB_BUILD): New debug bit. - * db.c (db_build) [DEBUG]: If bit is set, print hash table. - * hash.h (hash_print): Declare. - -Thu Mar 3 08:52:01 1994 Karl Berry (karl@cs.umb.edu) - - * Version 1.7. - -Sun Feb 27 15:57:30 1994 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (objects): Add db.o, hash.o. - * db.[ch]: New files. - * hash.[ch]: Also new files. - * pathsearch.c (path_search): Try db search. - * tex-glyph.c, fontmap.c: Use general hash functions. - -Sat Feb 26 13:15:53 1994 Karl Berry (karl@cs.umb.edu) - - * fontmap.c: Doc fix. - - * pathsearch.c (INIT_ALLOC): Increase to 75, what the heck. - -Fri Feb 25 08:30:50 1994 Karl Berry (karl@cs.umb.edu) - - * tex-file.[ch]: Decare args const. - -Thu Feb 24 07:55:43 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.h: Include tex-file.h, not init-path.h. - - * init-path.h (KPSE_*_{ENVS,PATHS}, kpse_font_override_path): Move - to tex-font.h. - * tex-font.h (kpse_find_{file,tfm,vf}): Also declare these. - * tex-font.c (kpse_find_file): Define these. - (kpse_font_override_path): Move definition here. - - * tex-file.*: Rename from tex-font.*. - * GNUmakefile: Corresponding changes. - - * elt-dirs.c (do_subdir): Only append the / once we know it's a - directory. - -Wed Feb 23 16:41:31 1994 Karl Berry (karl@cs.umb.edu) - - * elt-dirs.c (do_subdir): Don't tack POST on if it is exactly the - d_name, so we can find a/b with a path of a//b. - - * c-vararg.h (PVAR3[CH]): New defines. - - * init-path.h: Include KPSE_*_{ENVS,PATHS} here. - (kpse_init_path): Take an additional arg font_p. - * init-path.c (kpse_override_path): Rename kpse_font_override_path. - (kpse_init_path): Only use kpse_font_override_font if font_p. - -Mon Feb 21 15:38:53 1994 Karl Berry (karl@cs.umb.edu) - - * common.ac (extrasub): Define to remove VPATH lines if srcdir = `.'. - -Thu Feb 3 06:19:49 1994 Karl Berry (karl@cs.umb.edu) - - * Version 1.6. - - * fn.c (fn_copy0): Remember to allocate space for the null. - Thanks, simon. - -Wed Feb 2 09:57:47 1994 Karl Berry (karl@cs.umb.edu) - - * tex-make.h (KPSE_BITMAP_TOLERANCE): Move to here from tex-glyph.c - (kpse_check_bitmap_tolerance): Declare. - * tex-make.c (kpse_check_bitmap_tolerance): Define. - -Tue Feb 1 10:42:03 1994 Karl Berry (karl@cs.umb.edu) - - * c-std.h (*alloc) [! _MALLOC_INTERNAL]: Make decl conditional. - - * c-std.h [HAVE_STDLIB_H]: Change #if for including <stdlib.h> to this. - * common.ac (AC_HAVE_HEADERS): Check for stdlib.h. - - * Makefile.in (paths.h): Do all substitutions globally. - - * absolute.c [DOS]: Include c-ctype.h. - * tex-glyph.c (KPATHSEA_BITMAP_NAME) [DOS]: Double the backslash. - * elt-dirs.c (do_subdir) [!UNIX_ST_LINK]: Avoid dangling else. - From Wayne. - - * paths.h.in: Doc fix. - - * xputenv.c (xputenv): Check entire variable name for being saved, - not just a prefix of it. - -Mon Jan 31 12:05:30 1994 Karl Berry (karl@cs.umb.edu) - - * fn.c (fn_copy0): Allocate LEN if that's bigger than CHUNK_SIZE. - (CHUNK_SIZE): Increase to 75. - -Sat Jan 22 15:36:08 1994 Karl Berry (karl@cs.umb.edu) - - * Version 1.5. - - * common.ac (AC_HAVE_FUNCS): Check for memmove. - - * paths.h.in (DEFAULT_MF_PATH): Don't search just public/, cause - we need ams/. - -Mon Jan 17 15:09:36 1994 Karl Berry (karl@cs.umb.edu) - - * paths.h.in (DEFAULT_{FMT,BASE}_PATH): Include `.'. - -Sun Jan 16 14:50:02 1994 Karl Berry (karl@cs.umb.edu) - - * paths.h.in (DEFAULT_PK_PATH): Search subdirs of pk. - -Mon Jan 10 16:40:35 1994 Karl Berry (karl@cs.umb.edu) - - * xputenv.c (xputenv): Don't try to be smart about saving/freeing - stuff if SMART_PUTENV is defined. - - * c-std.h (assert) [!HAVE_ASSERT_H]: Define as nothing, to avoid - undefined references to assert. - -Tue Dec 21 16:28:13 1993 Karl Berry (karl@cs.umb.edu) - - * c-std.h (SYSV) [STDC_HEADERS]: Define, to get around old X - include files under hpux. - -Sun Dec 19 13:06:15 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (objects): Put tex-font.o first. - -Sat Dec 18 15:03:57 1993 Karl Berry (karl@cs.umb.edu) - - * config.h (GCC_WCHAR_T, _GCC_WCHAR_T): Remove these; I have - another theory now for wchar_t, done in xdvi.h and x11.c. - -Sat Dec 18 14:41:15 1993 Karl Berry (karl@owl.hq.ileaf.com) - - * c-memstr.h ([r]index) [STDC_HEADERS]: Conditionalize #define. - -Tue Dec 14 17:43:30 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (paths.h): Change substitutions accordingly. - * paths.h.in (DEFAULT_FMT_PATH): Variable is now fmtdir. - (DEFAULT_{BIB,BST}_PATH): Variable is now texmf_prefix. - -Sat Dec 11 13:21:43 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (ABS): New macro. - (kpse_set_maketex_mag): Use it, instead of fabs. - -Fri Dec 10 15:31:16 1993 Karl Berry (karl@cs.umb.edu) - - * xmalloc.c, xrealloc.c: Use exit instead of abort, remove abort - decls, and reword error messages to be less cryptic. From - john@minster.york.ac.uk. - - * dir.h: use `defined' instead of just `DIRENT || _POSIX_VERSION'. - How annoying. From kretschm@aitxu3.ait.physik.uni-tuebingen.de. - - * xputenv.c (putenv): Remove declaration, as different systems do - it differently. From kayvan@satyr.sylvan.com. - -Thu Dec 9 09:12:33 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (kpse_set_maketex_mag): Allow off-by-1 when deciding - if a dpi is a magstep. - -Tue Dec 7 11:03:51 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (kpse_set_maketex_mag): New routine from dvips, - called by dvipsk and xdvik to ensure consistency. - (magstep): Subroutine of above, also from dvips. - * tex-make.h: Declare it. - - * tex-doc.texi: Correct menu item (from maechler@stat.math.ethz.ch). - -Fri Dec 3 12:53:38 1993 Karl Berry (karl@cs.umb.edu) - - * c-pathmx.h: Doc fix. - -Sat Nov 27 14:36:11 1993 Karl Berry (karl@cs.umb.edu) - - * default.h: Doc fix. - - * paths.h.in (texfontdir): This has been renamed to fontdir. - -Sun Nov 21 08:28:41 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (distdir): Include HIER in the distribution, until - we merge it into the manual. - -Sun Nov 7 14:54:47 1993 Karl Berry (karl@cs.umb.edu) - - * c-namemx.h (NAME_MAX): Avoid use of pathconf. - * c-pathmx.h: Doc fix. - -Thu Nov 4 14:50:45 1993 Karl Berry (karl@cs.umb.edu) - - * config.h (_GCC_WCHAR_T) [!GCC_WCHAR]: Conditionalize. - - * c-std.h (EXIT_SUCCESS) [!EXIT_SUCCESS]: Move these defines - outside of !STDC_HEADERS, for the sake of SunOS 4.1.1. (From - vonbrand@inf.utfsm.cl.) - -Wed Nov 3 14:43:05 1993 Karl Berry (karl@cs.umb.edu) - - * Version 1.4. - -Wed Nov 3 07:05:48 1993 Karl Berry (karl@cs.umb.edu) - - * paths.h.in (DEFAULT_{BASE,FMT}_PATH): Had these definitions reversed. - -Fri Oct 29 19:27:36 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (try_fallback_resolutions): Initialize ret in all cases. - -Thu Oct 28 14:32:34 1993 Karl Berry (karl@cs.umb.edu) - - * lib.h: Doc fix. - - * common.h (AC_UNISTD_H): Replace this with unistd.h in the list - of HAVE_HEADERS. - -Tue Oct 26 13:59:33 1993 Karl Berry (karl@cs.umb.edu) - - * str-llist.[ch]: New files. - * Makefile.in (objects): Add str_llist.o. - * elt-dirs.[ch]: Use str_llist_type throughout. - * pathsearch.c (dir_list_search): Take a str_llist_type, and float - a successful dir towards the top. - (path_search): Change call of kpse_element_dirs. - -Sun Oct 24 19:41:49 1993 Karl Berry (karl@cs.umb.edu) - - * elt-dirs.c (do_optional): Remove this stub. - (expand_elt): Don't call it. - -Fri Oct 22 14:46:44 1993 Karl Berry (karl@cs.umb.edu) - - * xmalloc.c, xrealloc.c, line.c, pathsearch.c: Doc fix. - -Tue Oct 19 12:11:32 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (try_fallback_resolutions): New routine. - (kpse_find_glyph_format): Call it, instead of repeating (the now - pretty complicated) code. - * tex-font.c (kpse_init_fallback_resolutions): Pass the value of - any environment variable, not its name. From R.Kooijman@et.tudelft.nl. - - * c-memstr.h (str[r]chr) [!str[r]chr]: Conditionalize. From - maarrrk@seidel.ece.ucsb.edu. - -Tue Oct 12 16:26:48 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c: Doc fix. - -Thu Oct 7 13:13:57 1993 Karl Berry (karl@cs.umb.edu) - - * xmalloc.c: Rewrite to not require <config.h>. - * xrealloc.c: Likewise. - - * make-suffix.c (make_suffix): Declare variables const. - * remove-suffx.c (remove_suffix): Likewise. Also rename to - rm-suffix.c. - * xputenv.c (putenv): Declare with correct prototype. - * fontmap.c (internal routines): Likewise. - * line.c (xmalloc, xrealloc): Declare as void *. - (From john@minster.york.ac.uk.) - -Wed Oct 6 06:49:53 1993 Karl Berry (karl@cs.umb.edu) - - * Version 1.3. - - * tilde.c (kpse_tilde_expand): Always return a malloc-ed value. - (From ken@cs.toronto.edu.) - -Sun Oct 3 14:11:33 1993 Karl Berry (karl@cs.umb.edu) - - * config.h (_GCC_WCHAR_T): Define. - -Sat Oct 2 17:17:32 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (install-*): Don't reassign PATH, just invoke - mkdirchain explicitly. - - * tex-glyph.c (KPATHSEA_BITMAP_NAME) [DOS]: Define what I think - will work for this ... - - * paths.h.in: Doc fix. - - * Makefile.in: Doc fix. - - * tex-glyph.c (kpse_find_glyph_format): Unconditionally initialize - glyph_paths[*], since we might use them both in try_size. From - worsch@ira.uka.de. - -Fri Oct 1 12:02:11 1993 Karl Berry (karl@cs.umb.edu) - - * expand.c: Doc fix. - -Wed Sep 29 15:21:49 1993 (karl@terminus.cs.umb.edu) - - * Version 1.2. - -Sat Sep 25 14:12:00 1993 Karl Berry (karl@cs.umb.edu) - - * pathsearch.c (path_search, absolute_search): Don't initialize - structs. - -Fri Sep 24 12:50:00 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (try_size): Skip the simultaneous stuff. - (try_format): Set the envvar here. - (bitmap_name): Not here. - * pathsearch.c (kpse_*_multi_search): Delete. - Change most other routines to take only a single name again, - instead of a name list. - * pathsearch.h: Delete decls. - - * tex-glyph.c (init-path.h): Don't need to include this. - - * tex-glyph.c (kpse_find_glyph_format): Try the fallback - resolutions for the fallback font. - - * Makefile.in (warn_more, MAKEINFO_FLAGS) [hayley]: Define these - for development and distribution. - - * Makefile.in (dvi): Make analogous to info (including use of new - suffix rule). - - * tex-glyph.c (kpse_find_glyph_format): Set KPATHSEA_NAME to the - fallback font if we get that far. - -Wed Sep 15 19:29:56 1993 Karl Berry (karl@cs.umb.edu) - - * filefmt.h (KPSE_*_PATH): Pass NULL as first arg. - - * xputenv.c (xputenv): Rewrite again to save the variable names, - not the old items. - -Mon Sep 13 06:55:29 1993 Karl Berry (karl@cs.umb.edu) - - * concatn.h: Doc fix. - -Sun Sep 12 15:54:55 1993 Karl Berry (karl@cs.umb.edu) - - * lib.h (XTALLOC): Parenthesize the cast. - - * xputenv.c (xputenv): Rewrite to collect some of the garbage. - -Fri Sep 10 14:00:35 1993 Karl Berry (karl@cs.umb.edu) - - * lib.h (ENVVAR_SET_DEFAULT): No longer needed. - - * xputenv.c (xputenv_int): New routine. - -Thu Sep 9 14:58:00 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c (MAKE_TEX_PK_SPEC): Change MAKETEX_DPI to - KPATHSEA_DPI. - - * tex-glyph.c (try_fontmap): Use KPSE_GLYPH_PATH. - * filefmt.c (KPSE_GLYPH_{PATH,ENVS}): New macros. - (KPSE_{GF,PK}_ENVS): Use GLYPH_ENVS. - - * tex-glyph.c (bitmap_name): Rewrite to use a variable spec, - introducing KPATHSEA_{BITMAP_NAME,FORMAT,DPI,NAME}. - (kpse_find_glyph_format): Set KPATHSEA_DPI instead of MAKETEX_DPI; - also set KPATHSEA_NAME. - (try_fontmap): Also set KPATHSEA_NAME here. - (try_size): Set KPATHSEA_DPI here. - - * tex-glyph.c (try_name): Delete this routine. - (kpse_find_glyph_format): Try fallback resolutions here, call - try_resolution directly. - (try_fontmap): Call try_resolution directly. - - * init-path.h: Need not include c-proto.h. - -Sun Aug 29 13:34:25 1993 Karl Berry (karl@cs.umb.edu) - - * tex-make.c: Doc fix. - - * filefmt.h: Don't need c-proto.h or types.h. - -Fri Aug 27 10:36:46 1993 Karl Berry (karl@cs.umb.edu) - - * c-vararg.h (PVAR2C): Take AP as an arg. - - * init-path.[ch] (kpse_init_path): Take the current value as an - additional argument, separate from the default path, and always - expand_default. - - * uppercasify.c (uppercasify): Don't discard upcased result! - -Thu Aug 26 10:36:28 1993 Karl Berry (karl@cs.umb.edu) - - * Version 1.1. - -Sun Aug 22 19:18:35 1993 Karl Berry (karl@cs.umb.edu) - - * install-data (install-data): Replace nonexistent - $(kpath_includedir) with $(includedir), and define it. Also - remove c-auto.h. - -Thu Aug 5 09:03:22 1993 Karl Berry (karl@cs.umb.edu) - - * Version 1.0. - -Wed Aug 4 13:51:24 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (kpse_find_glyph_format): Fill in the font_file - struct in the maketex case. - - * Makefile.in (info): Just depend on kpathsea.info, and rely on - new suffix rule to do the work. - -Tue Aug 3 17:50:40 1993 Karl Berry (karl@fishbowl.hq.ileaf.com) - - * tex-glyph.c (try_name): Don't free expanded_name if we're - returning it. - -Tue Aug 3 10:13:43 1993 Karl Berry (karl@owl.hq.ileaf.com) - - * version.c (kpathsea_version_string): Do not declare const. - - * line.h (read_line): Protoize decl. - -Tue Aug 3 09:10:07 1993 Karl Berry (karl@blood.hq.ileaf.com) - - * c-memstr.h (bcmp, bcopy, bzero) [!HAVE_BCOPY]: Conditionalize. - - * putenv.c: Include <kpathsea/c-auto.h>, and use const when - calling memcpy. - -Sun Aug 1 08:48:49 1993 Karl Berry (karl@cs.umb.edu) - - * Add new features to manual. - - * Makefile.in (objects): Include putenv.o. - * putenv.c: New file from gdb. - * common.ac: Test for putenv. - -Sat Jul 31 11:54:31 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (distclean): Remove paths.h. - - * Most files: changes for traditional C compatibility. - - * filefmt.h: Add new KPSE_..._PATH's for the other formats. - * paths.h.in: Add defaults. - * Makefile.in (paths.h): sed the values in. - -Fri Jul 30 17:23:10 1993 Karl Berry (karl@cs.umb.edu) - - * filefmt.h (KPSE_VF_PATH): Add empty parens. - - * tex-paths.h*: Rename to just paths.h*. - -Tue Jul 27 09:00:58 1993 Karl Berry (karl@cs.umb.edu) - - * filefmt.h: Include tex-paths.h, and use default paths in - KPSE_..._PATH macros. - - * find-suffix.c: Correct logic. - - * filefmt.h: Include init-path.h. - -Sat Jul 24 10:44:21 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (kpse_find_glyph_format): Assign to it. - * tex-font.h (kpse_font_file_type): New member `source'. - (KPSE_FONT_FILE_SOURCE): Accessor macro. - (kpse_source_type): New type. - -Wed Jul 21 19:45:45 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (configclean): New target. - -Sun Jul 18 13:53:38 1993 Karl Berry (karl@cs.umb.edu) - - * tilde.[ch] (kpse_expand_tilde): Rename to kpse_tilde_expand. - - * elt-dirs.c, pathsearch.c, tex-glyph.c: Replace calls to - kpse_expand_tilde with kpse_expand. - * expand.[ch]: New files. - * Makefile.in (objects): Add it. - - * fn.[ch]: New files. - * elt-dirs.c (fn*): Moved to fn.c. - * tex-make.c, variable.c: Use the new routines. - * *obstack*: No longer needed. - * Makefile.in (objects): Appropriate changes. - -Sat Jul 17 13:25:25 1993 Karl Berry (karl@cs.umb.edu) - - * concat.c: Doc fix. - - * pathsearch.c (search, path_search): Expand variable references. - - * itoa.c: New file. - * lib.h (itoa): Declare it. - * Makefile.in (objects): Add it. - - * lib.h (ENVVAR_SET_DEFAULT): New macro. - * tex-glyph.c (kpse_find_glyph_format): Call it to set the dpi. - -Fri Jul 16 09:10:52 1993 Karl Berry (karl@cs.umb.edu) - - * xputenv.c: New file. - * Makefile.in (objects): Add it. - * lib.h (xputenv): Declare it. - - * c-obstack.h: New file. - * variable.[ch]: New files. - * Makefile.in (objects): Add it. - - * uppercasify.c: New file. - * Makefile.in (objects): add it. - * lib.h (uppercasify): Declare it. - -Tue Jul 13 13:47:54 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (kpse_find_glyph_format): Simplify path initialization. - * filefmt.h: New file; add abbrevs for GF and PK inits. - - * Makefile.in (objects): Add obstack.o and tex-make.o. - * obstack.[ch]: New files from GNU. - * concatn.[ch], tex-make.[ch]: New files. - * init-path.c: Doc fix. - - * elt-dirs.c: Doc fix. - * readable.[ch]: Doc fixes. - -Sun Jul 11 13:37:02 1993 Karl Berry (karl@cs.umb.edu) - - * tex-font.h (kpse_font_format_type): Rename to kpse_file_format_type, - and include the other file formats. - * tex-glyph.c: Change uses. - -Tue Jul 6 08:09:10 1993 Karl Berry (karl@cs.umb.edu) - - * tex-font.c (kpse_fallback_font): Initialize to NULL. - -Mon Jul 5 08:23:09 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (try_size): Don't fill in FONT_FILE if it's null. - - * tex-font.c (kpse_init_fallback_resolutions): Look for TEXSIZES - after the program-specific *SIZES var. - - * tex-glyph.c (kpse_find_glyph_format): Use kpse_init_path. - * Makefile.in (objects): Add init_path.o. - * tex-font.[ch] (kpse_override_path): Move to init-path.[ch]. - * init-path.[ch]: New files. - * c-vararg.h: New file. - -Sun Jul 4 11:26:17 1993 Karl Berry (karl@cs.umb.edu) - - * tex-font.c (kpse_init_fallback_resolutions): New routine. - * tex-font.h: Declare it, and companion return type. - -Fri Jul 2 10:43:11 1993 Karl Berry (karl@cs.umb.edu) - - * tex-glyph.c (kpse_find_glyph_format): Take first successful - fontmap entry. - - * fontmap.c (map_file_parse): Take first % on line as starting the - comment, not the last. - - * fontmap.c (map_insert): Always insert the new element. - -Thu Jul 1 19:21:35 1993 Karl Berry (karl@cs.umb.edu) - - * fontmap.c (map_lookup): Return a list, not a single string. - (map_lookup_str): Likewise. - * fontmap.h (map_lookup): Change decl. - * tex-glyph.c (kpse_find_glyph_format): Change caller. - -Sat Jun 26 11:48:36 1993 Karl Berry (karl@cs.umb.edu) - - * tex-font.h: Doc fix. - -Thu Jun 24 11:16:41 1993 Karl Berry (karl@cs.umb.edu) - - * configure.in (MISSING_HEADERS): Toss in favor of HAVE_HEADERS. Sigh. - Also, move all this to an include file. - Change uses in several files. - - * stat.h: Rename to c-stat.h, and change includers. - - * Makefile.in (objects): Add tex-glyph.o. - * pathsearch.[ch] (kpse_*_multi_search): New routines. - -Sat Jun 19 11:37:18 1993 Karl Berry (karl@cs.umb.edu) - - * str-list.c (str_list_free): New routine. - -Fri Jun 18 13:54:08 1993 Karl Berry (karl@cs.umb.edu) - - * fontmap.c (map_create): Rewrite to use kpse_all_path_search. - Include const in various subroutines. - -Tue Jun 15 15:58:18 1993 Karl Berry (karl@cs.umb.edu) - - * Change <kpathsea/pathsrch.h> to pathsearch. Rename the files - themselves. - - * elt-dirs.c (cache): Copy the key into our own storage, since it - comes from kpse_path_element and might get overwritten. Should we - copy all the values, too? - -Sun Jun 13 16:49:09 1993 Karl Berry (karl@cs.umb.edu) - - * pathsearch.c (dir_list_search): Don't need to append the null - here; in fact, it's wrong, since then the final list might have - nulls in the middle. - - * elt-dirs.c (dir_list_add): Correct check for new directory - already ending in /. - -Fri Jun 11 10:45:33 1993 Karl Berry (karl@cs.umb.edu) - - * str-list.[ch]: New files. - * pathsrch.c: Use it for the dir_list routines. - * Many changes and new files throughout for new implementation - including TeX-font-lookup routines. - -Tue Jun 8 14:00:54 1993 Karl Berry (karl@cs.umb.edu) - - * Most files: Change `const string' (constant pointer) to `const - char *' (pointer to constant data). What a crock. - -Mon Jun 7 09:43:21 1993 Karl Berry (karl@cs.umb.edu) - - * debug.[ch]: New files. - * config.h: Include debug.h. - - * dir-p.c: Rename to dir.c. - (dir_links): New routine. - - * c-std.h (assert.h) [!ASSERT_H_MISSING]: Include this. - * configure.in: Check for it with new macro AC_MISSING_HEADERS. - -Thu Jun 3 10:12:12 1993 Karl Berry (karl@cs.umb.edu) - - * dirio.h (leaf_dir_p): No longer defined; rename to dir.h. - * xopendir.c, dir-p.c, pathsrch.c: Change include. - -Mon May 31 07:49:16 1993 Karl Berry (karl@cs.umb.edu) - - * c-std.h (EXIT_{SUCCESS,FAILURE}): Define these if they're undefined. - - * config.h: Use <kpathsea/...> instead "...". - - * kpathlib.h: Had #ifndef protection messed up. Rename to lib.h. - - * c-memstr.h (index, rindex) [!index, !rindex]: Make definitions - conditional. - -Tue May 25 10:07:00 1993 Karl Berry (karl@cs.umb.edu) - - * c-{namemx,pathmx,pathch,...}.h: Doc fixes. - - * c-systypes.h: New file. - * c-std.h: Include it. - - * stat.h: New file. - * xstat.h: Include it. - - * configure.in (AC_HAVE_HEADERS): Test for `pwd.h'. - -Sun May 23 19:06:22 1993 Karl Berry (karl@cs.umb.edu) - - * pathsrch.[ch]: Doc fixes. - -Fri May 21 11:27:54 1993 Karl Berry (karl@cs.umb.edu) - - * line.c (free): Declare. - - * pathsrch.c, find-suffix.c: Change caller. - * c-pathch.h ({IS_,}{DIR,ENV}_SEP): Rename existing confusing - definitions to these. Suggested by rocky. - -Mon May 17 08:18:18 1993 Karl Berry (karl@cs.umb.edu) - - * Version 0.3. - - * pathsrch.c (expand_default): Handle doubled colon and - nothing-but-colon cases. - - * Write documentation, change Makefile accordingly. - -Thu May 13 16:32:34 1993 Karl Berry (karl@cs.umb.edu) - - * c-std.h (popen) [VMS]: Make decl conditional, and include - <unixlib.h> and <unixio.h>. - -Mon May 10 07:12:50 1993 Karl Berry (karl@cs.umb.edu) - - * Version 0.2. - - * version.c: Put in placeholder. - -Sun May 9 10:42:34 1993 Karl Berry (karl@cs.umb.edu) - - * config.h (c-auto.h): Use <...> instead of "...". - -Tue May 4 14:54:41 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (info check dvi): New targets (that do nothing). - -Mon May 3 13:46:17 1993 Karl Berry (karl@claude.cs.umb.edu) - - * Version 0.1. - - * Use KPATHSEARCH_ prefix for various headers' cpp protections. - -Sun May 2 10:28:25 1993 Karl Berry (karl@cs.umb.edu) - - * Makefile.in (dist): Depend on TAGS, and put it in the dist. - - * Makefile.in (c-auto.h.in): Remove extra $(srcdir). - -Sun Apr 25 11:22:12 1993 Karl Berry (karl@cs.umb.edu) - - * pathsrch.h: Include c-proto.h. - - * make-suffix.c: New file. - * Makefile.in (objects): Add the .o. - - * file-p.c: Use the SAME_FILE_P macro. - - * fontmap.h: Include c-proto.h and types.h. - - * lib.h: Rename to kpathlib.h. - * config.h: Include changed. - - * c-proto.h, c-std.h: Doc fix. - - * c-limits.h [LIMITS_H_MISSING]: Conditionalize include of c-std.h. - - * xstat.h: Include c-std.h. - - * Makefile.in (c-auto.h.in): Add unused warning to top. - - * dirio.h: Include c-proto.h and types.h. - -Fri Apr 23 16:11:13 1993 Karl Berry (karl@cs.umb.edu) - - * line.c: Don't include config.h, just declare xmalloc and - xrealloc explicitly. - - * pathsrch.c: paths.h need not be included. - - * Created.
deleted file mode 100644 --- a/kpathsea/HIER +++ /dev/null @@ -1,88 +0,0 @@ -TeX directory structure -======================= - - This section describes the default installation hierarchy of the -distribution. It conforms to both the GNU coding standards and the TeX -directory structure (TDS) standard. For rationale and further -explanation, please see those documents. The GNU standard is available -as `ftp://ftp.gnu.org/pub/gnu/standards/standards.texi' and -mirrors. The TDS document is available from `CTAN:/tex-archive/tds' -(*note unixtex.ftp::.). - - You can change the default paths in many ways (*note Changing search -paths::.). One common desire is to put everything (binaries and all) -under a single top-level directory such as `/usr/local/texmf' or -`/opt/texmf'--in the terms used below, make PREFIX and TEXMF the same. -For specific instructions on doing that, see *Note configure -scenarios::. - - Here is a skeleton of the default directory structure, extracted from -the TDS document: - - PREFIX/ installation root (`/usr/local' by default) - bin/ executables - man/ man pages - include/ C header files - info/ GNU info files - lib/ libraries (`libkpathsea.*') - share/ architecture-independent files - texmf/ TDS root - bibtex/ BibTeX input files - bib/ BibTeX databases - base/ base distribution (e.g., `xampl.bib') - misc/ single-file databases - PKG/ name of a package - bst/ BibTeX style files - base/ base distribution (e.g., `plain.bst', `acm.bst') - misc/ single-file styles - PKG/ name of a package - doc/ additional documentation - dvips/ `.pro', `.ps', `psfonts.map' - fonts/ font-related files - TYPE/ file type (e.g., `tfm', `pk') - MODE/ type of output device (types `pk' and `gf' only) - SUPPLIER/ name of a font supplier (e.g., `public') - TYPEFACE/ name of a typeface (e.g., `cm') - dpiNNN/ font resolution (types `pk' and `gf' only) - metafont/ Metafont (non-font) input files - base/ base distribution (e.g., `plain.mf') - misc/ single-file packages (e.g., `modes.mf') - PKG/ name of a package (e.g., `mfpic') - metapost/ MetaPost input files - base/ base distribution (e.g., `plain.mp') - misc/ single-file packages - PKG/ name of a package - support/ support files for MetaPost-related utilities (e.g., `trfonts.map') - mft/ `MFT' inputs (e.g., `plain.mft') - tex/ TeX input files - FORMAT/ name of a format (e.g., `plain') - base/ base distribution for FORMAT (e.g., `plain.tex') - misc/ single-file packages (e.g., `webmac.tex') - local/ local additions to or local configuration files for FORMAT - PKG/ name of a package (e.g., `graphics', `mfnfss') - generic/ format-independent packages - hyphen/ hyphenation patterns (e.g., `hyphen.tex') - images/ image input files (e.g., Encapsulated PostScript) - misc/ single-file format-independent packages (e.g., `null.tex'). - PKG/ name of a package (e.g., `babel') - web2c/ implementation-dependent files (`.pool', `.fmt', `texmf.cnf', etc.) - - Some concrete examples for most file types: - - /usr/local/bin/tex - /usr/local/man/man1/xdvi.1 - /usr/local/info/kpathsea.info - /usr/local/lib/libkpathsea.a - /usr/local/share/texmf/bibtex/bst/base/plain.bst - /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk - /usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf - /usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm - /usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa - /usr/local/share/texmf/metafont/base/plain.mf - /usr/local/share/texmf/metapost/base/plain.mp - /usr/local/share/texmf/tex/plain/base/plain.tex - /usr/local/share/texmf/tex/generic/hyphen/hyphen.tex - /usr/local/share/texmf/web2c/tex.pool - /usr/local/share/texmf/web2c/tex.fmt - /usr/local/share/texmf/web2c/texmf.cnf -
deleted file mode 100644 --- a/kpathsea/INSTALL +++ /dev/null @@ -1,830 +0,0 @@ -Contents: - -Installation - Simple installation - Custom installation - Disk space - Kpathsea application distributions - Changing search paths - Default path features - Default path generation - Running `configure' - `configure' shells - `configure' options - `configure' environment - `configure' scenarios - Shared library - Running `make' - Installing files - Cleaning up - Filename database generation - `mktex' scripts - `mktex' configuration - `mktex' script names - `mktex' script arguments - Installation testing - Security - - -Installation -************ - - The procedure for Kpathsea (and Web2c, etc.) configuration and -installation follows. If you encounter trouble, see *Note Common -problems::, a copy of which is in the file `kpathsea/BUGS'. - -Simple installation -=================== - - Installing TeX and friends for the first time can be a daunting -experience. Thus, you may prefer to skip this whole thing and just get -precompiled executables: see *Note unixtex.ftp::. - - This section explains what to do if you wish to take the defaults for -everything, and generally to install in the simplest possible way. Most -steps here refer to corresponding subsection in the next section which -explains how to override defaults and generally gives more details. - - By default everything will be installed under `/usr/local' and the -following discussion assumes this. However, if you already have TeX -installed, its location is used to derive the directory under which -everything is to be installed. - - 1. Be sure you have enough disk space: approximately 8 megabytes for - the compressed archives, 15MB for sources, 45MB for compilation, - 40MB for the (initial) installed system (including library files). - *Note Disk space::. - - 2. Retrieve these two distribution archives: - `ftp://ftp.tug.org/tex/texk.tar.gz' - These are the sources, which you will be compiling. - - `ftp://ftp.tug.org/tex/texmflib.tar.gz' - This is a basic set of input files. You should unpack it in - the directory `/usr/local/share'; doing so will create a - `texmf' subdirectory there. - - *Note Kpathsea application distributions::. - - 3. When using the default search paths, there is no need to edit any - distribution files. *Note Changing search paths::. - - 4. At the top level of the distribution, run `sh configure'. (If you - have the GNU Bash shell installed, run `bash configure'.) *Note - Running configure::. - - 5. `make'. *Note Running make::. If you are using a BSD 4.4 system - such as FreeBSD or NetBSD, use GNU make (often installed in - `/usr/local/bin'), not the BSD make. - - If you are using a HP-UX 10 system and the native compiler, - specify the `+u' flag in `XCFLAGS'. - - 6. `make install'. *Note Installing files::. - - 7. `make distclean'. *Note Cleaning up::. - - 8. Set up a cron job to rebuild the filename database that makes - searching faster. This line will rebuild it every midnight: - 0 0 * * * cd /usr/local/share/texmf && /BINDIR/mktexlsr - *Note Filename database generation::, and *Note Filename - database::. - - 9. If you're installing Dvips, you also need to set up configuration - files for your printers and make any additional PostScript fonts - available. *Note Installation: (dvips)Installation. If you have - any color printers, see *Note Color device configuration: - (dvips)Color device configuration. - - 10. The first time you run a DVI driver, a bunch of PK fonts will be - built by Metafont via `mktexpk' (and added to the filename - database). This will take some time. Don't be alarmed; they will - created only this first time (unless something is wrong with your - path definitions). - - By default, `mktexpk' will create these fonts in a hierarchy under - `/var/tmp/texfonts'; it simply assumes that `/var/tmp' exists and - is globally writable. If you need a different arrangement, see - *Note mktex configuration::. - - *Note mktex scripts::. - - 11. For some simple tests, try `tex story \\bye' and `latex sample2e'. - Then run `xdvi story' or `dvips sample2e' on the resulting DVI - files to preview/print the documents. *Note Installation - testing::. - -Custom installation -=================== - - Most sites need to modify the default installation procedure in some -way, perhaps merely changing the prefix from `/usr/local', perhaps -adding extra compiler or loader options to work around `configure' -bugs. This section explains how to override default choices. For -additional distribution-specific information: - * `dviljk/INSTALL'. - - * *Note Installation: (dvips)Installation. - - * *Note Installation: (web2c)Installation. - - * `xdvik/INSTALL'. - - These instructions are for Unix systems. Other operating-system -specific distributions have their own instructions. The code base -itself supports Amiga, DOS, OS/2, and VMS. - - Following are the same steps as in the previous section (which -describes the simplest installation), but with much more detail. - -Disk space ----------- - - Here is a table showing the disk space needed for each distribution -(described in the next section). The `(totals)' line reflects the -`texk' source distribution and `texmflib'; the individual distributions -don't enter into it. Sizes are in megabytes. All numbers are -approximate. - -Distribution .tar.gz Unpacked Compiled Installed -dviljk .9 3.8 -dvipsk .9 3.2 -xdvik .7 2.5 -web2c 1.3 5.0 -web 1.9 6.5 - - -texk 3.8 14.1 43.1 23.5 -texmflib 3.8 15.0 - 15.0 -(totals) 7.6 29.1 43.1 38.5 - -Kpathsea application distributions ----------------------------------- - - The archive `ftp://ftp.tug.org/tex/texk.tar.gz' contains all of the -Kpathsea applications I maintain, and the library itself. For example, -since NeXT does not generally support X11, you'd probably want to skip -`xdvik' (or simply remove it after unpacking `texk.tar.gz'. If you are -not interested in all of them, you can also retrieve them separately: - -`dviljk.tar.gz' - DVI to PCL, for LaserJet printers. - -`dvipsk.tar.gz' - DVI to PostScript, for previewers, printers, or PDF generation. - -`web2c.tar.gz' - The software needed to compile TeX and friends. - -`web.tar.gz' - The original WEB source files, also used in compilation. - -`xdvik.tar.gz' - DVI previewing under the X window system. - - If you want to use the Babel LaTeX package for support of non-English -typesetting, you may need to retrieve additional files. See the file -`install.txt' in the Babel distribution. - -Changing search paths ---------------------- - - If the search paths for your installation differ from the standard -TeX directory structure (*note Introduction: (tds)Top.), edit the file -`kpathsea/texmf.in' as desired, before running `configure'. For -example, if you have all your fonts or macros in one big directory. - - You may also wish to edit the file `mktex.cnf', either before or -after installation, to control various aspects of `mktexpk' and -friends. *Note mktex configuration::. - - You do not need to edit `texmf.in' to change the default top-level or -other installation *directories* (only the paths). You can and should -do that when you run `configure' (next step). - - You also do not need to edit `texmf.in' if you are willing to rely on -`texmf.cnf' at runtime to define the paths, and let the compile-time -default paths be incorrect. Usually there is no harm in doing this. - - The section below explains default generation in more detail. - -Default path features -..................... - - The purpose of having all the different files described in the section -above is to avoid having the same information in more than one place. If -you change the installation directories or top-level prefix at -`configure'-time, those changes will propagate through the whole -sequence. And if you change the default paths in `texmf.in', those -changes are propagated to the compile-time defaults. - - The Make definitions are all repeated in several Makefile's; but -changing the top-level `Makefile' should suffice, as it passes down all -the variable definitions, thus overriding the submakes. (The -definitions are repeated so you can run Make in the subdirectories, if -you should have occasion to.) - - By default, the bitmap font paths end with `/$MAKETEX_MODE', thus -including the device name (usually a Metafont mode name such as -`ljfour'). This distinguishes two different devices with the same -resolution--a write/white from a write/black 300dpi printer, for -example. - - However, since most sites don't have this complication, Kpathsea -(specifically, the `kpse_init_prog' function in `kpathsea/proginit.c') -has a special case: if the mode has not been explicitly set by the user -(or in a configuration file), it sets `MAKETEX_MODE' to `/'. This -makes the default PK path, for example, expand into `.../pk//', so -fonts will be found even if there is no subdirectory for the mode (if -you arranged things that way because your site has only one printer, -for example) or if the program is mode-independent (e.g., `pktype'). - - To make the paths independent of the mode, simply edit `texmf.in' -before installation, or the installed `texmf.cnf', and remove the -`$MAKETEX_MODE'. - - *Note mktex script arguments::, for how this interacts with `mktexpk'. - - *Note TeX directory structure: TeX directory structure, for a -description of the default arrangement of the input files that comprise -the TeX system. The file `kpathsea/HIER' is a copy of that section. - -Default path generation -....................... - - This section describes how the default paths are constructed. - - You may wish to ignore the whole mess and simply edit `texmf.cnf' -after it is installed, perhaps even copying it into place beforehand so -you can complete the installation, if it seems necessary. - - To summarize the chain of events that go into defining the default -paths: - - 1. `configure' creates a `Makefile' from each `Makefile.in'. - - 2. When Make runs in the `kpathsea' directory, it creates a file - `texmf.sed' that substitutes the Make value of `$(var)' for a - string `@var@'. The variables in question are the one that define - the installation directories. - - 3. `texmf.sed' (together with a little extra magic--see - `kpathsea/Makefile') is applied to `texmf.in' to generate - `texmf.cnf'. This is the file that will eventually be installed - and used. - - 4. The definitions in `texmf.cnf' are recast as C `#define''s in - `paths.h'. These values will be the compile-time defaults; they - are not used at runtime unless no `texmf.cnf' file can be found. - - (That's a lie: the compile-time defaults are what any extra :'s in - `texmf.cnf' expand into; but the paths as distributed have no extra - :'s, and there's no particular reason for them to.) - -Running `configure' -------------------- - - Run `sh configure OPTIONS' (in the top-level directory, the one -containing `kpathsea/'), possibly using a shell other than `sh' (*note -configure shells::.). - - `configure' adapts the source distribution to the present system via -`#define''s in `*/c-auto.h', which are created from the corresponding -`c-auto.in'. It also creates a `Makefile' from the corresponding -`Makefile.in', doing `@VAR@' and `ac_include' substitutions). - - `configure' is the best place to control the configuration, -compilation, and installed location of the software, either via -command-line options, or by setting environment variables before -invoking it. For example, you can disable `mktexpk' by default with -the option `--disable-mktexpk'. *Note configure options::. - -`configure' shells -.................. - - If you have Bash, the GNU shell, use it if `sh' runs into trouble -(*note Top: (features)Top.). - - Most Bourne shell variants other than Bash cannot handle `configure' -scripts as generated by GNU Autoconf (*note Introduction: -(autoconf)Top.). Specifically: -`ksh' - The Korn shell may be installed as `/bin/sh' on AIX. `/bin/bsh' - may serve instead. - -`ash' - Ash is sometimes installed as `/bin/sh' on NetBSD, FreeBSD, and - Linux systems. `/bin/bash' should be available. - -`Ultrix /bin/sh' - `/bin/sh' under Ultrix is a DEC-grown shell that is notably - deficient in many ways. `/bin/sh5' may be necessary. - -`configure' options -................... - - For a complete list of all `configure' options, run `configure ---help' or see *Note Running `configure' scripts: (autoconf)Invoking -configure, (a copy is in the file `kpathsea/README.CONFIGURE'). The -generic options are listed first in the `--help' output, and the -package-specific options come last. The environment variables -`configure' pays attention to are listed below. - - Options particularly likely to be useful are `--prefix', `--datadir', -and the like; see *Note configure scenarios::. - - This section gives pointers to descriptions of the `--with' and -`--enable' options to `configure' that Kpathsea-using programs accept. - -`--without-mktexmf-default' -`--without-mktexpk-default' -`--without-mktextfm-default' -`--with-mktextex-default' - Enable or disable the dynamic generation programs. *Note mktex - configuration::. - -`--enable-shared' - Build Kpathsea as a shared library, and link against it. Also - build the usual static library. *Note Shared library::. - -`--disable-static' - Build only the shared library. Implies `--enable-shared'. - -`--enable-maintainer-mode' - Enables make targets that are useful for the maintainer and likely - to be a pain for anyone else; the makefiles created when this - option is enabled may not work at all for you. You have been - warned. - -`configure' environment -....................... - - `configure' uses the value of the following environment variables in -determining your system's characteristics, and substitutes for them in -Makefile's: - -`CC' - The compiler to use: default is `gcc' if it's installed, otherwise - `cc'. - -`CFLAGS' - Options to give the compiler: default is `-g -O2' for `gcc', `-g' - otherwise. `CFLAGS' comes after any other options. You may need - to include `-w' here if your compilations commonly have useless - warnings (e.g., `NULL redefined'), or `configure' may fail to - detect the presence of header files (it takes the messages on - standard error to mean the header file doesn't exist). - -`CPPFLAGS' - Options to pass to the compiler preprocessor; this matters most for - configuration, not the actual source compilation. The `configure' - script often does only preprocessing (e.g., to check for the - existence of #include files), and `CFLAGS' is not used for this. - You may need to set this to something like - `-I/usr/local/include/wwwhatever' if you have the libwww library - installed for hyper-xdvik (see `xdvik/INSTALL'). - -`DEFS' - Additional preprocessor options, but not used by `configure'. - Provided for enabling or disabling program features, as documented - in the various program-specific installation instructions. `DEFS' - comes before any compiler options included by the distribution - `Makefile's or by `configure'. - -`LDFLAGS' - Additional options to give to the loader. `LDFLAGS' comes before - any other linker options. - -`LIBS' - Additional libraries to link with. - -`configure' scenarios -..................... - - Here are some common installation scenarios: - - * Including X support in Metafont. This is disabled by default, - since many sites have no use for it, and it's a leading cause of - configuration problems. - configure --with-x-toolkit - - * Putting the binaries, TeX files, GNU info files, etc. into a single - TeX hierarchy, say `/texmf', requires overriding defaults in both - `configure' and `make': - configure --prefix=`/texmf' --datadir=`/texmf' - make texmf=`/texmf' - - * You can compile on multiple architectures simultaneously either by - building symbolic link trees with the `lndir' script from the X11 - distribution, or with the `--srcdir' option: - configure --srcdir=SRCDIR - - * If you are installing binaries for multiple architectures into a - single hierarchy, you will probably want to override the default - `bin' and `lib' directories, something like this: - configure --prefix=TEXMF --datadir=TEXMF \ - --bindir=TEXMF/ARCH/bin --libdir=TEXMF/ARCH/lib - make texmf=TEXMF - (Unless you make provisions for architecture-specific files in - other ways, e.g., with Depot or an automounter.) - - * To compile with optimization (to compile without debugging, remove - the `-g'): - env CFLAGS="-g -O" sh configure ... - For a potential problem if you optimize, see *Note TeX or - Metafont failing: TeX or Metafont failing. - -Shared library -.............. - - You can compile Kpathsea as a shared library on a few systems, by -specifying the option `--enable-shared' when you run `configure'. - - The main advantage in doing this is that the executables can then -share the code, thus decreasing memory and disk space requirements. - - On some systems, you can record the location of shared libraries in a -binary, usually by giving certain options to the linker. Then -individual users do not need to set their system's environment variable -(e.g., `LD_LIBRARY_PATH') to find shared libraries. If you want to do -this, you will need to add the necessary options to `LDFLAGS' yourself; -for example, on Solaris, include something like `-R${prefix}/lib', on -IRIX or Linux, use `-rpath${prefix}/lib'. (Unfortunately, making this -happen by default is very difficult, because of interactions with an -existing installed shared library.) - - Currently, shared library support is implemented only on Linux, SunOS -4 (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're -interested and willing in adding support for other systems, please see -the `configure' mode in the `klibtool' script, especially the -host-specific case statement around line 250. - -Running `make' --------------- - - `make' (still in the top-level directory). This also creates the -`texmf.cnf' and `paths.h' files that define the default search paths, -and (by default) the `plain' and `latex' TeX formats. - - You can override directory names and other values at `make'-time. -`make/paths.make' lists the variables most commonly reset. For -example, `make default_texsizes=600' changes the list of fallback -resolutions. - - You can also override each of `configure''s environment variables -(*note configure environment::.). The Make variables have the same -names. - - Finally, you can supply additional options via the following -variables. (`configure' does not use these.) - -`XCPPFLAGS' -`XDEFS' - Preprocessor options. - -`XCFLAGS' - Compiler options. - -`XLDFLAGS' - Loader options (included at beginning of link commands). - -`XLOADLIBES' - More loader options (included at end of link commands). - -`XMAKEARGS' - Additional Make arguments passed to all sub-`make''s. You may need - to include assignments to the other variables here via `XMAKEARGS'; - for example: `make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"'. - - It's generally a bad idea to use a different compiler (`CC') or -libraries (`LIBS') for compilation than you did for configuration, -since the values `configure' determined may then be incorrect. - - Adding compiler options to change the "universe" you are using -(typically BSD vs. system V) is generally a cause of trouble. It's -best to use the native environment, whatever that is; `configure' and -the software usually adapt best to that. In particular, under Solaris -2.x, you should not use the BSD-compatibility library (`libucb') or -include files (`ucbinclude'). - - If you want to use the Babel LaTeX package for support of non-English -typesetting, you need to modify some files before making the LaTeX -format. See the file `install.txt' in the Babel distribution. - -Installing files ----------------- - - The basic command is the usual `make install'. For security issues, -*note Security::.. - - The first time you install any manual in the GNU Info system, you -should add a line (you choose where) to the file `dir' in your -`$(infodir)' directory. Sample text for this is given near the top of -the Texinfo source files (`kpathsea/kpathsea.texi', -`dvipsk/dvips.texi', and `web2c/doc/web2c.texi'). If you have a recent -version of the GNU Texinfo distribution installed -(`ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-3.9.tar.gz' or later), this -should happen automatically. - - On the offchance that this is your first Info installation, the `dir' -file I use is included in the distribution as `etc/dir-example'. - - You may wish to use one of the following targets, especially if you -are installing on multiple architectures: - * `make install-exec' to install in architecture-dependent - directories, i.e., ones that depend on the `$(exec_prefix)' Make - variable. This includes links to binaries, libraries, etc., not - just "executables". - - * `make install-data' to install in architecture-independent - directories, such as documentation, configuration files, pool - files, etc. - - If you use the Andrew File System, the normal path (e.g., PREFIX/bin) -only gets you to a read-only copy of the files, and you must specify a -different path for installation. The best way to do this is by setting -the `prefix' variable on the `make' command line. The sequence becomes -something like this: - configure --prefix=/whatever - make - make install prefix=/afs/.SYSTEM.NAME/system/1.3/@sys/whatever - With AFS, you will definitely want to use relative filenames in -`ls-R' (*note Filename database::.), not absolute filenames. This is -done by default, but check anyway. - -Cleaning up ------------ - -The basic command is `make distclean'. This removes all files created -by the build. - - Alternatively, - * `make mostlyclean' if you intend to compile on another - architecture. For Web2C, since the generated C files are portable, - they are not removed. If the `lex' vs. `flex' situation is going - to be different on the next machine, `rm web2c/lex.yy.c'. - - * `make clean' to remove files created by compiling, but leave - configuration files and Makefiles. - - * `make maintainer-clean' to remove everything that the Makefiles can - rebuild. This is more than `distclean' removes, and you should - only use it if you are thoroughly conversant with (and have the - necessary versions of) Autoconf. - - * `make extraclean' to remove other junk, e.g., core files, log - files, patch rejects. This is independent of the other `clean' - targets. - -Filename database generation ----------------------------- - - You will probably want to set up a `cron' entry on the appropriate -machine(s) to rebuild the filename database nightly or so, as in: - 0 0 * * * cd TEXMF && /BINDIR/mktexlsr - *Note Filename database::. - -Although the `mktex...' scripts make every effort to add newly-created -files on the fly, it can't hurt to make sure you get a fresh version -every so often. - -`mktex' scripts ---------------- - - If Kpathsea cannot otherwise find a file, for some file types it is -configured by default to invoke an external program to create it -dynamically (*note mktex configuration::.). This is most useful for -fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as -the Sauter and EC fonts), since any given document can use fonts never -before referenced. Trying to build all fonts in advance is therefore -impractical, if not impossible. - - The script is passed the name of the file to create and possibly other -arguments, as explained below. It must echo the full pathname of the -file it created (and nothing else) to standard output; it can write -diagnostics to standard error. - -`mktex' configuration -..................... - - The following file types can run an external program to create missing -files: `pk', `tfm', `mf', `tex'; the scripts are named `mktexpk', -`mktextfm', `mktexmf', and `mktextex'. - - In the absence of `configure' options specifying otherwise, -everything but `mktextex' will be enabled by default. The `configure' -options to change the defaults are: - - --without-mktexmf-default - --without-mktexpk-default - --without-mktextfm-default - --with-mktextex-default - - The `configure' setting is overridden if the environment variable or -configuration file value named for the script is set; e.g., `MKTEXPK' -(*note mktex script arguments::.). - - As distributed, all the scripts source a file `texmf/web2c/mktex.cnf' -if it exists, so you can override various defaults. See `mktex.opt', -for instance, which defines the default mode, resolution, some special -directory names, etc. If you prefer not to change the distributed -scripts, you can simply create `mktex.cnf' with the appropriate -definitions (you do not need to create it if you have nothing to put in -it). `mktex.cnf' has no special syntax; it's an arbitrary Bourne shell -script. The distribution contains a sample `mktex.cnf' for you to copy -and modify as you please (it is not installed anywhere). - - In addition, you can configure a number of features with the -`MT_FEATURES' variable, which you can define: - * in `mktex.opt', as just mentioned; - - * by editing the file `mktex.opt', either before `make install' (in - the source hierarchy) or after (in the installed hierarchy); - - * or in the environment. - - If none of the options below are enabled, `mktexpk', `mktextfm', and -`mktexmf' follow the following procedure to decide where fonts should -be installed. Find the tree where the font's sources are, and test the -permissions of the `fonts' directory of that tree to determine whether -it is writable. If it is, put the files in the tree in appropriate -locations. If it isn't writable, see whether the tree is a system tree -(named in `SYSTEXMF'). If so, the `VARTEXFONTS' tree is used. In all -other cases the working directory is used. - - The `appendonlydir' option is enabled by default. - -`appendonlydir' - Tell `mktexdir' to create directories append-only, i.e., set their - sticky bit (*note Mode Structure: (fileutils)Mode Structure.). - This feature is silently ignored on non-Unix platforms (e.g. - Windows/NT and MS-DOS) which don't support similar functionality. - This feature is enabled by default. - -`dosnames' - Use 8.3 names; e.g., `dpi600/cmr10.pk' instead of `cmr10.600pk'. - Note that this feature only affects filenames that would otherwise - clash with other TeX-related filenames; `mktex' scripts do nothing - about filenames which exceed the 8+3 MS-DOS limits but remain - unique when truncated (by the OS) to these limits, and nether do - the scripts care about possible clashes with files which aren't - related with TeX. For example, `cmr10.600pk' would clash with - `cmr10.600gf' and is therefore changed when `dosnames' is in - effect, but `mf.pool' and `mp.base' don't clash with any - TeX-related files and are therefore unchanged. - - This feature is turned on by default on MS-DOS. If you do not wish - `dosnames' to be set on an MS-DOS platform, you need to set the - `MT_FEATURES' environment variable to a value that doesn't include - `dosnames'. You can also change the default setting by editing - `mktex.opt', but only if you use the `mktex' shell scripts; the - emulation programs don't consult `mktex.opt'. - -`fontmaps' - Instead of deriving the location of a font in the destination tree - from the location of the sources, the aliases and directory names - from the Fontname distribution are used. (*note Introduction: - (fontname)Top.). - -`nomode' - Omit the directory level for the mode name; this is fine as long as - you generate fonts for only one mode. - -`stripsupplier' - Omit the font supplier name directory level. - -`striptypeface' - Omit the font typeface name directory level. - -`strip' - Omit the font supplier and typeface name directory levels. This - feature is deprecated in favour of `stripsupplier' and - `striptypeface'. - -`varfonts' - When this option is enabled, fonts that would otherwise be written - in system texmf tree go to the `VARTEXFONTS' tree instead. The - default value in `kpathsea/Makefile.in' is `/var/tmp/texfonts'. - The `Linux File System Standard' recommends `/var/tex/fonts'. - - The `varfonts' setting in `MT_FEATURES' is overridden by the - `USE_VARTEXFONTS' environment variable: if set to `1', the feature - is enabled, and if set to `0', the feature is disabled. - -`mktex' script names -.................... - - The following table shows the default name of the script for each -possible file types. (The source is the variable `kpse_make_specs' in -`kpathsea/tex-make.c'.) - -`mktexpk' - Glyph fonts. - -`mktextex' - TeX input files. - -`mktexmf' - Metafont input files. - -`mktextfm' - TFM files. - -These names are overridden by an environment variable specific to the -program--for example, `DVIPSMAKEPK' for Dvipsk. - - If a `mktex...' script fails, the invocation is appended to a file -`missfont.log' (by default) in the current directory. You can then -execute the log file to create the missing files after fixing the -problem. - - If the current directory is not writable and the environment variable -or configuration file value `TEXMFOUTPUT' is set, its value is used. -Otherwise, nothing is written. The name `missfont.log' is overridden -by the `MISSFONT_LOG' environment variable or configuration file value. - -`mktex' script arguments -........................ - - The first argument to a `mktex' script is always the name of the file -to be created. - - In the default `mktexpk' implementation, additional arguments may -also be passed: - -`--dpi NUM' - Sets the resolution of the generated font to NUM. - -`--mfmode NAME' - Sets the Metafont mode to NAME. - -`--bdpi NUM' - Sets the the "base dpi" for the font. This must match the mode - being used. - -`--mag STRING' - A "magstep" string suitable for the Metafont `mag' variable. This - must match the combination of BDPI and DPI being used. - -`--destdir STRING' - A directory name. If the directory is absolute, it is used as-is. - Otherwise, it is appended to the root destination directory set in - the script. - -Installation testing --------------------- - - Besides the tests listed in *Note Simple installation::, you can try -running `make check'. This includes the torture tests (trip, trap, and -mptrap) that come with Web2c (*note Triptrap: (web2c)Triptrap.). - -Security -======== - - None of the programs in the TeX system require any special system -privileges, so there's no first-level security concern of people gaining -illegitimate root access. - - A TeX document, however, can write to arbitrary files, e.g., -`~/.rhosts', and thus an unwitting user who runs TeX on a random -document is vulnerable to a trojan horse attack. This loophole is -closed by default, but you can be permissive if you so desire in -`texmf.cnf'. *Note tex invocation: (web2c)tex invocation. MetaPost has -the same issue. - - Dvips, Xdvi, and TeX can also execute shell commands under some -circumstances. To disable this, see the `-R' option in *Note Option -details: (dvips)Option details, the xdvi man page, and *Note tex -invocation: (web2c)tex invocation, respectively. - - Another security issue arises because it's very useful--almost -necessary--to make arbitrary fonts on user demand with `mktexpk' and -friends. Where do these files get installed? By default, the -`mktexpk' distributed with Kpathsea assumes a world-writable `/var/tmp' -directory; this is a simple and convenient approach, but it may not -suit your situation because it means that a local cache of fonts is -created on every machine. - - To avoid this duplication, many people consider a shared, globally -writable font tree desirable, in spite of the potential security -problems. To do this you should change the value of `VARTEXFONTS' in -`texmf.cnf' to refer to some globally known directory. *Note mktex -configuration::. - - The first restriction you can apply is to make newly-created -directories under `texmf' be append-only with an option in `mktex.cnf'. -*Note mktex configuration::. - - Another approach is to establish a group (or user) for TeX files, -make the `texmf' tree writable only to that group (or user), and make -`mktexpk' et al. setgid to that group (or setuid to that user). Then -users must invoke the scripts to install things. (If you're worried -about the inevitable security holes in scripts, then you could write a -C wrapper to exec the script.) - - The `mktex...' scripts install files with the same read and write -permissions as the directory they are installed in. The executable, -sgid, suid, and sticky bits are always cleared. - - Any directories created by the `mktex...' scripts have the same -permissions as their parent directory, unless the `appendonlydir' -feature is used, in which case the sticky bit is always set. -
deleted file mode 100644 --- a/kpathsea/Makefile.in +++ /dev/null @@ -1,1196 +0,0 @@ -# Makefile for kpathsea --kb@mail.tug.org. Public domain. -version = @KPSEVERSION@ - -# Add -DNO_DEBUG to disable debugging, for vanishingly better performance. - -# paths.make -- installation directories. -# -# The compile-time paths are defined in kpathsea/paths.h, which is built -# from kpathsea/texmf.in and these definitions. See kpathsea/INSTALL -# for how the various path-related files are used and created. - -# Do not change prefix and exec_prefix in Makefile.in! -# configure doesn't propagate the change to the other Makefiles. -# Instead, give the -prefix/-exec-prefix options to configure. -# (See kpathsea/INSTALL for more details.) This is arguably -# a bug, but it's not likely to change soon. -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# Architecture-dependent executables. -bindir = @bindir@ - -# Architecture-independent executables. -scriptdir = $(bindir) - -# Architecture-dependent files, such as lib*.a files. -libdir = @libdir@ - -# Architecture-independent files. -datadir = @datadir@ - -# Header files. -includedir = @includedir@ - -# GNU .info* files. -infodir = @infodir@ - -# Unix man pages. -manext = 1 -mandir = @mandir@/man$(manext) - -# TeX system-specific directories. Not all of the following are relevant -# for all programs, but it seems cleaner to collect everything in one place. - -# The default paths are now in kpathsea/texmf.in. Passing all the -# paths to sub-makes can make the arg list too long on system V. -# Note that if you make changes below, you will have to make the -# corresponding changes to texmf.in or texmf.cnf yourself. - -# The root of the main tree. -texmf = @texmfmain@ - -# The directory used by varfonts. -vartexfonts = /var/tmp/texfonts - -# Regular input files. -texinputdir = $(texmf)/tex -mfinputdir = $(texmf)/metafont -mpinputdir = $(texmf)/metapost -mftinputdir = $(texmf)/mft - -# dvips's epsf.tex, rotate.tex, etc. get installed here; -# ditto for dvilj's fonts support. -dvips_plain_macrodir = $(texinputdir)/plain/dvips -dvilj_latex2e_macrodir = $(texinputdir)/latex/dvilj - -# mktex.cnf, texmf.cnf, etc. -web2cdir = $(texmf)/web2c - -# The top-level font directory. -fontdir = $(texmf)/fonts - -# Memory dumps (.fmt/.base/.mem). -fmtdir = $(web2cdir) -basedir = $(fmtdir) -memdir = $(fmtdir) - -# Pool files. -texpooldir = $(web2cdir) -mfpooldir = $(texpooldir) -mppooldir = $(texpooldir) - -# Where the .map files from fontname are installed. -fontnamedir = $(texmf)/fontname - -# For dvips configuration files, psfonts.map, etc. -dvipsdir = $(texmf)/dvips - -# For dvips .pro files, gsftopk's render.ps, etc. -psheaderdir = $(dvipsdir) - -# If a font can't be found close enough to its stated size, we look for -# each of these sizes in the order given. This colon-separated list is -# overridden by the envvar TEXSIZES, and by a program-specific variable -# (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips). -# This list must be sorted in ascending order. -default_texsizes = 300:600 - -# End of paths.make. - -# makevars.make -- the directory names we pass. -# It's important that none of these values contain [ @%], for the sake -# of kpathsea/texmf.sed. -makevars = prefix=$(prefix) exec_prefix=$(exec_prefix) \ - bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \ - datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \ - manext=$(manext) mandir=$(mandir) \ - texmf=$(texmf) web2cdir=$(web2cdir) vartexfonts=$(vartexfonts)\ - texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) mpinputdir=$(mpinputdir)\ - fontdir=$(fontdir) fmtdir=$(fmtdir) basedir=$(basedir) memdir=$(memdir) \ - texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) mppooldir=$(mppooldir) \ - dvips_plain_macrodir=$(dvips_plain_macrodir) \ - dvilj_latex2e_macrodir=$(dvilj_latex2e_macrodir) \ - dvipsdir=$(dvipsdir) psheaderdir=$(psheaderdir) \ - default_texsizes='$(default_texsizes)' -# End of makevars.make. - -# common.make -- used by all Makefiles. -SHELL = /bin/sh -@SET_MAKE@ -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -CC = @CC@ -CFLAGS = @CFLAGS@ $(XCFLAGS) -CPPFLAGS = @CPPFLAGS@ $(XCPPFLAGS) -DEFS = @DEFS@ $(XDEFS) - -# Kpathsea needs this for compiling, programs need it for linking. -LIBTOOL = $(top_srcdir)/klibtool - -# You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but -# please don't change ALL_CPPFLAGS or ALL_CFLAGS. -# prog_cflags is set by subdirectories of web2c. -ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) $(prog_cflags) \ - -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) $(CPPFLAGS) -ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -c -compile = $(CC) $(ALL_CFLAGS) - -.SUFFIXES: .c .o # in case the suffix list has been cleared, e.g., by web2c -.c.o: - $(compile) $< - -# Installation. -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = $(INSTALL_PROGRAM) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LIBTOOL_LIBS = INSTALL_DATA='$(INSTALL_DATA)' $(LIBTOOL) install-lib -INSTALL_LIBTOOL_PROG = INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(LIBTOOL) install-prog - -# Creating (symbolic) links. -LN = @LN_S@ - -# We use these for many things. -kpathsea_parent = .. -kpathsea_dir = $(kpathsea_parent)/kpathsea -kpathsea_srcdir_parent = $(top_srcdir)/.. -kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea -kpathsea = $(kpathsea_dir)/libkpathsea.la - -# End of common.make. - -# library.make -- stuff only useful for libraries. -AR = ar -ARFLAGS = cq -RANLIB = @RANLIB@ -# End of library.make. - -# programs.make -- used by Makefiles for executables only. - -# Don't include $(CFLAGS), since ld -g under Linux forces -# static libraries, e.g., libc.a and libX*.a. -LDFLAGS = @LDFLAGS@ $(XLDFLAGS) - -# proglib is for web2c; -# XLOADLIBES is for the installer. -LIBS = @LIBS@ -LOADLIBES = $(proglib) $(kpathsea) $(LIBS) -lm $(XLOADLIBES) - -# May as well separate linking from compiling, just in case. -CCLD = $(CC) -link_command = $(CCLD) -o $@ $(LDFLAGS) - -# When we link with Kpathsea, have to take account that it might be a -# shared library, etc. -kpathsea_link = $(LIBTOOL) link $(link_command) -# End of programs.make. - -# texi.make -- making .dvi and .info from .texi. -MAKEINFO = makeinfo -MAKEINFO_FLAGS = --paragraph-indent=2 -I$(srcdir) - -TEXI2DVI = texi2dvi - -TEXI2HTML = texi2html -TEXI2HTML_FLAGS = -expandinfo -number -menu -split_chapter -# If you prefer one big .html file instead of several, remove -# -split-node or replace it by -split_chapter. - -# For making normal text files out of Texinfo source. -one_info = --no-headers --no-split --no-validate - -.SUFFIXES: .info .dvi .html .texi -.texi.info: - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ -.texi.dvi: - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< -.texi.html: - $(TEXI2HTML) $(TEXI2HTML_FLAGS) $< -# End of texi.make. - - -# Install these header files (except acconfig.h). -install_headers = *.h $(srcdir)/*.h - -# Put tex-file.o first, because it's what depends on the paths, and may -# reduce frustration if the paths are wrong by doing it first. - -objects = \ -tex-file.lo absolute.lo atou.lo basename.lo cnf.lo concat.lo concat3.lo \ -concatn.lo db.lo debug.lo dir.lo elt-dirs.lo expand.lo extend-fname.lo \ -file-p.lo find-suffix.lo fn.lo fontmap.lo getopt.lo getopt1.lo hash.lo \ -kdefault.lo line.lo magstep.lo make-suffix.lo path-elt.lo \ -pathsearch.lo proginit.lo progname.lo readable.lo rm-suffix.lo \ -str-list.lo str-llist.lo tex-glyph.lo tex-hush.lo tex-make.lo \ -tilde.lo truncate.lo uppercasify.lo variable.lo version.lo xcalloc.lo \ -xfopen.lo xfseek.lo xftell.lo xgetcwd.lo xmalloc.lo xopendir.lo xputenv.lo \ -xrealloc.lo xstat.lo xstrdup.lo $(liblobjs) $(malloc) -liblobjs = @LTLIBOBJS@ - -library = kpathsea - -# We want to compile almost everything with libtool ... -KPATHSEA_CC = $(LIBTOOL) compile "$(CC)" -.SUFFIXES: .lo -.c.lo: - $(KPATHSEA_CC) $< $(ALL_CFLAGS) - -default all: $(kpathsea) - -kpsewhich: $(kpathsea) kpsewhich.o - $(kpathsea_link) kpsewhich.o $(LOADLIBES) - -kpsestat: kpsestat.o - $(link_command) kpsestat.o - -access: access.o - $(link_command) access.o - -readlink: readlink.o - $(link_command) readlink.o - -## For Octave, just make the object files. - -$(kpathsea): $(objects) klibtool.version - -##$(kpathsea): $(objects) klibtool.version -## $(LIBTOOL) archive $(AR) $(ARFLAGS) $@ $(objects) -## $(INSTALL_LIBTOOL_LIBS) . lib$(library).la - -# All the objects depend on the klibtool configuration file. -$(objects): klibtool.config - -# Create klibtool.version in the build tree -klibtool.version: - $(LN) $(srcdir)/kpathsea.version $@ - -# Make variable substitutions for paths.h. -texmf.cnf: texmf.in texmf.sed - sed -f texmf.sed $(srcdir)/texmf.in >$@ - -# The idea is to turn each var=value into s%@var@%value%g. Seems simpler -# to put the substitutions in a file than to play shell quoting games. -texmf.sed: Makefile - rm -f texmf.sed - echo $(makevars) \ - | tr ' ' '\012' \ - | sed -e 's/^/s%@/' -e 's/=/@%/' -e 's/$$/%/' -e 's/$$/g/' \ - >$@ -# Insert $TEXMF in as many of the hardwired paths as possible. We could -# use the slightly different rule 's%$(texmf)/%\$$TEXMF/%g' and avoid -# the need for the corrections below. But if texmf.in is edited -# the heuristic may no longer work. - echo 's%$(texmf)%\$$TEXMF%g' >>$@ -# Now we repair the damage this may have caused. Don't replace the rhs of -# the TEXMFMAIN assignment itself, then we'd end up with TEXMFMAIN = $TEXMF -# and TEXMF = $TEXMFMAIN. The (commented) assignment of TEXMFLOCAL is -# likely to have been mangled as well. - echo '/^ *TEXMFMAIN[ =]/s%\$$TEXMF%$(texmf)%' >>$@ - echo '/^[% ]*TEXMFLOCAL[ =]/s%\$$TEXMF%$(texmf)%' >>$@ -# And fill in the last clause of TEXMFCNF with an absolute path. - echo '/^ *TEXMFCNF[ =]/s%@web2c@%$(web2cdir)%' >>$@ - -# First null out comments and leading/trailing whitespace, then remove -# lines that define invalid C identifiers, then remove blank lines and -# lines that define lowercase values (those are never path values). Each -# line remaining looks like -# <name> = <value> -# (but = and surrounding spaces are optional, hence can't remove all spaces). -# Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif, -# then change the @'s to newlines (sed isn't good at multiline replacements). -# -# No backslash-newline escapes in the long sed replacement because that -# will turn into a space in the output. -# -# Without the $TEXMF/prefix/etc. substitutions, if the cnf file was -# not found, the compile-time paths would be of little use, since TEXMF -# (etc.) wouldn't be defined. Alternatively, we could have a way to -# specify compile-time default values for variables in general, but I -# think it's better to keep the last-resort paths as simple as possible. -# -# The definition of DEFAULT_TEXMF (and other variables) -# that winds up in the final paths.h will not be used. -# -# We don't want to rewrite paths.h when we have only changed comments -# in texmf.in that have no effect on paths.h, since that would cause -# almost everything to be rebuilt. -$(kpathsea_dir)/paths.h: stamp-paths -stamp-paths: texmf.cnf - echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp - sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' texmf.cnf \ - | grep '^[ ]*[A-Z0-9_]*[ =]' \ - | sed '/^$$/d' \ - | sed 's/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1@#define DEFAULT_\1 "\2"@#endif/' \ - | tr '@' '\012' \ - | sed -e 's%\$$TEXMFMAIN%$(texmf)%g' \ - -e 's%\$$TEXMF%$(texmf)%g' \ - -e 's%\$$VARTEXFONTS%$(vartexfonts)%g' \ - -e 's%\$$web2cdir%$(web2cdir)%g' \ - -e 's%\$$prefix%$(prefix)%g' \ - >>paths.tmp - @if cmp -s paths.h paths.tmp 2>/dev/null; then \ - echo "paths.h is unchanged"; \ - else \ - echo "cp paths.tmp paths.h"; \ - cp paths.tmp paths.h; \ - fi - rm -f paths.tmp - date >stamp-paths - -# Need an extra definition for this. Dependencies included below. -tex-file.o: - $(KPATHSEA_CC) -DDEFAULT_FONT_SIZES='\"$(default_texsizes)\"' $(srcdir)/tex-file.c - -check: kpsewhich - ./kpsewhich -expand-var '$$TEXMF' - -#install: install-exec install-data -#uninstall: uninstall-exec uninstall-data - -install uninstall: - -install-exec: kpsewhich - $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir) \ - $(libdir) $(web2cdir) - if grep 'original mktexpk --' $(scriptdir)/mktexpk >/dev/null 2>&1\ - || test ! -r $(scriptdir)/mktexpk; then \ - $(INSTALL_SCRIPT) $(srcdir)/mktexpk $(scriptdir)/mktexpk; \ - else true; fi - if grep 'original mktexmf --' $(scriptdir)/mktexmf >/dev/null 2>&1\ - || test ! -r $(scriptdir)/mktexmf; then \ - $(INSTALL_SCRIPT) $(srcdir)/mktexmf $(scriptdir)/mktexmf; \ - else true; fi - if grep 'original mktextfm --' $(scriptdir)/mktextfm >/dev/null 2>&1\ - || test ! -r $(scriptdir)/mktextfm; then \ - $(INSTALL_SCRIPT) $(srcdir)/mktextfm $(scriptdir)/mktextfm; \ - else true; fi - if grep 'original mktexlsr --' $(scriptdir)/mktexlsr >/dev/null 2>&1\ - || test ! -r $(scriptdir)/mktexlsr; then \ - $(INSTALL_SCRIPT) $(srcdir)/mktexlsr $(scriptdir)/mktexlsr; \ - else true; fi - $(INSTALL_SCRIPT) $(srcdir)/mktex.opt $(web2cdir)/mktex.opt - $(INSTALL_SCRIPT) $(srcdir)/mktexdir $(web2cdir)/mktexdir - $(INSTALL_SCRIPT) $(srcdir)/mktexdir.opt $(web2cdir)/mktexdir.opt - $(INSTALL_SCRIPT) $(srcdir)/mktexnam $(web2cdir)/mktexnam - $(INSTALL_SCRIPT) $(srcdir)/mktexnam.opt $(web2cdir)/mktexnam.opt - $(INSTALL_SCRIPT) $(srcdir)/mktexupd $(web2cdir)/mktexupd - $(INSTALL_LIBTOOL_LIBS) $(libdir) lib$(library).la - $(INSTALL_LIBTOOL_PROG) $(bindir) kpsewhich - $(INSTALL_PROGRAM) kpsestat $(bindir) - $(INSTALL_PROGRAM) access $(bindir) - $(INSTALL_PROGRAM) readlink $(bindir) -uninstall-exec: - rm -f $(bindir)/kpsewhich - -install-data: texmf.cnf kpathsea.info install-man - $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf) $(infodir) $(web2cdir) - if grep 'original texmf.cnf --' $(web2cdir)/texmf.cnf >/dev/null 2>&1 \ - || test ! -r $(web2cdir)/texmf.cnf; then \ - $(INSTALL_DATA) texmf.cnf $(web2cdir)/texmf.cnf; \ - else true; fi - test -r kpathsea.info || cd $(srcdir) && for i in kpathsea.i*; do \ - $(INSTALL_DATA) $$i $(infodir)/$$i; done -# Should we install the headers? They are not just system-dependent, -# which is bad enough, but even compiler-dependent. - $(SHELL) $(top_srcdir)/../mkinstalldirs $(includedir)/kpathsea - for f in $(install_headers); do \ - $(INSTALL_DATA) $$f $(includedir)/kpathsea/; done - rm -f $(includedir)/kpathsea/acconfig.h - $(POSTINSTALL) - test -r $(infodir)/dir || $(INSTALL_DATA) $(top_srcdir)/../dir $(infodir) - if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - install-info --info-dir=$(infodir) $(infodir)/kpathsea.info; \ - else true; fi - -uninstall-data: - rm -f $(infodir)/kpathsea.i* -# for f in $(install_headers); do rm -f $(includedir)/`basename $$f`; done - -# distdir is used by other distributions; they define $(distdir). -distdir: doc $(library).dvi $(library).h - rm -rf $(distdir) - mkdir -p $(distdir) - ln $(ln_files) kpathsea.version $(distdir) - touch *.info* - ln mktex* *.info* *.texi $(library).aux $(library).cps $(distdir) - rm -f $(distdir)/*.1 $(distdir)/*.man - ln *.man $(distdir) - ln BUGS README.CONFIGURE HIER PROJECTS *.ac $(distdir) - touch kpathsea.h # to avoid .cps.h rule on Solaris - cd $(distdir) && rm -f paths.h - -# I don't use this, but other programmers want it. acconfig.h is an -# autoheader input file, not an includable C header. Bad name. -$(library).h: always - rm -f $@ - echo '#include <kpathsea/config.h>' >$@ - ls -1 *.h \ - | grep -v '\(acconfig\|config\|kpathsea\|win32lib\|c-auto\)\.h' \ - | sed -e 's,^,#include <kpathsea/,' -e s',$$,>,' >>$@ - touch -r `ls -1t *.h | tail +2 | head -1` $@ -always: -.PHONY: always - -# config.make -- autoconf rules to remake the Makefile, c-auto.h, etc. - -config.status: $(srcdir)/configure - $(SHELL) $(srcdir)/configure --no-create $(enablemaintflag) - -Makefile: $(srcdir)/Makefile.in config.status - $(SHELL) config.status - -# This rule isn't used for the top-level Makefile, but it doesn't hurt. -# We don't depend on config.status because configure always rewrites -# config.status, even when it doesn't change. Thus it might be newer -# than c-auto.h when we don't need to remake the latter. -c-auto.h: stamp-auto -stamp-auto: $(srcdir)/c-auto.in - $(SHELL) config.status - date >stamp-auto - - -# End of config.make. - -info: $(library).info -dvi: $(library).dvi - -$(library).info: bugs.texi hier.texi install.texi unixtex.texi - - -# clean.make -- cleaning. -mostlyclean:: - rm -f *.o - -clean:: mostlyclean - rm -f $(program) $(programs) squeeze lib$(library).* $(library).a *.bad - rm -f *.exe *.dvi *.lj - -distclean:: extraclean clean - rm -f Makefile - rm -f config.status config.log config.cache c-auto.h - rm -f stamp-auto stamp-tangle stamp-otangle - -# Although we can remake configure and c-auto.in, we don't remove -# them, since many people may lack Autoconf. Use configclean for that. -maintainer-clean:: distclean - rm -f *.info* - -extraclean:: - rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.pl *.tfm *.vf *.vpl - rm -f *.*pk *.*gf *.mpx *.i *.s *~ *.orig *.rej *\#* - rm -f CONTENTS.tex a.out core mfput.* texput.* mpout.* - -configclean: - rm -f configure c-auto.in c-auto.h stamp-* -# End of clean.make. - -mostlyclean:: - rm -f kpsewhich kpsestat access readlink *.lo klibtool.version - rm -rf PROF PROF_SHARED SHARED STATIC -distclean:: - rm -f paths.h texmf.cnf texmf.sed stamp-paths - -# The manual pages -manfiles = access.1 kpsestat.1 kpsewhich.1 readlink.1 \ - mktexlsr.1 mktexmf.1 mktextfm.1 mktexpk.1 - -# man.make: Makefile fragment for web2c manual pages. - -#DITROFF = ditroff -DITROFF = groff - -# The edited file always has extension .1; we change it when we install. -.SUFFIXES: .man .1 .txt .ps .dvi -.man.1: - sed -f sedscript $< >$@ -.1.dvi: - $(DITROFF) -Tdvi -man $< >$@ -.1.ps: - $(DITROFF) -Tps -man $< >$@ -.1.txt: - $(DITROFF) -Tascii -man $< | col -b | expand >$@ - -all: $(manfiles) -.PHONY: dw - -$(manfiles): sedscript - -manfiles: $(manfiles) -dvi: $(manfiles:.1=.dvi) -ps: $(manfiles:.1=.ps) -txt: $(manfiles:.1=.txt) - -# We do not depend on the top-level Makefile since the top-level -# Makefile can change for reasons that do not affect the man pages. -# At present, all but VERSION should be unused. -sedscript: - cp /dev/null sedscript - for f in $(kpathsea_dir)/paths.h; do \ - sed -n -e '/^#define/s/#define[ ][ ]*\([A-Z_a-z][A-Z_a-z]*\)[ ][ ]*\(.*\)/s%@\1@%\2%/p' \ - $$f \ - | sed -e 's/"//g' -e 's/[ ]*\/\*[^*]*\*\///g' >>sedscript;\ - done - echo 's%@VERSION@%$(version)%' >>sedscript - echo 's%@BINDIR@%$(bindir)%' >>sedscript - echo 's%@INFODIR@%$(infodir)%' >>sedscript - echo 's%@TEXINPUTDIR@%$(texinputdir)%' >>sedscript - echo 's%@MFINPUTDIR@%$(mfinputdir)%' >>sedscript - echo 's%@MPINPUTDIR@%$(mpinputdir)%' >>sedscript - echo 's%@FONTDIR@%$(fontdir)%' >>sedscript - echo 's%@FMTDIR@%$(fmtdir)%' >>sedscript - echo 's%@BASEDIR@%$(basedir)%' >>sedscript - echo 's%@MEMDIR@%$(memdir)%' >>sedscript - echo 's%@TEXPOOLDIR@%$(texpooldir)%' >>sedscript - echo 's%@MFPOOLDIR@%$(mfpooldir)%' >>sedscript - echo 's%@MPPOOLDIR@%$(mppooldir)%' >>sedscript - echo 's%@FONTMAPDIR@%$(dvipsdir)%' >>sedscript - echo 's%@LOCALMODES@%$(localmodes)%' >>sedscript - -install-man: manfiles - $(top_srcdir)/../mkinstalldirs $(mandir) - for nameone in $(manfiles); do \ - name=`basename $${nameone} .1`; \ - $(INSTALL_DATA) $${name}.1 $(mandir)/$${name}.$(manext); \ - done - -uninstall-man: - for nameone in $(manfiles); do \ - name=`basename $${nameone} .1`; \ - rm -f $(mandir)/$${name}.$(manext); \ - done - -install-data: install-man -uninstall-data: uninstall-man - -mostlyclean:: - rm -f *.1 - -clean:: - rm -f sedscript - -# end of man.make - -# rdepend.make -- rules for remaking the dependencies. - -# Let's stick a rule for TAGS here, just in case someone wants them. -# (We don't put them in the distributions, to keep them smaller.) -TAGS: *.c *.h - pwd | grep kpathsea >/dev/null && append=../kpathsea/TAGS; \ - etags $$append *.[ch] - -# Prevent GNU make 3.[59,63) from overflowing arg limit on system V. -.NOEXPORT: - -# End of rdepend.make. - -absolute.lo: absolute.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h -access.o: access.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -atou.lo: atou.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -basename.lo: basename.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -cnf.lo: cnf.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \ - $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h $(kpathsea_dir)/paths.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -concat.lo: concat.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -concat3.lo: concat3.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -concatn.lo: concatn.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h -db.lo: db.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/db.h \ - $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -debug.lo: debug.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -dir.lo: dir.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-dir.h \ - $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/hash.h -elt-dirs.lo: elt-dirs.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fn.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h -expand.lo: expand.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tilde.h $(kpathsea_srcdir)/variable.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/absolute.h -extend-fname.lo: extend-fname.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -file-p.lo: file-p.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h -find-suffix.lo: find-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h -fn.lo: fn.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/fn.h -fontmap.lo: fontmap.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/tex-file.h -getopt.lo: getopt.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -getopt1.lo: getopt1.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h getopt.h -hash.lo: hash.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/str-list.h -kdefault.lo: kdefault.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/default.h -kpsestat.o: kpsestat.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-stat.h -kpsewhich.o: kpsewhich.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/getopt.h \ - $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-glyph.h \ - $(kpathsea_srcdir)/variable.h -line.lo: line.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/line.h -magstep.lo: magstep.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h -make-suffix.lo: make-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h -path-elt.lo: path-elt.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h -pathsearch.lo: pathsearch.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/variable.h -proginit.lo: proginit.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h -progname.lo: progname.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h -putenv.lo: putenv.c -readable.lo: readable.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-hush.h \ - $(kpathsea_srcdir)/truncate.h -readlink.o: readlink.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathmx.h $(kpathsea_srcdir)/c-stat.h -rm-suffix.lo: rm-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -str-list.lo: str-list.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/str-list.h -str-llist.lo: str-llist.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/str-llist.h -strcasecmp.lo: strcasecmp.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -strstr.lo: strstr.c -strtol.lo: strtol.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -tex-file.lo: tex-file.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/cnf.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/default.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_dir)/paths.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/variable.h -tex-glyph.lo: tex-glyph.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-glyph.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/variable.h -tex-hush.lo: tex-hush.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-hush.h $(kpathsea_srcdir)/variable.h -tex-make.lo: tex-make.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h \ - $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/fn.h \ - $(kpathsea_srcdir)/magstep.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-make.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -tilde.lo: tilde.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/tilde.h -truncate.lo: truncate.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-namemx.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-pathmx.h \ - $(kpathsea_srcdir)/truncate.h -uppercasify.lo: uppercasify.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h -variable.lo: variable.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/variable.h -version.lo: version.c c-auto.h -win32lib.lo: win32lib.c -xcalloc.lo: xcalloc.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xfopen.lo: xfopen.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xfseek.lo: xfseek.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xftell.lo: xftell.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xgetcwd.lo: xgetcwd.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathmx.h -xmalloc.lo: xmalloc.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xopendir.lo: xopendir.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h -xputenv.lo: xputenv.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xrealloc.lo: xrealloc.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xstat.lo: xstat.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h -xstrdup.lo: xstrdup.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h
deleted file mode 100644 --- a/kpathsea/NEWS +++ /dev/null @@ -1,197 +0,0 @@ -This file records noteworthy changes. -3.2 (15 March 1998) -* Brace expansion will accept the path separator as well as the comma, - e.g., {foo:bar}. -* For TeX, we only recognize one suffix, because there is no such thing - as a canonical list of TeX suffixes. -* We distinguish between two kinds of suffixes in the code: the standard - suffixes which may be appended to filenames when searching; and the - alternative suffixes which are never appended, but when found this - prevents a search with one of the standard suffixes. -* kpse_reset_program_name: change assumed program name, resets the search - paths, so that searches will work as expected for the new name. -* kpse_set_program_name: new function, replaces kpse_set_progname. -* The MakeTeX* scripts have been renamed to mktex* forms. - -3.1 (10 November 1997) -* The support for multiple texmf trees is much improved. -* New MakeTeX* scripts, based on teTeX's. These scripts now use - heuristics to decide where generated files are placed and which - permissions they should have. -* The varfonts feature is enabled by default. -* Some MSDOS/Win32 support added to the sources. -* Change in searching algorithm: if a name doesn't have the default suffix - we append it for the first search. Then we search for the bare name. - Thus if you have foo.bar and foo.bar.tex, the latter will now be found - first. Under the old system, you had to specify boo.bar.tex.tex to get - foo.bar.tex instead of foo.bar. -* Prepend the value of KPSE_DOT to relative paths from texmf.cnf if it - defined in the environment. This means we can use . instead of - $KPSE_DOT in paths. -* Define brace expansion so that {a,b}{1,2} expands to a1:b1:a2:b2. This - is different from how shells do it, and exploited in texmf.in. -* Renamed texmf.cnf.in to texmf.in. -* New value for debugging: DEBUG_VARS, equal to 64. -* If a file format has no suffix, allow its long name as the argument to - kpsewhich --format. - -3.0 (7 February 1997) -* Distribution terms changed to the GNU Library General Public License. -* Default directory structure matches the TDS standard. The most - important change is in the fonts/ directory: the file type (tfm, pk) - is now directly underneath fonts/. Also, mft/ is now at the top level. - `modeless' is used for gsftopk/ps2pk/etc.-generated fonts. -* Change in searching algorithm: if the name already has a suffix - (foo.sty), search for it by itself first, before appending the default - suffix (foo.sty.tex). This loses if you have an executable named - foo.bar, with documentation in foo.bar.tex (foo.bar will be found - first). But this is unusual, and the other case is common. -* Environment variables PATH_program (e.g., TEXINPUTS_latex) checked - for, as with configuration file values (TEXINPUTS.latex). -* Multiple TEXMF trees supported, via the following new facility: -* Shell brace expansion {foo,bar} implemented, thanks to Bash. -* Multiple ls-R files supported via the TEXMFDBS path. -* An ``alias'' database for files in ls-R supported, to handle 8.3 problems. -* Directories in the ls-R file can be relative (./) as well as absolute (/). -* New MakeTeX{PK,TFM,MF} scripts with more features, based on teTeX's. -* DVIPSMAKEPK (etc.) actually overrides the name `MakeTeXPK', as documented. -* MakeTeX* can be globally disabled via configure options. -* Support for building as a shared library with configure --enable-shared. -* Directories whose names begin with `.' are ignored. -* Some warnings can be suppressed by TEX_HUSH cnf value or envvar. -* kpsewhich has many new capabilities, documented via --help and in the manual. -* texfonts.map parsing has an include directive, and @c is a comment. -* Input lines in texmf.cnf can be continued with \. -* TEXMFLOG can be set in texmf.cnf, as previously documented. -* SELFAUTODIR and SELFAUTOPARENT are defined according to the location - of the binary, and used to search for texmf.cnf. -* /// (or more) is equivalent to //. -* If $HOME = / (as with root on some systems), avoid creating // in paths. -* Support for AFM, PostScript Type 1 font, source, documentation, Omega, - and MetaPost-related file formats. -* New header kpathsea.h with all #include files. -* Under DOS, ls-R lines need not start with . or / or \ (e.g., c:). -* Amiga support. - -2.6 (9 January 1995) -* MakeTeXPK installed from kpathsea, instead of each driver. -* MakeTeXPK.site looked for in texmf/web2c, instead of texmf/dvips. -* texmf.cnf installed and looked for in texmf/web2c, instead of texmf. -* If a mode is not explicitly specified, search all subdirectories (this - was actually in a previous release). -* install-sh only looked for in the top-level directory. -* kpsewhich replaces and generalizes kpsexpand. - -2.5 (15 December 1994) -* Go back to calling db_insert after a successful MakeTeXPK, and check - for lack of an ls-R. -* Handle case of magstep -.5 for MakeTeXPK properly. - -2.4 (28 October 1994) -* Avoid calling db_insert, which caused a segmentation fault. - -2.3 (26 October 1994) -* Extra :'s in an envvar value, referring to the texmf.cnf value, work. -* Names like dpi600/cmr10.pk can be found in ls-R. -* KPATHSEA_DEBUG environment variable checked. -* Directories like pk/ljfour directly under $TEXMF/fonts are found. -* New standalone program, kpsexpand, optionally compiled and installed, - to do variable expansion (not path searching). -* Debugging output written to stderr instead of stdout. -* pxlNNN support removed; I never intended to support `pxl1500', and - pxl300 is never used. - -2.2 (14 October 1994) -* MakeTeXPK invoked for the any_glyph type; this is for xdvik. -* MakeTeXPK sources $(psheaderdir)/MakeTeXPK.site if it exists. -* pxlNNN/cmr10.pk searched for (as well as dpiNNN/cmr10.pk and cmr10.NNNpk) - -2.1 (12 September 1994) -* Manual goes through TeX, and .cps/.aux files are in the distribution. -* INSTALL* variables set at the top level. -* Dependency on GNU tr making paths.h and texmf.sed (->texmf.cnf) removed. -* texmf.cnf installed if it didn't previously exist. - -2.0 (8 September 1994) -* Runtime configuration file support; see the manual. -* Both dpi600/cmr10.pk and cmr10.600pk are searched for. -* ls-R matches $TEXMF//latex2e vs. $TEXMF//latex209. -* $TEXMFLOG, if set, specifies a filename for logging successful searches. -* All directory entries beginning with `.' are ignored, not just `.' and `..'. -* Default path for PK and GF fonts includes the mode name. -* ls-R is in $TEXMFROOT instead of hardwired at compile time. -* More debugging flags, and they can be set with client program options. -* If MakeTeX{PK,TFM} fail, or aren't invoked, a file missfont.log is - written with the requisite commands, as in dvips. -* More 328/329/330 fixes, maybe for the last time. -* The override font paths (XDVIFONTS etc.) apply only to glyph (PK/GF) - searches, not TFM or VF. -* -g is not the default when linking, to avoid unnecessarily large binaries - (due to static libraries) under Linux. -* configure checks for a smart putenv. -* Stat results are cached to speed up disk searches. - -1.8 (2 April 1994) -* New target install-info, so the documentation can be installed without - the headers. -* Existing but unreadable files are complained about, instead of just ignored. -* A leading %% in a path element forbids searching the disk for that - element; only a db will be searched (if it exists). -* The db is only used if it might be relevant to a given path element, - not searched first regardless. - -1.7 (1 March 1994) -* Searches can use an externally-built ls-R ``database'', for speed. -* `VPATH = .' lines removed from generated Makefile, for broken Sun make. -* A path foo//tfm finds foo/tfm as well as foo/*/tfm. - -1.6 (3 February 1994) -* Memory fault in copying long paths fixed. -* More variables passed down from the top-level Makefile. -* Mention SMART_PUTENV in the INSTALL file, and fix bug in xputenv.c - when one envvar is a proper prefix of another. -* More attempts at eliminating magstephalf annoyances. -* Directory name substitutions are done globally when creating paths.h. -* Various changes for DOS. - -1.5 (24 January 1994) -* Default paths changed. -* Defining GCC_WCHAR lets GCC define wchar_t. -* EXIT_FAILURE and EXIT_SUCCESS defined in all cases (if they're not already). -* str[r]chr never redefined (I hope). - -1.4 (3 November 1993) -* Check closest fallback font size. -* All default paths (including dvips') in paths.h.in, not the Makefile. -* Rearrange directory lists so that dirs in which a file is found - migrate to the top. -* Update for Autoconf 1.7. - -1.3 (6 October 1993) -* Fix free of non-malloced memory bug. -* Fix uninitialized gf path bug. -* mkdirchain invoked as an absolute filename. - -1.2 (27 September 1993) -* Running MakeTeXPK is tried before the fallback resolutions. -* The final bitmap name uses a variable spec, so DOS & OS/2 can get - dpi300/cmr10.pk. -* Document TeX-specific features. -* Dpi passed to MakeTeXPK via the envvar KPATHSEA_DPI instead of MAKETEX_DPI. - -1.1 (26 August 1993) -* Installation fixes. - -1.0 (5 August 1993) -* Routines to look up TeX font files, default path specifications, etc. -* Sort-of pattern matching: /foo//bar matches subdirectories - /foo/a/bar, /foo/b/bar, /foo/a1/a2/bar, etc. -* $var and ${var} expansion. -* Support for MakeTeX... scripts. -* Support for fallback resolutions and font. -* Lazy evaluation of path elements. -* Some runtime debugging support. - -0.2 (12 May 1993) - -First general release as a standalone library.
deleted file mode 100644 --- a/kpathsea/PROJECTS +++ /dev/null @@ -1,23 +0,0 @@ -Here are some ideas for improvements. If you would like to contribute, -please send mail to me (infovore@xs4all.nl) first. - - -If the library is built shared, it would be nice if the binaries did not -have it as a dependency; as it is, all of Web2c gets rebuilt if the -library changes, even though logically only relinking (maybe not even -that) is necessary. This is because if the Web2c programs themselves -get relinked (as they do), we must reconvert the web programs. - -For multiple texmf.cnf files (or multiple dvips configuration files), -replace extra :'s by the value from the next file in the path, rather -than the value from the next level. - -Support runtime registration of file types to search for, not just -compile-time. Either by a procedure call, or by reading a configuration -file. Implies putting the envvar list into the kpse_format_info_type struct. - -cd during filesystem operations, to minimize the pathname -length. Implies always using xgetwd. - -Separate the routines needed for path searching, and others that are here -only because it's a common place -- i.e., a kutil library.
deleted file mode 100644 --- a/kpathsea/README +++ /dev/null @@ -1,19 +0,0 @@ -This directory contains the Kpathsea[rch] library, which implements -generic path searching, configuration, and TeX-specific file searching. - -See `NEWS' for changes by release, `ChangeLog` for all changes. -See `INSTALL' for installation instructions. -See `BUGS' for bug reporting details. -See `README.CONFIGURE' for details on running the configure scripts. -See `PROJECTS' for future improvements you might like to work on. - -Suggestions for improvements in either the library or the documentation, -no matter how small, are welcome. But please read ./BUGS before sending -a bug report. - -This is free software. See the files COPYING* for copying permissions. -The top-level headers are `pathsearch.h' for the generic path searching -support, and `tex-{file,glyph}.h' for the TeX-specific support. - -kb@mail.tug.org -Member of the League for Programming Freedom -- write lpf@uunet.uu.net.
deleted file mode 100644 --- a/kpathsea/README.CONFIGURE +++ /dev/null @@ -1,193 +0,0 @@ -Contents: - - Basic Installation - Compilers and Options - Compiling For Multiple Architectures - Installation Names - Optional Features - Specifying the System Type - Sharing Defaults - Operation Controls - - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. -
deleted file mode 100644 --- a/kpathsea/absolute.c +++ /dev/null @@ -1,61 +0,0 @@ -/* absolute.c: Test if a filename is absolute or explicitly relative. - -Copyright (C) 1993, 94, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/absolute.h> -#include <kpathsea/c-pathch.h> - -/* Sorry this is such a system-dependent mess, but I can't see any way - to usefully generalize. */ - -boolean -kpse_absolute_p P2C(const_string, filename, boolean, relative_ok) -{ -#ifdef VMS -#include <string.h> - return strcspn (filename, "]>:") != strlen (filename); -#else /* not VMS */ - boolean 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] == '\\') -#endif -#ifdef AMIGA - /* Colon anywhere means a device. */ - || strchr (filename, ':') -#endif /* AMIGA */ - ; - boolean explicit_relative - = relative_ok -#ifdef AMIGA - /* Leading / is like `../' on Unix and DOS. Allow Unix syntax, - too, though, because of possible patch programs like - `UnixDirsII' by Martin Scott. */ - && IS_DIR_SEP (*filename) || 0 -#endif /* AMIGA */ - && (*filename == '.' && (IS_DIR_SEP (filename[1]) - || (filename[1] == '.' && IS_DIR_SEP (filename[2])))); - - return absolute || explicit_relative; -#endif /* not VMS */ -}
deleted file mode 100644 --- a/kpathsea/absolute.h +++ /dev/null @@ -1,31 +0,0 @@ -/* absolute.h: Declare absolute filename predicate. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_ABSOLUTE_H -#define KPATHSEA_ABSOLUTE_H - -#include <kpathsea/types.h> -#include <kpathsea/c-proto.h> - - -/* True if FILENAME is absolute (/foo) or, if RELATIVE_OK is true, - explicitly relative (./foo, ../foo), else false (foo). */ - -extern boolean kpse_absolute_p P2H(const_string filename, boolean relative_ok); - -#endif /* not KPATHSEA_ABSOLUTE_H */
deleted file mode 100644 --- a/kpathsea/access.c +++ /dev/null @@ -1,94 +0,0 @@ -/* access -- test for access permissions of a file. - Copyright (C) 1997 Olaf Weber. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include <kpathsea/config.h> -#include <kpathsea/c-unistd.h> - -#ifdef WIN32 -#include <string.h> -#endif - -/* - * access mode x - * Returns 0 is x exists and can be accessed in accordance with mode. - * We use this rather than test because test looks at the permissions - * only, which doesn't take read-only file systems into account. - */ - -int main (argc, argv) - int argc; - char *argv[]; -{ - int mode; - int status; - char * i; - - if (argc > 1 && strcmp (argv[1], "--help") == 0) { - printf("Usage: %s -MODE FILE\n\ - MODE is one or more of rwx. Exit successfully if FILE exists and is\n\ - readable (r), writable (w), or executable (x).\n\ -\n\ ---help display this help and exit\n\ ---version output version information and exit\n\n", argv[0]); - fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout); - exit(0); - } else if (argc > 1 && strcmp (argv[1], "--version") == 0) { - printf ("%s (%s)\n\ -Copyright (C) 1997 Olaf Weber.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU General Public License\n\ -For more information about these matters, see the file named COPYING.\n\ -Primary author of %s: Olaf Weber.\n", -argv[0], KPSEVERSION, argv[0]); - exit (0); - } - - /* insist on exactly two args */ - if (argc != 3) { - fprintf(stderr, "%s: Need exactly two arguments.\n\ -Try `access --help' for more information.\n", argv[0]); - exit(1); - } - - /* The option parsing is somewhat primitive: '-' need not be the first - * character of the mode. The mode must be specified in a single - * option. Both of these may change. - */ - mode = 0; - i = argv[1]; - for (i = argv[1]; *i; ++i) - switch (*i) { - case 'r': mode |= R_OK; break; - case 'w': mode |= W_OK; break; - case 'x': mode |= X_OK; break; - case '-': if (i == argv[1]) break; - default: - fprintf(stderr, "%s: Invalid MODE.\n", argv[0]); - exit(1); - } - - status = access(argv[2], mode); - - /* fail if the access call failed */ - if (status != 0) { - return 1; - } - - /* otherwise, succeed */ - return 0; -}
deleted file mode 100644 --- a/kpathsea/access.man +++ /dev/null @@ -1,64 +0,0 @@ -.TH ACCESS 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -access \- determine whether a file can be accessed -.SH SYNOPSIS -.B access -.I -mode -.I file -.\"===================================================================== -.SH DESCRIPTION -Exit successfully if -.I file -can be accessed with the specified mode. -.I mode -is one or more letters of -.IR rwx , -where -.I r -is for readable, -.I w -is for writable, and -.I x -is for executable. -.PP -The difference between -.B access -and -.B test -is that the latter looks at the permission bits, while the former -checks using the -.BR access (2) -system call. This makes a difference when file systems have been -mounted read-only. -.\"===================================================================== -.SH OPTIONS -.B access -accepts the following additional options: -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH "SEE ALSO" -.BR access (2)
deleted file mode 100644 --- a/kpathsea/acconfig.h +++ /dev/null @@ -1,90 +0,0 @@ -/* acconfig.h -- used by autoheader when generating c-auto.in. - - If you're thinking of editing acconfig.h to fix a configuration - problem, don't. Edit the c-auto.h file created by configure, - instead. Even better, fix configure to give the right answer. */ - -/* kpathsea: the version string. */ -#define KPSEVERSION "REPLACE-WITH-KPSEVERSION" -/* web2c: the version string. */ -#define WEB2CVERSION "REPLACE-WITH-WEB2CVERSION" - -/* kpathsea/configure.in tests for these functions with - kb_AC_KLIBTOOL_REPLACE_FUNCS, and naturally Autoheader doesn't know - about that macro. Since the shared library stuff is all preliminary - anyway, I decided not to change Autoheader, but rather to hack them - in here. */ -#undef HAVE_BASENAME -#undef HAVE_PUTENV -#undef HAVE_STRCASECMP -#undef HAVE_STRTOL -#undef HAVE_STRSTR - -@TOP@ - -/* Define if your compiler understands prototypes. */ -#undef HAVE_PROTOTYPES - -/* Define if your putenv doesn't waste space when the same environment - variable is assigned more than once, with different (malloced) - values. This is true only on NetBSD/FreeBSD, as far as I know. See - xputenv.c. */ -#undef SMART_PUTENV - -/* Define if getcwd if implemented using fork or vfork. Let me know - if you have to add this by hand because configure failed to detect - it. */ -#undef GETCWD_FORKS - -/* Define if you are using GNU libc or otherwise have global variables - `program_invocation_name' and `program_invocation_short_name'. */ -#undef HAVE_PROGRAM_INVOCATION_NAME - -/* Define if you get clashes concerning wchar_t, between X's include - files and system includes. */ -#undef FOIL_X_WCHAR_T - -/* tex: Define to enable --ipc. */ -#undef IPC - -/* all: Define to enable running scripts when missing input files. */ -#define MAKE_TEX_MF_BY_DEFAULT 0 -#define MAKE_TEX_PK_BY_DEFAULT 0 -#define MAKE_TEX_TEX_BY_DEFAULT 0 -#define MAKE_TEX_TFM_BY_DEFAULT 0 -#define MAKE_OMEGA_OFM_BY_DEFAULT 0 -#define MAKE_OMEGA_OCP_BY_DEFAULT 0 - -/* web2c: Define if gcc asm needs _ on external symbols. */ -#undef ASM_NEEDS_UNDERSCORE - -/* web2c: Define when using system-specific files for arithmetic. */ -#undef ASM_SCALED_FRACTION - -/* web2c: Define to enable HackyInputFileNameForCoreDump.tex. */ -#undef FUNNY_CORE_DUMP - -/* web2c: Define to disable architecture-independent dump files. - Faster on LittleEndian architectures. */ -#undef NO_DUMP_SHARE - -/* web2c: Default editor for interactive `e' option. */ -#define EDITOR "vi +%d %s" - -/* web2c: Window system support for Metafont. */ -#undef EPSFWIN -#undef HP2627WIN -#undef MFTALKWIN -#undef NEXTWIN -#undef REGISWIN -#undef SUNWIN -#undef TEKTRONIXWIN -#undef UNITERMWIN -#undef X11WIN - -/* xdvik: Define if you have SIGIO, F_SETOWN, and FASYNC. */ -#undef HAVE_SIGIO - -/* xdvik: Define to avoid using any toolkit (and consequently omit lots - of features). */ -#undef NOTOOL
deleted file mode 100644 --- a/kpathsea/acklibtool.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl Autoconf support for Klibtool. -dnl $Id: acklibtool.m4,v 1.7 2003-01-04 20:07:21 jwe Exp $ -dnl -dnl -dnl Find the script, check for subprogs, etc. -AC_DEFUN(kb_AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_PROG_RANLIB]) -AC_REQUIRE([AC_CANONICAL_HOST]) -# -AC_MSG_CHECKING([for libtool object types]) -# -## Check that the klibtool script is in ac_aux_dir. Don't bother to -# scan PATH. For one thing, if we found it somewhere there, we couldn't -# use that directory to put the config file ... and that's what we need -# to do, to avoid having to configure in every subdirectory. -LIBTOOL=$ac_aux_dir/klibtool -AC_SUBST(LIBTOOL) -if test ! -r $LIBTOOL; then - AC_MSG_ERROR([klibtool not in $ac_aux_dir, goodbye]) - exit 1 -fi -# -## Argument parsing: we support --enable-shared and --enable-static. -AC_ARG_ENABLE(shared, -[ --enable-shared build shared libraries [default=no]], - [if test "$enableval" = no; then BUILD_SHARED_LIBS=no; - else BUILD_SHARED_LIBS=yes; fi], - BUILD_SHARED_LIBS=no) -# -AC_ARG_ENABLE(static, -[ --enable-static build static libraries [default=yes]], - [if test "$enableval" = no; then BUILD_STATIC_LIBS=no; - else BUILD_STATIC_LIBS=yes; fi], - BUILD_STATIC_LIBS=yes) -## -## For Octave, only build the kinds of objects we ask for. -## -if test "$BUILD_STATIC_LIBS" = yes; then - LIBTOOL_OBJTYPES=STATIC:$LIBTOOL_OBJTYPES -fi -if test "$BUILD_SHARED_LIBS" = yes; then - LIBTOOL_OBJTYPES=SHARED:$LIBTOOL_OBJTYPES -fi -# Don't bother to remove the trailing :, it'll be ignored. -# -## Finally: Run the klibtool configure command. -LIBTOOL_OBJTYPES=$LIBTOOL_OBJTYPES RANLIB=$RANLIB \ - $LIBTOOL --source-dir $ac_aux_dir --config-dir . configure "$host" -AC_MSG_RESULT($LIBTOOL_OBJTYPES) -])dnl -dnl -dnl -dnl Like AC_REPLACE_FUNCS, but add to LTLIBOBJS instead of LIBOBJS. -AC_DEFUN(kb_AC_KLIBTOOL_REPLACE_FUNCS, -[ dnl cannot require this function, since it doesn't have a provide call. -AC_CHECK_FUNCS($1,, LTLIBOBJS="$LTLIBOBJS $ac_func.lo") -AC_SUBST(LTLIBOBJS)dnl -])dnl
deleted file mode 100644 --- a/kpathsea/atou.c +++ /dev/null @@ -1,30 +0,0 @@ -/* atou.c: like atoi, but if the number is negative, abort. - -Copyright (C) 1992, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "config.h" - -unsigned -atou P1C(const_string, s) -{ - int i = atoi (s); - - if (i < 0) - FATAL1 ("I expected a positive number, not %d", i); - - return i; -}
deleted file mode 100644 --- a/kpathsea/basename.c +++ /dev/null @@ -1,49 +0,0 @@ -/* basename.c: return the last element in a path. - -Copyright (C) 1992, 94, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Have to include this first to get c-auto.h. */ -#include <kpathsea/config.h> - -#ifndef HAVE_BASENAME /* rest of file */ - -#include <kpathsea/c-pathch.h> - -/* Return NAME with any leading path stripped off. This returns a - pointer into NAME. For example, `basename ("/foo/bar.baz")' - returns "bar.baz". */ - -const_string -basename P1C(const_string, name) -{ - const_string base = NULL; - unsigned len = strlen (name); - - for (len = strlen (name); len > 0; len--) { - if (IS_DIR_SEP (name[len - 1]) || IS_DEVICE_SEP (name[len - 1])) { - base = name + len; - break; - } - } - - if (!base) - base = name; - - return base; -} - -#endif /* not HAVE_BASENAME */
deleted file mode 100644 --- a/kpathsea/bugs.texi +++ /dev/null @@ -1,877 +0,0 @@ -@ifclear version -@defcodeindex fl -@defcodeindex op -@end ifclear - -@node Reporting bugs -@section Reporting bugs - -@cindex reporting bugs -@cindex bugs, reporting - -@ifset version -(A copy of this chapter is in the file @file{kpathsea/BUGS}.) -@end ifset - -@flindex tex-k@@mail.tug.org @r{(bug address)} -@cindex bug address -If you have problems or suggestions, please report them to -@email{tex-k@@mail.tug.org} using the bug checklist below. - -Please report bugs in the documentation; not only factual errors or -inconsistent behavior, but unclear or incomplete explanations, typos, -wrong fonts, @dots{} - -@menu -* Bug checklist:: What to include in a good bug report. -* Mailing lists:: Joining the bugs or announcements mailing lists. -* Debugging:: Analyzing runtime problems. -* Logging:: Recording searches. -* Common problems:: When things go wrong. -@end menu - - -@node Bug checklist -@subsection Bug checklist - -@cindex checklist for bug reports -@cindex bug checklist - -Before reporting a bug, please check below to be sure it isn't already -known (@pxref{Common problems}). - -Bug reports should be sent via electronic mail to -@email{tex-k@@mail.tug.org}, or by postal mail to 135 Center Hill Road / -Plymouth, MA 02360 / USA. - -The general principle is that a good bug report includes all the -information necessary for reproduction. Therefore, to enable -investigation, your report should include the following: - -@itemize @bullet -@item -@cindex version numbers, determining -The version number(s) of the program(s) involved, and of Kpathsea -itself. You can get the former by giving a sole option @samp{--version} -to the program, and the latter by running @samp{kpsewhich --version}. -The @file{NEWS} and @file{ChangeLog} files also contain the version -number. - -@item -@pindex uname -The hardware, operating system (including version number), compiler, and -@code{make} program you are using (the output of @code{uname -a} is a -start on the first two, though often incomplete). If the bug involves -the X window system, include X version and supplier information as well -(examples: X11R6 from MIT; X11R4 from HP; OpenWindows 3.3 bundled with -SunOS 4.1.4). - -@item -@flindex config.log -Any options you gave to @code{configure}. This is recorded in the -@file{config.status} files. - -@cindex configuration bugs -@flindex config.status -If you are reporting a bug in @samp{configure} itself, it's probably -system-dependent, and it will be unlikely the maintainers can do -anything useful if you merely report that thus-and-such is broken. -Therefore, you need to do some additional work: for some bugs, you can -look in the file @file{config.log} where the test that failed should -appear, along with the compiler invocation and source program in -question. You can then compile it yourself by hand, and discover why -the test failed. Other @samp{configure} bugs do not involve the -compiler; in that case, the only recourse is to inspect the -@code{configure} shell script itself, or the Autoconf macros that -generated @code{configure}. - -@item -The log of all debugging output, if the bug is in path searching. You -can get this by setting the environment variable @code{KPATHSEA_DEBUG} -to @samp{-1} before running the program. Please look at the log -yourself to make sure the behavior is really a bug before reporting it; -perhaps ``old'' environment variable settings are causing files not to -be found, for example. - -@item -The contents of any input files necessary to reproduce the bug. For -bugs in DVI-reading programs, for example, this generally means a DVI -file (and any EPS or other files it uses)---@TeX{} source files are -helpful, but the DVI file is necessary, because that's the actual -program input. - -@cindex shar@r{, recommended} -GNU @code{shar}, available from @url{ftp://ftp.gnu.org/pub/gnu/shar} is -a convenient way of packaging multiple (possibly binary) files for -electronic mail. If you feel your input files are too big to send by -email, you can ftp them to @url{ftp://ftp.tug.org/incoming} (that -directory is writable, but not readable). - -@item -@cindex context diff -@cindex sending patches -@flindex ChangeLog @r{entry} -If you are sending a patch (do so if you can!), please do so in the form -of a context diff (@samp{diff -c}) against the original distribution -source. Any other form of diff is either not as complete or harder for -me to understand. Please also include a @file{ChangeLog} entry. - -@item -@cindex stack trace -@cindex debugger -@cindex crashes, reporting -@cindex core dumps, reporting -@cindex null pointers, dereferencing -@pindex gdb@r{, recommended} -If the bug involved is an actual crash (i.e., core dump), it is easy and -useful to include a stack trace from a debugger (I recommend the GNU -debugger GDB, available from @url{ftp://ftp.gnu.org/pub/gnu/gdb}). If -the cause is apparent (a @code{NULL} value being dereferenced, for -example), please send the details along. If the program involved is -@TeX{} or Metafont, and the crash is happening at apparently-sound code, -however, the bug may well be in the compiler, rather than in the program -or the library (@pxref{TeX or Metafont failing,, @TeX{} or Metafont -failing}). - -@item -Any additional information that will be helpful in reproducing, -diagnosing, or fixing the bug. -@end itemize - - -@node Mailing lists -@subsection Mailing lists - -@cindex mailing lists -@cindex bug mailing list -@cindex announcement mailing list - -Web2c and Kpathsea in general are discussed on the mailing list -@email{tex-k@@mail.tug.org}. -@flindex tex-k-request@@mail.tug.org -To join, email @email{tex-k-request@@mail.tug.org} with a line -consisting of - -@example -subscribe @var{you}@@@var{your.preferred.email.address} -@end example - -@noindent in the body of the message. - -You do not need to join to submit a report, nor will it affect whether -you get a response. There is no Usenet newsgroup equivalent (if you can -be the one to set this up, email @samp{tex-k-request}). Traffic on the -list is fairly light, and is mainly bug reports and enhancement requests -to the software. The best way to decide if you want to join or not is -read some of the archives from @url{ftp://ftp.tug.org/mail/archives/tex-k/}. - -Be aware that large data files are sometimes included in bug reports. -If this is a problem for you, do not join the list. - -@flindex tex-archive@@math.utah.edu -@cindex announcement mailing list -If you only want announcements of new releases, not bug reports and -discussion, join @email{tex-archive@@math.utah.edu} (via mail to -@email{tex-archive-request@@math.utah.edu}). - -@cindex @TeX{} help mailing list -@cindex La@TeX{} help mailing list -@cindex Usenet @TeX{} newsgroup -@cindex newsgroup for @TeX{} -@cindex help, mailing list for general @TeX{} -@flindex info-tex@@shsu.edu -@flindex comp.text.tex -If you are looking for general @TeX{} help, such as how to use La@TeX{}, -please use the mailing list @email{info-tex@@shsu.edu} mailing list, -which is gatewayed to the @samp{comp.text.tex} Usenet newsgroup (or post -to the newsgroup; the gateway is bidirectional). - - -@node Debugging -@subsection Debugging - -@cindex debugging -@cindex runtime debugging -@cindex options for debugging - -@vindex kpathsea_debug -@flindex debug.h -Kpathsea provides a number of runtime debugging options, detailed below -by their names and corresponding numeric values. When the files you -expect aren't being found, the thing to do is enable these options and -examine the output. - -You can set these with some runtime argument (e.g., @samp{-d}) to the -program; in that case, you should use the numeric values described in -the program's documentation (which, for Dvipsk and Xdvik, are different -than those below). It's best to give the @samp{-d} (or whatever) option -first, for maximal output. Dvipsk and Xdvik have additional -program-specific debugging options as well. - -@vindex KPATHSEA_DEBUG -@vindex kpathsea_debug -You can also set the environment variable @code{KPATHSEA_DEBUG}; in this -case, you should use the numbers below. If you run the program under a -debugger and set the variable @code{kpathsea_debug}, also use the numbers -below. - -@kindex -1 @r{debugging value} -In any case, by far the simplest value to use is @samp{-1}, which will -turn on all debugging output. This is usually better than guessing -which particular values will yield the output you need. - -@cindex debugging output -@cindex standard error and debugging output -Debugging output always goes to standard error, so you can redirect it -easily. For example, in Bourne-compatible shells: -@example -dvips -d -1 @dots{} 2>/tmp/debug -@end example - -@cindex Kpsewhich, and debugging -It is sometimes helpful to run the standalone Kpsewhich utility -(@pxref{Invoking kpsewhich}), instead of the original program. - -@cindex numeric debugging values -In any case, you can @emph{not} use the @emph{names} below; you must -always use somebody's numbers. (Sorry.) To set more than one -option, just sum the corresponding numbers. - -@vtable @code -@item KPSE_DEBUG_STAT @r{(1)} -Report @samp{stat}(2) calls. This is useful for verifying that your -directory structure is not forcing Kpathsea to do many additional file -tests (@pxref{Slow path searching}, and @pxref{Subdirectory -expansion}). If you are using an up-to-date @file{ls-R} database -(@pxref{Filename database}), this should produce no output unless a -nonexistent file that must exist is searched for. - -@item KPSE_DEBUG_HASH @r{(2)} -Report lookups in all hash tables: @file{ls-R} and @file{aliases} -(@pxref{Filename database}); font aliases (@pxref{Fontmap}); and config -file values (@pxref{Config files}). Useful when expected values are not -being found, e.g.., file searches are looking at the disk instead of -using @file{ls-R}. - -@item KPSE_DEBUG_FOPEN @r{(4)} -@findex fopen@r{, redefined} -Report file openings and closings. Especially useful when your system's -file table is full, for seeing which files have been opened but never -closed. In case you want to set breakpoints in a debugger: this works by -redefining @samp{fopen} (@samp{fclose}) to be @samp{kpse_fopen_trace} -(@samp{kpse_fclose_trace}). - -@item KPSE_DEBUG_PATHS @r{(8)} -@tindex kpse_format_info_type -Report general path information for each file type Kpathsea is asked to -search. This is useful when you are trying to track down how a -particular path got defined---from @file{texmf.cnf}, @file{config.ps}, -an environment variable, the compile-time default, etc. This is the -contents of the @code{kpse_format_info_type} structure defined in -@file{tex-file.h}. - -@item KPSE_DEBUG_EXPAND @r{(16)} -Report the directory list corresponding to each path element Kpathsea -searches. This is only relevant when Kpathsea searches the disk, since -@file{ls-R} searches don't look through directory lists in this way. - -@item KPSE_DEBUG_SEARCH @r{(32)} -Report on each file search: the name of the file searched for, the path -searched in, whether or not the file must exist (when drivers search for -@file{cmr10.vf}, it need not exist), and whether or not we are -collecting all occurrences of the file in the path (as with, e.g., -@file{texmf.cnf} and @file{texfonts.map}), or just the first (as with -most lookups). This can help you correlate what Kpathsea is doing with -what is in your input file. - -@item KPSE_DEBUG_VARS @r{(64)} -Report the value of each variable Kpathsea looks up. This is useful for -verifying that variables do indeed obtain their correct values. - -@item GSFTOPK_DEBUG @r{(128)} -Activates debugging printout specific to @code{gsftopk} program. - -@item MAKETEX_DEBUG @r{(512)} -If you use the optional @code{mktex} programs instead of the -traditional shell scripts, this will report the name of the site file -(@file{mktex.cnf} by default) which is read, directories created by -@code{mktexdir}, the full path of the @file{ls-R} database built by -@code{mktexlsr}, font map searches, @code{MT_FEATURES} in effect, -parameters from @code{mktexnam}, filenames added by -@code{mktexupd}, and some subsidiary commands run by the programs. - -@item MAKETEX_FINE_DEBUG @r{(1024)} -When the optional @code{mktex} programs are used, this will print -additional debugging info from functions internal to these programs. -@end vtable - -@cindex @samp{kdebug:} -@vindex hash_summary_only @r{variable for debugging} -@cindex hash table buckets, printing -Debugging output from Kpathsea is always written to standard error, and -begins with the string @samp{kdebug:}. (Except for hash table buckets, -which just start with the number, but you can only get that output -running under a debugger. See comments at the @code{hash_summary_only} -variable in @file{kpathsea/db.c}.) - - -@node Logging -@subsection Logging - -@cindex log file - -@cindex logging successful searches -@cindex recording successful searches -@cindex usage patterns, finding -@cindex disk usage, reducing -Kpathsea can record the time and filename found for each successful -search. This may be useful in finding good candidates for deletion when -your filesystem is full, or in discovering usage patterns -at your site. - -@vindex TEXMFLOG -To do this, define the environment or config file variable -@code{TEXMFLOG}. The value is the name of the file to append the -information to. The file is created if it doesn't exist, and appended -to if it does. - -@cindex epoch, seconds since -@findex time @r{system call} -Each successful search turns into one line in the log file: two words -separated by a space. The first word is the time of the search, as the -integer number of seconds since ``the epoch'', i.e., UTC midnight 1 -January 1970 (more precisely, the result of the @code{time} system -call). The second word is the filename. - -For example, after @code{setenv TEXMFLOG /tmp/log}, running Dvips on -@file{story.dvi} appends the following lines: - -@example -774455887 /usr/local/share/texmf/dvips/config.ps -774455887 /usr/local/share/texmf/dvips/psfonts.map -774455888 /usr/local/share/texmf/dvips/texc.pro -774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk -774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk -774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk -774455889 /usr/local/share/texmf/dvips/texc.pro -@end example - -@cindex privacy, semblance of -@noindent Only filenames that are absolute are recorded, to preserve -some semblance of privacy. - - -@node Common problems -@subsection Common problems - -@cindex common problems -@cindex problems, common -@cindex FAQ, Kpathsea - -Here are some common problems with configuration, compilation, linking, -execution, @dots{} - -@menu -* Unable to find files:: If your program can't find fonts (or whatever). -* Slow path searching:: If it takes forever to find anything. -* Unable to generate fonts:: If mktexpk fails. -* TeX or Metafont failing:: Likely compiler bugs. - -* Empty Makefiles:: When configure produces empty makefiles. -* XtStrings:: When _XtStrings is undefined. -* dlopen:: When dlopen is undefined. -* ShellWidgetClass:: For dynamic linking troubles under OpenWindows. -* Pointer combination warnings:: For old compilers that don't grok char *. -@end menu - -@node Unable to find files -@subsubsection Unable to find files - -@cindex unable to find files -@cindex files, unable to find - -If a program complains it cannot find fonts (or other input files), any -of several things might be wrong. In any case, you may find the -debugging options helpful. @xref{Debugging}. - -@itemize @bullet -@item -Perhaps you simply haven't installed all the necessary files; the basic -fonts and input files are distributed separately from the programs. -@xref{unixtex.ftp}. - -@item -@flindex /etc/profile -@cindex environment variables, old -You have (perhaps unknowingly) told Kpathsea to use search paths that -don't reflect where the files actually are. One common cause is having -environment variables set from a previous installation, thus overriding -what you carefully set in @file{texmf.cnf} (@pxref{Supported file -formats}). System @file{/etc/profile} or other files such may be the -culprit. - -@item -@cindex symbolic links not found -@cindex leaf directories wrongly guessed -Your files reside in a directory that is only pointed to via a symbolic -link, in a leaf directory and is not listed in @file{ls-R}. - -Unfortunately, Kpathsea's subdirectory searching has an irremediable -deficiency: If a directory @var{d} being searched for subdirectories -contains plain files and symbolic links to other directories, but no -true subdirectories, @var{d} will be considered a leaf directory, i.e., -the symbolic links will not be followed. @xref{Subdirectory expansion}. - -You can work around this problem by creating an empty dummy subdirectory -in @var{d}. Then @var{d} will no longer be a leaf, and the symlinks will -be followed. - -The directory immediately followed by the @samp{//} in the path -specification, however, is always searched for subdirectories, even if -it is a leaf. Presumably you would not have asked for the directory to -be searched for subdirectories if you didn't want it to be. - -@item -If the fonts (or whatever) don't already exist, @code{mktexpk} (or -@code{mktexmf} or @code{mktextfm}) will try to create them. If -these rather complicated shell scripts fail, you'll eventually get an -error message saying something like @samp{Can't find font -@var{fontname}}. The best solution is to fix (or at least report) the -bug in @code{mktexpk}; the workaround is to generate the necessary -fonts by hand with Metafont, or to grab them from a CTAN site -(@pxref{unixtex.ftp}). - -@item -There is a bug in the library. @xref{Reporting bugs}. -@end itemize - - -@node Slow path searching -@subsubsection Slow path searching - -@cindex excessive startup time -@cindex slow startup time -@cindex startup time, excessive - -If your program takes an excessively long time to find fonts or other -input files, but does eventually succeed, here are some possible culprits: - -@itemize @bullet -@item -Most likely, you just have a lot of directories to search, and that -takes a noticeable time. The solution is to create and maintain a -separate @file{ls-R} file that lists all the files in your main @TeX{} -hierarchy. @xref{Filename database}. Kpathsea always uses @file{ls-R} -if it's present; there's no need to recompile or reconfigure any of the -programs. - -@item -Your recursively-searched directories (e.g., -@file{/usr/local/share/texmf/fonts//}), contain a mixture of files and -directories. This prevents Kpathsea from using a useful optimization -(@pxref{Subdirectory expansion}). - -It is best to have only directories (and perhaps a @file{README}) in the -upper levels of the directory structure, and it's very important to have -@emph{only} files, and no subdirectories, in the leaf directories where -the dozens of TFM, PK, or whatever files reside. -@end itemize - -In any case, you may find the debugging options helpful in determining -precisely when the disk or network is being pounded. @xref{Debugging}. - - -@node Unable to generate fonts -@subsubsection Unable to generate fonts - -@cindex unable to generate fonts -@cindex font generation failures - -This can happen if either @code{mktexpk} hasn't been installed -properly, or if the local installation of Metafont isn't correct. - -@cindex Metafont installation -If @code{mf} is a command not found by @code{mktexpk}, then you need -to install Metafont (@pxref{unixtex.ftp}). - -@cindex Metafont using the wrong resolution -@cindex resolution, wrong -If Metafont runs, but generates fonts at the wrong resolution, you need -to be sure the @samp{M} and @samp{D} lines in your Dvips configuration -file match (@pxref{Config files,,, dvips, Dvips}). For example, if -@code{mktexpk} is generating 300@dmn{dpi} fonts, but you need -600@dmn{dpi} fonts, you should have: -@example -M ljfour -D 600 -@end example - -@flindex .2602gf -@flindex 2602gf -@cindex Metafont making too-large fonts -@cindex proof mode -@cindex online Metafont display, spurious -If Metafont runs but generates fonts at a resolution of 2602@dmn{dpi} -(and prints out the name of each character as well as just a character -number, and maybe tries to display the characters), then your Metafont -base file probably hasn't been made properly. (It's using the default -@code{proof} mode, instead of an actual device mode.) To make a proper -@file{plain.base}, assuming the local mode definitions are contained in -a file @file{modes.mf}, run the following command (assuming Unix): - -@example -inimf "plain; input modes; dump" -@end example - -@noindent -@flindex plain.base -Then copy the @file{plain.base} file from the current directory to where -the base files are stored on your system -(@file{/usr/local/share/texmf/web2c} by default), and make a link -(either hard or soft) from @file{plain.base} to @file{mf.base} in that -directory. -@xref{inimf invocation,,, web2c, Web2c}. - - -@node TeX or Metafont failing -@subsubsection @TeX{} or Metafont failing - -@cindex @TeX{} failures -@cindex Metafont failures -@cindex compiler bugs -If @TeX{} or Metafont get a segmentation fault or otherwise fail while -running a normal input file, the problem is usually a compiler bug -(unlikely as that may sound). Even if the trip and trap tests are -passed, problems may lurk. Optimization occasionally causes trouble in -programs other than @TeX{} and Metafont themselves, too. - -Insufficient swap space may also cause core dumps or other erratic -behavior. - -@cindex optimization caveat -For a workaround, if you enabled any optimization flags, it's best to -omit optimization entirely. In any case, the way to find the facts is -to run the program under the debugger and see where it's failing. - -@cindex GNU C compiler bugs -@cindex system C compiler bugs -Also, if you have trouble with a system C compiler, I advise trying the -GNU C compiler. And vice versa, unfortunately; but in that case I also -recommend reporting a bug to the GCC mailing list; see @ref{Bugs,,, gcc, -Using and Porting GNU CC}. - -@cindex compiler bugs, finding -To report compiler bugs effectively requires perseverance and -perspicacity: you must find the miscompiled line, and that usually -involves delving backwards in time from the point of error, checking -through @TeX{}'s (or whatever program's) data structures. Things are -not helped by all-too-common bugs in the debugger itself. Good luck. - -@cindex ANSI C -@cindex HP-UX, compiling on -@cindex compiling on HP-UX -One known cause of trouble is the way arrays are handled. Some of the -Pascal arrays have a lower index other than 0, and the C code will take -the pointer to the allocated memory, subtract the lower index, and use -the resulting pointer for the array. While this trick often works, ANSI -C doesn't guarantee that it will. It it known to fail on HP-UX 10 -mchines when the native compiler is used, unless the @samp{+u} compiler -switch was specified. Using GCC will work on this platform as well. - -@node Empty Makefiles -@subsubsection Empty Makefiles - -@cindex Makefiles, empty -@pindex sed @r{error from @code{configure}} -@pindex configure @r{error from @code{sed}} -@cindex NetBSD @code{configure} error -@cindex FreeBSD @code{configure} error -@cindex Mach10 @code{configure} error -@cindex AIX 4.1 @code{configure} error -@cindex NeXT @code{sed} error - -On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), @code{configure} -may fail to properly create the Makefiles. Instead, you get an error -which looks something like this: - -@example -prompt$ ./configure -@dots{} -creating Makefile -sed: 1: "\\@@^ac_include make/pat ...": \ can not be used as a string delimiter -@end example - -So far as I know, the bug here is in @code{/bin/sh} on these systems. I -don't have access to a machine running any of them, so if someone can -find a workaround that avoids the quoting bug, I'd be most -grateful. (Search for @code{ac_include} in the @code{configure} script -to get to the problematic code.) - -It should work to run @code{bash configure}, instead of using -@code{/bin/sh}. You can get Bash from -@url{ftp://ftp.gnu.org/pub/gnu/bash} and mirrors. - -Another possible cause (reported for NeXT) is a bug in the @code{sed} -command. In that case the error may look like this: - -@example -Unrecognized command: \@@^ac_include make/paths.make@@r make/paths.make -@end example - -In this case, installing GNU @code{sed} should solve the problem. You -can get GNU @code{sed} from the same places as Bash. - -@ignore -@node wchar_t -@subsubsection @code{wchar_t} - -@vindex FOIL_X_WCHAR_T -@tindex wchar_t - -The upshot of all the following is that if you get error messages -regarding @code{wchar_t}, try defining @code{NO_FOIL_X_WCHAR_T} (for -Web2c) or @code{FOIL_X_WCHAR_T} (for everything else), as in: - -@example -make XCFLAGS=-DNO_FOIL_X_WCHAR_T @var{other-make-options} -@end example - -@flindex Xlib.h -@flindex stddef.h -@code{wchar_t} has caused infinite trouble. None of my code ever uses -@code{wchar_t}; all I want to do is include X header files and various -system header files, possibly compiling with GCC. This seems an -impossible task! The basic problem is that the X11 header -@file{<Xlib.h>} and GCC's @file{<stddef.h>} have conflicting definitions -for @code{wchar_t}. - -The particulars: @file{<X11/Xlib.h>} from MIT X11R5 defines -@code{wchar_t} if @code{X_WCHAR} is defined, which is defined if -@code{X_NOT_STDC_ENV} is defined, and we define @emph{that} if -@code{STDC_HEADERS} is not defined (@samp{configure} decides if -@code{STDC_HEADERS} gets defined). But when compiling with GCC on SunOS -4.1.x, @code{STDC_HEADERS} is not defined (@file{string.h} doesn't -declare the @samp{mem}* functions), so we do get X's -@code{wchar_t}---and we also get GCC's @code{wchar_t} from its -@file{<stddef.h>}. Conflict. - -On the other hand, SunOS 4.1.1 with some other X configurations actually -needs GCC to define @code{wchar_t}, and fails otherwise. - -My current theory is to define @code{wchar_t} to a nonsense symbol -before the X include files are read; that way its definition (if any) -will be ignored by other system include files. Going along with that, -define @code{X_WCHAR} to tell X not to use @file{<stddef.h>}, that we've -already included, but instead to make its own definition. - -But this is not the end of the story. The X11 include files distributed -with DG/UX 5.4.2 for the Aviion have been modified to include -@file{<_int_wchar_t.h>} if @code{X_WCHAR}, so our @code{#define} will -not have any typedef to change---but the uses of @code{wchar_t} in the X -include files will be changed to reference this undefined symbol. So -there's nothing to foil in this case. I don't know how to detect this -automatically, so it's up to you to define @code{NO_FOIL_X_WCHAR_T} -yourself. -@end ignore - -@node XtStrings -@subsubsection @code{XtStrings} - -@findex XtStrings -You may find that linking X programs results in an error from the linker -that @samp{XtStrings} is undefined, something like this: - -@example -gcc -o virmf @dots{} -@dots{}/x11.c:130: undefined reference to `XtStrings' -@end example - -This generally happens because of a mismatch between the X include files -with which you compiled and the X libraries with which you linked; -often, the include files are from MIT and the libraries from Sun. - -The solution is to use the same X distribution for compilation and -linking. Probably @samp{configure} was unable to guess the proper -directories from your installation. You can use the @code{configure} -options @samp{--x-includes=@var{path}} and -@samp{--x-libraries=@var{path}} to explicitly specify them. - - -@node dlopen -@subsubsection @code{dlopen} - -@cindex static linking and @code{dlsym} -@flindex dlopen -@flindex dlsym -@flindex dlclose -@flindex wcstombs -@flindex libdl.a -(This section adapted from the file @file{dlsym.c} in the X distribution.) - -The @code{Xlib} library uses the standard C function @code{wcstombs}. -Under SunOS 4.1, @code{wcstombs} uses the @samp{dlsym} interface defined -in @file{libdl.so}. Unfortunately, the SunOS 4.1 distribution does not -include a static @samp{libdl.a} library. - -As a result, if you try to link an X program statically under SunOS, you -may get undefined references to @code{dlopen}, @code{dlsym}, and -@code{dlclose}. One workaround is to include these definitions -when you link: - -@example -void *dlopen() @{ return 0; @} -void *dlsym() @{ return 0; @} -int dlclose() @{ return -1; @} -@end example - -@flindex dlsym.c -@noindent These are contained in the @file{dlsym.c} file in the MIT X -distribution. - - -@node ShellWidgetClass -@subsubsection @code{ShellWidgetClass} - -@cindex dynamic linking problems with OpenWin libraries -@cindex OpenWin libraries, dynamic linking problems -@findex get_wmShellWidgetClass -@findex get_applicationShellWidgetClass - -@flindex comp.sys.sun.admin @r{FAQ} -@cindex FAQ, @t{comp.sys.sun.admin} -(This section adapted from the @t{comp.sys.sun.admin} FAQ.) - -If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x, you -may get undefined symbols @code{_get_wmShellWidgetClass} and -@code{_get_applicationShellWidgetClass} when linking. This problem does -not arise using the standard MIT X libraries under SunOS. - -@findex Xmu @r{library problems} -The cause is bugs in the @code{Xmu} shared library as shipped from Sun. -There are several fixes: - -@itemize @bullet - -@item Install the free MIT distribution from @samp{ftp.x.org} and mirrors. - -@item Get the OpenWindows patches listed below. - -@item Statically link the @code{Xmu} library into the executable. - -@item Avoid using @code{Xmu} at all. If you are compiling -Metafont, see @ref{Online Metafont graphics,,, web2c, Web2c}. If you are -compiling Xdvi, see the @code{-DNOTOOL} option in @file{xdvik/INSTALL}. - -@item Ignore the errors. The binary runs fine regardless. - -@end itemize - -@cindex Sun OpenWin patches -@cindex patches, Sun OpenWin -Here is the information for getting the two patches: - -@display -Patch ID: 100512-02 -Bug ID's: 1086793, 1086912, 1074766 -Description: 4.1.x OpenWindows 3.0 @code{libXt} jumbo patch - -Patch ID: 100573-03 -Bug ID: 1087332 -Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared @code{libXmu}. -@end display - -@cindex static linking -The way to statically link with @code{libXmu} depends on whether you are -using a Sun compiler (e.g., @code{cc}) or @code{gcc}. If the latter, -alter the @code{x_libs} Make variable to include - -@opindex -static -@opindex -dynamic -@example --static -lXmu -dynamic -@end example - -@opindex -Bstatic -@opindex -Bdynamic -If you are using the Sun compiler, use @samp{-Bstatic} and @samp{-Bdynamic}. - - -@node Pointer combination warnings -@subsubsection Pointer combination warnings - -@cindex warnings, pointer combinations -@cindex pointer combination warnings -@cindex illegal pointer combination warnings -@pindex cc @r{warnings} -When compiling with old C compilers, you may get some warnings about -``illegal pointer combinations''. These are spurious; just ignore them. -I decline to clutter up the source with casts to get rid of them. - -@c This isn't worth including any more, OSF 1.x is too old. -@c The other XtInherit problem (R4 Xlib on Suns) should never come up, -@c but the answer from the X faq is included anyway. -@c -@c @node XtInherit -@c @subsubsection @code{XtInherit} -@c -@c @findex XtInherit @r{bug on OSF/1} -@c @cindex OSF/1 loader bug and @code{XtInherit} -@c @cindex Alpha OSF/1 loader bug and @code{XtInherit} -@c -@c On DEC OSF/1 1.x systems, the loader has a bug that manifests itself in -@c the following error (all on one line, but for the sake of the paper -@c width it's broken here): -@c -@c @example -@c xdvik/xdvi: /sbin/loader: Fatal Error: search_for_undefineds: -@c symbol _XtInherit should not have any relocation entry -@c @end example -@c -@c @noindent According to Michael Rickabaugh @code{<mjr@@quarry.enet.dec.com>}: -@c -@c @quotation -@c This is a bug fixed in DEC OSF/1 2.0. -@c -@c If you know how, installing @file{/sbin/loader} from a 2.0 system onto a -@c 1.3 system will work. Make sure that @file{/usr} is @emph{not} mounted -@c when you do this. (If you forget about umounting @code{/usr}, it is -@c possible most of your filesystems will become corrupted.) -@c -@c Otherwise, I suggest getting a later CD and running -@c @file{/usr/sbin/installupdate}. -@c @end quotation -@c -@c Alternatively, you may be able to use the freely available X11 libraries -@c that come with the MIT distribution (on @file{ftp.x.org}, for example). -@c -@c Linking statically, perhaps only with some of the X libraries, may also -@c work. -@c -@c The Sun XtInherit weirdness, from the comp.windows.x FAQ: -@c Subject: 126)! What are these problems with "*_XtInherit* not found" on the Sun? -@c When I link a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the -@c error "ld.so: symbol not found *_XtInherit*". -@c -@c What you are seeing is a side-effect of a kludge in the R4 libXt.a to -@c get Sun shared libraries working. Apparently, you can't share a function that -@c is both called and compared, as *_XtInherit* is. This was handled by putting -@c *_XtInherit* in the same file as a function that is always used, thereby -@c guaranteeing that it would be loaded -- that is, in Initialize.c, where -@c XtToolkitInitialize() and XtInitialize() reside. These routines would normally -@c be called. -@c -@c You are probably seeing this error because your program is not a normal -@c Xt-based program and does not call XtToolkitInitialize() anywhere. -@c 1) it may be a program that uses Xt functions but never opens a -@c connection to the X server. [OSF/Motif's 1.1.0 UIL had this problem; it called -@c XtMalloc() and other Xt functions.] The solution is to add the call to your -@c program; the function does not have to be executed, just linked in. -@c 2) alternatively, your program doesn't need any Xt functions and is -@c correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView -@c program. In this case, you can remove -lXt from your link command. -@c -@c It should not be necessary to link the shared libraries statically, -@c although this will certainly solve the problem. - -@c * Empty Makefiles:: If configure gives you sed errors. -@c * wchar_t:: For wchar_t difficulties.
deleted file mode 100644 --- a/kpathsea/c-auto.in +++ /dev/null @@ -1,195 +0,0 @@ -/* c-auto.in. Generated from configure.in by autoheader. */ -/* acconfig.h -- used by autoheader when generating c-auto.in. - - If you're thinking of editing acconfig.h to fix a configuration - problem, don't. Edit the c-auto.h file created by configure, - instead. Even better, fix configure to give the right answer. */ - -/* kpathsea: the version string. */ -#define KPSEVERSION "REPLACE-WITH-KPSEVERSION" -/* web2c: the version string. */ -#define WEB2CVERSION "REPLACE-WITH-WEB2CVERSION" - -/* kpathsea/configure.in tests for these functions with - kb_AC_KLIBTOOL_REPLACE_FUNCS, and naturally Autoheader doesn't know - about that macro. Since the shared library stuff is all preliminary - anyway, I decided not to change Autoheader, but rather to hack them - in here. */ -#undef HAVE_BASENAME -#undef HAVE_PUTENV -#undef HAVE_STRCASECMP -#undef HAVE_STRTOL -#undef HAVE_STRSTR - - -/* Define if your compiler understands prototypes. */ -#undef HAVE_PROTOTYPES - -/* Define if your putenv doesn't waste space when the same environment - variable is assigned more than once, with different (malloced) - values. This is true only on NetBSD/FreeBSD, as far as I know. See - xputenv.c. */ -#undef SMART_PUTENV - -/* Define if getcwd if implemented using fork or vfork. Let me know - if you have to add this by hand because configure failed to detect - it. */ -#undef GETCWD_FORKS - -/* Define if you are using GNU libc or otherwise have global variables - `program_invocation_name' and `program_invocation_short_name'. */ -#undef HAVE_PROGRAM_INVOCATION_NAME - -/* Define if you get clashes concerning wchar_t, between X's include - files and system includes. */ -#undef FOIL_X_WCHAR_T - -/* tex: Define to enable --ipc. */ -#undef IPC - -/* all: Define to enable running scripts when missing input files. */ -#define MAKE_TEX_MF_BY_DEFAULT 0 -#define MAKE_TEX_PK_BY_DEFAULT 0 -#define MAKE_TEX_TEX_BY_DEFAULT 0 -#define MAKE_TEX_TFM_BY_DEFAULT 0 -#define MAKE_OMEGA_OFM_BY_DEFAULT 0 -#define MAKE_OMEGA_OCP_BY_DEFAULT 0 - -/* web2c: Define if gcc asm needs _ on external symbols. */ -#undef ASM_NEEDS_UNDERSCORE - -/* web2c: Define when using system-specific files for arithmetic. */ -#undef ASM_SCALED_FRACTION - -/* web2c: Define to enable HackyInputFileNameForCoreDump.tex. */ -#undef FUNNY_CORE_DUMP - -/* web2c: Define to disable architecture-independent dump files. - Faster on LittleEndian architectures. */ -#undef NO_DUMP_SHARE - -/* web2c: Default editor for interactive `e' option. */ -#define EDITOR "vi +%d %s" - -/* web2c: Window system support for Metafont. */ -#undef EPSFWIN -#undef HP2627WIN -#undef MFTALKWIN -#undef NEXTWIN -#undef REGISWIN -#undef SUNWIN -#undef TEKTRONIXWIN -#undef UNITERMWIN -#undef X11WIN - -/* xdvik: Define if you have SIGIO, F_SETOWN, and FASYNC. */ -#undef HAVE_SIGIO - -/* xdvik: Define to avoid using any toolkit (and consequently omit lots - of features). */ -#undef NOTOOL - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define to 1 if you have the <assert.h> header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `basename' function. */ -#undef HAVE_BASENAME - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the <float.h> header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getwd' function. */ -#undef HAVE_GETWD - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const
deleted file mode 100644 --- a/kpathsea/c-ctype.h +++ /dev/null @@ -1,81 +0,0 @@ -/* c-ctype.h: ASCII-safe versions of the <ctype.h> macros. - -Copyright (C) 1992 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_CTYPE_H -#define KPATHSEA_C_CTYPE_H - -#include <ctype.h> - -/* Be sure we have `isascii'. */ -#ifndef isascii -#define isascii(c) 1 -#endif - -#define ISALNUM(c) (isascii (c) && isalnum(c)) -#define ISALPHA(c) (isascii (c) && isalpha(c)) -#define ISASCII isascii -#define ISCNTRL(c) (isascii (c) && iscntrl(c)) -#define ISDIGIT(c) (isascii (c) && isdigit (c)) -#define ISGRAPH(c) (isascii (c) && isgraph(c)) -#define ISLOWER(c) (isascii (c) && islower(c)) -#define ISPRINT(c) (isascii (c) && isprint(c)) -#define ISPUNCT(c) (isascii (c) && ispunct(c)) -#define ISSPACE(c) (isascii (c) && isspace(c)) -#define ISUPPER(c) (isascii (c) && isupper(c)) -#define ISXDIGIT(c) (isascii (c) && isxdigit(c)) -#define TOASCII toascii -#define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c)) -#define TOUPPER(c) (ISLOWER (c) ? toupper (c) : (c)) - -/* This isn't part of the usual <ctype.h>, but it's useful sometimes. */ -#ifndef isblank -#define isblank(c) ((c) == ' ' || (c) == '\t') -#endif - - -/* Here's why this mess is necessary: - -From: meyering@cs.utexas.edu (Jim Meyering) -Date: Wed, 25 Nov 1992 09:52:33 -0600 -Subject: ss-921123: using isascii with <ctype.h> macros - - Yesterday some cursory regression testing found that GNU od - (in an upcoming release of textutils) generated incorrect output - when run on an SGI indigo because isprint ('\377') returned true. - Of course, '\377' is not a printing character; the problem lay - in using isprint without first making sure its integer argument - corresponded to an ascii code. - - MORAL: always guard uses of ctype macros with isascii if it's available. - An obvious alternative is to avoid <ctype.h> and define and use your - own versions of the ctype macros. - - A pretty clean approach to using <ctype.h> and isascii was - suggested by David MacKenzie: - - #ifndef isascii - #define isascii(c) 1 - #endif - - #define ISDIGIT(c) (isascii (c) && isdigit (c)) - #define ISPRINT(c) (isascii (c) && isprint (c)) - ... - - then, use ISDIGIT, etc. instead of isdigit, etc. */ - -#endif /* not KPATHSEA_C_CTYPE_H */
deleted file mode 100644 --- a/kpathsea/c-dir.h +++ /dev/null @@ -1,52 +0,0 @@ -/* c-dir.h: directory headers. - -Copyright (C) 1992, 93, 94 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_DIR_H -#define KPATHSEA_C_DIR_H - -#ifdef WIN32 - -#include <direct.h> - -#else /* not WIN32 */ - -/* Use struct dirent instead of struct direct. */ -#ifdef HAVE_DIRENT_H -#include <dirent.h> -#define NAMLEN(dirent) strlen ((dirent)->d_name) -#else /* not DIRENT */ -#define dirent direct -#define NAMLEN(dirent) ((dirent)->d_namlen) - -#ifdef HAVE_SYS_NDIR_H -#include <sys/ndir.h> -#endif - -#ifdef HAVE_SYS_DIR_H -#include <sys/dir.h> -#endif - -#ifdef HAVE_NDIR_H -#include <ndir.h> -#endif - -#endif /* not DIRENT */ - -#endif /* not WIN32 */ - -#endif /* not KPATHSEA_C_DIR_H */
deleted file mode 100644 --- a/kpathsea/c-errno.h +++ /dev/null @@ -1,27 +0,0 @@ -/* c-errno.h: <errno.h> and the errno variable. - -Copyright (C) 1992 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_ERRNO_H -#define KPATHSEA_C_ERRNO_H - -#include <errno.h> -#ifndef errno -extern int errno; -#endif - -#endif /* not KPATHSEA_C_ERRNO_H */
deleted file mode 100644 --- a/kpathsea/c-fopen.h +++ /dev/null @@ -1,87 +0,0 @@ -/* c-fopen.h: how to open files with fopen. - -Copyright (C) 1992, 94, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef C_FOPEN_H -#define C_FOPEN_H - -/* How to open a text file: */ -#ifndef FOPEN_A_MODE -#define FOPEN_A_MODE "a" -#endif - -#ifndef FOPEN_R_MODE -#define FOPEN_R_MODE "r" -#endif - -#ifndef FOPEN_W_MODE -#define FOPEN_W_MODE "w" -#endif - -/* How to open a binary file for reading: */ -#ifndef FOPEN_RBIN_MODE -#if defined (VMS) || defined (VMCMS) || defined(DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) -#define FOPEN_RBIN_MODE "rb" -#else -#define FOPEN_RBIN_MODE "r" -#endif /* not (VM/CMS or VMS or DOS or OS2 or WIN32 or __DJGPP__ or __CYGWIN32__) */ -#endif /* not FOPEN_RBIN_MODE */ - -/* How to open a binary file for writing: */ -#ifndef FOPEN_WBIN_MODE -#if defined (DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) -#define FOPEN_WBIN_MODE "wb" -#else -#ifdef VMCMS -#define FOPEN_WBIN_MODE "wb, lrecl=1024, recfm=f" -#else -#define FOPEN_WBIN_MODE "w" -#endif /* not VM/CMS */ -#endif /* not (DOS or OS2 or WIN32 or DJGPP or CYGWIN32) */ -#endif /* not FOPEN_WBIN_MODE */ - -/* How to open a binary file for appending: */ -#ifndef FOPEN_ABIN_MODE -#if defined (DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) -#define FOPEN_ABIN_MODE "ab" -#else -#define FOPEN_ABIN_MODE "a" -#endif /* not (DOS or OS2 or WIN32 or DJGPP or CYGWIN32) */ -#endif /* not FOPEN_ABIN_MODE */ - -/* How to switch an already open file handle to binary mode. - Used on DOSISH systems when we need to switch a standard - stream, such as stdin or stdout, to binary mode. */ -#include <fcntl.h> -#ifdef DOSISH -#include <io.h> -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#endif -#endif -#if defined (__DJGPP__) || defined (WIN32) || defined (__CYGWIN32__) -#define SET_BINARY(f) setmode((f), O_BINARY) -#endif -#else /* not DOSISH */ -#ifndef O_BINARY -#define O_BINARY 0 -#endif -#define SET_BINARY(f) 0 -#endif /* not DOSISH */ - -#endif /* not C_FOPEN_H */
deleted file mode 100644 --- a/kpathsea/c-limits.h +++ /dev/null @@ -1,36 +0,0 @@ -/* c-limits.h: include the system parameter file. - -Copyright (C) 1992, 93, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef C_LIMITS_H -#define C_LIMITS_H - -#ifdef HAVE_LIMITS_H -#include <limits.h> -#else -#include <kpathsea/systypes.h> -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#endif /* not HAVE_LIMITS_H */ - -/* Some systems may have the floating-point limits in the above. */ -#if defined (HAVE_FLOAT_H) && !defined (FLT_MAX) -#include <float.h> -#endif - -#endif /* not C_LIMITS_H */
deleted file mode 100644 --- a/kpathsea/c-memstr.h +++ /dev/null @@ -1,82 +0,0 @@ -/* c-memstr.h: memcpy, strchr, etc. - -Copyright (C) 1992, 93, 94, 95, 97 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_MEMSTR_H -#define KPATHSEA_C_MEMSTR_H - -/* <X11/Xfuncs.h> tries to declare bcopy etc., which can only conflict. */ -#define _XFUNCS_H_ - -/* Just to be complete, we make both the system V/ANSI and the BSD - versions of the string functions available. */ -#if defined (STDC_HEADERS) || defined (HAVE_STRING_H) -#if 0 /* OK, we'll try without; seems to be unnecessary now. */ -#define SYSV /* so <X11/Xos.h> knows not to include <strings.h> */ -#endif /* 0 */ -#include <string.h> - -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) -#include <memory.h> -#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ - -/* Do not define these if we are not STDC_HEADERS, because in that - case X11/Xos.h defines `strchr' to be `index'. */ -#ifdef STDC_HEADERS -/* Let's hope that if index/rindex are defined, they're defined to the - right thing. */ -#ifndef index -#define index strchr -#endif -#ifndef rindex -#define rindex strrchr -#endif -#endif /* STDC_HEADERS */ - -#ifndef HAVE_BCOPY -#ifndef bcmp -#define bcmp(s1, s2, len) memcmp ((s1), (s2), (len)) -#endif -#ifndef bcopy -#define bcopy(from, to, len) memcpy ((to), (from), (len)) -#endif -#ifndef bzero -#define bzero(s, len) memset ((s), 0, (len)) -#endif -#endif /* not HAVE_BCOPY */ - -#else /* not (STDC_HEADERS or HAVE_STRING_H) */ - -#include <strings.h> - -#ifndef strchr -#define strchr index -#endif -#ifndef strrchr -#define strrchr rindex -#endif - -#define memcmp(s1, s2, n) bcmp ((s1), (s2), (n)) -#define memcpy(to, from, len) bcopy ((from), (to), (len)) - -extern char *strtok (); -extern char *strstr (); - -#endif /* not (STDC_HEADERS or HAVE_STRING_H) */ - -#endif /* not KPATHSEA_C_MEMSTR_H */
deleted file mode 100644 --- a/kpathsea/c-minmax.h +++ /dev/null @@ -1,84 +0,0 @@ -/* c-minmax.h: define INT_MIN, etc. Assume a 32-bit machine if the - values aren't defined. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_MINMAX_H -#define KPATHSEA_C_MINMAX_H - -#include <kpathsea/c-limits.h> - -/* Declared in <limits.h> on ANSI C systems. If the system doesn't - define it, we use the minimum ANSI values -- except for `int'; we - assume 32-bit integers. */ - -#ifndef SCHAR_MIN -#define SCHAR_MIN (-127) -#endif -#ifndef SCHAR_MAX -#define SCHAR_MAX 128 -#endif -#ifndef UCHAR_MAX -#define UCHAR_MAX 255 -#endif - -#ifndef SHRT_MIN -#define SHRT_MIN (-32767) -#endif -#ifndef SHRT_MAX -#define SHRT_MAX 32767 -#endif -#ifndef USHRT_MAX -#define USHRT_MAX 65535 -#endif - -#ifndef INT_MIN -#define INT_MIN (-2147483647) -#endif -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif -#ifndef UINT_MAX -#define UINT_MAX 4294967295 -#endif - -#ifndef LONG_MIN -#define LONG_MIN INT_MIN -#endif -#ifndef LONG_MAX -#define LONG_MAX INT_MAX -#endif -#ifndef ULONG_MAX -#define ULONG_MAX UINT_MAX -#endif - -/* Declared in <float.h> on ANSI C systems. */ -#ifndef DBL_MIN -#define DBL_MIN 1e-37 -#endif -#ifndef DBL_MAX -#define DBL_MAX 1e+37 -#endif - -#ifndef FLT_MIN -#define FLT_MIN 1e-37 -#endif -#ifndef FLT_MAX -#define FLT_MAX 1e+37 -#endif - -#endif /* not KPATHSEA_C_MINMAX_H */
deleted file mode 100644 --- a/kpathsea/c-namemx.h +++ /dev/null @@ -1,36 +0,0 @@ -/* c-namemx.h: define NAME_MAX, the maximum length of a single - component in a filename. No such limit may exist, or may vary - depending on the filesystem. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_NAME_MX_H -#define KPATHSEA_C_NAME_MX_H - -#include <kpathsea/c-limits.h> - -/* Most likely the system will truncate filenames if it is not POSIX, - and so we can use the BSD value here. */ -#ifndef _POSIX_NAME_MAX -#define _POSIX_NAME_MAX 255 -#endif - -#ifndef NAME_MAX -#define NAME_MAX _POSIX_NAME_MAX -#endif - -#endif /* not KPATHSEA_C_NAME_MX_H */
deleted file mode 100644 --- a/kpathsea/c-pathch.h +++ /dev/null @@ -1,100 +0,0 @@ -/* c-pathch.h: define the characters which separate components of - filenames and environment variable paths. - -Copyright (C) 1992, 93, 95, 97 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef C_PATHCH_H -#define C_PATHCH_H - -#include <kpathsea/c-ctype.h> - -/* What separates filename components? */ -#ifndef DIR_SEP -#ifdef VMS -#define DIR_SEP ':' -#define DIR_SEP_STRING ":" -#else -#ifdef DOSISH -/* Either \'s or 's work. Wayne Sullivan's web2pc prefers /, so we'll - go with that. */ -#define DIR_SEP '/' -#define DIR_SEP_STRING "/" -#define IS_DEVICE_SEP(ch) ((ch) == ':') -#define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1])) -/* On DOS, it's good to allow both \ and / between directories. */ -#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') -#else -#ifdef AMIGA -#define DIR_SEP '/' -#define DIR_SEP_STRING "/" -#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':') -#define IS_DEVICE_SEP(ch) ((ch) == ':') -#else -#ifdef VMCMS -#define DIR_SEP ' ' -#define DIR_SEP_STRING " " -#else -#define DIR_SEP '/' -#define DIR_SEP_STRING "/" -#endif /* not VM/CMS */ -#endif /* not AMIGA */ -#endif /* not DOSISH */ -#endif /* not VMS */ -#endif /* not DIR_SEP */ - -#ifndef IS_DIR_SEP -#define IS_DIR_SEP(ch) ((ch) == DIR_SEP) -#endif -#ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix. */ -#define IS_DEVICE_SEP(ch) 0 -#endif -#ifndef NAME_BEGINS_WITH_DEVICE -#define NAME_BEGINS_WITH_DEVICE(name) 0 -#endif - - -/* What separates elements in environment variable path lists? */ -#ifndef ENV_SEP -#ifdef VMS -#define ENV_SEP ',' -#define ENV_SEP_STRING "," -#else -#ifdef DOSISH -#define ENV_SEP ';' -#define ENV_SEP_STRING ";" -#else -#ifdef AMIGA -#define ENV_SEP ';' -#define ENV_SEP_STRING ";" -#else -#ifdef VMCMS -#define ENV_SEP ' ' -#define ENV_SEP_STRING " " -#else -#define ENV_SEP ':' -#define ENV_SEP_STRING ":" -#endif /* not VM/CMS */ -#endif /* not AMIGA */ -#endif /* not DOS */ -#endif /* not VMS */ -#endif /* not ENV_SEP */ - -#ifndef IS_ENV_SEP -#define IS_ENV_SEP(ch) ((ch) == ENV_SEP) -#endif - -#endif /* not C_PATHCH_H */
deleted file mode 100644 --- a/kpathsea/c-pathmx.h +++ /dev/null @@ -1,42 +0,0 @@ -/* c-pathmx.h: define PATH_MAX, the maximum length of a filename. - Since no such limit may exist, it's preferable to dynamically grow - filenames as needed. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_PATH_MX_H -#define KPATHSEA_C_PATH_MX_H - -#include <kpathsea/c-limits.h> - -/* Cheat and define this as a manifest constant no matter what, instead - of using pathconf. I forget why we want to do this. */ - -#ifndef _POSIX_PATH_MAX -#define _POSIX_PATH_MAX 255 -#endif - -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX _POSIX_PATH_MAX -#endif -#endif /* not PATH_MAX */ - - -#endif /* not KPATHSEA_C_PATH_MAX_H */
deleted file mode 100644 --- a/kpathsea/c-proto.h +++ /dev/null @@ -1,86 +0,0 @@ -/* c-proto.h: macros to include or discard prototypes. - -Copyright (C) 1992, 93, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_PROTO_H -#define KPATHSEA_C_PROTO_H - -#if !defined(WIN32) -#define DllImport -#define __cdecl -#elif (defined(_DLL) && !defined(_IMPORT)) || !defined(_DLL) -#define DllImport -#else -#define DllImport __declspec(dllimport) -#endif - -/* These macros munge function declarations to make them work in both - cases. The P?H macros are used for declarations, the P?C for - definitions. Cf. <ansidecl.h> from the GNU C library. P1H(void) - also works for definitions of routines which take no args. */ - -#ifdef HAVE_PROTOTYPES - -#define AA(args) args /* For an arbitrary number; ARGS must be in parens. */ - -#define P1H(p1) (p1) -#define P2H(p1,p2) (p1, p2) -#define P3H(p1,p2,p3) (p1, p2, p3) -#define P4H(p1,p2,p3,p4) (p1, p2, p3, p4) -#define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5) -#define P6H(p1,p2,p3,p4,p5,p6) (p1, p2, p3, p4, p5, p6) -#define P7H(p1,p2,p3,p4,p5,p6,p7) (p1, p2, p3, p4, p5, p6, p7) - -#define P1C(t1,n1)(t1 n1) -#define P2C(t1,n1, t2,n2)(t1 n1, t2 n2) -#define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3) -#define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4) -#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \ - (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) -#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) \ - (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) -#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \ - (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7) - -#else /* not HAVE_PROTOTYPES */ - -#define AA(args) () - -#define P1H(p1) () -#define P2H(p1, p2) () -#define P3H(p1, p2, p3) () -#define P4H(p1, p2, p3, p4) () -#define P5H(p1, p2, p3, p4, p5) () -#define P6H(p1, p2, p3, p4, p5, p6) () -#define P7H(p1, p2, p3, p4, p5, p6, p7) () - -#define P1C(t1,n1) (n1) t1 n1; -#define P2C(t1,n1, t2,n2) (n1,n2) t1 n1; t2 n2; -#define P3C(t1,n1, t2,n2, t3,n3) (n1,n2,n3) t1 n1; t2 n2; t3 n3; -#define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1,n2,n3,n4) \ - t1 n1; t2 n2; t3 n3; t4 n4; -#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1,n2,n3,n4,n5) \ - t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; -#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) (n1,n2,n3,n4,n5,n6) \ - t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; -#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \ - (n1,n2,n3,n4,n5,n6,n7) \ - t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7; - -#endif /* not HAVE_PROTOTYPES */ - -#endif /* not KPATHSEA_C_PROTO_H */
deleted file mode 100644 --- a/kpathsea/c-stat.h +++ /dev/null @@ -1,60 +0,0 @@ -/* c-stat.h: declarations for using stat(2). - -Copyright (C) 1993, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_STAT_H -#define KPATHSEA_STAT_H - -#include <kpathsea/systypes.h> -#include <sys/stat.h> - -#if defined (WIN32) && !defined (__MINGW32__) -#include <kpathsea/win32lib.h> -#endif /* WIN32 */ - -/* POSIX predicates for testing file attributes. */ - -#if !defined (S_ISBLK) && defined (S_IFBLK) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#endif -#if !defined (S_ISCHR) && defined (S_IFCHR) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#endif -#if !defined (S_ISDIR) && defined (S_IFDIR) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if !defined (S_ISREG) && defined (S_IFREG) -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#if !defined (S_ISFIFO) && defined (S_IFIFO) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#endif -#if !defined (S_ISLNK) && defined (S_IFLNK) -#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#endif -#if !defined (S_ISSOCK) && defined (S_IFSOCK) -#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -#endif -#if !defined (S_ISMPB) && defined (S_IFMPB) /* V7 */ -#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -#endif -#if !defined (S_ISNWK) && defined (S_IFNWK) /* HP/UX */ -#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -#endif - -#endif /* not KPATHSEA_STAT_H */
deleted file mode 100644 --- a/kpathsea/c-std.h +++ /dev/null @@ -1,98 +0,0 @@ -/* c-std.h: the first header files. - -Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_STD_H -#define KPATHSEA_C_STD_H - -/* Header files that essentially all of our sources need, and - that all implementations have. We include these first, to help with - NULL being defined multiple times. */ -#include <math.h> -#include <stdio.h> - -/* Be sure we have constants from <unistd.h>. */ -#include <kpathsea/c-unistd.h> - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -/* Include <stdlib.h> before <stddef.h>, to help avoid NULL - redefinitions on some systems. (We don't include <stddef.h> - ourselves any more, but FYI.) */ -#else -/* It's impossible to say for sure what the system will deign to put in - <stdlib.h>, but let's hope it's at least this. */ -extern char *getenv (); -#endif /* not HAVE_STDLIB_H */ - -#ifdef WIN32 -#include <malloc.h> -#else -#ifndef STDC_HEADERS -#ifndef ALLOC_RETURN_TYPE -#ifdef DOSISH -#define ALLOC_RETURN_TYPE void -#else -#define ALLOC_RETURN_TYPE char -#endif /* not DOSISH */ -#endif /* not ALLOC_RETURN_TYPE */ -extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc (); -#endif /* not STDC_HEADERS */ -#endif /* not WIN32 */ - -/* SunOS 4.1.1 gets STDC_HEADERS defined, but it doesn't provide - EXIT_FAILURE. So far no system has defined one of EXIT_FAILURE and - EXIT_SUCCESS without the other. */ -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 -#define EXIT_FAILURE 0 -#else -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif -#endif /* not EXIT_SUCCESS */ - -/* strchr vs. index, memcpy vs. bcopy, etc. */ -#include <kpathsea/c-memstr.h> - -/* Error numbers and errno declaration. */ -#include <kpathsea/c-errno.h> - -/* Numeric minima and maxima. */ -#include <kpathsea/c-minmax.h> - -/* Assertions are too useful to not make generally available. */ -#ifdef HAVE_ASSERT_H -#include <assert.h> -#else -#define assert(expr) /* as nothing */ -#endif - -#ifdef VMS -#include <unixlib.h> -#include <unixio.h> -#else -#ifndef WIN32 -/* `popen' and `pclose' are part of POSIX.2, not POSIX.1. So - STDC_HEADERS isn't enough. */ -extern FILE *popen (); -extern int pclose (); -#endif /* not WIN32 */ -#endif /* not VMS */ - -#endif /* not KPATHSEA_C_STD_H */
deleted file mode 100644 --- a/kpathsea/c-unistd.h +++ /dev/null @@ -1,53 +0,0 @@ -/* c-unistd.h: ensure we have constants from <unistd.h>. Included from - c-std.h. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_C_UNISTD_H -#define KPATHSEA_C_UNISTD_H - -/* <unistd.h> is allowed to depend on <sys/types.h>. */ -#include <kpathsea/systypes.h> - -#if HAVE_UNISTD_H -#include <unistd.h> -#endif - -#include <kpathsea/c-std.h> - -/* For fseek. */ -#ifndef SEEK_SET -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 -#endif /* not SEEK_SET */ - -/* For access. */ -#ifndef F_OK -#define F_OK 0 -#define X_OK 1 -#define W_OK 2 -#define R_OK 4 -#endif /* not F_OK */ - -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#endif /* not STDIN_FILENO */ - -#endif /* not KPATHSEA_C_UNISTD_H */
deleted file mode 100644 --- a/kpathsea/c-vararg.h +++ /dev/null @@ -1,61 +0,0 @@ -/* c-vararg.h: Top layer for stdarg and varargs. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef C_VARARG_H -#define C_VARARG_H - -/* See function `init_path' in `kpathsea/tex-file.c' for an example of use. - The idea is to say PVAR1C(type1, parameter1, ap) in the function header, - and then end the function with two }}'s. We do this to avoid having to - specify the argument list (with types) twice -- once in the function - header, and once in a (hypothetical) VA_START1. */ - -#ifdef HAVE_PROTOTYPES -#include <stdarg.h> - -#define PVAR1H(p1) (p1, ...) -#define PVAR2H(p1, p2) (p1, p2, ...) -#define PVAR3H(p1, p2, p3) (p1, p2, p3, ...) - -#define PVAR1C(t1, n1, ap) \ - (t1 n1, ...) { va_list ap; va_start (ap, n1); -#define PVAR2C(t1, n1, t2, n2, ap) \ - (t1 n1, t2 n2, ...) { va_list ap; va_start (ap, n2); -#define PVAR3C(t1, n1, t2, n2, t3, n3, ap) \ - (t1 n1, t2 n2, t3 n3, ...) { va_list ap; va_start (ap, n3); - -#else /* not HAVE_PROTOTYPES */ -#include <varargs.h> - -#define PVAR1H(p1) () -#define PVAR2H(p1, p2) () -#define PVAR3H(p1, p2, p3) () - -#define PVAR1C(t1, n1, ap) \ - (va_alist) va_dcl { t1 n1; va_list ap; va_start (ap); \ - n1 = va_arg (ap, t1); -#define PVAR2C(t1, n1, t2, n2, ap) \ - (va_alist) va_dcl { t1 n1; t2 n2; va_list ap; va_start (ap); \ - n1 = va_arg (ap, t1); n2 = va_arg (ap, t2); -#define PVAR3C(t1, n1, t2, n2, t3, n3, ap) \ - (va_alist) va_dcl { t1 n1; t2 n2; t3 n3; va_list ap; va_start (ap); \ - n1 = va_arg (ap, t1); n2 = va_arg (ap, t2); \ - n3 = va_arg (ap, t3); -#endif /* not HAVE_PROTOTYPES */ - -#endif /* not C_VARARG_H */
deleted file mode 100644 --- a/kpathsea/cnf.c +++ /dev/null @@ -1,264 +0,0 @@ -/* cnf.c: read config files. - -Copyright (C) 1994, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-fopen.h> -#include <kpathsea/c-ctype.h> -#include <kpathsea/cnf.h> -#include <kpathsea/db.h> -#include <kpathsea/hash.h> -#include <kpathsea/line.h> -#include <kpathsea/paths.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/progname.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/variable.h> - -/* By using our own hash table, instead of the environment, we - complicate variable expansion (because we have to look in two - places), but we don't bang so much on the system. DOS and System V - have very limited environment space. Also, this way - `kpse_init_format' can distinguish between values originating from - the cnf file and ones from environment variables, which can be useful - for users trying to figure out what's going on. */ -static hash_table_type cnf_hash; -#define CNF_HASH_SIZE 751 -#define CNF_NAME "texmf.cnf" - -/* Do a single line in a cnf file: if it's blank or a comment, skip it. - Otherwise, parse <variable>[.<program>] [=] <value>. Do - this even if the <variable> is already set in the environment, since - the envvalue might contain a trailing :, in which case we'll be - looking for the cnf value. */ - -static void -do_line P1C(string, line) -{ - unsigned len; - string start; - string value, var; - string prog = NULL; - - /* Skip leading whitespace. */ - while (ISSPACE (*line)) - line++; - - /* More to do only if we have non-comment material left. */ - if (*line == 0 || *line == '%' || *line == '#') - return; - - /* The variable name is everything up to the next space or = or `.'. */ - start = line; - while (!ISSPACE (*line) && *line != '=' && *line != '.') - line++; - - /* `line' is now one character past the end of the variable name. */ - len = line - start; - var = xmalloc (len + 1); - strncpy (var, start, len); - var[len] = 0; - - /* If the variable is qualified with a program name, we might be - ignoring it. */ - while (ISSPACE (*line)) - line++; - if (*line == '.') { - /* Skip spaces, then everything up to the next space or =. */ - line++; - while (ISSPACE (*line)) - line++; - start = line; - while (!ISSPACE (*line) && *line != '=') - line++; - - /* It's annoying to repeat all this, but making a tokenizing - subroutine would be just as long and annoying. */ - len = line - start; - prog = xmalloc (len + 1); - strncpy (prog, start, len); - prog[len] = 0; - - /* If we are running `prog', fine; otherwise, we're done. */ - assert (kpse_program_name); - if (!FILESTRCASEEQ (prog, kpse_program_name)) { - free (prog); - free (var); - return; - } - } - - /* Skip whitespace, an optional =, more whitespace. */ - while (ISSPACE (*line)) - line++; - if (*line == '=') { - line++; - while (ISSPACE (*line)) - line++; - } - - /* The value is whatever remains. Remove trailing whitespace. */ - start = line; - len = strlen (start); - while (ISSPACE (start[len - 1]) && len > 0) - len--; - - value = xmalloc (len + 1); - strncpy (value, start, len); - value[len] = 0; - - /* Suppose we want to write a single texmf.cnf that can be used under - both NT and Unix. This is feasible except for the path separators - : on Unix, ; on NT. We can't switch NT to allowing :'s, since : - is the drive separator. So we switch Unix to allowing ;'s. On the - other hand, we don't want to change IS_ENV_SEP and all the rest. - - So, simply translate all ;'s in the path - values to :'s if we are a Unix binary. (Fortunately we don't use ; - in other kinds of texmf.cnf values.) - - If you really want to put ; in your filenames, add - -DALLOW_SEMICOLON_IN_FILENAMES. (And there's no way to get :'s in - your filenames, sorry.) */ - -/* gcc -ansi doesn't predefine `unix', since ANSI forbids it. And AIX - generally doesn't predefine unix, who knows why. */ -#ifndef unix -#if defined (__unix__) || defined (_AIX) -#define unix -#endif -#endif - -/* DJGPP defines `unix' (for portability), but generates MSDOS programs. */ -#ifndef __DJGPP__ -#if !defined (ALLOW_SEMICOLON_IN_FILENAMES) && defined (unix) - { - string loc; - for (loc = value; *loc; loc++) { - if (*loc == ';') - *loc = ':'; - } - } -#endif -#endif - - /* We want TEXINPUTS.prog to override plain TEXINPUTS. The simplest - way is to put both in the hash table (so we don't have to write - hash_delete and hash_replace, and keep track of values' sources), - and then look up the .prog version first in `kpse_cnf_get'. */ - if (prog) { - string lhs = concat3 (var, ".", prog); - free (var); - free (prog); - var = lhs; - } - hash_insert (&cnf_hash, var, value); - - /* We could check that anything remaining is preceded by a comment - character, but let's not bother. */ -} - -/* Read all the configuration files in the path. */ - -static void -read_all_cnf P1H(void) -{ - string *cnf_files; - const_string cnf_path = kpse_init_format (kpse_cnf_format); - - cnf_hash = hash_create (CNF_HASH_SIZE); - - for (cnf_files = kpse_all_path_search (cnf_path, CNF_NAME); - cnf_files && *cnf_files; cnf_files++) { - string line; - string cnf_filename = *cnf_files; - FILE *cnf_file = xfopen (cnf_filename, FOPEN_R_MODE); - - while ((line = read_line (cnf_file)) != NULL) { - unsigned len = strlen (line); - /* Concatenate consecutive lines that end with \. */ - while (len > 0 && line[len - 1] == '\\') { - string next_line = read_line (cnf_file); - line[len - 1] = 0; - if (!next_line) { - WARNING1 ("%s: Last line ends with \\", cnf_filename); - } else { - string new_line; - new_line = concat (line, next_line); - free (line); - line = new_line; - len = strlen (line); - } - } - - do_line (line); - free (line); - } - - xfclose (cnf_file, cnf_filename); - } -} - -/* Read the cnf files on the first call. Return the first value in the - returned list -- this will be from the last-read cnf file. */ - -string -kpse_cnf_get P1C(const_string, name) -{ - string ret, try; - string *ret_list; - static boolean doing_cnf_init = false; - - /* When we expand the compile-time value for DEFAULT_TEXMFCNF, - we end up needing the value for TETEXDIR and other variables, - so kpse_var_expand ends up calling us again. No good. */ - if (doing_cnf_init) - return NULL; - - if (cnf_hash.size == 0) { - doing_cnf_init = true; - read_all_cnf (); - doing_cnf_init = false; - - /* Here's a pleasant kludge: Since `kpse_init_dbs' recursively calls - us, we must call it from outside a `kpse_path_element' loop - (namely, the one in `read_all_cnf' above): `kpse_path_element' is - not reentrant. */ - kpse_init_db (); - } - - /* First look up NAME.`kpse_program_name', then NAME. */ - assert (kpse_program_name); - try = concat3 (name, ".", kpse_program_name); - ret_list = hash_lookup (cnf_hash, try); - if (ret_list) { - ret = *ret_list; - free (ret_list); - } else { - free (try); - ret_list = hash_lookup (cnf_hash, name); - if (ret_list) { - ret = *ret_list; - free (ret_list); - } else { - ret = NULL; - } - } - - return ret; - -}
deleted file mode 100644 --- a/kpathsea/cnf.h +++ /dev/null @@ -1,30 +0,0 @@ -/* cnf.h: runtime config files. - -Copyright (C) 1994, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_CNF_H -#define KPATHSEA_CNF_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Return the value in the last-read cnf file for VAR, or NULL if none. - On the first call, also read all the `texmf.cnf' files in the - path for kpse_cnf_format (and initialize the path). */ -extern string kpse_cnf_get P1H(const_string var); - -#endif /* not KPATHSEA_CNF_H */
deleted file mode 100644 --- a/kpathsea/common.ac +++ /dev/null @@ -1,143 +0,0 @@ -dnl Common Autoconf sinclude file for kpathsea-using programs. (Have to -dnl use the m4 `sinclude' builtin instead of `include', since Autoconf -dnl disables `include'.) - -dnl These configure scripts won't work with anything else. -AC_PREREQ(2.12) - -dnl Write output here, instead of putting a zillion -D's on the command line. -AC_CONFIG_HEADER(c-auto.h:c-auto.in) - -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_FUNC_CLOSEDIR_VOID -AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h \ - string.h sys/param.h unistd.h) - - -dnl We would to do the klibtool stuff only in kpathsea (i.e., in -dnl kpathsea/configure.in instead of here in common.ac), but then -dnl HAVE_BASENAME etc. are not defined when compiling the programs, -dnl because <kpathsea/config.h> includes <c-auto.h> (the programs'), -dnl not <kpathsea/c-auto.h>. Should it include both? But then we will -dnl have many benign redefinitions that some compilers may not consider -dnl benign. And it's a big change. -sinclude(acklibtool.m4) -kb_AC_PROG_LIBTOOL -dnl If the list of functions here changes, also change acconfig.h. */ -kb_AC_KLIBTOOL_REPLACE_FUNCS(basename putenv strcasecmp strtol strstr) - -AC_CHECK_FUNCS(bcopy getcwd getwd) - -AC_C_CONST - -# Check whether prototypes work. -AC_MSG_CHECKING(whether the compiler accepts prototypes) -AC_CACHE_VAL(kb_cv_c_prototypes, -[AC_TRY_COMPILE([#include <stdarg.h>], [extern void foo(int i,...);], - kb_cv_c_prototypes=yes, kb_cv_c_prototypes=no)])dnl -AC_MSG_RESULT($kb_cv_c_prototypes) -if test "$kb_cv_c_prototypes" = yes; then - AC_DEFINE(HAVE_PROTOTYPES) -fi - -# This is a GNU libc invention. -AC_MSG_CHECKING(whether program_invocation_name is predefined) -AC_CACHE_VAL(kb_cv_var_program_inv_name, -[AC_TRY_LINK(, - [extern char *program_invocation_name; program_invocation_name = "love";], - kb_cv_var_program_inv_name=yes, kb_cv_var_program_inv_name=no)])dnl -AC_MSG_RESULT($kb_cv_var_program_inv_name) -if test "$kb_cv_var_program_inv_name" = yes; then - AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME) -fi - -# Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. -# This test program is due to Mike Hibler <mike@cs.utah.edu>. -# We don't actually need to run this if we don't have putenv, but it -# doesn't hurt. -AC_MSG_CHECKING(whether putenv uses malloc) -AC_CACHE_VAL(kb_cv_func_putenv_malloc, -[AC_TRY_RUN([ -#define VAR "YOW_VAR" -#define STRING1 "GabbaGabbaHey" -#define STRING2 "Yow!!" /* should be shorter than STRING1 */ -extern char *getenv (); /* in case char* and int don't mix gracefully */ -main () -{ - char *str1, *rstr1, *str2, *rstr2; - str1 = getenv (VAR); - if (str1) - exit (1); - str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); - if (str1 == 0) - exit (2); - strcpy (str1, VAR); - strcat (str1, "="); - strcat (str1, STRING1); - if (putenv (str1) < 0) - exit (3); - rstr1 = getenv (VAR); - if (rstr1 == 0) - exit (4); - rstr1 -= strlen (VAR) + 1; - if (strncmp (rstr1, VAR, strlen (VAR))) - exit (5); - str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); - if (str2 == 0 || str1 == str2) - exit (6); - strcpy (str2, VAR); - strcat (str2, "="); - strcat (str2, STRING2); - if (putenv (str2) < 0) - exit (7); - rstr2 = getenv (VAR); - if (rstr2 == 0) - exit (8); - rstr2 -= strlen (VAR) + 1; -#if 0 - printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); - /* - * If string from first call was reused for the second call, - * you had better not do a free on the first string! - */ - if (rstr1 == rstr2) - printf ("#define SMART_PUTENV\n"); - else - printf ("#undef SMART_PUTENV\n"); -#endif - exit (rstr1 == rstr2 ? 0 : 1); -}], kb_cv_func_putenv_malloc=yes, kb_cv_func_putenv_malloc=no, - kb_cv_func_putenv_malloc=no)])dnl -AC_MSG_RESULT($kb_cv_func_putenv_malloc) -if test $kb_cv_func_putenv_malloc = yes; then - AC_DEFINE(SMART_PUTENV) -fi - -if test $ac_cv_func_getcwd = yes; then -# We only need to run this if we have getcwd. -AC_MSG_CHECKING(whether getcwd uses fork or vfork) -AC_CACHE_VAL(kb_cv_func_getcwd_forks, -[AC_TRY_RUN([ -int fork() { exit(1); } -int vfork() { exit(1); } -extern char *getcwd(); -char path[100]; -int main() { -getcwd(path,100); -return 0; -}], kb_cv_func_getcwd_forks=no, kb_cv_func_getcwd_forks=yes, - kb_cv_func_getcwd_forks=no)])dnl -AC_MSG_RESULT($kb_cv_func_getcwd_forks) -if test $kb_cv_func_getcwd_forks = yes; then - AC_DEFINE(GETCWD_FORKS) -fi -fi - -# Common --with and --enable options. -sinclude(withenable.ac)
deleted file mode 100644 --- a/kpathsea/concat.c +++ /dev/null @@ -1,33 +0,0 @@ -/* concat.c: dynamic string concatenation. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -/* Return the concatenation of S1 and S2. See `concatn.c' for a - `concatn', which takes a variable number of arguments. */ - -string -concat P2C(const_string, s1, const_string, s2) -{ - string answer = (string) xmalloc (strlen (s1) + strlen (s2) + 1); - strcpy (answer, s1); - strcat (answer, s2); - - return answer; -}
deleted file mode 100644 --- a/kpathsea/concat3.c +++ /dev/null @@ -1,32 +0,0 @@ -/* concat3.c: concatenate three strings. - -Copyright (C) 1992 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -string -concat3 P3C(const_string, s1, const_string, s2, const_string, s3) -{ - string answer - = (string) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1); - strcpy (answer, s1); - strcat (answer, s2); - strcat (answer, s3); - - return answer; -}
deleted file mode 100644 --- a/kpathsea/concatn.c +++ /dev/null @@ -1,70 +0,0 @@ -/* concatn.c: Concatenate an arbitrary number of strings. - -Copyright (C) 1993, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/concatn.h> - - -/* OK, it would be epsilon more efficient to compute the total length - and then do the copying ourselves, but I doubt it matters in reality. */ - -string -concatn PVAR1C(const_string, str1, ap) -{ - string arg; - string ret; - - if (!str1) - return NULL; - - ret = xstrdup (str1); - - while ((arg = va_arg (ap, string)) != NULL) - { - string temp = concat (ret, arg); - free (ret); - ret = temp; - } - va_end (ap); - - return ret; -}} - -#ifdef TEST -int -main () -{ - printf ("null = \"%s\"\n", concatn (NULL)); - printf ("\"a\" = \"%s\"\n", concatn ("a", NULL)); - printf ("\"ab\" = \"%s\"\n", concatn ("a", "b", NULL)); - printf ("\"abc\" = \"%s\"\n", concatn ("a", "b", "c", NULL)); - printf ("\"abcd\" = \"%s\"\n", concatn ("ab", "cd", NULL)); - printf ("\"abcde\" = \"%s\"\n", concatn ("ab", "c", "de", NULL)); - printf ("\"abcdef\" = \"%s\"\n", concatn ("", "a", "", "bcd", "ef", NULL)); - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -standalone-compile-command: "gcc -posix -g -I. -I.. -DTEST concatn.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/concatn.h +++ /dev/null @@ -1,33 +0,0 @@ -/* concatn.h: concatenate a variable number of strings. - This is a separate include file only because I don't see the point of - having every source file include <c-vararg.h>. The declarations for - the other concat routines are in lib.h. - -Copyright (C) 1993, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_CONCATN_H -#define KPATHSEA_CONCATN_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/c-vararg.h> -#include <kpathsea/types.h> - -/* Concatenate a null-terminated list of strings and return the result - in malloc-allocated memory. */ -extern DllImport string concatn PVAR1H(const_string str1); - -#endif /* not KPATHSEA_CONCATN_H */
deleted file mode 100755 --- a/kpathsea/config.guess +++ /dev/null @@ -1,1321 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. - -timestamp='2002-03-20' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; - for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - rm -f $dummy.c $dummy.o $dummy.rel ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; - esac - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - ftp://ftp.gnu.org/pub/gnu/config/ - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
deleted file mode 100644 --- a/kpathsea/config.h +++ /dev/null @@ -1,108 +0,0 @@ -/* config.h: master configuration file, included first by all compilable - source files (not headers). - -Copyright (C) 1993, 95, 96, 97 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_CONFIG_H -#define KPATHSEA_CONFIG_H - -/* System defines are for non-Unix systems only. (Testing for all Unix - variations should be done in configure.) Presently the defines used - are: AMIGA DOS OS2 VMCMS VMS WIN32. I do not use any of these systems - myself; if you do, I'd be grateful for any changes. --kb@mail.tug.org */ - -/* If we have either DOS or OS2, we are DOSISH. */ -#if defined (DOS) || defined (OS2) || defined (WIN32) || defined(__MSDOS__) -#define DOSISH -#endif - -#if defined (DOSISH) -#define MONOCASE_FILENAMES /* case-insensitive filename comparisons */ -#endif - -#if defined(__MINGW32__) -#include <windows.h> -#include <fcntl.h> -#include <dirent.h> -#elif defined(WIN32) -#define __STDC__ 1 -#include <kpathsea/win32lib.h> -#endif /* not WIN32 */ - -#ifdef __DJGPP__ -#include <fcntl.h> /* for long filenames' stuff */ -#include <dir.h> /* for `getdisk' */ -#include <io.h> /* for `setmode' */ -#endif - -/* Some drivers have partially integrated kpathsea changes. */ -#ifndef KPATHSEA -#define KPATHSEA 32 -#endif - -/* System dependencies that are figured out by `configure'. If we are - compiling standalone, we get our c-auto.h. Otherwise, the package - containing us must provide this (unless it can somehow generate ours - from c-auto.in). We use <...> instead of "..." so that the current - cpp directory (i.e., kpathsea/) won't be searched. */ -#include <c-auto.h> - -#include <kpathsea/c-std.h> /* <stdio.h>, <math.h>, etc. */ - -#include <kpathsea/c-proto.h> /* Macros to discard or keep prototypes. */ - -#include <kpathsea/debug.h> /* Runtime tracing. */ -#include <kpathsea/lib.h> /* STREQ, etc. */ -#include <kpathsea/types.h> /* <sys/types.h>, boolean, string, etc. */ -#include <kpathsea/progname.h> /* for program_invocation_*name */ - - -/* If you want to find subdirectories in a directory with non-Unix - semantics (specifically, if a directory with no subdirectories does - not have exactly two links), define this. */ -#if !defined (VMS) && !defined (VMCMS) -#if !defined (DOSISH) || defined(__DJGPP__) -/* Surprise! DJGPP returns st_nlink exactly like on Unix. */ -#define ST_NLINK_TRICK -#endif /* either not DOSISH or __DJGPP__ */ -#endif /* not DOS and not VMS and not VMCMS */ - -#ifdef AMIGA -/* No popen/pclose on Amiga, but rather than put #ifdef's in tex-make.c, - let's get rid of the functions here. (CallMF will automatically - generate fonts.) pclose must not be simply empty, since it still - occurs in a comparison. */ -#define popen(cmd, mode) NULL -#define pclose(file) 0 -#endif /* AMIGA */ - -#ifdef OS2 -#define access ln_access -#define chmod ln_chmod -#define creat ln_creat -#define fopen ln_fopen -#define freopen ln_freopen -#define lstat ln_lstat -#define open ln_open -#define remove ln_remove -#define rename ln_rename -#define sopen ln_sopen -#define stat ln_stat -#define unlink ln_unlink -#endif /* OS2 */ - -#endif /* not KPATHSEA_CONFIG_H */
deleted file mode 100755 --- a/kpathsea/config.sub +++ /dev/null @@ -1,1443 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. - -timestamp='2002-03-07' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dsp16xx \ - | fr30 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 | mipsisa64 \ - | mn10200 | mn10300 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i686-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh3eb | sh4eb) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto*) - os=-nto-qnx - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
deleted file mode 100644 --- a/kpathsea/configure.in +++ /dev/null @@ -1,15 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT -AC_CONFIG_SRCDIR([pathsearch.c]) -AC_PREREQ(2.52) dnl Minimum Autoconf version required. - -KPSEVERSION=3.2 -AC_SUBST(KPSEVERSION) -AC_DEFINE_UNQUOTED(KPSEVERSION, "kpathsea version $KPSEVERSION") - -sinclude(common.ac) - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT -dnl Update stamp-auto, since we just remade `c-auto.h'. -date >stamp-auto
deleted file mode 100644 --- a/kpathsea/db.c +++ /dev/null @@ -1,530 +0,0 @@ -/* db.c: an external database to avoid filesystem lookups. - -Copyright (C) 1994, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This gives us a better chance of finding a prototype for basename - on some systems. */ - -#if ! defined (_GNU_SOURCE) -#define _GNU_SOURCE -#endif - -#include <kpathsea/config.h> -#include <kpathsea/absolute.h> -#include <kpathsea/c-fopen.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/db.h> -#include <kpathsea/hash.h> -#include <kpathsea/line.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/readable.h> -#include <kpathsea/str-list.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/variable.h> - -static hash_table_type db; /* The hash table for all the ls-R's. */ -/* SMALL: The old size of the hash table was 7603, with the assumption - that a minimal ls-R bas about 3500 entries. But a typical ls-R will - be more like double that size. */ -#ifndef DB_HASH_SIZE -#define DB_HASH_SIZE 15991 -#endif -#ifndef DB_NAME -#define DB_NAME "ls-R" -#endif - -static hash_table_type alias_db; -#ifndef ALIAS_NAME -#define ALIAS_NAME "aliases" -#endif -#ifndef ALIAS_HASH_SIZE -#define ALIAS_HASH_SIZE 1009 -#endif - -static str_list_type db_dir_list; - -/* If DIRNAME contains any element beginning with a `.' (that is more - than just `./'), return true. This is to allow ``hidden'' - directories -- ones that don't get searched. */ - -static boolean -ignore_dir_p P1C(const_string, dirname) -{ - const_string dot_pos = dirname; - - while ((dot_pos = strchr (dot_pos + 1, '.'))) { - /* If / before and no / after, skip it. */ - if (IS_DIR_SEP (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP (dot_pos[1])) - return true; - } - - return false; -} - -/* If no DB_FILENAME, return false (maybe they aren't using this feature). - Otherwise, add entries from DB_FILENAME to TABLE, and return true. */ - -static boolean -db_build P2C(hash_table_type *, table, const_string, db_filename) -{ - string line; - unsigned dir_count = 0, file_count = 0, ignore_dir_count = 0; - unsigned len = strlen (db_filename) - sizeof (DB_NAME) + 1; /* Keep the /. */ - string top_dir = xmalloc (len + 1); - string cur_dir = NULL; /* First thing in ls-R might be a filename. */ - FILE *db_file = fopen (db_filename, FOPEN_R_MODE); - - strncpy (top_dir, db_filename, len); - top_dir[len] = 0; - - if (db_file) { - while ((line = read_line (db_file)) != NULL) { - len = strlen (line); - - /* A line like `/foo:' = new dir foo. Allow both absolute (/...) - and explicitly relative (./...) names here. It's a kludge to - pass in the directory name with the trailing : still attached, - but it doesn't actually hurt. */ - if (len > 0 && line[len - 1] == ':' && kpse_absolute_p (line, true)) { - /* New directory line. */ - if (!ignore_dir_p (line)) { - /* If they gave a relative name, prepend full directory name now. */ - line[len - 1] = DIR_SEP; - /* Skip over leading `./', it confuses `match' and is just a - waste of space, anyway. This will lose on `../', but `match' - won't work there, either, so it doesn't matter. */ - cur_dir = *line == '.' ? concat (top_dir, line + 2) : xstrdup (line); - dir_count++; - } else { - cur_dir = NULL; - ignore_dir_count++; - } - - /* Ignore blank, `.' and `..' lines. */ - } else if (*line != 0 && cur_dir /* a file line? */ - && !(*line == '.' - && (line[1] == '0' || (line[1] == '.' && line[2] == 0)))) - {/* Make a new hash table entry with a key of `line' and a data - of `cur_dir'. An already-existing identical key is ok, since - a file named `foo' can be in more than one directory. Share - `cur_dir' among all its files (and hence never free it). */ - hash_insert (table, xstrdup (line), cur_dir); - file_count++; - - } /* else ignore blank lines or top-level files - or files in ignored directories*/ - - free (line); - } - - xfclose (db_file, db_filename); - - if (file_count == 0) { - WARNING1 ("kpathsea: No usable entries in %s", db_filename); - WARNING ("kpathsea: See the manual for how to generate ls-R"); - db_file = NULL; - } else { - str_list_add (&db_dir_list, xstrdup (top_dir)); - } - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) { - /* Don't make this a debugging bit, since the output is so - voluminous, and being able to specify -1 is too useful. - Instead, let people who want it run the program under - a debugger and change the variable that way. */ - boolean hash_summary_only = true; - - DEBUGF4 ("%s: %u entries in %d directories (%d hidden).\n", - db_filename, file_count, dir_count, ignore_dir_count); - DEBUGF ("ls-R hash table:"); - hash_print (*table, hash_summary_only); - fflush (stderr); - } -#endif /* KPSE_DEBUG */ - } - - free (top_dir); - - return db_file != NULL; -} - - -/* Insert FNAME into the hash table. This is for files that get built - during a run. We wouldn't want to reread all of ls-R, even if it got - rebuilt. */ - -void -kpse_db_insert P1C(const_string, passed_fname) -{ - /* We might not have found ls-R, or even had occasion to look for it - yet, so do nothing if we have no hash table. */ - if (db.buckets) { - const_string dir_part; - string fname = xstrdup (passed_fname); - string baseptr = (string)basename (fname); - const_string file_part = xstrdup (baseptr); - - *baseptr = '\0'; /* Chop off the filename. */ - dir_part = fname; /* That leaves the dir, with the trailing /. */ - - hash_insert (&db, file_part, dir_part); - } -} - -/* Return true if FILENAME could be in PATH_ELT, i.e., if the directory - part of FILENAME matches PATH_ELT. Have to consider // wildcards, but - $ and ~ expansion have already been done. */ - -static boolean -match P2C(const_string, filename, const_string, path_elt) -{ - const_string original_filename = filename; - boolean matched = false; - - for (; *filename && *path_elt; filename++, path_elt++) { - if (FILECHARCASEEQ (*filename, *path_elt)) /* normal character match */ - ; - - else if (IS_DIR_SEP (*path_elt) /* at // */ - && original_filename < filename && IS_DIR_SEP (path_elt[-1])) { - while (IS_DIR_SEP (*path_elt)) - path_elt++; /* get past second and any subsequent /'s */ - if (*path_elt == 0) { - /* Trailing //, matches anything. We could make this part of the - other case, but it seems pointless to do the extra work. */ - matched = true; - break; - } else { - /* Intermediate //, have to match rest of PATH_ELT. */ - for (; !matched && *filename; filename++) { - /* Try matching at each possible character. */ - if (IS_DIR_SEP (filename[-1]) - && FILECHARCASEEQ (*filename, *path_elt)) - matched = match (filename, path_elt); - } - /* Prevent filename++ when *filename='\0'. */ - break; - } - } - - else /* normal character nonmatch, quit */ - break; - } - - /* If we've reached the end of PATH_ELT, check that we're at the last - component of FILENAME, we've matched. */ - if (!matched && *path_elt == 0) { - /* Probably PATH_ELT ended with `vf' or some such, and FILENAME ends - with `vf/ptmr.vf'. In that case, we'll be at a directory - separator. On the other hand, if PATH_ELT ended with a / (as in - `vf/'), FILENAME being the same `vf/ptmr.vf', we'll be at the - `p'. Upshot: if we're at a dir separator in FILENAME, skip it. - But if not, that's ok, as long as there are no more dir separators. */ - if (IS_DIR_SEP (*filename)) - filename++; - - while (*filename && !IS_DIR_SEP (*filename)) - filename++; - matched = *filename == 0; - } - - return matched; -} - - -/* If DB_DIR is a prefix of PATH_ELT, return true; otherwise false. - That is, the question is whether to try the db for a file looked up - in PATH_ELT. If PATH_ELT == ".", for example, the answer is no. If - PATH_ELT == "/usr/local/lib/texmf/fonts//tfm", the answer is yes. - - In practice, ls-R is only needed for lengthy subdirectory - comparisons, but there's no gain to checking PATH_ELT to see if it is - a subdir match, since the only way to do that is to do a string - search in it, which is all we do anyway. */ - -static boolean -elt_in_db P2C(const_string, db_dir, const_string, path_elt) -{ - boolean found = false; - - while (!found && FILECHARCASEEQ (*db_dir++, *path_elt++)) { - /* If we've matched the entire db directory, it's good. */ - if (*db_dir == 0) - found = true; - - /* If we've reached the end of PATH_ELT, but not the end of the db - directory, it's no good. */ - else if (*path_elt == 0) - break; - } - - return found; -} - -/* If ALIAS_FILENAME exists, read it into TABLE. */ - -static boolean -alias_build P2C(hash_table_type *, table, const_string, alias_filename) -{ - string line, real, alias; - unsigned count = 0; - FILE *alias_file = fopen (alias_filename, FOPEN_R_MODE); - - if (alias_file) { - while ((line = read_line (alias_file)) != NULL) { - /* comments or empty */ - if (*line == 0 || *line == '%' || *line == '#') { - ; - } else { - /* Each line should have two fields: realname aliasname. */ - real = line; - while (*real && ISSPACE (*real)) - real++; - alias = real; - while (*alias && !ISSPACE (*alias)) - alias++; - *alias++ = 0; - while (*alias && ISSPACE (*alias)) - alias++; - /* Is the check for errors strong enough? Should we warn the user - for potential errors? */ - if (strlen (real) != 0 && strlen (alias) != 0) { - hash_insert (table, xstrdup (alias), xstrdup (real)); - count++; - } - } - free (line); - } - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) { - /* As with ls-R above ... */ - boolean hash_summary_only = true; - DEBUGF2 ("%s: %u aliases.\n", alias_filename, count); - DEBUGF ("alias hash table:"); - hash_print (*table, hash_summary_only); - fflush (stderr); - } -#endif /* KPSE_DEBUG */ - - xfclose (alias_file, alias_filename); - } - - return alias_file != NULL; -} - -/* Initialize the path for ls-R files, and read them all into the hash - table `db'. If no usable ls-R's are found, set db.buckets to NULL. */ - -void -kpse_init_db P1H(void) -{ - boolean ok = false; - const_string db_path = kpse_init_format (kpse_db_format); - string *db_files = kpse_all_path_search (db_path, DB_NAME); - string *orig_db_files = db_files; - - /* Must do this after the path searching (which ends up calling - kpse_db_search recursively), so db.buckets stays NULL. */ - db = hash_create (DB_HASH_SIZE); - - while (db_files && *db_files) { - if (db_build (&db, *db_files)) - ok = true; - free (*db_files); - db_files++; - } - - if (!ok) { - /* If db can't be built, leave `size' nonzero (so we don't - rebuild it), but clear `buckets' (so we don't look in it). */ - free (db.buckets); - db.buckets = NULL; - } - - free (orig_db_files); - - /* Add the content of any alias databases. There may exist more than - one alias file along DB_NAME files. This duplicates the above code - -- should be a function. */ - ok = false; - db_files = kpse_all_path_search (db_path, ALIAS_NAME); - orig_db_files = db_files; - - alias_db = hash_create (ALIAS_HASH_SIZE); - - while (db_files && *db_files) { - if (alias_build (&alias_db, *db_files)) - ok = true; - free (*db_files); - db_files++; - } - - if (!ok) { - free (alias_db.buckets); - alias_db.buckets = NULL; - } - - free (orig_db_files); -} - -/* Avoid doing anything if this PATH_ELT is irrelevant to the databases. */ - -str_list_type * -kpse_db_search P3C(const_string, name, const_string, orig_path_elt, - boolean, all) -{ - string *db_dirs, *orig_dirs, *r; - const_string last_slash; - string path_elt; - boolean done; - str_list_type *ret; - unsigned e; - string *aliases = NULL; - boolean relevant = false; - - /* If we failed to build the database (or if this is the recursive - call to build the db path), quit. */ - if (db.buckets == NULL) - return NULL; - - /* When tex-glyph.c calls us looking for, e.g., dpi600/cmr10.pk, we - won't find it unless we change NAME to just `cmr10.pk' and append - `/dpi600' to PATH_ELT. We are justified in using a literal `/' - here, since that's what tex-glyph.c unconditionally uses in - DPI_BITMAP_SPEC. But don't do anything if the / begins NAME; that - should never happen. */ - last_slash = strrchr (name, '/'); - if (last_slash && last_slash != name) { - unsigned len = last_slash - name + 1; - string dir_part = xmalloc (len); - strncpy (dir_part, name, len - 1); - dir_part[len - 1] = 0; - path_elt = concat3 (orig_path_elt, "/", dir_part); - name = last_slash + 1; - } else - path_elt = (string) orig_path_elt; - - /* Don't bother doing any lookups if this `path_elt' isn't covered by - any of database directories. We do this not so much because the - extra couple of hash lookups matter -- they don't -- but rather - because we want to return NULL in this case, so path_search can - know to do a disk search. */ - for (e = 0; !relevant && e < STR_LIST_LENGTH (db_dir_list); e++) { - relevant = elt_in_db (STR_LIST_ELT (db_dir_list, e), path_elt); - } - if (!relevant) - return NULL; - - /* If we have aliases for this name, use them. */ - if (alias_db.buckets) - aliases = hash_lookup (alias_db, name); - - if (!aliases) { - aliases = XTALLOC1 (string); - aliases[0] = NULL; - } - { /* Push aliases up by one and insert the original name at the front. */ - unsigned i; - unsigned len = 1; /* Have NULL element already allocated. */ - for (r = aliases; *r; r++) - len++; - XRETALLOC (aliases, len + 1, string); - for (i = len; i > 0; i--) { - aliases[i] = aliases[i - 1]; - } - aliases[0] = (string) name; - } - - done = false; - for (r = aliases; !done && *r; r++) { - string try = *r; - - /* We have an ls-R db. Look up `try'. */ - orig_dirs = db_dirs = hash_lookup (db, try); - - ret = XTALLOC1 (str_list_type); - *ret = str_list_init (); - - /* For each filename found, see if it matches the path element. For - example, if we have .../cx/cmr10.300pk and .../ricoh/cmr10.300pk, - and the path looks like .../cx, we don't want the ricoh file. */ - while (!done && db_dirs && *db_dirs) { - string db_file = concat (*db_dirs, try); - boolean matched = match (db_file, path_elt); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - DEBUGF3 ("db:match(%s,%s) = %d\n", db_file, path_elt, matched); -#endif - - /* We got a hit in the database. Now see if the file actually - exists, possibly under an alias. */ - if (matched) { - string found = NULL; - if (kpse_readable_file (db_file)) { - found = db_file; - - } else { - string *a; - - free (db_file); /* `db_file' wasn't on disk. */ - - /* The hit in the DB doesn't exist in disk. Now try all its - aliases. For example, suppose we have a hierarchy on CD, - thus `mf.bas', but ls-R contains `mf.base'. Find it anyway. - Could probably work around this with aliases, but - this is pretty easy and shouldn't hurt. The upshot is that - if one of the aliases actually exists, we use that. */ - for (a = aliases + 1; *a && !found; a++) { - string atry = concat (*db_dirs, *a); - if (kpse_readable_file (atry)) - found = atry; - else - free (atry); - } - } - - /* If we have a real file, add it to the list, maybe done. */ - if (found) { - str_list_add (ret, found); - if (!all && found) - done = true; - } - } else { /* no match in the db */ - free (db_file); - } - - - /* On to the next directory, if any. */ - db_dirs++; - } - - /* This is just the space for the pointers, not the strings. */ - if (orig_dirs && *orig_dirs) - free (orig_dirs); - } - - free (aliases); - - /* If we had to break up NAME, free the temporary PATH_ELT. */ - if (path_elt != orig_path_elt) - free (path_elt); - - return ret; -}
deleted file mode 100644 --- a/kpathsea/db.h +++ /dev/null @@ -1,42 +0,0 @@ -/* db.h: lookups in an externally built db file. - -Copyright (C) 1994, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_DB_H -#define KPATHSEA_DB_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> -#include <kpathsea/str-list.h> - -/* Initialize the database. Until this is called, no ls-R matches will - be found. */ -extern void kpse_init_db P1H(void); - -/* Return list of matches for NAME in the ls-R file matching PATH_ELT. If - ALL is set, return (null-terminated list) of all matches, else just - the first. If no matches, return a pointer to an empty list. If no - databases can be read, or PATH_ELT is not in any of the databases, - return NULL. */ -extern str_list_type *kpse_db_search P3H(const_string name, - const_string path_elt, boolean all); - -/* Insert the filename FNAME into the database. - Called by mktexpk et al. */ -extern void kpse_db_insert P1H(const_string fname); - -#endif /* not KPATHSEA_DB_H */
deleted file mode 100644 --- a/kpathsea/debug.c +++ /dev/null @@ -1,52 +0,0 @@ -/* debug.c: Help the user discover what's going on. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#ifdef KPSE_DEBUG /* whole file */ - -unsigned kpathsea_debug = 0; - -/* If the real definitions of fopen or fclose are macros, we lose -- the - #undef won't restore them. */ - -FILE * -fopen P2C(const_string, filename, const_string, mode) -{ -#undef fopen - FILE *ret = fopen (filename, mode); - - if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN)) - DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret); - - return ret; -} - -int -fclose P1C(FILE *, f) -{ -#undef fclose - int ret = fclose (f); - - if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN)) - DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret); - - return ret; -} - -#endif /* KPSE DEBUG */
deleted file mode 100644 --- a/kpathsea/debug.h +++ /dev/null @@ -1,97 +0,0 @@ -/* debug.h: Runtime tracing. - -Copyright (C) 1993, 94, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_DEBUG_H -#define KPATHSEA_DEBUG_H - -/* If NO_DEBUG is defined (not recommended), skip all this. */ -#ifndef NO_DEBUG - -#include <kpathsea/c-proto.h> -#include <kpathsea/c-std.h> -#include <kpathsea/types.h> - -#if defined(WIN32) -#if defined(_DEBUG) -/* This was needed at some time for catching errors in pdftex. */ -#include <crtdbg.h> -#define SET_CRT_DEBUG_FIELD(a) \ - _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) -#define CLEAR_CRT_DEBUG_FIELD(a) \ - _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) -#define SETUP_CRTDBG \ - { _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); \ - _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); \ - _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); \ - _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); \ - _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); \ - _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );\ - } -#else /* ! _DEBUG */ -#define SET_CRT_DEBUG_FIELD(a) -#define CLEAR_CRT_DEBUG_FIELD(a) -#define SETUP_CRTDBG -#endif /* _DEBUG */ -#endif /* WIN32 */ - -/* OK, we'll have tracing support. */ -#define KPSE_DEBUG - -/* Bit vector defining what we should trace. */ -extern DllImport unsigned kpathsea_debug; - -/* Set a bit. */ -#define KPSE_DEBUG_SET(bit) kpathsea_debug |= 1 << (bit) - -/* Test if a bit is on. */ -#define KPSE_DEBUG_P(bit) (kpathsea_debug & (1 << (bit))) - -#define KPSE_DEBUG_STAT 0 /* stat calls */ -#define KPSE_DEBUG_HASH 1 /* hash lookups */ -#define KPSE_DEBUG_FOPEN 2 /* fopen/fclose calls */ -#define KPSE_DEBUG_PATHS 3 /* search path initializations */ -#define KPSE_DEBUG_EXPAND 4 /* path element expansion */ -#define KPSE_DEBUG_SEARCH 5 /* searches */ -#define KPSE_DEBUG_VARS 6 /* variable values */ -#define KPSE_LAST_DEBUG KPSE_DEBUG_VARS - -/* A printf for the debugging. */ -#define DEBUGF_START() do { fputs ("kdebug:", stderr) -#define DEBUGF_END() fflush (stderr); } while (0) - -#define DEBUGF(str) \ - DEBUGF_START (); fputs (str, stderr); DEBUGF_END () -#define DEBUGF1(str, e1) \ - DEBUGF_START (); fprintf (stderr, str, e1); DEBUGF_END () -#define DEBUGF2(str, e1, e2) \ - DEBUGF_START (); fprintf (stderr, str, e1, e2); DEBUGF_END () -#define DEBUGF3(str, e1, e2, e3) \ - DEBUGF_START (); fprintf (stderr, str, e1, e2, e3); DEBUGF_END () -#define DEBUGF4(str, e1, e2, e3, e4) \ - DEBUGF_START (); fprintf (stderr, str, e1, e2, e3, e4); DEBUGF_END () - -#undef fopen -#define fopen kpse_fopen_trace -extern FILE *fopen P2H(const_string filename, const_string mode); -#undef fclose -#define fclose kpse_fclose_trace -extern int fclose P1H(FILE *); - -#endif /* not NO_DEBUG */ - -#endif /* not KPATHSEA_DEBUG_H */
deleted file mode 100644 --- a/kpathsea/default.h +++ /dev/null @@ -1,32 +0,0 @@ -/* default.h: Declare default path expander. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_DEFAULT_H -#define KPATHSEA_DEFAULT_H - -#include <kpathsea/types.h> -#include <kpathsea/c-proto.h> - - -/* Replace a leading or trailing or doubled : in PATH with DFLT. If - no extra colons, return PATH. Only one extra colon is replaced. - DFLT may not be NULL. */ - -extern string kpse_expand_default P2H(const_string path, const_string dflt); - -#endif /* not KPATHSEA_DEFAULT_H */
deleted file mode 100644 --- a/kpathsea/depend.make +++ /dev/null @@ -1,608 +0,0 @@ -absolute.lo: absolute.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h -access.o: access.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -atou.lo: atou.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -basename.lo: basename.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -cnf.lo: cnf.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \ - $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h $(kpathsea_dir)/paths.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -concat.lo: concat.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -concat3.lo: concat3.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -concatn.lo: concatn.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h -db.lo: db.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/db.h \ - $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -debug.lo: debug.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -dir.lo: dir.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-dir.h \ - $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/hash.h -elt-dirs.lo: elt-dirs.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fn.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h -expand.lo: expand.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tilde.h $(kpathsea_srcdir)/variable.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/absolute.h -extend-fname.lo: extend-fname.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -file-p.lo: file-p.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h -find-suffix.lo: find-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h -fn.lo: fn.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/fn.h -fontmap.lo: fontmap.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/tex-file.h -getopt.lo: getopt.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -getopt1.lo: getopt1.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h getopt.h -hash.lo: hash.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/str-list.h -kdefault.lo: kdefault.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/default.h -kpsestat.o: kpsestat.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-stat.h -kpsewhich.o: kpsewhich.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/getopt.h \ - $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-glyph.h \ - $(kpathsea_srcdir)/variable.h -line.lo: line.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/line.h -magstep.lo: magstep.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h -make-suffix.lo: make-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h -path-elt.lo: path-elt.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h -pathsearch.lo: pathsearch.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/variable.h -proginit.lo: proginit.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h -progname.lo: progname.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h -putenv.lo: putenv.c -readable.lo: readable.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-stat.h \ - $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-hush.h \ - $(kpathsea_srcdir)/truncate.h -readlink.o: readlink.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathmx.h $(kpathsea_srcdir)/c-stat.h -rm-suffix.lo: rm-suffix.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -str-list.lo: str-list.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/str-list.h -str-llist.lo: str-llist.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/str-llist.h -strcasecmp.lo: strcasecmp.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -strstr.lo: strstr.c -strtol.lo: strtol.c config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -tex-file.lo: tex-file.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/cnf.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/default.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_dir)/paths.h \ - $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/variable.h -tex-glyph.lo: tex-glyph.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h \ - $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-glyph.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/variable.h -tex-hush.lo: tex-hush.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/pathsearch.h \ - $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-hush.h $(kpathsea_srcdir)/variable.h -tex-make.lo: tex-make.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-fopen.h \ - $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h \ - $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/fn.h \ - $(kpathsea_srcdir)/magstep.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/tex-make.h \ - $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h -tilde.lo: tilde.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/tilde.h -truncate.lo: truncate.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-namemx.h $(kpathsea_srcdir)/c-pathch.h \ - $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/c-pathmx.h \ - $(kpathsea_srcdir)/truncate.h -uppercasify.lo: uppercasify.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h -variable.lo: variable.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \ - $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/variable.h -version.lo: version.c c-auto.h -win32lib.lo: win32lib.c -xcalloc.lo: xcalloc.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xfopen.lo: xfopen.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xfseek.lo: xfseek.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xftell.lo: xftell.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xgetcwd.lo: xgetcwd.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-pathmx.h -xmalloc.lo: xmalloc.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xopendir.lo: xopendir.c $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h -xputenv.lo: xputenv.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xrealloc.lo: xrealloc.c \ - $(kpathsea_srcdir)/config.h c-auto.h \ - $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h \ - $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h -xstat.lo: xstat.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h -xstrdup.lo: xstrdup.c $(kpathsea_srcdir)/config.h c-auto.h $(kpathsea_srcdir)/c-std.h \ - $(kpathsea_srcdir)/c-unistd.h \ - $(kpathsea_srcdir)/systypes.h \ - $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \ - $(kpathsea_srcdir)/c-minmax.h \ - $(kpathsea_srcdir)/c-limits.h \ - $(kpathsea_srcdir)/c-proto.h \ - $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \ - $(kpathsea_srcdir)/progname.h
deleted file mode 100644 --- a/kpathsea/dir.c +++ /dev/null @@ -1,93 +0,0 @@ -/* dir.c: directory operations. - -Copyright (C) 1992, 93, 94, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-dir.h> -#include <kpathsea/c-stat.h> -#include <kpathsea/hash.h> - - -/* Return true if FN is a directory or a symlink to a directory, - false if not. */ - -boolean -dir_p P1C(const_string, fn) -{ -#ifdef WIN32 - int fa = GetFileAttributes(fn); - return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY)); -#else - struct stat stats; - return stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode); -#endif -} - -#ifndef WIN32 - -/* Return -1 if FN isn't a directory, else its number of links. - Duplicate the call to stat; no need to incur overhead of a function - call for that little bit of cleanliness. */ - -int -dir_links P1C(const_string, fn) -{ - static hash_table_type link_table; - string *hash_ret; - long ret; - - if (link_table.size == 0) - link_table = hash_create (457); - -#ifdef KPSE_DEBUG - /* This is annoying, but since we're storing integers as pointers, we - can't print them as strings. */ - if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) - kpse_debug_hash_lookup_int = true; -#endif - - hash_ret = hash_lookup (link_table, fn); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) - kpse_debug_hash_lookup_int = false; -#endif - - /* Have to cast the int we need to/from the const_string that the hash - table stores for values. Let's hope an int fits in a pointer. */ - if (hash_ret) - ret = (long) *hash_ret; - else - { - struct stat stats; - ret = stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode) - ? stats.st_nlink : -1; - - /* It's up to us to copy the value. */ - hash_insert (&link_table, xstrdup (fn), (const_string) ret); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_STAT)) - DEBUGF2 ("dir_links(%s) => %ld\n", fn, ret); -#endif - } - - return ret; -} - -#endif /* !WIN32 */
deleted file mode 100644 --- a/kpathsea/elt-dirs.c +++ /dev/null @@ -1,434 +0,0 @@ -/* elt-dirs.c: Translate a path element to its corresponding director{y,ies}. - -Copyright (C) 1993, 94, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> -#include <kpathsea/expand.h> -#include <kpathsea/fn.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/xopendir.h> - -/* To avoid giving prototypes for all the routines and then their real - definitions, we give all the subroutines first. The entry point is - the last routine in the file. */ - -/* Make a copy of DIR (unless it's null) and save it in L. Ensure that - DIR ends with a DIR_SEP for the benefit of later searches. */ - -static void -dir_list_add P2C(str_llist_type *, l, const_string, dir) -{ - char last_char = dir[strlen (dir) - 1]; - string saved_dir - = IS_DIR_SEP (last_char) || IS_DEVICE_SEP (last_char) - ? xstrdup (dir) - : concat (dir, DIR_SEP_STRING); - - str_llist_add (l, saved_dir); -} - - -/* If DIR is a directory, add it to the list L. */ - -static void -checked_dir_list_add P2C(str_llist_type *, l, const_string, dir) -{ - if (dir_p (dir)) - dir_list_add (l, dir); -} - -/* The cache. Typically, several paths have the same element; for - example, /usr/local/lib/texmf/fonts//. We don't want to compute the - expansion of such a thing more than once. Even though we also cache - the dir_links call, that's not enough -- without this path element - caching as well, the execution time doubles. */ - -typedef struct -{ - const_string key; - str_llist_type *value; -} cache_entry; - -static cache_entry *the_cache = NULL; -static unsigned cache_length = 0; - -#if 0 -void -kpse_clear_dir_cache P1H(void) -{ - while (cache_length > 0) - { - str_llist_type elt = *the_cache[--cache_length].value; - - while (elt) - { - str_llist_type next = STR_LLIST_NEXT (*elt); - - string s = STR_LLIST (*elt); - - if (s) - free (s); - - free (elt); - - elt = next; - } - } - - if (the_cache) - free (the_cache); - - the_cache = NULL; -} -#endif - -/* Associate KEY with VALUE. We implement the cache as a simple linear - list, since it's unlikely to ever be more than a dozen or so elements - long. We don't bother to check here if PATH has already been saved; - we always add it to our list. We copy KEY but not VALUE; not sure - that's right, but it seems to be all that's needed. */ - -static void -cache P2C(const_string, key, str_llist_type *, value) -{ - cache_length++; - XRETALLOC (the_cache, cache_length, cache_entry); - the_cache[cache_length - 1].key = xstrdup (key); - the_cache[cache_length - 1].value = value; -} - - -/* To retrieve, just check the list in order. */ - -static str_llist_type * -cached P1C(const_string, key) -{ - unsigned p; - - for (p = 0; p < cache_length; p++) - { - if (FILESTRCASEEQ (the_cache[p].key, key)) - return the_cache[p].value; - } - - return NULL; -} - -/* Handle the magic path constructs. */ - -/* Declare recursively called routine. */ -static void expand_elt P3H(str_llist_type *, const_string, unsigned); - - -/* POST is a pointer into the original element (which may no longer be - ELT) to just after the doubled DIR_SEP, perhaps to the null. Append - subdirectories of ELT (up to ELT_LENGTH, which must be a /) to - STR_LIST_PTR. */ - -#ifdef WIN32 -/* Shared across recursive calls, it acts like a stack. */ -static char dirname[MAX_PATH]; -#endif - -static void -do_subdir P4C(str_llist_type *, str_list_ptr, const_string, elt, - unsigned, elt_length, const_string, post) -{ -#ifdef WIN32 - WIN32_FIND_DATA find_file_data; - HANDLE hnd; - int proceed; -#else - DIR *dir; - struct dirent *e; -#endif /* not WIN32 */ - fn_type name; - - /* Some old compilers don't allow aggregate initialization. */ - name = fn_copy0 (elt, elt_length); - - assert (IS_DIR_SEP (elt[elt_length - 1]) - || IS_DEVICE_SEP (elt[elt_length - 1])); - -#if defined (WIN32) - strcpy(dirname, FN_STRING(name)); - strcat(dirname, "/*.*"); /* "*.*" or "*" -- seems equivalent. */ - hnd = FindFirstFile(dirname, &find_file_data); - - if (hnd == INVALID_HANDLE_VALUE) { - fn_free(&name); - return; - } - - /* Include top level before subdirectories, if nothing to match. */ - if (*post == 0) - dir_list_add (str_list_ptr, FN_STRING (name)); - else { - /* If we do have something to match, see if it exists. For - example, POST might be `pk/ljfour', and they might have a - directory `$TEXMF/fonts/pk/ljfour' that we should find. */ - fn_str_grow (&name, post); - expand_elt (str_list_ptr, FN_STRING (name), elt_length); - fn_shrink_to (&name, elt_length); - } - proceed = 1; - while (proceed) { - if (find_file_data.cFileName[0] != '.') { - /* Construct the potential subdirectory name. */ - fn_str_grow (&name, find_file_data.cFileName); - if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - unsigned potential_len = FN_LENGTH (name); - - /* It's a directory, so append the separator. */ - fn_str_grow (&name, DIR_SEP_STRING); - - do_subdir (str_list_ptr, FN_STRING (name), - potential_len, post); - } - fn_shrink_to (&name, elt_length); - } - proceed = FindNextFile (hnd, &find_file_data); - } - fn_free (&name); - FindClose(hnd); - -#else /* not WIN32 */ - - /* If we can't open it, quit. */ - dir = opendir (FN_STRING (name)); - if (dir == NULL) - { - fn_free (&name); - return; - } - - /* Include top level before subdirectories, if nothing to match. */ - if (*post == 0) - dir_list_add (str_list_ptr, FN_STRING (name)); - else - { /* If we do have something to match, see if it exists. For - example, POST might be `pk/ljfour', and they might have a - directory `$TEXMF/fonts/pk/ljfour' that we should find. */ - fn_str_grow (&name, post); - expand_elt (str_list_ptr, FN_STRING (name), elt_length); - fn_shrink_to (&name, elt_length); - } - - while ((e = readdir (dir)) != NULL) - { /* If it begins with a `.', never mind. (This allows ``hidden'' - directories that the algorithm won't find.) */ - if (e->d_name[0] != '.') - { - int links; - - /* Construct the potential subdirectory name. */ - fn_str_grow (&name, e->d_name); - - /* If we can't stat it, or if it isn't a directory, continue. */ - links = dir_links (FN_STRING (name)); - - if (links >= 0) - { - unsigned potential_len = FN_LENGTH (name); - - /* It's a directory, so append the separator. */ - fn_str_grow (&name, DIR_SEP_STRING); - - /* Should we recurse? To see if the subdirectory is a - leaf, check if it has two links (one for . and one for - ..). This means that symbolic links to directories do - 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. - - The #ifdef here makes all this configurable at - compile-time, so that if we're using VMS directories or - some such, we can still find subdirectories, even if it - is much slower. */ -#ifdef ST_NLINK_TRICK -#ifdef AMIGA - /* With SAS/C++ 6.55 on the Amiga, `stat' sets the `st_nlink' - field to -1 for a file, or to 1 for a directory. */ - if (links == 1) -#else - if (links > 2) -#endif /* not AMIGA */ -#endif /* not ST_NLINK_TRICK */ - /* All criteria are met; find subdirectories. */ - do_subdir (str_list_ptr, FN_STRING (name), - potential_len, post); -#ifdef ST_NLINK_TRICK - else if (*post == 0) - /* Nothing to match, no recursive subdirectories to - look for: we're done with this branch. Add it. */ - dir_list_add (str_list_ptr, FN_STRING (name)); -#endif - } - - /* Remove the directory entry we just checked from `name'. */ - fn_shrink_to (&name, elt_length); - } - } - - fn_free (&name); - xclosedir (dir); -#endif /* not WIN32 */ -} - - -/* Assume ELT is non-empty and non-NULL. Return list of corresponding - directories (with no terminating NULL entry) in STR_LIST_PTR. Start - looking for magic constructs at START. */ - -static void -expand_elt P3C(str_llist_type *, str_list_ptr, const_string, elt, - unsigned, start) -{ - const_string dir = elt + start, post; - - while (*dir != 0) - { - if (IS_DIR_SEP (*dir)) - { - /* If two or more consecutive /'s, find subdirectories. */ - if (IS_DIR_SEP (dir[1])) - { - for (post = dir + 1; IS_DIR_SEP (*post); post++) ; - do_subdir (str_list_ptr, elt, dir - elt + 1, post); - return; - } - - /* No special stuff at this slash. Keep going. */ - } - - dir++; - } - - /* When we reach the end of ELT, it will be a normal filename. */ - checked_dir_list_add (str_list_ptr, elt); -} - -/* Here is the entry point. Returns directory list for ELT. */ - -str_llist_type * -kpse_element_dirs P1C(const_string, elt) -{ - str_llist_type *ret; - - /* If given nothing, return nothing. */ - if (!elt || !*elt) - return NULL; - - /* If we've already cached the answer for ELT, return it. */ - ret = cached (elt); - if (ret) - return ret; - - /* We're going to have a real directory list to return. */ - ret = XTALLOC1 (str_llist_type); - *ret = NULL; - - /* We handle the hard case in a subroutine. */ - expand_elt (ret, elt, 0); - - /* Remember the directory list we just found, in case future calls are - made with the same ELT. */ - cache (elt, ret); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_EXPAND)) - { - DEBUGF1 ("path element %s =>", elt); - if (ret) - { - str_llist_elt_type *e; - for (e = *ret; e; e = STR_LLIST_NEXT (*e)) - fprintf (stderr, " %s", STR_LLIST (*e)); - } - putc ('\n', stderr); - fflush (stderr); - } -#endif /* KPSE_DEBUG */ - - return ret; -} - -#ifdef TEST - -void -print_element_dirs (const_string elt) -{ - str_llist_type *dirs; - - printf ("Directories of %s:\t", elt ? elt : "(nil)"); - fflush (stdout); - - dirs = kpse_element_dirs (elt); - - if (!dirs) - printf ("(nil)"); - else - { - str_llist_elt_type *dir; - for (dir = *dirs; dir; dir = STR_LLIST_NEXT (*dir)) - { - string d = STR_LLIST (*dir); - printf ("%s ", *d ? d : "`'"); - } - } - - putchar ('\n'); -} - -int -main () -{ - /* DEBUG_SET (DEBUG_STAT); */ - /* All lists end with NULL. */ - print_element_dirs (NULL); /* */ - print_element_dirs (""); /* ./ */ - print_element_dirs ("/k"); /* */ - print_element_dirs (".//"); /* ./ ./archive/ */ - print_element_dirs (".//archive"); /* ./ ./archive/ */ -#ifdef AMIGA - print_element_dirs ("TeXMF:AmiWeb2c/texmf/fonts//"); /* lots */ - print_element_dirs ("TeXMF:AmiWeb2c/share/texmf/fonts//bakoma"); /* just one */ - print_element_dirs ("TeXMF:AmiWeb2c/texmf/fonts//"); /* lots again [cache] */ - print_element_dirs ("TeXMF:"); /* TeXMF: */ - print_element_dirs ("TeXMF:/"); /* TeXMF: and all subdirs */ -#else /* not AMIGA */ - print_element_dirs ("/tmp/fonts//"); /* no need to stat anything */ - print_element_dirs ("/usr/local/lib/tex/fonts//"); /* lots */ - print_element_dirs ("/usr/local/lib/tex/fonts//times"); /* just one */ - print_element_dirs ("/usr/local/lib/tex/fonts//"); /* lots again [cache] */ - print_element_dirs ("~karl"); /* tilde expansion */ - print_element_dirs ("$karl"); /* variable expansion */ - print_element_dirs ("~${LOGNAME}"); /* both */ -#endif /* not AMIGA */ - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -test-compile-command: "gcc -g -I. -I.. -DTEST elt-dirs.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/expand.c +++ /dev/null @@ -1,609 +0,0 @@ -/* expand.c: general expansion. Some of this file (the brace-expansion - code from bash) is covered by the GPL; this is the only GPL-covered - code in kpathsea. The part of the file that I wrote (the first - couple of functions) is covered by the LGPL. - -Copyright (C) 1993, 94, 95, 96, 97 Karl Berry & O. Weber. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> -#include <kpathsea/expand.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/tilde.h> -#include <kpathsea/variable.h> -#include <kpathsea/concatn.h> -#include <kpathsea/absolute.h> - - -/* Do variable expansion first so ~${USER} works. (Besides, it's what the - shells do.) */ - -string -kpse_expand P1C(const_string, s) -{ - string var_expansion = kpse_var_expand (s); - string tilde_expansion = kpse_tilde_expand (var_expansion); - - /* `kpse_var_expand' always gives us new memory; `kpse_tilde_expand' - doesn't, necessarily. So be careful that we don't free what we are - about to return. */ - if (tilde_expansion != var_expansion) - free (var_expansion); - - return tilde_expansion; -} - - -/* Forward declarations of functions from the original expand.c */ -static char **brace_expand P1H(const_string); -static void free_array P1H(char **); - -/* If $KPSE_DOT is defined in the environment, prepend it to any relative - path components. */ - -static string -kpse_expand_kpse_dot P1C(string, path) -{ - string ret, elt; - string kpse_dot = getenv("KPSE_DOT"); -#ifdef MSDOS - boolean malloced_kpse_dot = false; -#endif - - if (kpse_dot == NULL) - return path; - ret = xmalloc(1); - *ret = 0; - -#ifdef MSDOS - /* Some setups of ported Bash force $KPSE_DOT to have the //d/foo/bar - form (when `pwd' is used), which is not understood by libc and the OS. - Convert them back to the usual d:/foo/bar form. */ - if (kpse_dot[0] == '/' && kpse_dot[1] == '/' - && kpse_dot[2] >= 'A' && kpse_dot[2] <= 'z' && kpse_dot[3] == '/') { - kpse_dot++; - kpse_dot = xstrdup (kpse_dot); - kpse_dot[0] = kpse_dot[1]; /* drive letter */ - kpse_dot[1] = ':'; - malloced_kpse_dot = true; - } -#endif - - for (elt = kpse_path_element (path); elt; elt = kpse_path_element (NULL)) { - string save_ret = ret; - /* We assume that the !! magic is only used on absolute components. - Single "." get special treatment, as does "./" or its equivalent. */ - if (kpse_absolute_p (elt, false) || (elt[0] == '!' && elt[1] == '!')) { - ret = concat3(ret, elt, ENV_SEP_STRING); - } else if (elt[0] == '.' && elt[1] == 0) { - ret = concat3 (ret, kpse_dot, ENV_SEP_STRING); -#ifndef VMS - } else if (elt[0] == '.' && IS_DIR_SEP(elt[1])) { - ret = concatn (ret, kpse_dot, elt + 1, ENV_SEP_STRING, NULL); - } else { - ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL); -#endif - } - free (save_ret); - } - -#ifdef MSDOS - if (malloced_kpse_dot) free (kpse_dot); -#endif - - ret[strlen (ret) - 1] = 0; - return ret; -} - -/* Do brace expansion on ELT; then do variable and ~ expansion on each - element of the result; then do brace expansion again, in case a - variable definition contained braces (e.g., $TEXMF). Return a - string comprising all of the results separated by ENV_SEP_STRING. */ - -static string -kpse_brace_expand_element P1C(const_string, elt) -{ - unsigned i; - string *expansions = brace_expand (elt); - string ret = xmalloc (1); - *ret = 0; - - for (i = 0; expansions[i]; i++) { - /* Do $ and ~ expansion on each element. */ - string x = kpse_expand (expansions[i]); - string save_ret = ret; - if (!STREQ (x, expansions[i])) { - /* If we did any expansions, do brace expansion again. Since - recursive variable definitions are not allowed, this recursion - must terminate. (In practice, it's unlikely there will ever be - more than one level of recursion.) */ - string save_x = x; - x = kpse_brace_expand_element (x); - free (save_x); - } - ret = concat3 (ret, x, ENV_SEP_STRING); - free (save_ret); - free (x); - } - - free_array (expansions); - ret[strlen (ret) - 1] = 0; /* waste the trailing null */ - return ret; -} - -/* Be careful to not waste all the memory we allocate for each element. */ - -string -kpse_brace_expand P1C(const_string, path) -{ - string kpse_dot_expansion; - string elt; - unsigned len; - /* Must do variable expansion first because if we have - foo = .:~ - TEXINPUTS = $foo - we want to end up with TEXINPUTS = .:/home/karl. - Since kpse_path_element is not reentrant, we must get all - the path elements before we start the loop. */ - string xpath = kpse_var_expand (path); - string ret = xmalloc (1); - *ret = 0; - - for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) { - string save_ret = ret; - /* Do brace expansion first, so tilde expansion happens in {~ka,~kb}. */ - string expansion = kpse_brace_expand_element (elt); - ret = concat3 (ret, expansion, ENV_SEP_STRING); - free (expansion); - free (save_ret); - } - - /* Waste the last byte by overwriting the trailing env_sep with a null. */ - len = strlen (ret); - if (len != 0) - ret[len - 1] = 0; - free (xpath); - - kpse_dot_expansion = kpse_expand_kpse_dot (ret); - if (kpse_dot_expansion != ret) - free (ret); - - return kpse_dot_expansion; -} - -/* Expand all special constructs in a path, and include only the actually - existing directories in the result. */ -string -kpse_path_expand P1C(const_string, path) -{ - string ret; - string xpath; - string elt; - unsigned len; - - /* Initialise ret to the empty string. */ - ret = xmalloc (1); - *ret = 0; - len = 0; - - /* Expand variables and braces first. */ - xpath = kpse_brace_expand (path); - - /* Now expand each of the path elements, printing the results */ - for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) { - str_llist_type *dirs; - - /* Skip and ignore magic leading chars. */ - if (*elt == '!' && *(elt + 1) == '!') - elt += 2; - - /* Do not touch the device if present */ - if (NAME_BEGINS_WITH_DEVICE (elt)) { - while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) { - *(elt + 2) = *(elt + 1); - *(elt + 1) = *elt; - elt++; - } - } else { - /* We never want to search the whole disk. */ - while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) - elt++; - } - - /* Search the disk for all dirs in the component specified. - Be faster to check the database, but this is more reliable. */ - dirs = kpse_element_dirs (elt); - if (dirs && *dirs) { - str_llist_elt_type *dir; - - for (dir = *dirs; dir; dir = STR_LLIST_NEXT (*dir)) { - string thedir = STR_LLIST (*dir); - unsigned dirlen = strlen (thedir); - string save_ret = ret; - /* Retain trailing slash if that's the root directory. */ - if (dirlen == 1 || (dirlen == 3 && NAME_BEGINS_WITH_DEVICE (thedir) - && IS_DIR_SEP (thedir[2]))) { - ret = concat3 (ret, thedir, ENV_SEP_STRING); - len += dirlen + 1; - ret[len - 1] = ENV_SEP; - } else { - ret = concat (ret, thedir); - len += dirlen; - ret [len - 1] = ENV_SEP; - } - free (save_ret); - } - } - } - /* Get rid of trailing ':', if any. */ - if (len != 0) - ret[len - 1] = 0; - return ret; -} - -/* braces.c -- code for doing word expansion in curly braces. Taken from - bash 1.14.5. [Ans subsequently modified for kpatshea.] - - Copyright (C) 1987,1991 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. */ - - -#define brace_whitespace(c) (!(c) || (c) == ' ' || (c) == '\t' || (c) == '\n') -#define savestring xstrdup - -/* Basic idea: - - Segregate the text into 3 sections: preamble (stuff before an open brace), - postamble (stuff after the matching close brace) and amble (stuff after - preamble, and before postamble). Expand amble, and then tack on the - expansions to preamble. Expand postamble, and tack on the expansions to - the result so far. - */ - -/* The character which is used to separate arguments. */ -static int brace_arg_separator = ','; - -static int brace_gobbler P3H(const_string, int *, int); -static char **expand_amble P1H(const_string), - **array_concat P2H(string * , string *); - -/* Return the length of ARRAY, a NULL terminated array of char *. */ -static int -array_len P1C(char **, array) -{ - register int i; - for (i = 0; array[i]; i++); - return (i); -} - -/* Free the contents of ARRAY, a NULL terminated array of char *. */ -static void -free_array P1C(char **, array) -{ - register int i = 0; - - if (!array) return; - - while (array[i]) - free (array[i++]); - free (array); -} - -/* Allocate and return a new copy of ARRAY and its contents. */ -static char ** -copy_array P1C(char **, array) -{ - register int i; - int len; - char **new_array; - - len = array_len (array); - - new_array = (char **)xmalloc ((len + 1) * sizeof (char *)); - for (i = 0; array[i]; i++) - new_array[i] = savestring (array[i]); - new_array[i] = (char *)NULL; - - return (new_array); -} - - -/* Return an array of strings; the brace expansion of TEXT. */ -static char ** -brace_expand P1C(const_string, text) -{ - register int start; - char *preamble, *amble; - const_string postamble; - char **tack, **result; - int i, c; - - /* Find the text of the preamble. */ - i = 0; - c = brace_gobbler (text, &i, '{'); - - preamble = xmalloc (i + 1); - strncpy (preamble, text, i); - preamble[i] = 0; - - result = xmalloc (2 * sizeof (char *)); - result[0] = preamble; - result[1] = NULL; - - /* Special case. If we never found an exciting character, then - the preamble is all of the text, so just return that. */ - if (c != '{') - return (result); - - /* Find the amble. This is the stuff inside this set of braces. */ - start = ++i; - c = brace_gobbler (text, &i, '}'); - - /* What if there isn't a matching close brace? */ - if (!c) - { - WARNING1 ("%s: Unmatched {", text); - free (preamble); /* Same as result[0]; see initialization. */ - result[0] = savestring (text); - return (result); - } - - amble = xmalloc (1 + (i - start)); - strncpy (amble, &text[start], (i - start)); - amble[i - start] = 0; - - postamble = &text[i + 1]; - - tack = expand_amble (amble); - result = array_concat (result, tack); - free (amble); - free_array (tack); - - tack = brace_expand (postamble); - result = array_concat (result, tack); - free_array (tack); - - return (result); -} - - -/* Expand the text found inside of braces. We simply try to split the - text at BRACE_ARG_SEPARATORs into separate strings. We then brace - expand each slot which needs it, until there are no more slots which - need it. */ -static char ** -expand_amble P1C(const_string, text) -{ - char **result, **partial; - char *tem; - int start, i, c; - - result = NULL; - - for (start = 0, i = 0, c = 1; c; start = ++i) - { - int c0, c1; - int i0, i1; - i0 = i; - c0 = brace_gobbler (text, &i0, brace_arg_separator); - i1 = i; - c1 = brace_gobbler (text, &i1, ENV_SEP); - c = c0 | c1; - i = (i0 < i1 ? i0 : i1); - - tem = xmalloc (1 + (i - start)); - strncpy (tem, &text[start], (i - start)); - tem[i- start] = 0; - - partial = brace_expand (tem); - - if (!result) - result = partial; - else - { - register int lr = array_len (result); - register int lp = array_len (partial); - register int j; - - result = xrealloc (result, (1 + lp + lr) * sizeof (char *)); - - for (j = 0; j < lp; j++) - result[lr + j] = partial[j]; - - result[lr + j] = NULL; - free (partial); - } - free (tem); - } - return (result); -} - -/* Return a new array of strings which is the result of appending each - string in ARR2 to each string in ARR1. The resultant array is - len (arr1) * len (arr2) long. For convenience, ARR1 (and its contents) - are free ()'ed. ARR1 can be NULL, in that case, a new version of ARR2 - is returned. */ -static char ** -array_concat P2C(string *, arr1, string *, arr2) -{ - register int i, j, len, len1, len2; - register char **result; - - if (!arr1) - return (copy_array (arr2)); - - if (!arr2) - return (copy_array (arr1)); - - len1 = array_len (arr1); - len2 = array_len (arr2); - - result = xmalloc ((1 + (len1 * len2)) * sizeof (char *)); - - len = 0; - for (i = 0; i < len2; i++) - { - int strlen_2 = strlen (arr2[i]); - - for (j = 0; j < len1; j++) - { - int strlen_1 = strlen (arr1[j]); - - result[len] = - xmalloc (1 + strlen_1 + strlen_2); - strcpy (result[len], arr1[j]); - strcpy (result[len] + strlen_1, arr2[i]); - len++; - } - } - free_array (arr1); - - result[len] = NULL; - return (result); -} - -/* Start at INDEX, and skip characters in TEXT. Set INDEX to the - index of the character matching SATISFY. This understands about - quoting. Return the character that caused us to stop searching; - this is either the same as SATISFY, or 0. */ -static int -brace_gobbler P3C(const_string, text, int *, indx, int, satisfy) -{ - register int i, c, quoted, level, pass_next; - - level = quoted = pass_next = 0; - - for (i = *indx; (c = text[i]); i++) - { - if (pass_next) - { - pass_next = 0; - continue; - } - - /* A backslash escapes the next character. This allows backslash to - escape the quote character in a double-quoted string. */ - if (c == '\\' && (quoted == 0 || quoted == '"' || quoted == '`')) - { - pass_next = 1; - continue; - } - - if (quoted) - { - if (c == quoted) - quoted = 0; - continue; - } - - if (c == '"' || c == '\'' || c == '`') - { - quoted = c; - continue; - } - - if (c == satisfy && !level && !quoted) - { - /* We ignore an open brace surrounded by whitespace, and also - an open brace followed immediately by a close brace, that - was preceded with whitespace. */ - if (c == '{' && - ((!i || brace_whitespace (text[i - 1])) && - (brace_whitespace (text[i + 1]) || text[i + 1] == '}'))) - continue; - /* If this is being compiled as part of bash, ignore the `{' - in a `${}' construct */ - if ((c != '{') || !i || (text[i - 1] != '$')) - break; - } - - if (c == '{') - level++; - else if (c == '}' && level) - level--; - } - - *indx = i; - return (c); -} - -#if defined (TEST) -#include <stdio.h> - -fatal_error (format, arg1, arg2) - char *format, *arg1, *arg2; -{ - report_error (format, arg1, arg2); - exit (1); -} - -report_error (format, arg1, arg2) - char *format, *arg1, *arg2; -{ - fprintf (stderr, format, arg1, arg2); - fprintf (stderr, "\n"); -} - -main () -{ - char example[256]; - - for (;;) - { - char **result; - int i; - - fprintf (stderr, "brace_expand> "); - - if ((!fgets (example, 256, stdin)) || - (strncmp (example, "quit", 4) == 0)) - break; - - if (strlen (example)) - example[strlen (example) - 1] = 0; - - result = brace_expand (example); - - for (i = 0; result[i]; i++) - printf ("%s\n", result[i]); - - free_array (result); - } -} - -/* - * Local variables: - * test-compile-command: "gcc -g -DTEST -I.. -I. -o brace_expand braces.c -L. -lkpathsea" - * end: - */ - -#endif /* TEST */
deleted file mode 100644 --- a/kpathsea/expand.h +++ /dev/null @@ -1,42 +0,0 @@ -/* expand.h: general expansion. - -Copyright (C) 1993, 94, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_EXPAND_H -#define KPATHSEA_EXPAND_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Call kpse_var_expand and kpse_tilde_expand (in that order). Result - is always in fresh memory, even if no expansions were done. */ -extern string kpse_expand P1H(const_string s); - -/* Do brace expansion and call `kpse_expand' on each element of the - result; return the final expansion (always in fresh memory, even if - no expansions were done). We don't call `kpse_expand_default' - because there is a whole sequence of defaults to run through; see - `kpse_init_format'. */ -extern string kpse_brace_expand P1H(const_string path); - -/* Do brace expansion and call `kpse_expand' on each argument of the - result, then expand any `//' constructs. The final expansion (always - in fresh memory) is a path of all the existing directories that match - the pattern. */ -extern string kpse_path_expand P1H(const_string path); - -#endif /* not KPATHSEA_EXPAND_H */
deleted file mode 100644 --- a/kpathsea/extend-fname.c +++ /dev/null @@ -1,34 +0,0 @@ -/* extend-fname.c: give a filename a suffix, if necessary. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -/* We may or may not return NAME. It's up to the caller not to assume - the return value is modifiable. */ - -string -extend_filename P2C(const_string, name, const_string, default_suffix) -{ - string new_s; - const_string suffix = find_suffix (name); - - new_s = suffix == NULL ? concat3 (name, ".", default_suffix) - : (string) name; - return new_s; -}
deleted file mode 100644 --- a/kpathsea/file-p.c +++ /dev/null @@ -1,37 +0,0 @@ -/* file-p.c: file predicates. - -Copyright (C) 1992, 93, 94 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/xstat.h> - - -/* Test whether FILENAME1 and FILENAME2 are actually the same file. If - stat fails on either of the names, we return false, without error. */ - -boolean -same_file_p P2C(const_string, filename1, const_string, filename2) -{ - struct stat sb1, sb2; - /* These are put in variables only so the results can be inspected - under gdb. */ - int r1 = stat (filename1, &sb1); - int r2 = stat (filename2, &sb2); - - return r1 == 0 && r2 == 0 ? SAME_FILE_P (sb1, sb2) : false; -}
deleted file mode 100644 --- a/kpathsea/find-suffix.c +++ /dev/null @@ -1,45 +0,0 @@ -/* find-suffix.c: return the stuff after a dot. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> - - -/* Return pointer to first character after `.' in last directory element - of NAME. If the name is `foo' or `/foo.bar/baz', we have no extension. */ - -string -find_suffix P1C(const_string, name) -{ - const_string slash_pos; - string dot_pos = strrchr (name, '.'); - - if (dot_pos == NULL) - return NULL; - - for (slash_pos = name + strlen (name); - slash_pos > dot_pos && !IS_DIR_SEP (*slash_pos); - slash_pos--) - ; - - return slash_pos > dot_pos ? NULL : dot_pos + 1; -} - - -
deleted file mode 100644 --- a/kpathsea/fn.c +++ /dev/null @@ -1,119 +0,0 @@ -/* fn.c: arbitrarily long filenames (or just strings). - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/fn.h> - - -/* /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmr10.300pk is 58 - chars, so ASCII `K' seems a good choice. */ -#define CHUNK_SIZE 75 - - -fn_type -fn_init P1H(void) -{ - fn_type ret; - - FN_ALLOCATED (ret) = FN_LENGTH (ret) = 0; - FN_STRING (ret) = NULL; - - return ret; -} - - -fn_type -fn_copy0 P2C(const_string, s, unsigned, len) -{ - fn_type ret; - - FN_ALLOCATED (ret) = CHUNK_SIZE > len ? CHUNK_SIZE : len + 1; - FN_STRING (ret) = xmalloc (FN_ALLOCATED (ret)); - - strncpy (FN_STRING (ret), s, len); - FN_STRING (ret)[len] = 0; - FN_LENGTH (ret) = len + 1; - - return ret; -} - -/* Don't think we ever try to free something that might usefully be - empty, so give fatal error if nothing allocated. */ - -void -fn_free P1C(fn_type *, f) -{ - assert (FN_STRING (*f) != NULL); - free (FN_STRING (*f)); - FN_STRING (*f) = NULL; - FN_ALLOCATED (*f) = 0; - FN_LENGTH (*f) = 0; -} - -/* An arithmetic increase seems more reasonable than geometric. We - don't increase the length member since it may be more convenient for - the caller to add than subtract when appending the stuff that will - presumably follow. */ - -static void -grow P2C(fn_type *, f, unsigned, len) -{ - while (FN_LENGTH (*f) + len > FN_ALLOCATED (*f)) - { - FN_ALLOCATED (*f) += CHUNK_SIZE; - XRETALLOC (FN_STRING (*f), FN_ALLOCATED (*f), char); - } -} - - -void -fn_1grow P2C(fn_type *, f, char, c) -{ - grow (f, 1); - FN_STRING (*f)[FN_LENGTH (*f)] = c; - FN_LENGTH (*f)++; -} - - -void -fn_grow P3C(fn_type *, f, address, source, unsigned, len) -{ - grow (f, len); - strncpy (FN_STRING (*f) + FN_LENGTH (*f), source, len); - FN_LENGTH (*f) += len; -} - - -void -fn_str_grow P2C(fn_type *, f, const_string, s) -{ - unsigned more_len = strlen (s); - grow (f, more_len); - strcat (FN_STRING (*f), s); - FN_LENGTH (*f) += more_len; -} - - -void -fn_shrink_to P2C(fn_type *, f, unsigned, loc) -{ - assert (FN_LENGTH (*f) > loc); - FN_STRING (*f)[loc] = 0; - FN_LENGTH (*f) = loc + 1; -}
deleted file mode 100644 --- a/kpathsea/fn.h +++ /dev/null @@ -1,67 +0,0 @@ -/* fn.h: arbitrarily long filenames (or just strings). - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_FN_H -#define KPATHSEA_FN_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Arbitrarily long filenames; it's inconvenient to use obstacks here, - because we want to maintain a null terminator. Also used for - dynamically growing strings even when the null byte isn't necessary, - e.g., in `variable.c', since I don't want to pass obstacks around - everywhere, and one can't free parts of an obstack arbitrarily. */ - -typedef struct -{ - string str; - unsigned allocated; - unsigned length; /* includes the terminating null byte, if any */ -} fn_type; - -#define FN_STRING(fn) ((fn).str) -#define FN_ALLOCATED(fn) ((fn).allocated) -#define FN_LENGTH(fn) ((fn).length) - - -/* Create a new empty fn. */ -extern fn_type fn_init P1H(void); - -/* Create a new fn from the first LEN characters from S and a null. */ -extern fn_type fn_copy0 P2H(const_string s, unsigned len); - -/* Free what's been allocated. Can also just free the string if it's - been extracted out. Fatal error if nothing allocated in F. */ -extern void fn_free P1H(fn_type *f); - -/* Append the character C to the fn F. Don't append trailing null. */ -extern void fn_1grow P2H(fn_type *f, char c); - -/* Append LENGTH bytes from SOURCE to F. */ -extern void fn_grow P3H(fn_type *f, address source, unsigned length); - -/* Concatenate the component S to the fn F. Assumes string currently in - F is null terminated. */ -extern void fn_str_grow P2H(fn_type *f, const_string s); - -/* Add a null to F's string at position LOC, and update its length. - Fatal error if LOC is past the end of the string. */ -extern void fn_shrink_to P2H(fn_type *f, unsigned loc); - -#endif /* not KPATHSEA_FN_H */
deleted file mode 100644 --- a/kpathsea/fontmap.c +++ /dev/null @@ -1,197 +0,0 @@ -/* fontmap.c: read files for additional font names. - -Copyright (C) 1993, 94, 95, 96, 97 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-ctype.h> -#include <kpathsea/c-fopen.h> -#include <kpathsea/fontmap.h> -#include <kpathsea/hash.h> -#include <kpathsea/line.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/str-list.h> -#include <kpathsea/tex-file.h> - -/* We have one and only one fontmap, so may as well make it static - instead of passing it around. */ -static hash_table_type map; -#ifndef MAP_NAME -#define MAP_NAME "texfonts.map" -#endif -#ifndef MAP_HASH_SIZE -#define MAP_HASH_SIZE 4001 -#endif - -static const_string map_path; /* Only want to create this once. */ - -/* Return next whitespace-delimited token in STR or NULL if none. */ - -static string -token P1C(const_string, str) -{ - unsigned len; - const_string start; - string ret; - - while (*str && ISSPACE (*str)) - str++; - - start = str; - while (*str && !ISSPACE (*str)) - str++; - - len = str - start; - ret = xmalloc (len + 1); - strncpy (ret, start, len); - ret[len] = 0; - - return ret; -} - -/* Open and read the mapping file MAP_FILENAME, putting its entries into - MAP. Comments begin with % and continue to the end of the line. Each - line of the file defines an entry: the first word is the real - filename (e.g., `ptmr'), the second word is the alias (e.g., - `Times-Roman'), and any subsequent words are ignored. .tfm is added - if either the filename or the alias have no extension. This is the - same order as in Dvips' psfonts.map. Perhaps someday the programs - will both read the same file. */ - -static void -map_file_parse P1C(const_string, map_filename) -{ - char *orig_l; - unsigned map_lineno = 0; - FILE *f = xfopen (map_filename, FOPEN_R_MODE); - - while ((orig_l = read_line (f)) != NULL) { - string filename; - string l = orig_l; - string comment_loc = strrchr (l, '%'); - if (!comment_loc) { - comment_loc = strstr (l, "@c"); - } - - /* Ignore anything after a % or @c. */ - if (comment_loc) - *comment_loc = 0; - - map_lineno++; - - /* Skip leading whitespace so we can use strlen below. Can't use - strtok since this routine is recursive. */ - while (*l && ISSPACE (*l)) - l++; - - /* If we don't have any filename, that's ok, the line is blank. */ - filename = token (l); - if (filename) { - string alias = token (l + strlen (filename)); - - if (STREQ (filename, "include")) { - if (alias == NULL) { - WARNING2 ("%s:%u: Filename argument for include directive missing", - map_filename, map_lineno); - } else { - string include_fname = kpse_path_search (map_path, alias, false); - if (include_fname) { - map_file_parse (include_fname); - if (include_fname != alias) - free (include_fname); - } else { - WARNING3 ("%s:%u: Can't find fontname include file `%s'", - map_filename, map_lineno, alias); - } - free (alias); - free (filename); - } - - /* But if we have a filename and no alias, something's wrong. */ - } else if (alias == NULL) { - WARNING3 ("%s:%u: Fontname alias missing for filename `%s'", - map_filename, map_lineno, filename); - free (filename); - - } else { - /* We've got everything. Insert the new entry. They were - already dynamically allocated, so don't bother with xstrdup. */ - hash_insert (&map, alias, filename); - } - } - - free (l); - } - - xfclose (f, map_filename); -} - -/* Parse the file MAP_NAME in each of the directories in PATH and - return the resulting structure. Entries in earlier files override - later files. */ - -static void -read_all_maps P1H(void) -{ - string *filenames; - - map_path = kpse_init_format (kpse_fontmap_format); - filenames = kpse_all_path_search (map_path, MAP_NAME); - - map = hash_create (MAP_HASH_SIZE); - - while (*filenames) { - map_file_parse (*filenames); - filenames++; - } -} - -/* Look up KEY in texfonts.map's; if it's not found, remove any suffix - from KEY and try again. Create the map if necessary. */ - -string * -kpse_fontmap_lookup P1C(const_string, key) -{ - string *ret; - string suffix = find_suffix (key); - - if (map.size == 0) { - read_all_maps (); - } - - ret = hash_lookup (map, key); - if (!ret) { - /* OK, the original KEY didn't work. Let's check for the KEY without - an extension -- perhaps they gave foobar.tfm, but the mapping only - defines `foobar'. */ - if (suffix) { - string base_key = remove_suffix (key); - ret = hash_lookup (map, base_key); - free (base_key); - } - } - - /* Append any original suffix. */ - if (ret && suffix) { - string *elt; - for (elt = ret; *elt; elt++) { - *elt = extend_filename (*elt, suffix); - } - } - - return ret; -}
deleted file mode 100644 --- a/kpathsea/fontmap.h +++ /dev/null @@ -1,31 +0,0 @@ -/* fontmap.h: declarations for reading a file to define additional font names. - -Copyright (C) 1993, 94, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef FONTMAP_H -#define FONTMAP_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/hash.h> -#include <kpathsea/types.h> - - -/* Look up KEY in all texfonts.map's in the glyph_format path, and - return a null-terminated list of all matching entries, or NULL. */ -extern string *kpse_fontmap_lookup P1H(const_string key); - -#endif /* not FONTMAP_H */
deleted file mode 100644 --- a/kpathsea/getopt.c +++ /dev/null @@ -1,1001 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.org - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. - Ditto for AIX 3.2 and <stdlib.h>. */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include <gnu-versions.h> -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include <stdlib.h> -#include <unistd.h> -#endif /* GNU C library. */ - -#ifdef VMS -#include <unixlib.h> -#if HAVE_STRING_H - 0 -#include <string.h> -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include <stdlib.h> -#include <windows.h> -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include <libintl.h> -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#if defined(__GNU_LIBRARY__) || defined(WIN32) -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include <string.h> -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -static const char *nonoption_flags; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void store_args (int argc, char *const *argv) __attribute__ ((unused)); -static void -store_args (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -text_set_element (__libc_subinit, store_args); -#endif - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (!__getopt_initialized || optind == 0) - { - optstring = _getopt_initialize (argc, argv, optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) -#else -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */
deleted file mode 100644 --- a/kpathsea/getopt.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#if !defined(WIN32) || (defined(_DLL) && !defined(_IMPORT)) || !defined(_DLL) -#define DllImport -#else -#define DllImport __declspec(dllimport) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern DllImport char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern DllImport int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern DllImport int opterr; - -/* Set to an option character which was unrecognized. */ - -extern DllImport int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */
deleted file mode 100644 --- a/kpathsea/getopt1.c +++ /dev/null @@ -1,189 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "getopt.h" - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include <gnu-versions.h> -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include <stdlib.h> -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include <stdio.h> - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */
deleted file mode 100644 --- a/kpathsea/hash.c +++ /dev/null @@ -1,203 +0,0 @@ -/* hash.c: hash table operations. - -Copyright (C) 1994, 95, 96, 97 Karl Berry & Olaf Weber. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/hash.h> -#include <kpathsea/str-list.h> - - -/* The hash function. We go for simplicity here. */ - -/* All our hash tables are related to filenames. */ -#ifdef MONOCASE_FILENAMES -#define TRANSFORM(x) toupper (x) -#else -#define TRANSFORM(x) (x) -#endif - -static unsigned -hash P2C(hash_table_type, table, const_string, key) -{ - unsigned n = 0; - - /* Our keys aren't often anagrams of each other, so no point in - weighting the characters. */ - while (*key != 0) - n = (n + n + TRANSFORM (*key++)) % table.size; - - return n; -} - -hash_table_type -hash_create P1C(unsigned, size) -{ - /* hash_table_type ret; changed into "static ..." to work around gcc - optimizer bug for Alpha. */ - static hash_table_type ret; - unsigned b; - ret.buckets = XTALLOC (size, hash_element_type *); - ret.size = size; - - /* calloc's zeroes aren't necessarily NULL, so be safe. */ - for (b = 0; b <ret.size; b++) - ret.buckets[b] = NULL; - - return ret; -} - -/* Whether or not KEY is already in MAP, insert it and VALUE. Do not - duplicate the strings, in case they're being purposefully shared. */ - -void -hash_insert P3C(hash_table_type *, table, const_string, key, - const_string, value) -{ - unsigned n = hash (*table, key); - hash_element_type *new_elt = XTALLOC1 (hash_element_type); - - new_elt->key = key; - new_elt->value = value; - new_elt->next = NULL; - - /* Insert the new element at the end of the list. */ - if (!table->buckets[n]) - /* first element in bucket is a special case. */ - table->buckets[n] = new_elt; - else - { - hash_element_type *loc = table->buckets[n]; - while (loc->next) /* Find the last element. */ - loc = loc->next; - loc->next = new_elt; /* Insert the new one after. */ - } -} - -/* Remove a (KEY, VALUE) pair. */ - -void -hash_remove P3C(hash_table_type *, table, const_string, key, - const_string, value) -{ - hash_element_type *p; - hash_element_type *q; - unsigned n = hash (*table, key); - - /* Find pair. */ - for (q = NULL, p = table->buckets[n]; p != NULL; q = p, p = p->next) - if (FILESTRCASEEQ (key, p->key) && STREQ (value, p->value)) - break; - if (p) { - /* We found something, remove it from the chain. */ - if (q) q->next = p->next; else table->buckets[n] = p->next; - /* We cannot dispose of the contents. */ - free (p); - } -} - -/* Look up STR in MAP. Return a (dynamically-allocated) list of the - corresponding strings or NULL if no match. */ - -#ifdef KPSE_DEBUG -/* Print the hash values as integers if this is nonzero. */ -boolean kpse_debug_hash_lookup_int = false; -#endif - -string * -hash_lookup P2C(hash_table_type, table, const_string, key) -{ - hash_element_type *p; - str_list_type ret; - unsigned n = hash (table, key); - ret = str_list_init (); - - /* Look at everything in this bucket. */ - for (p = table.buckets[n]; p != NULL; p = p->next) - if (FILESTRCASEEQ (key, p->key)) - /* Cast because the general str_list_type shouldn't force const data. */ - str_list_add (&ret, (string) p->value); - - /* If we found anything, mark end of list with null. */ - if (STR_LIST (ret)) - str_list_add (&ret, NULL); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) - { - DEBUGF1 ("hash_lookup(%s) =>", key); - if (!STR_LIST (ret)) - fputs (" (nil)\n", stderr); - else - { - string *r; - for (r = STR_LIST (ret); *r; r++) - { - putc (' ', stderr); - if (kpse_debug_hash_lookup_int) - fprintf (stderr, "%ld", (long) *r); - else - fputs (*r, stderr); - } - putc ('\n', stderr); - } - fflush (stderr); - } -#endif - - return STR_LIST (ret); -} - -/* We only print nonempty buckets, to decrease output volume. */ - -void -hash_print P2C(hash_table_type, table, boolean, summary_only) -{ - unsigned b; - unsigned total_elements = 0, total_buckets = 0; - - for (b = 0; b < table.size; b++) { - hash_element_type *bucket = table.buckets[b]; - - if (bucket) { - unsigned len = 1; - hash_element_type *tb; - - total_buckets++; - if (!summary_only) fprintf (stderr, "%4d ", b); - - for (tb = bucket->next; tb != NULL; tb = tb->next) - len++; - if (!summary_only) fprintf (stderr, ":%-5d", len); - total_elements += len; - - if (!summary_only) { - for (tb = bucket; tb != NULL; tb = tb->next) - fprintf (stderr, " %s=>%s", tb->key, tb->value); - putc ('\n', stderr); - } - } - } - - fprintf (stderr, - "%u buckets, %u nonempty (%u%%); %u entries, average chain %.1f.\n", - table.size, - total_buckets, - 100 * total_buckets / table.size, - total_elements, - total_buckets ? total_elements / (double) total_buckets : 0.0); -}
deleted file mode 100644 --- a/kpathsea/hash.h +++ /dev/null @@ -1,65 +0,0 @@ -/* hash.h: declarations for a hash table. - -Copyright (C) 1994, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef HASH_H -#define HASH_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* A single (key,value) pair. */ -typedef struct hash_element_struct -{ - const_string key; - const_string value; - struct hash_element_struct *next; -} hash_element_type; - -/* The usual arrangement of buckets initialized to null. */ -typedef struct -{ - hash_element_type **buckets; - unsigned size; -} hash_table_type; - -#ifdef KPSE_DEBUG -/* How to print the hash results when debugging. */ -extern boolean kpse_debug_hash_lookup_int; -#endif - -/* Create a hash table of size SIZE. */ -extern hash_table_type hash_create P1H(unsigned size); - -/* Insert the (KEY,VALUE) association into TABLE. KEY may have more - than one VALUE. Neither KEY nor VALUE is copied. */ -extern void hash_insert P3H(hash_table_type *table, const_string key, - const_string value); - -/* Remove the (KEY,VALUE) association from TABLE. */ -extern void hash_remove P3H(hash_table_type *table, const_string key, - const_string value); - -/* Look up KEY in MAP, and return NULL-terminated list of all matching - values (not copies), in insertion order. If none, return NULL. */ -extern string *hash_lookup P2H(hash_table_type table, const_string key); - -/* Print TABLE to stderr. */ -extern void hash_print P2H(hash_table_type table, boolean summary_only); - -#endif /* not HASH_H */
deleted file mode 100644 --- a/kpathsea/hier.texi +++ /dev/null @@ -1,102 +0,0 @@ -@ifclear version -@defcodeindex fl -@defcodeindex op -@end ifclear - -@node TeX directory structure -@section @TeX{} directory structure - -@vindex TEXMF -@cindex @TeX{} directory structure -@cindex directory structure, for @TeX{} files -@cindex skeleton @TeX{} directory -@cindex TDS - -This section describes the default installation hierarchy of the -distribution. It conforms to both the GNU coding standards and the -@TeX{} directory structure (TDS) standard. For rationale and further -explanation, please see those documents. The GNU standard is available -as @url{ftp://ftp.gnu.org/pub/gnu/standards/standards.texi} and -mirrors. The TDS document is available from -@file{@var{CTAN:}/tex-archive/tds} (@pxref{unixtex.ftp}). - -You can change the default paths in many ways (@pxref{Changing search -paths}). One common desire is to put everything (binaries and all) -under a single top-level directory such as @file{/usr/local/texmf} or -@file{/opt/texmf}---in the terms used below, make @var{prefix} and -@var{texmf} the same. For specific instructions on doing that, -see @ref{configure scenarios}. - -Here is a skeleton of the default directory structure, extracted from -the TDS document: - -@example -@var{prefix}/ @r{installation root (@file{/usr/local} by default)} - bin/ @r{executables} - man/ @r{man pages} - include/ @r{C header files} - info/ @r{GNU info files} - lib/ @r{libraries (@file{libkpathsea.*})} - share/ @r{architecture-independent files} - texmf/ @r{TDS root} - bibtex/ @r{Bib@TeX{} input files} - bib/ @r{Bib@TeX{} databases} - base/ @r{base distribution (e.g., @samp{xampl.bib})} - misc/ @r{single-file databases} - @var{pkg}/ @r{name of a package} - bst/ @r{Bib@TeX{} style files} - base/ @r{base distribution (e.g., @samp{plain.bst}, @samp{acm.bst})} - misc/ @r{single-file styles} - @var{pkg}/ @r{name of a package} - doc/ @r{additional documentation} - dvips/ @r{@samp{.pro}, @samp{.ps}, @samp{psfonts.map}} - fonts/ @r{font-related files} - @var{type}/ @r{file type (e.g., @samp{tfm}, @samp{pk})} - @var{mode}/ @r{type of output device (types @samp{pk} and @samp{gf} only)} - @var{supplier}/ @r{name of a font supplier (e.g., @samp{public})} - @var{typeface}/ @r{name of a typeface (e.g., @samp{cm})} - dpi@var{nnn}/ @r{font resolution (types @samp{pk} and @samp{gf} only)} - metafont/ @r{Metafont (non-font) input files} - base/ @r{base distribution (e.g., @samp{plain.mf})} - misc/ @r{single-file packages (e.g., @samp{modes.mf})} - @var{pkg}/ @r{name of a package (e.g., @samp{mfpic})} - metapost/ @r{MetaPost input files} - base/ @r{base distribution (e.g., @samp{plain.mp})} - misc/ @r{single-file packages} - @var{pkg}/ @r{name of a package} - support/ @r{support files for MetaPost-related utilities (e.g., @samp{trfonts.map})} - mft/ @r{@samp{MFT} inputs (e.g., @samp{plain.mft})} - tex/ @r{@TeX{} input files} - @var{format}/ @r{name of a format (e.g., @samp{plain})} - base/ @r{base distribution for @var{format} (e.g., @samp{plain.tex})} - misc/ @r{single-file packages (e.g., @samp{webmac.tex})} - local/ @r{local additions to or local configuration files for @var{format}} - @var{pkg}/ @r{name of a package (e.g., @samp{graphics}, @samp{mfnfss})} - generic/ @r{format-independent packages} - hyphen/ @r{hyphenation patterns (e.g., @samp{hyphen.tex})} - images/ @r{image input files (e.g., Encapsulated PostScript)} - misc/ @r{single-file format-independent packages (e.g., @samp{null.tex}).} - @var{pkg}/ @r{name of a package (e.g., @samp{babel})} - web2c/ @r{implementation-dependent files (@file{.pool}, @file{.fmt}, @file{texmf.cnf}, etc.)} -@end example - -Some concrete examples for most file types: - -@example -/usr/local/bin/tex -/usr/local/man/man1/xdvi.1 -/usr/local/info/kpathsea.info -/usr/local/lib/libkpathsea.a -/usr/local/share/texmf/bibtex/bst/base/plain.bst -/usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk -/usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf -/usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm -/usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa -/usr/local/share/texmf/metafont/base/plain.mf -/usr/local/share/texmf/metapost/base/plain.mp -/usr/local/share/texmf/tex/plain/base/plain.tex -/usr/local/share/texmf/tex/generic/hyphen/hyphen.tex -/usr/local/share/texmf/web2c/tex.pool -/usr/local/share/texmf/web2c/tex.fmt -/usr/local/share/texmf/web2c/texmf.cnf -@end example
deleted file mode 100755 --- a/kpathsea/install-sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh - -# -# install - install a program, script, or datafile -# This comes from X11R5; it is not part of GNU. -# -# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" - -instcmd="$mvprog" -chmodcmd="" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -fi - -if [ x"$dst" = x ] -then - echo "install: no destination specified" - exit 1 -fi - - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - -if [ -d $dst ] -then - dst="$dst"/`basename $src` -fi - -# Make a temp file name in the proper directory. - -dstdir=`dirname $dst` -dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - -$doit $instcmd $src $dsttmp - -# and set any options; do chmod last to preserve setuid bits - -if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi -if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi -if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi -if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi - -# Now rename the file to the real destination. - -$doit $rmcmd $dst -$doit $mvcmd $dsttmp $dst - - -exit 0
deleted file mode 100644 --- a/kpathsea/install.texi +++ /dev/null @@ -1,1214 +0,0 @@ -@ifclear version -@defcodeindex cm -@defcodeindex fl -@defcodeindex op -@end ifclear - -@node Installation -@chapter Installation - -@cindex installation -@cindex configuration -@cindex compilation - -@ifset version -(A copy of this chapter is in the distribution file @file{kpathsea/INSTALL}.) -@end ifset - -The procedure for Kpathsea (and Web2c, etc.) configuration and -installation follows. If you encounter trouble, see @ref{Common -problems}, a copy of which is in the file @file{kpathsea/BUGS}. - -@menu -* Simple installation:: If you just want to do it. -* Custom installation:: If you want to change things around. -* Security:: Who can write what files, etc. -* TeX directory structure:: Managing the horde of TeX input files. -* unixtex.ftp:: Getting software via FTP, on CD-ROM, or on tape. -* Reporting bugs:: Where and how to report bugs. -@end menu - - -@node Simple installation -@section Simple installation - -@cindex simple installation -@cindex installation, simple - -@cindex precompiled executables, instead of installation -@cindex installation, getting executables instead of -Installing @TeX{} and friends for the first time can be a daunting -experience. Thus, you may prefer to skip this whole thing and just get -precompiled executables: see @ref{unixtex.ftp}. - -This section explains what to do if you wish to take the defaults for -everything, and generally to install in the simplest possible way. Most -steps here refer to corresponding subsection in the next section which -explains how to override defaults and generally gives more details. - -By default everything will be installed under @file{/usr/local} and the -following discussion assumes this. However, if you already have @TeX{} -installed, its location is used to derive the directory under which -everything is to be installed. - -@enumerate -@item -Be sure you have enough disk space: approximately 8 megabytes for the -compressed archives, 15MB for sources, 45MB for compilation, 40MB for -the (initial) installed system (including library files). @xref{Disk -space}. - -@item -Retrieve these two distribution archives: -@table @url -@item ftp://ftp.tug.org/tex/texk.tar.gz -These are the sources, which you will be compiling. - -@item ftp://ftp.tug.org/tex/texmflib.tar.gz -This is a basic set of input files. You should unpack it in the -directory @file{/usr/local/share}; doing so will create a @file{texmf} -subdirectory there. -@end table - -@noindent @xref{Kpathsea application distributions}. - -@item -When using the default search paths, there is no need to edit any -distribution files. @xref{Changing search paths}. - -@item -At the top level of the distribution, run @samp{sh configure}. (If you -have the GNU Bash shell installed, run @samp{bash configure}.) -@xref{Running configure}. - -@item -@samp{make}. @xref{Running make}. If you are using a BSD 4.4 system -such as FreeBSD or NetBSD, use GNU make (often installed in -@file{/usr/local/bin}), not the BSD make. - -If you are using a HP-UX 10 system and the native compiler, specify the -@samp{+u} flag in @code{XCFLAGS}. - -@item -@samp{make install}. @xref{Installing files}. - -@item -@samp{make distclean}. @xref{Cleaning up}. - -@item -Set up a cron job to rebuild the filename database that makes searching -faster. This line will rebuild it every midnight: -@example -0 0 * * * cd /usr/local/share/texmf && @var{/bindir}/mktexlsr -@end example -@xref{Filename database generation}, and @ref{Filename database}. - -@item -@cindex printer configuration files -@cindex PostScript fonts, additional -@cindex color printers, configuring -If you're installing Dvips, you also need to set up configuration files -for your printers and make any additional PostScript fonts available. -@xref{Installation,,, dvips, Dvips}. If you have any color printers, -see @ref{Color device configuration,,, dvips, Dvips}. - -@item -The first time you run a DVI driver, a bunch of PK fonts will be built -by Metafont via @code{mktexpk} (and added to the filename database). -This will take some time. Don't be alarmed; they will created only this -first time (unless something is wrong with your path definitions). - -By default, @code{mktexpk} will create these fonts in a hierarchy -under @file{/var/tmp/texfonts}; it simply assumes that @file{/var/tmp} -exists and is globally writable. If you need a different arrangement, -see @ref{mktex configuration}. - -@xref{mktex scripts}. - -@item -@cindex fonts, being created -@pindex mktexpk @r{, initial runs} -@cindex tests, simple -For some simple tests, try @samp{tex story \\bye} and @samp{latex -sample2e}. Then run @file{xdvi story} or @file{dvips sample2e} on the -resulting DVI files to preview/print the documents. @xref{Installation -testing}. -@end enumerate - - -@node Custom installation -@section Custom installation - -@cindex custom installation -@cindex installation, customized - -Most sites need to modify the default installation procedure in some -way, perhaps merely changing the prefix from @samp{/usr/local}, perhaps -adding extra compiler or loader options to work around @code{configure} -bugs. This section explains how to override default choices. For -additional distribution-specific information: -@itemize @bullet -@item @file{dviljk/INSTALL}. -@item @xref{Installation,,,dvips,Dvips}. -@item @xref{Installation,,,web2c,Web2c}. -@item @file{xdvik/INSTALL}. -@end itemize - -@cindex non-Unix operating systems -@cindex Amiga support -@cindex DOS support -@cindex OS/2 support -@cindex VMS support -These instructions are for Unix systems. Other operating-system -specific distributions have their own instructions. The code base -itself supports Amiga, DOS, OS/2, and VMS. - - -Following are the same steps as in the previous section (which describes -the simplest installation), but with much more detail. - -@menu -* Disk space:: -* Kpathsea application distributions:: -* Changing search paths:: -* Running configure:: -* Running make:: -* Installing files:: -* Cleaning up:: -* Filename database generation:: -* mktex scripts:: -* Installation testing:: -@end menu - - -@node Disk space -@subsection Disk space - -@cindex disk space, needed -@cindex total disk space -@cindex size of distribution archives -Here is a table showing the disk space needed for each distribution -(described in the next section). The `(totals)' line reflects the -@samp{texk} source distribution and @samp{texmflib}; the individual -distributions don't enter into it. Sizes are in megabytes. All numbers -are approximate. - -@multitable {distribution} {.tar.gz} {unpacked} {compiled} {installed} -@item Distribution @tab .tar.gz @tab Unpacked @tab Compiled @tab Installed -@item dviljk @tab .9 @tab 3.8 @tab -@item dvipsk @tab .9 @tab 3.2 @tab -@item xdvik @tab .7 @tab 2.5 @tab -@item web2c @tab 1.3 @tab 5.0 @tab -@item web @tab 1.9 @tab 6.5 @tab - @tab - -@item texk @tab 3.8 @tab 14.1 @tab 43.1 @tab 23.5 -@item texmflib @tab 3.8 @tab 15.0 @tab - @tab 15.0 -@item (totals) @tab 7.6 @tab 29.1 @tab 43.1 @tab 38.5 -@end multitable - - -@node Kpathsea application distributions -@subsection Kpathsea application distributions - -@cindex distributions, compiling simultaneously -@cindex version number, of Kpathsea -@cindex Kpathsea version number - -@cindex distributions, not compiling -@cindex NeXT, lacking X11 -@cindex X11, lacking on NeXT -The archive @url{ftp://ftp.tug.org/tex/texk.tar.gz} contains all of the -Kpathsea applications I maintain, and the library itself. For example, -since NeXT does not generally support X11, you'd probably want to skip -@samp{xdvik} (or simply remove it after unpacking @file{texk.tar.gz}. -If you are not interested in all of them, you can also retrieve them -separately: - -@cindex DVI drivers -@table @file -@item dviljk.tar.gz -@cindex PCL driver -@cindex LaserJet drive -DVI to PCL, for LaserJet printers. - -@item dvipsk.tar.gz -@cindex PDF generation -@cindex PostScript driver -DVI to PostScript, for previewers, printers, or PDF generation. - -@item web2c.tar.gz -The software needed to compile @TeX{} and friends. - -@item web.tar.gz -The original WEB source files, also used in compilation. - -@item xdvik.tar.gz -@cindex X11 previewer -DVI previewing under the X window system. - -@end table - -@cindex Babel -@cindex non-English typesetting -If you want to use the Babel La@TeX{} package for support of non-English -typesetting, you may need to retrieve additional files. See the file -@file{install.txt} in the Babel distribution. - - -@node Changing search paths -@subsection Changing search paths - -@cindex search paths, changing default -@cindex paths, changing default -@flindex texmf.in@r{, editing} -If the search paths for your installation differ from the standard -@TeX{} directory structure (@pxref{Top,, Introduction, tds, A Directory -Structure for @TeX{} files}), edit the file @file{kpathsea/texmf.in} -as desired, before running @code{configure}. For example, if you have -all your fonts or macros in one big directory. - -You may also wish to edit the file @file{mktex.cnf}, either before or -after installation, to control various aspects of @code{mktexpk} and -friends. @xref{mktex configuration}. - -You do not need to edit @file{texmf.in} to change the default -top-level or other installation @emph{directories} (only the paths). -You can and should do that when you run @code{configure} (next step). - -You also do not need to edit @file{texmf.in} if you are willing to -rely on @file{texmf.cnf} at runtime to define the paths, and let the -compile-time default paths be incorrect. Usually there is no harm in -doing this. - -The section below explains default generation in more detail. - -@menu -* Default path features:: -* Default path generation:: -@end menu - - -@node Default path features -@subsubsection Default path features - -@cindex default path features -@cindex features, of default paths - -The purpose of having all the different files described in the section -above is to avoid having the same information in more than one place. If -you change the installation directories or top-level prefix at -@code{configure}-time, those changes will propagate through the whole -sequence. And if you change the default paths in @file{texmf.in}, -those changes are propagated to the compile-time defaults. - -The Make definitions are all repeated in several @t{Makefile}'s; but -changing the top-level @file{Makefile} should suffice, as it passes down -all the variable definitions, thus overriding the submakes. (The -definitions are repeated so you can run Make in the subdirectories, if -you should have occasion to.) - -@vindex MAKETEX_MODE -@cindex paths, device name included in -By default, the bitmap font paths end with @samp{/$MAKETEX_MODE}, thus -including the device name (usually a Metafont mode name such as -@samp{ljfour}). This distinguishes two different devices with the same -resolution---a write/white from a write/black 300@dmn{dpi} printer, for -example. - -@findex kpse_init_prog@r{, and @code{MAKETEX_MODE}} -@flindex proginit.c -However, since most sites don't have this complication, Kpathsea -(specifically, the @code{kpse_init_prog} function in -@file{kpathsea/proginit.c}) has a special case: if the mode has not been -explicitly set by the user (or in a configuration file), it sets -@code{MAKETEX_MODE} to @code{/}. This makes the default PK path, for -example, expand into @code{@dots{}/pk//}, so fonts will be found even if -there is no subdirectory for the mode (if you arranged things that way -because your site has only one printer, for example) or if the program -is mode-independent (e.g., @code{pktype}). - -To make the paths independent of the mode, simply edit -@file{texmf.in} before installation, or the installed -@file{texmf.cnf}, and remove the @samp{$MAKETEX_MODE}. - -@xref{mktex script arguments}, for how this interacts with @code{mktexpk}. - -@flindex HIER -@flindex kpathsea/HIER -@xref{TeX directory structure,, @TeX{} directory structure}, for a -description of the default arrangement of the input files that comprise -the @TeX{} system. The file @file{kpathsea/HIER} is a copy of that -section. - - -@node Default path generation -@subsubsection Default path generation - -@cindex default paths, changing -@cindex paths, changing default -@cindex installation, changing default directories -@cindex directories, changing default installation - -This section describes how the default paths are constructed. - -You may wish to ignore the whole mess and simply edit @file{texmf.cnf} -after it is installed, perhaps even copying it into place beforehand so -you can complete the installation, if it seems necessary. - -@cindex default paths, how they're made -To summarize the chain of events that go into defining the default paths: - -@enumerate -@item -@samp{configure} creates a @file{Makefile} from each @file{Makefile.in}. - -@item -@flindex texmf.sed -When Make runs in the @file{kpathsea} directory, it creates a file -@file{texmf.sed} that substitutes the Make value of @code{$(var)} for a -string @code{@@var@@}. The variables in question are the one that -define the installation directories. - -@item -@flindex texmf.in -@flindex texmf.cnf@r{, generated} -@file{texmf.sed} (together with a little extra magic---see -@file{kpathsea/Makefile}) is applied to @file{texmf.in} to generate -@file{texmf.cnf}. This is the file that will eventually be installed -and used. - -@item -@flindex paths.h -The definitions in @file{texmf.cnf} are recast as C @code{#define}'s in -@file{paths.h}. These values will be the compile-time defaults; they -are not used at runtime unless no @file{texmf.cnf} file can be found. - -(That's a lie: the compile-time defaults are what any extra @t{:}'s in -@file{texmf.cnf} expand into; but the paths as distributed have no extra -@t{:}'s, and there's no particular reason for them to.) -@end enumerate - - -@node Running configure -@subsection Running @code{configure} - -@flindex configure@r{, running} -@flindex c-auto.in -@flindex Makefile.in -@findex ac_include@r{, Autoconf extension} -@cindex @@@var{var}@@ substitutions -@cindex system dependencies -Run @code{sh configure @var{options}} (in the top-level directory, the -one containing @file{kpathsea/}), possibly using a shell other than -@code{sh} (@pxref{configure shells}). - -@code{configure} adapts the source distribution to the present system -via @code{#define}'s in @file{*/c-auto.h}, which are created from the -corresponding @file{c-auto.in}. It also creates a @file{Makefile} from -the corresponding @file{Makefile.in}, doing @samp{@@@var{var}@@} and -@samp{ac_include} substitutions). - -@flindex README.CONFIGURE -@flindex kpathsea/README.CONFIGURE -@code{configure} is the best place to control the configuration, -compilation, and installed location of the software, either via -command-line options, or by setting environment variables before -invoking it. For example, you can disable @code{mktexpk} by default -with the option @samp{--disable-mktexpk}. -@xref{configure options}. - -@menu -* configure shells:: -* configure options:: -* configure environment:: -* configure scenarios:: -* Shared library:: -@end menu - - -@node configure shells -@subsubsection @code{configure} shells - -@cindex shells and @code{configure} -@pindex bash@r{, recommended for running @code{configure}} - -If you have Bash, the GNU shell, use it if @code{sh} runs into trouble -(@pxref{Top,,,features,Bash Features}). - -Most Bourne shell variants other than Bash cannot handle -@code{configure} scripts as generated by GNU Autoconf (@pxref{Top, -Introduction,, autoconf, Autoconf}). Specifically: -@table @code -@item ksh -@pindex ksh@r{, losing with @code{configure}} -@pindex bsh@r{, ok with @code{configure}} -@cindex Korn shell@r{, losing with @code{configure}} -@cindex AIX shells and @code{configure} -The Korn shell may be installed as @file{/bin/sh} on AIX. -@file{/bin/bsh} may serve instead. - -@item ash -@pindex ash@r{, losing with @code{configure}} -@cindex NetBSD shells and @code{configure} -@cindex FreeBSD shells and @code{configure} -@cindex Linux shells and @code{configure} -Ash is sometimes installed as @file{/bin/sh} on NetBSD, FreeBSD, and -Linux systems. @file{/bin/bash} should be available. - -@item @r{Ultrix} /bin/sh -@cindex DEC shells and @code{configure} -@cindex Ultrix shells and @code{configure} -@pindex sh5@r{, ok with @code{configure}} -@file{/bin/sh} under Ultrix is a DEC-grown shell that is notably -deficient in many ways. @file{/bin/sh5} may be necessary. -@end table - - -@node configure options -@subsubsection @code{configure} options - -@cindex @code{configure} options - -For a complete list of all @code{configure} options, run @samp{configure ---help} or see @ref{Invoking configure,, Running @code{configure} scripts, -autoconf, Autoconf}, (a copy is in the file @file{kpathsea/README.CONFIGURE}). -The generic options are listed first in the @samp{--help} output, and -the package-specific options come last. The environment variables -@code{configure} pays attention to are listed below. - -Options particularly likely to be useful are @samp{--prefix}, -@samp{--datadir}, and the like; see @ref{configure scenarios}. - -@opindex --with @r{options} -@opindex --enable @r{options} -@cindex configuration of optional features -@cindex options to @code{configure} -This section gives pointers to descriptions of the @samp{--with} and -@samp{--enable} options to @code{configure} that Kpathsea-using programs -accept. - -@table @samp -@item --without-mktexmf-default -@itemx --without-mktexpk-default -@itemx --without-mktextfm-default -@itemx --with-mktextex-default -Enable or disable the dynamic generation programs. @xref{mktex -configuration}. - -@item --enable-shared -@opindex --enable-shared -Build Kpathsea as a shared library, and link against it. Also build the -usual static library. @xref{Shared library}. - -@item --disable-static -@opindex --disable-static -Build only the shared library. Implies @samp{--enable-shared}. - -@item --enable-maintainer-mode -@opindex --enable-maintainer-mode -Enables make targets that are useful for the maintainer and likely to be -a pain for anyone else; the makefiles created when this option is -enabled may not work at all for you. You have been warned. -@end table - -@node configure environment -@subsubsection @code{configure} environment - -@code{configure} uses the value of the following environment variables in -determining your system's characteristics, and substitutes for them in -@t{Makefile}'s: - -@vtable @samp -@item CC -@pindex gcc@r{, compiling with} -@pindex cc@r{, compiling with} -The compiler to use: default is @code{gcc} if it's installed, otherwise -@code{cc}. - -@item CFLAGS -@cindex compiler options, specifying -Options to give the compiler: default is @samp{-g -O2} for @code{gcc}, -@samp{-g} otherwise. @code{CFLAGS} comes after any other options. You -may need to include @code{-w} here if your compilations commonly have -useless warnings (e.g., @code{NULL redefined}), or @code{configure} may -fail to detect the presence of header files (it takes the messages on -standard error to mean the header file doesn't exist). - -@item CPPFLAGS -@cindex configuration compiler options -Options to pass to the compiler preprocessor; this matters most for -configuration, not the actual source compilation. The @code{configure} -script often does only preprocessing (e.g., to check for the existence -of @t{#include} files), and @code{CFLAGS} is not used for this. You may -need to set this to something like -@samp{-I/usr/local/include/wwwhatever} if you have the libwww library -installed for hyper-xdvik (see @file{xdvik/INSTALL}). - -@item DEFS -@cindex preprocessor options -Additional preprocessor options, but not used by @code{configure}. -Provided for enabling or disabling program features, as documented in -the various program-specific installation instructions. @code{DEFS} -comes before any compiler options included by the distribution -@file{Makefile}s or by @code{configure}. - -@item LDFLAGS -@cindex loader options -Additional options to give to the loader. @code{LDFLAGS} comes before -any other linker options. - -@item LIBS -@cindex libraries, specifying additional -Additional libraries to link with. -@end vtable - - -@node configure scenarios -@subsubsection @code{configure} scenarios - -Here are some common installation scenarios: - -@itemize @bullet -@item -Including X support in Metafont. This is disabled by default, since -many sites have no use for it, and it's a leading cause of configuration -problems. -@example -configure --with-x-toolkit -@end example - -@item -@cindex @TeX{} hierarchy, one -Putting the binaries, @TeX{} files, GNU info files, etc.@: into a single -@TeX{} hierarchy, say @file{/texmf}, requires overriding defaults in both -@code{configure} and @code{make}: -@example -configure --prefix=@file{/texmf} --datadir=@file{/texmf} -make texmf=@file{/texmf} -@end example - -@item -@cindex multiple architectures, compiling on -@cindex architectures, compiling multiple -@cindex symbolic link trees, for multiple architectures -@opindex --srcdir@r{, for building multiple architectures} -@pindex lndir @r{for building symlink trees} -You can compile on multiple architectures simultaneously either by -building symbolic link trees with the @code{lndir} script from the X11 -distribution, or with the @samp{--srcdir} option: -@example -configure --srcdir=@var{srcdir} -@end example - -@item -@cindex multiple architectures, directories for -If you are installing binaries for multiple architectures into a single -hierarchy, you will probably want to override the default @file{bin} and -@file{lib} directories, something like this: -@example -configure --prefix=@var{texmf} --datadir=@var{texmf} \ - --bindir=@var{texmf}/@var{arch}/bin --libdir=@var{texmf}/@var{arch}/lib -make texmf=@var{texmf} -@end example -@pindex depot -@cindex automounter, and configuration -@noindent (Unless you make provisions for architecture-specific files in -other ways, e.g., with Depot or an automounter.) - -@item -@opindex -O@r{, compiling with} -@opindex -g@r{, compiling without} -@cindex optimization, enabling -@cindex debugging with @samp{-g}, disabling -To compile with optimization (to compile without debugging, remove the -@samp{-g}): -@example -env CFLAGS="-g -O" sh configure @dots{} -@end example -@noindent For a potential problem if you optimize, see @ref{TeX or -Metafont failing,, @TeX{} or Metafont failing}. -@end itemize - - -@node Shared library -@subsubsection Shared library - -@cindex shared library, making - -@opindex --enable-shared -You can compile Kpathsea as a shared library on a few systems, by -specifying the option @samp{--enable-shared} when you run -@samp{configure}. - -@cindex code sharing -The main advantage in doing this is that the executables can then share -the code, thus decreasing memory and disk space requirements. - -On some systems, you can record the location of shared libraries in a -binary, usually by giving certain options to the linker. Then -individual users do not need to set their system's environment variable -(e.g., @code{LD_LIBRARY_PATH}) to find shared libraries. If you want to -do this, you will need to add the necessary options to @code{LDFLAGS} -yourself; for example, on Solaris, include something like -@samp{-R$@{prefix@}/lib}, on IRIX or Linux, use -@samp{-rpath$@{prefix@}/lib}. (Unfortunately, making this happen by -default is very difficult, because of interactions with an existing -installed shared library.) - -Currently, shared library support is implemented only on Linux, SunOS 4 -(Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're -interested and willing in adding support for other systems, please see -the @samp{configure} mode in the @file{klibtool} script, especially the -host-specific case statement around line 250. - - -@node Running make -@subsection Running @code{make} - -@pindex make@r{, running} - -@flindex texmf.cnf@r{, creating} -@flindex paths.h@r{, creating} -@code{make} (still in the top-level directory). This also creates the -@file{texmf.cnf} and @file{paths.h} files that define the default search -paths, and (by default) the @samp{plain} and @samp{latex} @TeX{} formats. - -@cindex fallback resolutions, overriding -You can override directory names and other values at @code{make}-time. -@file{make/paths.make} lists the variables most commonly reset. For -example, @samp{make default_texsizes=600} changes the list of fallback -resolutions. - -You can also override each of @code{configure}'s environment variables -(@pxref{configure environment}). The Make variables have the same names. - -Finally, you can supply additional options via the following variables. -(@code{configure} does not use these.) - -@vtable @samp -@item XCPPFLAGS -@itemx XDEFS -@cindex preprocessor options, additional -Preprocessor options. - -@item XCFLAGS -@cindex compiler options, additional -Compiler options. - -@item XLDFLAGS -@cindex loader options, initial -Loader options (included at beginning of link commands). - -@item XLOADLIBES -@cindex loader options, final -More loader options (included at end of link commands). - -@item XMAKEARGS -@cindex Make arguments, additional -Additional Make arguments passed to all sub-@code{make}'s. You may need -to include assignments to the other variables here via @code{XMAKEARGS}; -for example: @samp{make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"}. -@end vtable - -@cindex compiler, changing -@cindex libraries, changing -It's generally a bad idea to use a different compiler (@samp{CC}) or -libraries (@code{LIBS}) for compilation than you did for configuration, -since the values @code{configure} determined may then be incorrect. - -@cindex universe, BSD vs.@: system V -@cindex BSD universe -@cindex system V universe -@cindex Solaris BSD compatibility, not -@flindex libucb@r{, avoiding} -@flindex ucbinclude@r{, avoiding} -Adding compiler options to change the ``universe'' you are using -(typically BSD vs.@: system V) is generally a cause of trouble. It's -best to use the native environment, whatever that is; @code{configure} -and the software usually adapt best to that. In particular, under -Solaris 2.x, you should not use the BSD-compatibility library -(@file{libucb}) or include files (@file{ucbinclude}). - -@cindex Babel -If you want to use the Babel La@TeX{} package for support of non-English -typesetting, you need to modify some files before making the La@TeX{} -format. See the file @file{install.txt} in the Babel distribution. - - -@node Installing files -@subsection Installing files - -@cindex installing files - -The basic command is the usual @code{make install}. For security -issues, @pxref{Security}. - -The first time you install any manual in the GNU Info system, you should -add a line (you choose where) to the file @file{dir} in your -@samp{$(infodir)} directory. Sample text for this is given near the top -of the Texinfo source files (@file{kpathsea/kpathsea.texi}, -@file{dvipsk/dvips.texi}, and @file{web2c/doc/web2c.texi}). -If you have a recent version of the GNU Texinfo distribution installed -(@url{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-3.9.tar.gz} or later), this -should happen automatically. - -On the offchance that this is your first Info installation, the -@file{dir} file I use is included in the distribution as -@file{etc/dir-example}. - -@cindex multiple architectures, installing on -@cindex architecture-(in)dependent files, installing only -@cindex installation, architecture-(in)dependent files only -You may wish to use one of the following targets, especially if you are -installing on multiple architectures: -@itemize @bullet -@item -@findex install-exec @r{Make target} -@code{make install-exec} to install in architecture-dependent -directories, i.e., ones that depend on the @code{$(exec_prefix)} Make -variable. This includes links to binaries, libraries, etc., not just -``executables''. - -@item -@findex install-data @r{Make target} -@code{make install-data} to install in architecture-independent -directories, such as documentation, configuration files, pool files, etc. -@end itemize - -@cindex AFS -@cindex Andrew File System, installing with -@flindex /afs/@dots{} @r{, installing into} -If you use the Andrew File System, the normal path (e.g., -@var{prefix}/bin) only gets you to a read-only copy of the files, and -you must specify a different path for installation. The best way to do this -is by setting the @samp{prefix} variable on the @code{make} command -line. The sequence becomes something like this: -@example -configure --prefix=/whatever -make -make install prefix=/afs/.@var{system.name}/system/1.3/@@sys/whatever -@end example -@flindex ls-R @r{and AFS} -@cindex relative filenames in @file{ls-R} -@noindent With AFS, you will definitely want to use relative filenames in -@file{ls-R} (@pxref{Filename database}), not absolute filenames. This -is done by default, but check anyway. - - -@node Cleaning up -@subsection Cleaning up - -@findex distclean @r{Make target} -The basic command is @code{make distclean}. This removes all files -created by the build. - -Alternatively, -@itemize @bullet -@item -@findex mostlyclean @r{Make target} -@code{make mostlyclean} if you intend to compile on another -architecture. For Web2C, since the generated C files are portable, -they are not removed. If the @code{lex} vs.@: @code{flex} situation -is going to be different on the next machine, @code{rm -web2c/lex.yy.c}. - -@item -@findex clean @r{Make target} -@code{make clean} to remove files created by compiling, but leave -configuration files and Makefiles. - -@item -@findex maintainer-clean @r{Make target} -@code{make maintainer-clean} to remove everything that the Makefiles can -rebuild. This is more than @samp{distclean} removes, and you should -only use it if you are thoroughly conversant with (and have the necessary -versions of) Autoconf. - -@item -@findex extraclean @r{Make target} -@code{make extraclean} to remove other junk, e.g., core files, log -files, patch rejects. This is independent of the other @samp{clean} -targets. -@end itemize - - -@node Filename database generation -@subsection Filename database generation - -@cindex filename database generation -@cindex generation of filename database - -You will probably want to set up a @code{cron} entry on the appropriate -machine(s) to rebuild the filename database nightly or so, as in: -@example -0 0 * * * cd @var{texmf} && @var{/bindir}/mktexlsr -@end example -@noindent @xref{Filename database}. - -Although the @code{mktex@dots{}} scripts make every effort to add -newly-created files on the fly, it can't hurt to make sure you get a -fresh version every so often. - - -@node mktex scripts -@subsection @file{mktex} scripts - -@cindex @file{mktex} scripts -@cindex scripts for file creation - -@cindex font set, infinite -@cindex dynamic creation of files -@cindex Sauter fonts, and dynamic source creation -@cindex EC fonts, and dynamic source creation -If Kpathsea cannot otherwise find a file, for some file types it is -configured by default to invoke an external program to create it -dynamically (@pxref{mktex configuration}). This is most useful for -fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as -the Sauter and EC fonts), since any given document can use fonts never -before referenced. Trying to build all fonts in advance is therefore -impractical, if not impossible. - -The script is passed the name of the file to create and possibly other -arguments, as explained below. It must echo the full pathname of the -file it created (and nothing else) to standard output; it can write -diagnostics to standard error. - -@menu -* mktex configuration:: -* mktex script names:: -* mktex script arguments:: -@end menu - - -@node mktex configuration -@subsubsection @file{mktex} configuration - -@cindex @file{mktex} script configuration -@cindex configuration of @file{mktex} scripts -@cindex enabling @file{mktex} scripts -@cindex disabling @file{mktex} scripts - -The following file types can run an external program to create missing -files: @file{pk}, @file{tfm}, @file{mf}, @file{tex}; the scripts are -named @file{mktexpk}, @file{mktextfm}, @file{mktexmf}, and -@file{mktextex}. - -In the absence of @code{configure} options specifying otherwise, -everything but @file{mktextex} will be enabled by default. The -@code{configure} options to change the defaults are: - -@cindex @code{configure} options for @file{mktex} scripts -@opindex --without-mktexmf-default -@opindex --without-mktexpk-default -@opindex --without-mktextfm-default -@opindex --with-mktextex-default -@example ---without-mktexmf-default ---without-mktexpk-default ---without-mktextfm-default ---with-mktextex-default -@end example - -The @code{configure} setting is overridden if the environment variable -or configuration file value named for the script is set; e.g., -@file{MKTEXPK} (@pxref{mktex script arguments}). - -@flindex mktex.cnf -@cindex site overrides for @code{mktex@dots{}} -As distributed, all the scripts source a file -@file{texmf/web2c/mktex.cnf} if it exists, so you can override -various defaults. See @file{mktex.opt}, for instance, which defines -the default mode, resolution, some special directory names, etc. If you -prefer not to change the distributed scripts, you can simply create -@file{mktex.cnf} with the appropriate definitions (you do not need to -create it if you have nothing to put in it). @file{mktex.cnf} has no -special syntax; it's an arbitrary Bourne shell script. The distribution -contains a sample @file{mktex.cnf} for you to copy and modify as you -please (it is not installed anywhere). - -@flindex mktex.opt -@vindex MT_FEATURES -In addition, you can configure a number of features with the -@code{MT_FEATURES} variable, which you can define: -@itemize @bullet -@item -in @file{mktex.opt}, as just mentioned; - -@item -by editing the file @file{mktex.opt}, either before @samp{make -install} (in the source hierarchy) or after (in the installed -hierarchy); - -@item -or in the environment. -@end itemize - -If none of the options below are enabled, @code{mktexpk}, -@code{mktextfm}, and @code{mktexmf} follow the following procedure to -decide where fonts should be installed. Find the tree where the font's -sources are, and test the permissions of the @samp{fonts} directory of -that tree to determine whether it is writable. If it is, put the files -in the tree in appropriate locations. If it isn't writable, see whether -the tree is a system tree (named in @code{SYSTEXMF}). If so, the -@code{VARTEXFONTS} tree is used. In all other cases the working -directory is used. - -The @samp{appendonlydir} option is enabled by default. - -@vtable @samp -@item appendonlydir -@cindex directories, making append-only -@flindex mktexdir -Tell @code{mktexdir} to create directories append-only, i.e., set -their sticky bit (@pxref{Mode Structure,,, fileutils, GNU File -Utilities}). This feature is silently ignored on non-Unix platforms -(e.g. Windows/NT and MS-DOS) which don't support similar functionality. -This feature is enabled by default. - -@item dosnames -@cindex 8.3 filenames, using -@cindex DOS compatible names -@flindex dpi@var{nnn} directories -Use 8.3 names; e.g., @file{dpi600/cmr10.pk} instead of -@file{cmr10.600pk}. Note that this feature only affects filenames that -would otherwise clash with other TeX-related filenames; @file{mktex} -scripts do nothing about filenames which exceed the 8+3 MS-DOS limits -but remain unique when truncated (by the OS) to these limits, and nether -do the scripts care about possible clashes with files which aren't -related with TeX. For example, @file{cmr10.600pk} would clash with -@file{cmr10.600gf} and is therefore changed when @samp{dosnames} is in -effect, but @file{mf.pool} and @file{mp.base} don't clash with any -TeX-related files and are therefore unchanged. - -This feature is turned on by default on MS-DOS. If you do not wish -@samp{dosnames} to be set on an MS-DOS platform, you need to set the -@code{MT_FEATURES} environment variable to a value that doesn't include -@samp{dosnames}. You can also change the default setting by editing -@file{mktex.opt}, but only if you use the @file{mktex} shell scripts; -the emulation programs don't consult @file{mktex.opt}. - -@item fontmaps -@cindex fontmaps -@cindex fontname -Instead of deriving the location of a font in the destination tree from -the location of the sources, the aliases and directory names from the -Fontname distribution are used. (@pxref{Top,, Introduction, fontname, -Fontname}). - -@item nomode -@cindex mode directory, omitting -Omit the directory level for the mode name; this is fine as long as -you generate fonts for only one mode. - -@item stripsupplier -@cindex supplier directory, omitting -Omit the font supplier name directory level. - -@item striptypeface -@cindex typeface directory, omitting -Omit the font typeface name directory level. - -@item strip -@cindex supplier directory, omitting -@cindex typeface directory, omitting -Omit the font supplier and typeface name directory levels. This feature -is deprecated in favour of @samp{stripsupplier} and @samp{striptypeface}. - -@item varfonts -@flindex /var/tmp/texfonts -@vindex VARTEXFONTS -@cindex Linux File System Standard -When this option is enabled, fonts that would otherwise be written in -system texmf tree go to the @code{VARTEXFONTS} tree instead. The -default value in @file{kpathsea/Makefile.in} is -@file{/var/tmp/texfonts}. The @cite{Linux File System Standard} -recommends @file{/var/tex/fonts}. - -@vindex USE_VARTEXFONTS -The @samp{varfonts} setting in @code{MT_FEATURES} is overridden by the -@code{USE_VARTEXFONTS} environment variable: if set to @samp{1}, the -feature is enabled, and if set to @samp{0}, the feature is disabled. -@end vtable - - -@node mktex script names -@subsubsection @file{mktex} script names - -@cindex @file{mktex} script names -@cindex names for @file{mktex} scripts - -@flindex tex-make.c -@vindex kpse_make_specs -The following table shows the default name of the script for each -possible file types. (The source is the variable @code{kpse_make_specs} -in @file{kpathsea/tex-make.c}.) - -@table @file -@item mktexpk -@pindex mktexpk -Glyph fonts. - -@item mktextex -@pindex mktextex -@TeX{} input files. - -@item mktexmf -@pindex mktexmf -Metafont input files. - -@item mktextfm -@pindex mktextfm -TFM files. -@end table - -@vindex DVIPSMAKEPK -@vindex XDVIMAKEPK -@vindex DVILJMAKEPK -@noindent These names are overridden by an environment variable specific -to the program---for example, @code{DVIPSMAKEPK} for Dvipsk. - -@comment next two paragraphs are repeated in dvips.texi -@flindex missfont.log -@cindex failed @code{mktex@dots{}} script invocation -If a @code{mktex@dots{}} script fails, the invocation is appended to a -file @file{missfont.log} (by default) in the current directory. You can -then execute the log file to create the missing files after fixing the -problem. - -@vindex TEXMFOUTPUT -@vindex MISSFONT_LOG -If the current directory is not writable and the environment variable or -configuration file value @code{TEXMFOUTPUT} is set, its value is -used. Otherwise, nothing is written. The name @samp{missfont.log} is -overridden by the @code{MISSFONT_LOG} environment variable or -configuration file value. - - -@node mktex script arguments -@subsubsection @file{mktex} script arguments - -@cindex arguments to @file{mktex} - -The first argument to a @file{mktex} script is always the name -of the file to be created. - -In the default @file{mktexpk} implementation, additional arguments may -also be passed: - -@table @samp -@item --dpi @var{num} -Sets the resolution of the generated font to @var{num}. -@item --mfmode @var{name} -Sets the Metafont mode to @var{name}. -@item --bdpi @var{num} -Sets the the ``base dpi'' for the font. This must match the mode being -used. -@item --mag @var{string} -A ``magstep'' string suitable for the Metafont @code{mag} variable. -This must match the combination of @var{bdpi} and @var{dpi} being used. -@item --destdir @var{string} -A directory name. If the directory is absolute, it is used as-is. -Otherwise, it is appended to the root destination directory set in the -script. -@end table - -@c The feature mentioned here doesn't seem to be implemented. -@c Worse, the variable name clashed with the "switch" used to select -@c whether a mktex program is run at all. However, a dearth of -@c complains suggests that no-one was using it anyway. -@c -@c @vindex MKTEXPK @r{environment variable} -@c @cindex specification for @code{mktexpk} -@c You can change the specification for the arguments passed to the -@c external script by setting the environment variable named as the script -@c name, but all capitals---@code{MKTEXPK}, for example. If you've -@c changed the script name by setting (say) @code{DVIPSMAKEPK} to -@c @samp{foo}, then the spec is taken from the environment variable -@c @code{FOO}. -@c -@c The spec can contain any variable references, to the above variables or -@c any others. As an example, the default spec for @code{mktexpk} is: -@c @example -@c $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE -@c @end example -@c -@c @noindent The convention of passing the name of the file to be created -@c as the first argument cannot be changed. - - -@node Installation testing -@subsection Installation testing - -@cindex testing, post-installation -@cindex installation testing - -Besides the tests listed in @ref{Simple installation}, you can try -running @samp{make check}. This includes the torture tests (trip, trap, -and mptrap) that come with Web2c (@pxref{Triptrap,,, web2c, Web2c}). - - -@node Security -@section Security - -@cindex security considerations - -None of the programs in the @TeX{} system require any special system -privileges, so there's no first-level security concern of people gaining -illegitimate root access. - -@cindex trojan horse attack -@flindex .rhosts@r{, writable by @TeX{}} -A @TeX{} document, however, can write to arbitrary files, e.g., -@file{~/.rhosts}, and thus an unwitting user who runs @TeX{} on a random -document is vulnerable to a trojan horse attack. This loophole is -closed by default, but you can be permissive if you so desire in -@file{texmf.cnf}. @xref{tex invocation,,, web2c, Web2c}. MetaPost has -the same issue. - -Dvips, Xdvi, and @TeX{} can also execute shell commands under some -circumstances. To disable this, see the @samp{-R} option in @ref{Option -details,,, dvips, Dvips}, the xdvi man page, and @ref{tex -invocation,,, web2c, Web2c}, respectively. - -@cindex local cache of fonts -@cindex cache of fonts, local -Another security issue arises because it's very useful---almost -necessary---to make arbitrary fonts on user demand with @code{mktexpk} -and friends. Where do these files get installed? By default, the -@code{mktexpk} distributed with Kpathsea assumes a world-writable -@file{/var/tmp} directory; this is a simple and convenient approach, but -it may not suit your situation because it means that a local cache of -fonts is created on every machine. - -@cindex globally writable directories -To avoid this duplication, many people consider a shared, globally -writable font tree desirable, in spite of the potential security -problems. To do this you should change the value of @code{VARTEXFONTS} -in @file{texmf.cnf} to refer to some globally known directory. -@xref{mktex configuration}. - -@cindex append-only directories and @code{mktexpk} -The first restriction you can apply is to make newly-created directories -under @file{texmf} be append-only with an option in @file{mktex.cnf}. -@xref{mktex configuration}. - -@cindex group-writable directories -@cindex setgid scripts -Another approach is to establish a group (or user) for @TeX{} files, -make the @file{texmf} tree writable only to that group (or user), and -make @code{mktexpk} et al.@: setgid to that group (or setuid to that -user). Then users must invoke the scripts to install things. (If -you're worried about the inevitable security holes in scripts, then you -could write a C wrapper to exec the script.) - -@cindex file permissions -@cindex permissions, file -The @file{mktex@dots{}} scripts install files with the same read and -write permissions as the directory they are installed in. The -executable, sgid, suid, and sticky bits are always cleared. - -@cindex directory permissions -@cindex permissions, directory -Any directories created by the @file{mktex@dots{}} scripts have the -same permissions as their parent directory, unless the -@code{appendonlydir} feature is used, in which case the sticky bit is -always set.
deleted file mode 100644 --- a/kpathsea/kdefault.c +++ /dev/null @@ -1,122 +0,0 @@ -/* kdefault.c: Expand extra colons. - (This is not named default.c because then the OSF/1 make tries to - make a program `default' from it, since we have a target `default'; - and OSF/1 make doesn't understand .PHONY.) - -Copyright (C) 1993, 94, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> -#include <kpathsea/default.h> - - -/* Check for leading colon first, then trailing, then doubled, since - that is fastest. Usually it will be leading or trailing. */ - -string -kpse_expand_default P2C(const_string, path, const_string, fallback) -{ - unsigned path_length; - string expansion; - - /* The default path better not be null. */ - assert (fallback); - - if (path == NULL) - expansion = xstrdup (fallback); - - /* Solitary or leading :? */ - else if (IS_ENV_SEP (*path)) - { - expansion = path[1] == 0 ? xstrdup (fallback) : concat (fallback, path); - } - - /* Sorry about the assignment in the middle of the expression, but - conventions were made to be flouted and all that. I don't see the - point of calling strlen twice or complicating the logic just to - avoid the assignment (especially now that I've pointed it out at - such great length). */ - else if (path[(path_length = strlen (path)) - 1] == ENV_SEP) - expansion = concat (path, fallback); - - /* OK, not leading or trailing. Check for doubled. */ - else - { - const_string loc; - - /* What we'll return if we find none. */ - expansion = xstrdup (path); - - for (loc = path; *loc; loc++) - { - if (IS_ENV_SEP (loc[0]) && IS_ENV_SEP (loc[1])) - { /* We have a doubled colon. */ - expansion = xmalloc (path_length + strlen (fallback) + 1); - - /* Copy stuff up to and including the first colon. */ - strncpy (expansion, path, loc - path + 1); - expansion[loc - path + 1] = 0; - - /* Copy in FALLBACK, and then the rest of PATH. */ - strcat (expansion, fallback); - strcat (expansion, loc + 1); - - break; - } - } - } - - return expansion; -} - -#ifdef TEST - -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); -} - -int -main () -{ - string default_path = "default"; - - test_expand_default (NULL, default_path); - test_expand_default ("", default_path); - test_expand_default ("none", default_path); - test_expand_default (ENV_SEP_STRING, default_path); - 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); - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -standalone-compile-command: "gcc -g -I. -I.. -DTEST default.c kpathsea.a" -End: -*/
deleted file mode 100755 --- a/kpathsea/klibtool +++ /dev/null @@ -1,684 +0,0 @@ -#!/bin/sh -# This purports to allow distributions to be built with shared libraries. -# -# I wrote it for Kpathsea and friends, but I don't think there's -# anything TeX-specific in here. -# -# There is a much fancier libtool project underway by -# <gord@enci.ucalgary.ca>, but I did not want to wait for that to be -# completed, stable, and portable before releasing Web2c. The ideas are -# based on Gord's Libtool, though, and you may find its documentation -# interesting/useful reading. -# -# Porting this to other systems shouldn't be too hard, mostly because I -# don't try to take advantage of all the fancy features offered by some -# os's (like multiple version compatibility, encoding directory paths in -# the binary, etc.) See the configure mode. I can send you the -# hello,world Makefile I used for testing if you want it. -# -rcs_version='$Id: klibtool,v 1.2 1998-04-24 04:24:36 jwe Exp $' -version=0.1 -maint=tex-k@mail.tug.org -help="Usage: $0 [OPTION]... MODE [ARG]... -Help for building and linking with shared libraries. - -Modes: Environment variables used: -configure [HOSTTYPE] RANLIB, LIBTOOL_OBJTYPES -compile CC SOURCEFILE ARG... -archive AR ARFLAGS LIBNAME ARG... -link CC ARG... -install-lib DIR LIBNAME... INSTALL_DATA -install-prog DIR PROGNAME... INSTALL_PROGRAM -version - -Options: - --source-dir DIR - --config-dir DIR --n, --dry-run - --help - --quiet, --silent --v, --verbose - --version - -Email bugs to $maint. -" - -bug_report="$0: Please report this bug to $maint. -Please mention this is Klibtool version $version ($rcs_version), -and your hardware/operating system (`uname -a`, at least). - -Running this same command ($0 $*) with --verbose and including the -resulting output would be nice, but is not required." - -verbose=: -chicken= -show=echo -config_dir= -source_dir= - -# Yes, this option parsing is imperfect, e.g., -xcruddy will be -# recognized as --config-dir. I don't think it's worth the trouble to -# program correctly until somebody besides me uses this. -while test $# -gt 0; do - case "$1" in - configure|compile|archive|link|install-lib|install-prog|version) - mode=$1; break;; - --source-dir) # --source-dir - shift; source_dir=$1;; - -*c*) # --config-dir - shift; config_dir=$1;; - -n|-*d*) # -n, --dry-run - chicken=echo;; - -*help) # --help - echo "$help"; exit 0;; - -*q|-*s) # --quiet, --silent - show=:; verbose=:;; - -v|-*verb*) # --verbose - verbose=echo;; - -*version) # --version - echo "$0 version $version ($rcs_version)"; exit 0;; - -*) - echo "$0: Unknown option \`$1'. Try --help for info." >&2; exit 1;; - *) - echo "$0: Unknown mode \`$1'. Try --help for info." >&2; exit 1;; - esac - shift -done - -# Read all the arguments. Peel off the mode. -shift - -# -# Read the configuration file unless we're configuring. -# -if test $mode != configure; then - # Read configuration file. If we have it in the current directory, or - # the user told us where it is, great. More likely, though, it's only - # in the directory with the library that we're eventually going to - # link with. We have no way of knowing what that is, so let's use the - # location of this script itself as the default if not in `.', `..', - # or `../..'. - test -z "$config_dir" && config_dir=$KLIBTOOL_CONFIG_DIR - if test -z "$config_dir"; then - if test -r ./klibtool.config; then - config_dir=. - elif test -r ../klibtool.config; then - config_dir=.. - elif test -r ../../klibtool.config; then - config_dir=../.. - else - dir=`echo $0 | sed 's,/[^/]*$,,'` - test -r $dir/klibtool.config && config_dir=$dir - fi - fi - if test -z "$config_dir"; then - echo "$0: Cannot find klibtool.config in . or .. or $dir," >&2 - echo "$0: and no --config-dir option specified" >&2 - echo "$0: or KLIBTOOL_CONFIG_DIR environment variable set." >&2 - exit 1 - fi - # Read the file. - . $config_dir/klibtool.config - - if test -z "$LIBTOOL_OBJTYPES"; then - echo "$0: Impossibly empty LIBTOOL_OBJTYPES!" >&2 - echo "$bug_report" >&2 - exit 1 - fi - # Copy the valid object type names from LIBTOOL_OBJTYPES into objtypes. - $verbose "$0: checking LIBTOOL_OBJTYPES = $LIBTOOL_OBJTYPES." - objtypes= - for ot in `echo $LIBTOOL_OBJTYPES | tr : " "`; do - case $ot in - SHARED) - if $shared_support; then - objtypes=$objtypes:$ot - else - echo "$0: Shared libraries not supported on this system." >&2 - fi - ;; - STATIC) - objtypes=$objtypes:$ot;; - "") true;; # don't worry about empty object types. - *) - echo "$0: Ignoring unknown libtool object type $objtype." >&2;; - esac - done - # Remove the extra trailing colon from our list-building. - objtypes=`echo $objtypes | sed 's/^://'` - if test -z $objtypes; then - # If they just took the default, we started with STATIC and so - # wouldn't be here. - echo "$0: No valid object types in $LIBTOOL_OBJTYPES, quitting." >&2 - exit 1 - fi - $verbose "$0: final objtypes = $objtypes." -fi - - -# -# Do the deed. -# -# I wish we had subroutines so we could make this readable, but shell -# functions aren't portable enough, even nowadays. -# -$verbose "$0: mode = $mode." -case $mode in - - - # configure mode: [HOSTTYPE] - configure) - # If no config dir specified, use the script location. - if test -z "$config_dir"; then - if echo $0 | grep / >/dev/null; then - config_dir=`echo $0 | sed 's,/[^/]*$,,'` - else - config_dir=. # $0 is just the script name, no directory part. - fi - fi - if test -z "$source_dir"; then - source_dir=$config_dir - fi - config_file=$config_dir/klibtool.config - config_tmp=$config_dir/klt$$.tmp - $verbose "$0: writing to config_file = $config_file." - - # If no specified HOSTTYPE, guess it. - if test $# -eq 0; then - config_guess=$source_dir/config.guess - if test ! -r $config_guess; then - echo "$0: config.guess not in $source_dir." >&2 - echo "$0: Either specify a host type or get the scripts." >&2 - exit 1 - fi - host_alias=`$config_guess` - else - test $# -eq 1 \ - || echo "$0: Using $1 as host alias, ignoring other arguments ($*)." >&2 - host_alias=$1 - fi - - # Convert the original host type to canonical form. - config_sub=$source_dir/config.sub - if test ! -r $config_sub; then - echo "$0: config.sub missing from $source_dir; it's required." >&2 - exit 1 - fi - host_type=`$config_sub $host_alias` - if test -z "$host_type"; then - echo "$0: $host_alias not a recognizable host type." >&2 - exit 1 - fi - - # Define defaults, to be overridden in the system-specific cases. - config_vars="LIBTOOL_OBJTYPES shared_support shared_ext libpath_var CC - args_STATIC_compile args_SHARED_compile - args_STATIC_archive STATIC_ranlib args_SHARED_archive - args_SHARED_link - SHARED_postinstall" - for v in $config_vars; do - # Preserve existing value of a couple variables. - case $v in - LIBTOOL_OBJTYPES|CC) true;; - *) eval $v=;; - esac - done - test -z "$LIBTOOL_OBJTYPES" && LIBTOOL_OBJTYPES=STATIC - shared_ext=so - libpath_var=LD_LIBRARY_PATH - STATIC_ranlib=$RANLIB - - # The compiler. If the user set CC, take that, else use gcc if we - # can find it, else use cc. Up to the user to avoid /usr/ucb/cc. - if test -z "$CC"; then - for dir in `echo $PATH | tr : ' '`; do - test -z "$dir" && dir=. - if test -f $dir/gcc; then - CC=gcc - break - elif test -f $dir/gcc.exe; then - CC=gcc - break - fi - done - fi - test -z "$CC" && CC=cc - # - # But the real question is not the name of the command, it's whether - # it is GNU C. We only distinguish gcc and system cc. We have to - # assume that they use the same compiler at `klibtool compile' time - # as we determine here; the whole point is that we don't want to do - # this check before compiling every file (for speed). - rm -f conftest.c - ( - echo "#ifdef __GNUC__" - echo "yes;" - echo "#endif" - ) >conftest.c - if eval "$CC -E conftest.c" | grep yes >/dev/null 2>&1; then - compiler=gcc - args_SHARED_compile=-fPIC # should we have an option for -fpic? - args_SHARED_archive=-shared - else - compiler=cc - fi - rm -f conftest.c - - # Override defaults for this system. - case $host_type in - *-*-linux*) - shared_support=true - SHARED_postinstall='ldconfig $libdir' - ;; - - *-*-solaris2*) - shared_support=true - if test $compiler = cc; then # /opt/SUNWspro/cc, that is. - args_SHARED_compile=-KPIC - args_SHARED_archive="-G -z text" # Perhaps should have -h. - fi - ;; - - *-*-sunos4*) - shared_support=true - STATIC_ranlib=ranlib - SHARED_postinstall='ldconfig $libdir' - if test $compiler = cc; then - args_SHARED_compile=-PIC - prog_SHARED_archive=ld - args_SHARED_archive="-assert pure-text" # gord has -Bstatic? - fi - ;; - - *-*-irix5*|*-*-irix6*) - shared_support=true - args_SHARED_compile= - ;; - - *-*-*djgpp* | *-*-*go32* | *-*-msdos*) - shared_support=false - libpath_var=LIBRARY_PATH - ;; - - *) - echo "$0: $host_type not explicitly supported, using defaults." >&2 - ;; - esac - - # Finally, we'll be creating something. - rm -f $config_tmp - - # Output values. - for v in $config_vars; do - config_line=$v=\'`eval echo '$'$v`\' - $verbose "$0: writing config line $config_line." - echo $config_line >>$config_tmp - done - - # Check if this changed anything. - if cmp -s $config_file $config_tmp 2>/dev/null; then - $verbose "$0: $config_file is unchanged" - rm -f $config_tmp - else - rm -f $config_file - mv $config_tmp $config_file - fi - ;; - - - # compile mode: CC SOURCEFILE [ARG]... - compile) - compiler=$1; shift # must assume it's what configure found - sourcefile=$1 - objname=`basename $sourcefile | sed 's/\.[^./]*$//'`.o - $verbose "$0: object basename for source file $sourcefile = $objname." - # - for ot in `echo $objtypes | tr : " "`; do - # Snarf arguments for this object type. - ot_args=`eval echo '$'args_${ot}_${mode}` - $verbose "$0: args_${ot}_${mode} = $ot_args." - - # Have to output into a subdirectory of current directory (not - # source directory, which might be read-only). - output_arg="-o $ot/$objname" - if test ! -d $ot; then - $show mkdir $ot - $chicken mkdir $ot - fi - - # Construct and run the cmd. - cmd="$compiler ""$@"" $ot_args $output_arg" - $show $cmd - $chicken eval "$cmd" - status=$? - test $status -eq 0 || break - done # end of objtypes loop for compile mode - test $status -eq 0 && date >./"`echo $objname | sed 's/o$/lo/'`" - exit $status - ;; - - - # archive mode - archive) - cmdname=$1; shift # the archiver - for ot in `echo $objtypes | tr : " "`; do - libname= - args= - if test $ot = SHARED; then - # Can't generally use ar to make a shared library. - old_ar="$cmdname $1" - shift - ot_args=`eval echo '$'args_SHARED_archive` - ot_prog=`eval echo '$'prog_SHARED_archive` - test -z "$ot_prog" && ot_prog=$CC - cmdname="$ot_prog $ot_args -o" - $verbose "$0: replaced $old_ar with $cmdname." - fi - - # Now transform remaining arguments (presumably filenames). - for arg in "$@"; do - case "$arg" in - *.l[ao]) # Remove the `l' from a .la or .lo filename. - newarg=`echo $arg | sed 's/l\(.\)$/\1/'` - $verbose "$0: transformed arg $arg to $newarg." - # First .la file is the output library. - if test -z "$libname" && echo $newarg | grep '\.a$'>/dev/null; then - if test $ot = SHARED; then - $verbose "$0: running $0 version $newarg." - verstring=`$0 version $newarg` - $verbose "$0: got version $verstring." - libname=`echo $newarg | sed 's/\.a$/\.'$shared_ext$verstring/` - else - libname=$newarg - fi - if echo $libname | grep / >/dev/null; then - lib_dir=`echo $libname | sed 's,/[^/]*$,,'` - else - lib_dir=. - fi - lib_basename=`basename $libname` - lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'` - - # We might have to run a command after making the library. - post= - if test $ot = SHARED; then - # If it supports shared libraries, it supports symlinks. - # Although this is unnecessary on (e.g.) SunOS, it - # doesn't hurt, and it is necessary on (e.g.) Solaris. - post="&& rm -f $lib_base && ln -s $lib_basename $lib_base" - elif test $ot = STATIC; then - ranlib=`eval echo '$'${ot}_ranlib` - $verbose "${ot}_ranlib = $ranlib." - test -n "$ranlib" && post="&& $ranlib $lib_basename" - fi - - $verbose "$0: output library dir = $lib_dir." - $verbose "$0: output library basename = $lib_basename." - $verbose "$0: output library base = $lib_base." - newarg=$lib_basename - fi - arg=$newarg - ;; - esac - args="$args $arg" - done - if test -z "$libname"; then - # FIXME: should check that the .la file was second arg. - echo "$0 archive: .la (libtool archive) argument missing." >&2 - exit 1 - fi - - # Remove old archive file because we recommend `ar q', not `r', - # and the user can't necessarily know the library name. We remove - # both $lib_base and $lib_base* because on MS-DOS the latter may not - # match the former. - cmd="cd $lib_dir/$ot && rm -f $lib_base $lib_base* && $cmdname $args $post" - $show $cmd - $chicken eval "($cmd)" - status=$? - test $status -eq 0 || break - - # If making both objtypes, need original arguments next time through. - if test $ot = SHARED; then - cmdname=$old_ar - else - true # Don't think we failed to make the library just because - # the last objtype was not SHARED. - fi - done # end of objtypes loop for archive mode - # - # Create the .la file we claimed that we would. - test $status -eq 0 && date >./"`echo $libname | sed 's/\.[^/]*$/.la/'`" - exit $status - ;; - - - # link mode - link) - cmdname=$1; shift # the linker - # Do links using the first object type. - linktype=`echo $objtypes | sed 's/:.*//'` - $verbose "$0: linktype = $linktype." - if test -z "$linktype"; then - echo "$0: Impossibly empty linktype?!" >&2 - exit 1 - fi - # - # Need to know the output name if we generate the wrapper. - looking_for_output=false - real_output_name= - libpath= - # - for arg in "$@"; do - if $looking_for_output; then - real_output_name=$arg - arg=$real_output_name.exe - looking_for_output=false - fi - case "$arg" in - -o) - test $linktype = SHARED && looking_for_output=true - ;; - *.l[ao]) # Find .la files in the linktype subdir - # of the given directory, e.g., if the user says - # ../foo/libfoo.la, transform into - # ../foo/$linktype/libfoo.{a,so...}. We do the same for - # libtool archive, although it's not as often necessary. - newarg=`echo $arg | sed -e 's,\([^/]*\)$,'$linktype'/\1,' \ - -e 's/l\(.\)$/\1/'` - if test $linktype = SHARED \ - && echo $newarg | grep '\.a$' >/dev/null; then - # If shared, transform dir/foo.la into -Ldir -lfoo. - dir=`echo $newarg | sed 's,/[^/]*$,,'` - lib=`echo $newarg | sed -e 's,.*/\([^/]*\),\1,' \ - -e 's/^lib//' -e 's/\.a$//'` - newarg="-L$dir -l$lib" - # Remember we will need this directory in LD_LIBRARY_PATH. - if echo $dir | grep -v '^/' >/dev/null; then - dir=`pwd`/$dir - fi - # Maybe had previous directories. - test -n "$libpath" && libpath=$libpath: - libpath=$libpath$dir - fi - $verbose "$0: transformed .la arg $arg to $newarg." - arg=$newarg - ;; - *.lo) # .lo files have no directory stripping or suffix changing. - newarg=`echo $arg | sed -e 's,\([^/]*\)$,'$linktype'/\1,' \ - -e 's/l\(.\)$/\1/'` - $verbose "$0: transformed .lo arg $arg to $newarg." - arg=$newarg - ;; - esac - args="$args $arg" - done - - # Set up to generate wrapper shell script if shared. - if test $linktype = SHARED; then - if $looking_for_output; then - echo "$0 link: -o requires an argument." >&2 - exit 1 - fi - if test -z "$real_output_name"; then - # If they didn't give -o at all, default to a.out. - real_output_name=a.out - args="$args -o $real_output_name.exe" - fi - fi - - # Do the link. - cmd="$cmdname $args" - $show $cmd - $chicken eval "$cmd" - - status=$? - if test $status -eq 0 && test -n "$real_output_name"; then - $verbose "$0: creating wrapper $real_output_name." - # We created the binary, so create the wrapper script. - # Use as short a temporary suffix as we can to minimize the chance - # of collisions on deficient systems. - rm -f ${real_output_name} ${real_output_name}T - ( - libpath_var_val='$'$libpath_var - echo "#! /bin/sh" - echo "# Generated `date` by $0." - echo "# Do not install this wrapper script." - echo "# It's only here to enable running $real_output_name" - echo "# before it's installed. (Use $0 install-progs to install it.)" - echo - echo "if test -z \"$libpath_var_val\"; then" - echo " $libpath_var=\"$libpath\"" - echo "else" - echo " $libpath_var=\"$libpath:$libpath_var_val\"" - echo "fi" - echo "export $libpath_var" - echo - echo "thisdir=\`echo $""0 | sed 's%/[^/]*$%%'\`" - echo 'test "x$thisdir" = "x$0" && thisdir=.' - echo - echo "exec \$thisdir/$real_output_name.exe \"\$@\"" - ) >${real_output_name}T - chmod +x ${real_output_name}T - mv ${real_output_name}T ${real_output_name} - fi - exit $status - ;; - - - # install-lib mode: DIR LIBNAME... - install-lib) - if test $# -lt 2; then - echo "$0 install-lib: Need directory and at least one library." >&2 - exit 1 - fi - libdir=$1; shift - if test ! -d $libdir; then - echo "$0 install-lib: $1 not a directory." >&2 - exit 1 - fi - for arg in "$@"; do # for each library... - # Always having a directory part simplifies the code below. - echo $arg | grep / >/dev/null || arg="./$arg" - for ot in `echo $objtypes | tr : " "`; do # for each object type... - case $ot in - SHARED) # needs shared extension and version number. - verstring=`$0 version $arg` - libname=`echo $arg | sed 's/\.la$/\.'$shared_ext$verstring/` - ;; - STATIC) # just get rid of the `l'. - libname=`echo $arg | sed 's/l\(.\)$/\1/'` - ;; - *) - echo "$0: Impossible object type $ot!" >&2 - echo "$bug_report" >&2 - exit 1;; - esac - # Have to insert the object type directory. - libname=`echo $libname | sed 's,\(/[^/]*\)$,/'$ot'\1,'` - lib_basename=`basename $libname` - $verbose "$0: library name = $libname." - $verbose "$0: installation name = $libdir/$lib_basename." - cmd="${INSTALL_DATA-cp} $libname $libdir/$lib_basename" - # - if test $ot = SHARED; then - # Link libfoo.so to libfoo.so.1.2.3. - lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'` - $verbose "$0: linking $libdir/$lib_base to $lib_basename" - (cd $libdir && rm -f $lib_base && ln -s $lib_basename $lib_base) - fi - # - # Run ldconfig, etc. - postinstall=`eval echo '$'${ot}_postinstall` - test -n "$postinstall" && cmd="$cmd && $postinstall" - $show $cmd - $chicken eval "$cmd" - done - done - ;; - - - # install-prog mode: DIR PROGNAME... - install-prog) - if test $# -lt 2; then - echo "$0 install-prog: Need directory and at least one program." >&2 - exit 1 - fi - dir=$1; shift - if test ! -d $dir; then - echo "$0 install-prog: $1 not a directory." >&2 - exit 1 - fi - # The program got linked using the first object type, so - # installation of the program will proceed accordingly. - linktype=`echo $objtypes | sed 's/:.*//'` - $verbose "$0: linktype = $linktype." - if test -z "$linktype"; then - echo "$0: Impossibly empty linktype?!" >&2 - exit 1 - fi - if test $linktype = SHARED; then - # Install the binary, not the wrapper script. - suffix=.exe - else - suffix= - fi - for arg in "$@"; do # for each program... - # FIXME: On SunOS, AIX, and HP-UX, relink to avoid hardwired libdirs. - cmd="${INSTALL_PROGRAM-cp} $arg$suffix $dir/$arg" - $show $cmd - $chicken eval "$cmd" - done - ;; - - - # version mode - version) - if test $# -ne 1; then - echo "$0 version: Exactly one argument needed, not $# ($*)." >&2 - exit 1 - fi - # Strip directory name, `lib' prefix, and any .suffix. - dir=`echo $1 | sed 's,/[^/]*$,,'` - test "x$dir" = "x$1" && dir=. - libname=`basename $1 | sed -e 's,^lib,,' -e s',\..*$,,'` - verfile=$dir/klibtool.version - if test ! -r $verfile; then - echo "$0 version: No file $verfile for $libname version info." >&2 - echo "$0 version: Original argument was $1." >&2 - exit 1 - fi - $verbose "$0: dir = $dir, libname = $libname." - version=`awk '$1 == "'$libname'" { print "." $2 "." $3 "." $4 }' $verfile` - $verbose "$0: version for $libname = $version." - echo $version - ;; - - - # unknown mode - *) - echo "$0: Impossible mode \`$mode'!" >&2 - echo "$bug_report" >&2 - exit 1 - ;; -esac
deleted file mode 100644 --- a/kpathsea/kpathsea.cps +++ /dev/null @@ -1,808 +0,0 @@ -\initial {!} -\entry {\code {!! \r {in path specifications}}}{36} -\initial {$} -\entry {\code {$ \r {expansion}}}{33} -\initial {-} -\entry {\code {--color=tty}}{36} -\entry {\code {--debug=\var {num}}}{40} -\entry {\code {--disable-static}}{9} -\entry {\code {--dpi=\var {num}}}{38} -\entry {\code {--enable \r {options}}}{8} -\entry {\code {--enable-maintainer-mode}}{9} -\entry {\code {--enable-shared}}{9, 10} -\entry {\code {--expand-braces=\var {string}}}{40} -\entry {\code {--expand-path=\var {string}}}{40} -\entry {\code {--expand-var=\var {string}}}{40} -\entry {\code {--format=\var {name}}}{38} -\entry {\code {--help}}{40} -\entry {\code {--interactive}}{39} -\entry {\code {--mode=\var {string}}}{39} -\entry {\code {--must-exist}}{39} -\entry {\code {--path=\var {string}}}{39} -\entry {\code {--progname=\var {name}}}{39} -\entry {\code {--show-path=\var {name}}}{40} -\entry {\code {--srcdir\r {, for building multiple architectures}}}{10} -\entry {\code {--version}}{40} -\entry {\code {--with \r {options}}}{8} -\entry {\code {--with-mktextex-default}}{13} -\entry {\code {--without-mktexmf-default}}{13} -\entry {\code {--without-mktexpk-default}}{13} -\entry {\code {--without-mktextfm-default}}{13} -\entry {\code {-1 \r {debugging value}}}{23} -\entry {\code {-A \r {option to \code {ls}}}}{36} -\entry {\code {-Bdynamic}}{29} -\entry {\code {-Bstatic}}{29} -\entry {\code {-D \var {num}}}{38} -\entry {\code {-dynamic}}{29} -\entry {\code {-g\r {, compiling without}}}{10} -\entry {\code {-L \r {option to \code {ls}}}}{36} -\entry {\code {-mktex=\var {filetype}}}{39} -\entry {\code {-no-mktex=\var {filetype}}}{39} -\entry {\code {-O\r {, compiling with}}}{10} -\entry {\code {-static}}{29} -\initial {.} -\entry {\code {. \r {directories, ignored}}}{36} -\entry {\code {. \r {files}}}{36} -\entry {\code {.2602gf}}{27} -\entry {\code {.afm}}{41} -\entry {\code {.base}}{41} -\entry {\code {.bib}}{41} -\entry {\code {.bst}}{41} -\entry {\code {.cnf}}{41} -\entry {\code {.eps}}{42} -\entry {\code {.epsi}}{42} -\entry {\code {.fmt}}{41} -\entry {\code {.ist}}{42} -\entry {\code {.map}}{42} -\entry {\code {.mem}}{42} -\entry {\code {.mf}}{42} -\entry {\code {.mft}}{42} -\entry {\code {.mp}}{42} -\entry {\code {.ocp}}{42} -\entry {\code {.ofm}}{42} -\entry {\code {.opl}}{42} -\entry {\code {.otp}}{42} -\entry {\code {.ovf}}{42} -\entry {\code {.ovp}}{42} -\entry {\code {.pfa}}{43} -\entry {\code {.pfb}}{43} -\entry {\code {.pk}}{42} -\entry {\code {.pool}}{42, 43} -\entry {\code {.pro}}{42} -\entry {\code {.rhosts\r {, writable by \TeX{}}}}{16} -\entry {\code {.tex}}{42} -\entry {\code {.tex \r {file, included in \file {ls-R}}}}{36} -\entry {\code {.tfm}}{43} -\entry {\code {.ttc}}{43} -\entry {\code {.ttf}}{43} -\entry {\code {.vf}}{43} -\initial {/} -\entry {\code {/ \r {may not be /}}}{30} -\entry {\code {/\r {, trailing in home directory}}}{34} -\entry {\code {//}}{34} -\entry {\code {/afs/\dots {} \r {, installing into}}}{12} -\entry {\code {/etc/profile}}{25} -\entry {\code {/etc/profile \r {and aliases}}}{36} -\entry {\code {/var/tmp/texfonts}}{14} -\initial {:} -\entry {\code {: \r {may not be :}}}{30} -\entry {\code {:: \r {expansion}}}{32} -\initial {@} -\entry {@\var {var}@ substitutions}{8} -\initial {{\tt\char '173}} -\entry {\code {{\tt\char '173} \r {expansion}}}{34} -\initial {{\tt\char '176}} -\entry {\code {~ \r {expansion}}}{33} -\initial {{\tt\indexbackslash }} -\entry {\code {{\tt\rawbackslashxx }\r {, line continuation in \file {texmf.cnf}}}}{31} -\entry {\code {{\tt\rawbackslashxx }openin}}{30} -\entry {\code {{\tt\rawbackslashxx }special\r {, suppressing warnings about}}}{46} -\initial {2} -\entry {\code {2602gf}}{27} -\initial {4} -\entry {4all\TeX{} Live CD-ROM}{20} -\initial {8} -\entry {8.3 filenames, using}{14} -\initial {A} -\entry {absolute filenames}{30} -\entry {\code {ac_include\r {, Autoconf extension}}}{8} -\entry {access warnings}{30} -\entry {Acorn \TeX{} implementations}{21} -\entry {\code {AFMFONTS}}{41} -\entry {AFS}{12} -\entry {AIX 4.1 \code {configure} error}{27} -\entry {AIX shells and \code {configure}}{8} -\entry {aliases for fonts}{45} -\entry {aliases, for filenames}{36} -\entry {\code {all}}{46} -\entry {alphabetical order, not}{34} -\entry {Amiga support}{5} -\entry {Amiga \TeX{} implementations}{21} -\entry {Andrew File System, installing with}{12} -\entry {announcement mailing list}{22, 23} -\entry {ANSI C}{27} -\entry {append-only directories and \code {mktexpk}}{16} -\entry {\code {appendonlydir}}{13, 14} -\entry {architecture-(in)dependent files, installing only}{12} -\entry {architectures, compiling multiple}{10} -\entry {arguments to \file {mktex}}{15} -\entry {\code {argv[0]}}{47, 48} -\entry {\code {ash\r {, losing with \code {configure}}}}{8} -\entry {\code {autoconf\r {, recommended}}}{48} -\entry {automounter, and configuration}{10} -\entry {automounter, and \file {ls-R}}{36} -\entry {auxiliary tasks}{39} -\initial {B} -\entry {Babel}{6, 11} -\entry {Bach, Johann Sebastian}{33} -\entry {backbone of CTAN}{18} -\entry {backslash-newline}{31} -\entry {\code {bash\r {, recommended for running \code {configure}}}}{8} -\entry {basic glyph lookup}{44} -\entry {Berry, Karl}{2} -\entry {\code {BIBINPUTS}}{41} -\entry {binary mode, for file transfers}{19} -\entry {blank lines, in \file {texmf.cnf}}{31} -\entry {brace expansion}{34} -\entry {BSD universe}{11} -\entry {\code {bsh\r {, ok with \code {configure}}}}{8} -\entry {\code {BSTINPUTS}}{41} -\entry {bug address}{21} -\entry {bug checklist}{21} -\entry {bug mailing list}{22} -\entry {bugs, reporting}{21} -\initial {C} -\entry {\code {c-*.h}}{48} -\entry {\code {c-auto.in}}{8} -\entry {cache of fonts, local}{16} -\entry {calling sequence}{47} -\entry {\code {CC}}{9} -\entry {\code {cc \r {warnings}}}{29} -\entry {\code {cc\r {, compiling with}}}{9} -\entry {CD-ROM distributions}{20} -\entry {\code {CFLAGS}}{9} -\entry {\code {ChangeLog \r {entry}}}{22} -\entry {checklist for bug reports}{21} -\entry {\code {checksum}}{46} -\entry {circle fonts}{45} -\entry {\code {clean \r {Make target}}}{12} -\entry {\code {client_path \r {in \code {kpse_format_info}}}}{48} -\entry {\code {cmr10\r {, as fallback font}}}{46} -\entry {\code {cmr10.vf}}{30} -\entry {\code {cnf.c}}{32} -\entry {\code {cnf.h}}{49} -\entry {code sharing}{10} -\entry {color printers, configuring}{5} -\entry {comments, in fontmap files}{45} -\entry {comments, in \file {texmf.cnf}}{31} -\entry {comments, making}{1} -\entry {common features in glyph lookup}{44} -\entry {common problems}{25} -\entry {\code {comp.sys.sun.admin \r {FAQ}}}{29} -\entry {\code {comp.text.tex}}{23} -\entry {compilation}{4} -\entry {compilation value, source for path}{31} -\entry {compiler bugs}{27} -\entry {compiler bugs, finding}{27} -\entry {compiler options, additional}{11} -\entry {compiler options, specifying}{9} -\entry {compiler, changing}{11} -\entry {compiling on HP-UX}{27} -\entry {conditions for use}{1} -\entry {config files}{31} -\entry {config files, for Kpathsea-using programs}{48} -\entry {config files, programming with}{49} -\entry {\code {config.log}}{22} -\entry {\code {config.ps\r {, search path for}}}{41} -\entry {\code {config.status}}{22} -\entry {configuration}{4} -\entry {configuration bugs}{22} -\entry {configuration compiler options}{9} -\entry {configuration file, source for path}{31} -\entry {configuration files as shell scripts.}{32} -\entry {configuration of \file {mktex} scripts}{13} -\entry {configuration of optional features}{8} -\entry {\code {configure \r {error from \code {sed}}}}{27} -\entry {\code {configure} options}{8} -\entry {\code {configure} options for \file {mktex} scripts}{13} -\entry {\code {configure\r {, running}}}{8} -\entry {context diff}{22} -\entry {continuation character}{31} -\entry {core dumps, reporting}{22} -\entry {\code {CPPFLAGS}}{9} -\entry {crashes, reporting}{22} -\entry {CTAN, defined}{18} -\entry {\code {CTAN.sites}}{19} -\entry {custom installation}{5} -\initial {D} -\entry {Dante \TeX{} CD-ROM}{20} -\entry {database search}{30} -\entry {database, for filenames}{35} -\entry {database, format of}{37} -\entry {\code {debug.h}}{23} -\entry {debugger}{22} -\entry {debugging}{23} -\entry {debugging options, in Kpathsea-using program}{48} -\entry {debugging output}{23} -\entry {debugging with \samp {-g}, disabling}{10} -\entry {DEC shells and \code {configure}}{8} -\entry {default expansion}{32} -\entry {default path features}{7} -\entry {default paths, changing}{7} -\entry {default paths, how they're made}{7} -\entry {\code {default_texsizes}}{46} -\entry {\code {DEFS}}{9} -\entry {\code {depot}}{10} -\entry {directories, changing default installation}{7} -\entry {directories, making append-only}{14} -\entry {directory permissions}{16} -\entry {directory structure, for \TeX{} files}{16} -\entry {disabling \file {mktex} scripts}{13} -\entry {disk search}{30} -\entry {disk searching, avoiding}{36} -\entry {disk space, needed}{5} -\entry {disk usage, reducing}{25} -\entry {\code {distclean \r {Make target}}}{12} -\entry {distributions, compiling simultaneously}{6} -\entry {distributions, not compiling}{6} -\entry {distributions, on CD-ROM}{20} -\entry {distributions, on tape}{20} -\entry {distributions, via ftp}{18} -\entry {\code {dlclose}}{28} -\entry {\code {dlopen}}{28} -\entry {\code {dlsym}}{28} -\entry {\code {dlsym.c}}{28} -\entry {\code {doc files}}{43} -\entry {DOS compatible names}{14} -\entry {DOS support}{5} -\entry {DOS \TeX{} implementations}{21} -\entry {\code {dosnames}}{14} -\entry {dot files}{36} -\entry {doubled colons}{32} -\entry {\code {dpi\var {nnn} directories}}{14} -\entry {DVI drivers}{6} -\entry {\code {DVILJMAKEPK}}{15} -\entry {\code {DVILJSIZES}}{46} -\entry {\code {DVIPSFONTS}}{43} -\entry {\code {DVIPSHEADERS}}{43} -\entry {\code {DVIPSMAKEPK}}{15} -\entry {\code {DVIPSSIZES}}{46} -\entry {dynamic creation of files}{13} -\entry {dynamic linking problems with OpenWin libraries}{29} -\initial {E} -\entry {EC fonts, and dynamic source creation}{13} -\entry {\code {elt-dirs.c}}{35} -\entry {email CTAN access}{19} -\entry {enabling \file {mktex} scripts}{13} -\entry {environment variable, source for path}{31} -\entry {environment variables for \TeX{}}{41} -\entry {environment variables in paths}{33} -\entry {environment variables, old}{25} -\entry {epoch, seconds since}{25} -\entry {error message macros}{47} -\entry {excessive startup time}{26} -\entry {\code {expand.c}}{34} -\entry {expanding symlinks}{47} -\entry {expansion, default}{32} -\entry {expansion, path element}{30} -\entry {expansion, search path}{32} -\entry {expansion, subdirectory}{34} -\entry {expansion, tilde}{33} -\entry {expansion, variable}{33} -\entry {explicitly relative filenames}{30} -\entry {externally-built filename database}{35} -\entry {extra colons}{32} -\entry {\code {extraclean \r {Make target}}}{12} -\initial {F} -\entry {failed \code {mktex\dots {}} script invocation}{15} -\entry {fallback font}{46} -\entry {fallback resolutions}{46} -\entry {fallback resolutions, overriding}{11} -\entry {FAQ, \t {comp.sys.sun.admin}}{29} -\entry {FAQ, Kpathsea}{25} -\entry {Farwell, Matthew}{35} -\entry {features, of default paths}{7} -\entry {file formats, supported}{41} -\entry {file lookup}{44} -\entry {file permissions}{16} -\entry {file types, registering new}{47} -\entry {filename aliases}{36} -\entry {filename database}{35} -\entry {filename database generation}{12} -\entry {filenames, absolute or explicitly relative}{30} -\entry {files, unable to find}{25} -\entry {filesystem search}{30} -\entry {floating directories}{30} -\entry {font alias files}{45} -\entry {font generation failures}{26} -\entry {font of last resort}{46} -\entry {font set, infinite}{13} -\entry {fontmap files}{45} -\entry {\code {fontmaps}}{14} -\entry {fontname}{14} -\entry {fontnames, arbitrary length}{45} -\entry {fonts, being created}{5} -\entry {\code {FOOINPUTS}}{43} -\entry {\code {fopen\r {, redefined}}}{24} -\entry {format of external database}{37} -\entry {Free Software Foundation}{20} -\entry {FreeBSD \code {configure} error}{27} -\entry {FreeBSD shells and \code {configure}}{8} -\entry {FSF Source Code CD-ROM}{20} -\entry {ftp retrieval}{18} -\entry {\code {ftp.tug.org}}{18} -\entry {fundamental purpose of Kpathsea}{1} -\initial {G} -\entry {\code {gcc\r {, compiling with}}}{9} -\entry {\code {gdb\r {, recommended}}}{22} -\entry {generation of filename database}{12} -\entry {German \TeX{} CD info}{20} -\entry {\code {get_applicationShellWidgetClass}}{29} -\entry {\code {get_wmShellWidgetClass}}{29} -\entry {\code {gf}}{41} -\entry {\code {GFFONTS}}{41} -\entry {globally writable directories}{16} -\entry {glyph lookup}{44} -\entry {glyph lookup bitmap tolerance}{44} -\entry {\code {GLYPHFONTS}}{41, 42} -\entry {GNU C compiler bugs}{27} -\entry {GNU General Public License}{1} -\entry {Gopher CTAN access}{19} -\entry {group-writable directories}{16} -\entry {\code {GSFTOPK_DEBUG \r {(128)}}}{24} -\entry {GUTenberg}{20} -\initial {H} -\entry {hash table buckets, printing}{24} -\entry {hash table routines}{48} -\entry {\code {hash_summary_only \r {variable for debugging}}}{24} -\entry {help, mailing list for general \TeX{}}{23} -\entry {\code {HIER}}{7} -\entry {history of Kpathsea}{2} -\entry {home directories in paths}{33} -\entry {\code {HOME\r {, as ~ expansion}}}{33} -\entry {HP-UX, compiling on}{27} -\initial {I} -\entry {identifiers, characters valid in}{31} -\entry {illegal pointer combination warnings}{29} -\entry {\code {include \r {fontmap directive}}}{45} -\entry {\code {INDEXSTYLE}}{42} -\entry {\code {info-tex@shsu.edu}}{23} -\entry {input lines, reading}{48} -\entry {\code {install-data \r {Make target}}}{12} -\entry {\code {install-exec \r {Make target}}}{12} -\entry {installation}{4} -\entry {installation testing}{15} -\entry {installation, architecture-(in)dependent files only}{12} -\entry {installation, changing default directories}{7} -\entry {installation, customized}{5} -\entry {installation, getting executables instead of}{4} -\entry {installation, simple}{4} -\entry {installing files}{11} -\entry {interactive query}{39} -\entry {interface, not frozen}{1} -\entry {introduction}{1} -\initial {K} -\entry {\samp {kdebug:}}{24} -\entry {\code {kdefault.c}}{33} -\entry {Knuth, Donald E.}{2} -\entry {Knuth, Donald E., archive of programs by}{21} -\entry {Knuth, Donald E., original author}{19} -\entry {Korn shell\r {, losing with \code {configure}}}{8} -\entry {Kpathsea config file, source for path}{31} -\entry {Kpathsea version number}{6} -\entry {\code {kpathsea.h}}{47} -\entry {\code {kpathsea/HIER}}{7} -\entry {\code {kpathsea/README.CONFIGURE}}{8} -\entry {\code {kpathsea_debug}}{23} -\entry {\code {KPATHSEA_DEBUG}}{23, 47} -\entry {\code {kpathsea_debug \r {variable}}}{48} -\entry {\code {KPSE_BITMAP_TOLERANCE}}{44} -\entry {\code {kpse_cnf_get}}{49} -\entry {\code {KPSE_DEBUG_EXPAND \r {(16)}}}{24} -\entry {\code {KPSE_DEBUG_FOPEN \r {(4)}}}{23, 24} -\entry {\code {KPSE_DEBUG_HASH \r {(2)}}}{23} -\entry {\code {KPSE_DEBUG_PATHS \r {(8)}}}{24} -\entry {\code {KPSE_DEBUG_SEARCH \r {(32)}}}{24} -\entry {\code {KPSE_DEBUG_STAT \r {(1)}}}{23} -\entry {\code {KPSE_DEBUG_VARS \r {(64)}}}{24} -\entry {\code {KPSE_DOT \r {expansion}}}{34} -\entry {\code {kpse_fallback_font}}{46} -\entry {\code {kpse_find_*}}{48} -\entry {\code {kpse_find_file}}{44, 48} -\entry {\code {kpse_find_glyph_format}}{44} -\entry {\code {kpse_format_info}}{48} -\entry {\code {kpse_format_info_type}}{24} -\entry {\code {kpse_init_prog}}{48} -\entry {\code {kpse_init_prog\r {, and \code {MAKETEX_MODE}}}}{7} -\entry {\code {kpse_make_specs}}{14} -\entry {\code {kpse_open_file}}{48} -\entry {\code {kpse_program_name}}{47} -\entry {\code {kpse_set_progname}}{48} -\entry {\code {kpse_set_program_name}}{47} -\entry {\code {kpse_var_value}}{49} -\entry {\code {kpsewhich}}{37} -\entry {Kpsewhich, and debugging}{23} -\entry {\code {ksh\r {, losing with \code {configure}}}}{8} -\initial {L} -\entry {\code {labrea.stanford.edu}}{21} -\entry {LaserJet drive}{6} -\entry {last-resort font}{46} -\entry {La\TeX{} help mailing list}{23} -\entry {\code {lcircle10}}{45} -\entry {\code {LDFLAGS}}{9} -\entry {leading colons}{32} -\entry {leaf directories wrongly guessed}{25} -\entry {leaf directory trick}{35} -\entry {\code {libdl.a}}{28} -\entry {libraries, changing}{11} -\entry {libraries, specifying additional}{9} -\entry {\code {LIBS}}{9} -\entry {\code {libucb\r {, avoiding}}}{11} -\entry {license for using the library}{1} -\entry {lines, reading arbitrary-length}{48} -\entry {Linux File System Standard}{14} -\entry {Linux shells and \code {configure}}{8} -\entry {Linux, using Web2c}{20} -\entry {\code {lndir \r {for building symlink trees}}}{10} -\entry {loader options}{9} -\entry {loader options, final}{11} -\entry {loader options, initial}{11} -\entry {local cache of fonts}{16} -\entry {log file}{25} -\entry {logging successful searches}{25} -\entry {\code {lost+found \r {directory}}}{30} -\entry {\code {lostchar}}{46} -\entry {\code {ls-R}}{42} -\entry {\code {ls-R \r {and AFS}}}{12} -\entry {\code {ls-R \r {database file}}}{35} -\entry {\code {ls-R\r {, simplest build}}}{36} -\initial {M} -\entry {Mach10 \code {configure} error}{27} -\entry {Macintosh \TeX{} implementations}{21} -\entry {MacKenzie, David}{2, 35} -\entry {magic characters}{30} -\entry {mailing lists}{22} -\entry {\code {maintainer-clean \r {Make target}}}{12} -\entry {Make arguments, additional}{11} -\entry {\code {make\r {, running}}}{11} -\entry {\code {Makefile.in}}{8} -\entry {Makefiles, empty}{27} -\entry {\code {MAKETEX_DEBUG \r {(512)}}}{24} -\entry {\code {MAKETEX_FINE_DEBUG \r {(1024)}}}{24} -\entry {\code {MAKETEX_MODE}}{7} -\entry {memory allocation routines}{48} -\entry {Metafont failures}{27} -\entry {Metafont installation}{26} -\entry {Metafont making too-large fonts}{27} -\entry {Metafont using the wrong resolution}{26} -\entry {\code {MFBASES}}{41} -\entry {\code {MFINPUTS}}{42} -\entry {\code {MFPOOL}}{42} -\entry {\code {MFTINPUTS}}{42} -\entry {mirrors, FTP}{19} -\entry {mismatched checksum warnings}{46} -\entry {\code {missfont.log}}{15} -\entry {\code {MISSFONT_LOG}}{15} -\entry {missing character warnings}{46} -\entry {\file {mktex} script configuration}{13} -\entry {\file {mktex} script names}{14} -\entry {\file {mktex} scripts}{13} -\entry {\code {mktex.cnf}}{13} -\entry {\code {mktex.opt}}{13} -\entry {\code {mktexdir}}{14} -\entry {\code {mktexmf}}{15} -\entry {\code {mktexpk}}{15} -\entry {\code {mktexpk \r {, initial runs}}}{5} -\entry {\code {mktextex}}{15} -\entry {\code {mktextfm}}{15} -\entry {mode directory, omitting}{14} -\entry {Morgan, Tim}{2} -\entry {\code {mostlyclean \r {Make target}}}{12} -\entry {\code {MPINPUTS}}{42} -\entry {\code {MPMEMS}}{42} -\entry {\code {MPPOOL}}{42} -\entry {\code {MPSUPPORT}}{42} -\entry {\code {MT_FEATURES}}{13} -\entry {multiple architectures, compiling on}{10} -\entry {multiple architectures, directories for}{10} -\entry {multiple architectures, installing on}{12} -\entry {multiple \TeX{} hierarchies}{34} -\entry {must exist}{30} -\initial {N} -\entry {names for \file {mktex} scripts}{14} -\entry {NetBSD \code {configure} error}{27} -\entry {NetBSD shells and \code {configure}}{8} -\entry {Neumann, Gustaf}{2} -\entry {newsgroup for \TeX{}}{23} -\entry {NeXT \code {sed} error}{27} -\entry {NeXT, lacking X11}{6} -\entry {NFS and \file {ls-R}}{36} -\entry {NFS CTAN access}{19} -\entry {\code {nomode}}{14} -\entry {non-English typesetting}{6} -\entry {non-Unix operating systems}{5} -\entry {Northwest Computing Support Center}{20} -\entry {NTG}{20} -\entry {null pointers, dereferencing}{22} -\entry {numeric debugging values}{23} -\initial {O} -\entry {obtaining \TeX{}}{18} -\entry {obtaining \TeX{} on tape}{20} -\entry {obtaining Web2c by ftp}{18} -\entry {obtaining Web2c on CD-ROM}{20} -\entry {\code {OCPINPUTS}}{42} -\entry {\code {OFMFONTS}}{42} -\entry {online Metafont display, spurious}{27} -\entry {OpenWin libraries, dynamic linking problems}{29} -\entry {optimization caveat}{27} -\entry {optimization, enabling}{10} -\entry {options for debugging}{23} -\entry {options to \code {configure}}{8} -\entry {OS/2 support}{5} -\entry {other \TeX{} distributions}{21} -\entry {\code {OTPINPUTS}}{42} -\entry {overview of path searching}{30} -\entry {overview of programming with Kpathsea}{47} -\entry {\code {OVFFONTS}}{42} -\entry {\code {OVPFONTS}}{42} -\initial {P} -\entry {patches, Sun OpenWin}{29} -\entry {path expansion}{32} -\entry {path searching}{30} -\entry {path searching options}{38} -\entry {path searching, overview}{30} -\entry {path searching, standalone}{37} -\entry {path sources}{31} -\entry {paths, changing default}{6, 7} -\entry {paths, device name included in}{7} -\entry {\code {paths.h}}{8} -\entry {\code {paths.h\r {, creating}}}{11} -\entry {\code {pathsearch.h}}{47} -\entry {\code {pc \r {Pascal compiler}}}{2} -\entry {PCL driver}{6} -\entry {PDF generation}{6} -\entry {permission denied}{30} -\entry {permissions, directory}{16} -\entry {permissions, file}{16} -\entry {\code {PKFONTS}}{42} -\entry {\code {plain.base}}{27} -\entry {pointer combination warnings}{29} -\entry {PostScript driver}{6} -\entry {PostScript fonts, additional}{5} -\entry {precompiled executables, instead of installation}{4} -\entry {precompiled Unix binaries}{21} -\entry {preprocessor options}{9} -\entry {preprocessor options, additional}{11} -\entry {Prime Time \TeX{}cetera CD-ROM}{20} -\entry {printer configuration files}{5} -\entry {privacy, semblance of}{25} -\entry {problems, common}{25} -\entry {\code {proginit.c}}{7} -\entry {\code {proginit.h}}{48} -\entry {program-varying paths}{41} -\entry {\code {program_invocation_name}}{47} -\entry {\code {program_invocation_short_name}}{47} -\entry {programming overview}{47} -\entry {programming with config files}{49} -\entry {programming with Kpathsea}{47} -\entry {programs using the library}{1} -\entry {proof mode}{27} -\entry {\code {PSHEADERS}}{42} -\entry {\code {pxp \r {Pascal preprocessor}}}{2} -\initial {Q} -\entry {quoting variable values}{33} -\initial {R} -\entry {\code {readable}}{46} -\entry {reading arbitrary-length lines}{48} -\entry {\code {README.CONFIGURE}}{8} -\entry {\code {README.mirrors}}{19} -\entry {recording successful searches}{25} -\entry {relative filenames}{30} -\entry {relative filenames in \file {ls-R}}{12} -\entry {reporting bugs}{21} -\entry {\code {resident.c}}{48} -\entry {resolution, setting}{38} -\entry {resolution, wrong}{26} -\entry {resolutions, last-resort}{46} -\entry {retrieving \TeX{}}{18} -\entry {right-hand side of variable assignments}{32} -\entry {Rokicki, Tom}{2} -\entry {\t {root} user}{34} -\entry {runtime configuration files}{31} -\entry {runtime debugging}{23} -\initial {S} -\entry {Sauter fonts, and dynamic source creation}{13} -\entry {scripts for file creation}{13} -\entry {search path, defined}{30} -\entry {search paths, changing default}{6} -\entry {searching for files}{44} -\entry {searching for glyphs}{44} -\entry {searching overview}{30} -\entry {searching the database}{30} -\entry {searching the disk}{30} -\entry {security considerations}{16} -\entry {\code {sed \r {error from \code {configure}}}}{27} -\entry {SELFAUTODIR}{47} -\entry {SELFAUTOLOC}{47} -\entry {SELFAUTOPARENT}{47} -\entry {sending patches}{22} -\entry {setgid scripts}{16} -\entry {\code {sh5\r {, ok with \code {configure}}}}{8} -\entry {shar\r {, recommended}}{22} -\entry {shared library, making}{10} -\entry {shell scripts as configuration files}{32} -\entry {shell variables}{33} -\entry {\code {shell_escape\r {, example for code}}}{49} -\entry {shells and \code {configure}}{8} -\entry {simple installation}{4} -\entry {site overrides for \code {mktex\dots {}}}{13} -\entry {size of distribution archives}{5} -\entry {skeleton \TeX{} directory}{16} -\entry {slow startup time}{26} -\entry {Solaris BSD compatibility, not}{11} -\entry {\code {source files}}{43} -\entry {sources for search paths}{31} -\entry {\code {special}}{46} -\entry {\code {st_nlink}}{35} -\entry {stack trace}{22} -\entry {standalone path searching}{37} -\entry {standard error and debugging output}{23} -\entry {standard options}{40} -\entry {startup time, excessive}{26} -\entry {static linking}{29} -\entry {static linking and \code {dlsym}}{28} -\entry {string routines}{48} -\entry {\code {strip}}{14} -\entry {\code {stripsupplier}}{14} -\entry {\code {striptypeface}}{14} -\entry {subdirectory searching}{34} -\entry {suggestions, making}{1} -\entry {Sun 2}{2} -\entry {Sun OpenWin patches}{29} -\entry {supplier directory, omitting}{14} -\entry {support organization}{20} -\entry {supported file formats}{41} -\entry {suppressing warnings}{46} -\entry {symbolic link trees, for multiple architectures}{10} -\entry {symbolic links not found}{25} -\entry {symbolic links, and \file {ls-R}}{36} -\entry {symlinks, resolving}{47} -\entry {system C compiler bugs}{27} -\entry {system dependencies}{8} -\entry {system V universe}{11} -\initial {T} -\entry {\code {T1FONTS}}{43} -\entry {\code {T1INPUTS}}{43} -\entry {\code {T42FONTS}}{43} -\entry {tape distribution}{20} -\entry {TDS}{16} -\entry {testing, post-installation}{15} -\entry {tests, simple}{5} -\entry {te\TeX{}}{21} -\entry {\code {tex-archive@math.utah.edu}}{23} -\entry {\code {tex-file.c}}{44} -\entry {\code {tex-file.h}}{47} -\entry {\code {tex-glyph.c}}{44} -\entry {\code {tex-glyph.h}}{47} -\entry {\code {tex-k-request@mail.tug.org}}{22} -\entry {\code {tex-k@mail.tug.org \r {(bug address)}}}{21} -\entry {\code {tex-make.c}}{14} -\entry {\code {TEX_HUSH}}{30, 46} -\entry {\TeX{} directory structure}{16} -\entry {\TeX{} distributions besides Web2c}{21} -\entry {\TeX{} environment variables}{41} -\entry {\TeX{} failures}{27} -\entry {\TeX{} file lookup}{44} -\entry {\TeX{} glyph lookup}{44} -\entry {\TeX{} help mailing list}{23} -\entry {\TeX{} hierarchy, one}{10} -\entry {\TeX{} Live CD-ROM}{20} -\entry {\TeX{} support}{41} -\entry {\TeX{} Users Group}{1} -\entry {\code {TEXBIB}}{41} -\entry {\code {TEXCONFIG}}{41} -\entry {\code {TEXDOCS}}{43} -\entry {\code {TEXFONTMAPS}}{42} -\entry {\code {TEXFONTS}}{41, 42, 43} -\entry {\code {texfonts.map}}{45} -\entry {\code {TEXFORMATS}}{41} -\entry {\code {TEXINDEXSTYLE}}{42} -\entry {\code {TEXINPUTS}}{42} -\entry {\code {TEXMF}}{16} -\entry {\code {texmf.cnf\r {, and variable expansion}}}{33} -\entry {\code {texmf.cnf\r {, creating}}}{11} -\entry {\code {texmf.cnf\r {, definition for}}}{31} -\entry {\code {texmf.cnf\r {, generated}}}{7} -\entry {\code {texmf.cnf\r {, source for path}}}{31} -\entry {\code {texmf.in}}{7} -\entry {\code {texmf.in\r {, editing}}}{6} -\entry {\code {texmf.sed}}{7} -\entry {\code {TEXMFCNF}}{31, 41} -\entry {\code {TEXMFDBS}}{35, 42} -\entry {\code {TEXMFINI}}{41, 42} -\entry {\code {TEXMFLOG}}{25} -\entry {\code {TEXMFOUTPUT}}{15} -\entry {\code {TEXPICTS}}{42} -\entry {\code {TEXPKS}}{42} -\entry {\code {TEXPOOL}}{43} -\entry {\code {TEXPSHEADERS}}{42, 43} -\entry {\code {TEXSIZES}}{46} -\entry {\code {TEXSOURCES}}{43} -\entry {\code {TFMFONTS}}{43} -\entry {tilde expansion}{33} -\entry {\code {tilde.c}}{34} -\entry {\code {time \r {system call}}}{25} -\entry {tolerance for glyph lookup}{44} -\entry {total disk space}{5} -\entry {trailing \samp {/} in home directory}{34} -\entry {trailing colons}{32} -\entry {\code {TRFONTS}}{43} -\entry {trick for detecting leaf directories}{35} -\entry {trojan horse attack}{16} -\entry {\code {TTFONTS}}{43} -\entry {TUG}{20} -\entry {\code {tug.org}}{18} -\entry {\code {tug@tug.org}}{1} -\entry {typeface directory, omitting}{14} -\initial {U} -\entry {\code {ucbinclude\r {, avoiding}}}{11} -\entry {UKTUG}{20} -\entry {Ultrix shells and \code {configure}}{8} -\entry {unable to find files}{25} -\entry {unable to generate fonts}{26} -\entry {\code {uname}}{21} -\entry {universe, BSD vs.\spacefactor =1000 system V}{11} -\entry {\code {UNIX_ST_LINK}}{35} -\entry {\code {unixtex.ftp}}{18} -\entry {\code {unixtex@u.washington.edu}}{20} -\entry {unknown special warnings}{46} -\entry {unreadable file warnings}{46} -\entry {unreadable files}{30} -\entry {unusable \file {ls-R} warning}{36} -\entry {usage patterns, finding}{25} -\entry {\code {USE_VARTEXFONTS}}{14} -\entry {Usenet \TeX{} newsgroup}{23} -\initial {V} -\entry {\code {varfonts}}{14} -\entry {variable expansion}{33} -\entry {\code {variable.c}}{33} -\entry {\code {variable.h}}{49} -\entry {\code {VARTEXFONTS}}{14} -\entry {VAX 11/750}{2} -\entry {version number, of Kpathsea}{6} -\entry {version numbers, determining}{21} -\entry {VF files, not found}{30} -\entry {\code {VFFONTS}}{43} -\entry {VMS support}{5} -\entry {VMS \TeX{} implementations}{21} -\entry {Vojta, Paul}{2} -\initial {W} -\entry {Walnut Creek \TeX{} CD-ROM}{20} -\entry {Walsh, Norman}{2} -\entry {warning about unusable \file {ls-R}}{36} -\entry {warnings, file access}{30} -\entry {warnings, pointer combinations}{29} -\entry {warnings, suppressing}{46} -\entry {\code {wcstombs}}{28} -\entry {Weber, Olaf}{3} -\entry {whitespace, in fontmap files}{45} -\entry {whitespace, not ignored on continuation lines}{31} -\entry {Windows \TeX{} implementations}{21} -\entry {World Wide Web CTAN access}{19} -\entry {\code {www.tug.org}}{18} -\initial {X} -\entry {X11 previewer}{6} -\entry {X11, lacking on NeXT}{6} -\entry {\code {XCFLAGS}}{11} -\entry {\code {XCPPFLAGS}}{11} -\entry {\code {XDEFS}}{11} -\entry {\code {XDVIFONTS}}{43} -\entry {\code {XDVIMAKEPK}}{15} -\entry {\code {XDVISIZES}}{46} -\entry {\code {XLDFLAGS}}{11} -\entry {\code {XLOADLIBES}}{11} -\entry {\code {XMAKEARGS}}{11} -\entry {\code {Xmu \r {library problems}}}{29} -\entry {\code {XtStrings}}{28} -\initial {Z} -\entry {zuhn, david}{2}
deleted file mode 100644 --- a/kpathsea/kpathsea.h +++ /dev/null @@ -1,48 +0,0 @@ -#include <kpathsea/config.h> -#include <kpathsea/absolute.h> -#include <kpathsea/c-ctype.h> -#include <kpathsea/c-dir.h> -#include <kpathsea/c-errno.h> -#include <kpathsea/c-fopen.h> -#include <kpathsea/c-limits.h> -#include <kpathsea/c-memstr.h> -#include <kpathsea/c-minmax.h> -#include <kpathsea/c-namemx.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-pathmx.h> -#include <kpathsea/c-proto.h> -#include <kpathsea/c-stat.h> -#include <kpathsea/c-std.h> -#include <kpathsea/c-unistd.h> -#include <kpathsea/c-vararg.h> -#include <kpathsea/cnf.h> -#include <kpathsea/concatn.h> -#include <kpathsea/db.h> -#include <kpathsea/debug.h> -#include <kpathsea/default.h> -#include <kpathsea/expand.h> -#include <kpathsea/fn.h> -#include <kpathsea/fontmap.h> -#include <kpathsea/getopt.h> -#include <kpathsea/hash.h> -#include <kpathsea/lib.h> -#include <kpathsea/line.h> -#include <kpathsea/magstep.h> -#include <kpathsea/paths.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/proginit.h> -#include <kpathsea/progname.h> -#include <kpathsea/readable.h> -#include <kpathsea/str-list.h> -#include <kpathsea/str-llist.h> -#include <kpathsea/systypes.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/tex-glyph.h> -#include <kpathsea/tex-hush.h> -#include <kpathsea/tex-make.h> -#include <kpathsea/tilde.h> -#include <kpathsea/truncate.h> -#include <kpathsea/types.h> -#include <kpathsea/variable.h> -#include <kpathsea/xopendir.h> -#include <kpathsea/xstat.h>
deleted file mode 100644 --- a/kpathsea/kpathsea.info +++ /dev/null @@ -1,4288 +0,0 @@ -This is Info file kpathsea.info, produced by Makeinfo version 1.68 from -the input file kpathsea.texi. - -INFO-DIR-SECTION TeX -START-INFO-DIR-ENTRY -* Kpathsea: (kpathsea). File lookup along search paths. -* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching. -* mktexmf: (kpathsea)mktex scripts. MF source generation. -* mktexpk: (kpathsea)mktex scripts. PK bitmap generation. -* mktextex: (kpathsea)mktex scripts. TeX source generation. -* mktextfm: (kpathsea)mktex scripts. TeX font metric generation. -* mktexlsr: (kpathsea)Filename database. Update ls-R. -END-INFO-DIR-ENTRY - - This file documents the Kpathsea library for path searching. - - Copyright (C) 1993, 94, 95, 96, 97 K. Berry & O. Weber. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: kpathsea.info, Node: Top, Next: Introduction, Up: (dir) - -Kpathsea library -**************** - - This manual documents how to install and use the Kpathsea library for -filename lookup. It corresponds to version 3.2, released in October -1997. - -* Menu: - -* Introduction:: Overview. -* Installation:: Compilation, installation, and bug reporting. - -* Path searching:: How filename lookups work. -* TeX support:: Special support for TeX-related file lookups. - -* Programming:: How to use Kpathsea features in your program. - -* Index:: General index. - - -File: kpathsea.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top - -Introduction -************ - - This manual corresponds to version 3.2 of the Kpathsea library, -released in October 1997. - - The library's fundamental purpose is to return a filename from a list -of directories specified by the user, similar to what shells do when -looking up program names to execute. - - The following software, all of which we maintain, uses this library: - - * Dviljk (see the `dvilj' man page) - - * Dvipsk (*note Introduction: (dvips)Top.) - - * GNU font utilities (*note Introduction: (fontu)Top.) - - * Web2c (*note Introduction: (web2c)Top.) - - * Xdvik (see the `xdvi' man page) - -Other software that we do not maintain also uses it. - - We are still actively maintaining the library (and probably always -will be, despite our hopes). If you have comments or suggestions, -please send them to us (*note Reporting bugs::.). - - We distribute the library under the GNU Library General Public License -(LGPL), with one exception (see below). In short, this means if you -write a program using the library, you must (offer to) distribute the -source to the library, along with any changes you have made, and allow -anyone to modify the library source and distribute their modifications. -It does not mean you have to distribute the source to your program, -although we hope you will. - - The exception is the part of the file `expand.c' which implements -brace expansion. We took this from Bash, which is covered by the GNU -General Public License (GPL). Therefore, if you wish to redistribute -the library under the LGPL, you must remove this code. (If you write a -replacement we can distribute, we hope you'll share it with us.) See -the files `COPYING' and `COPYING.LIB' for the text of the GNU licenses. - - If you know enough about TeX to be reading this manual, then you (or -your institution) should consider joining the TeX Users Group (if -you're already a member, great!). TUG produces the periodical -`TUGboat', sponsors an annual meeting and publishes the proceedings, -and arranges courses on TeX for all levels of users throughout the -world. Anyway, here is the address: - - TeX Users Group - P.O. Box 1239 - Three Rivers, CA 93271-1239 - USA - phone: 1 209 561 0112 - fax: 1 209 561 4584 - email: <tug@tug.org> - -* Menu: - -* History:: - - -File: kpathsea.info, Node: History, Up: Introduction - -History -======= - - (This section is for those people who are curious about how the -library came about.) (If you like to read historical accounts of -software, we urge you to seek out the GNU Autoconf manual and the -"Errors of TeX" paper by Don Knuth, published in `Software--Practice and -Experience' 19(7), July 1989.) - - [Karl writes.] My first ChangeLog entry for Web2c seems to be -February 1990, but I may have done some work before then. In any case, -Tim Morgan and I were jointly maintaining it for a time. (I should -mention here that Tim had made Web2c into a real distribution long -before I had ever used it or even heard of it, and Tom Rokicki did the -original implementation. I was using `pxp' and `pc' on VAX 11/750's -and the hot new Sun 2 machines.) - - It must have been later in 1990 and 1991 that I started working on -`TeX for the Impatient'. Dvips, Xdvi, Web2c, and the GNU fontutils -(which I was also writing at the time) all used different environment -variables, and, more importantly, had different bugs in their path -searching. This became extremely painful, as I was stressing everything -to the limit working on the book. I also desperately wanted to -implement subdirectory searching, since I couldn't stand putting -everything in one big directory, and also couldn't stand having to -explicitly specify `cm', `pandora', ... in a path. - - In the first incarnation, I just hacked separately on each -program--that was the original subdirectory searching code in both Xdvi -and Dvips, though I think Paul Vojta has completely rewritten Xdvi's -support by now. That is, I tried to go with the flow in each program, -rather than changing the program's calling sequences to conform to -common routines. - - Then, as bugs inevitably appeared, I found I was fixing the same thing -three times (Web2c and fontutils were always sharing code, since I -maintained those--there was no Dvipsk or Xdvik or Dviljk at this -point). After a while, I finally started sharing source files. They -weren't yet a library, though. I just kept things up to date with shell -scripts. (I was developing on a 386 running ISC 2.2 at the time, and so -didn't have symbolic links. An awful experience.) - - The ChangeLogs for Xdvik and Dvipsk record initial releases of those -distributions in May and June 1992. I think it was because I was tired -of the different configuration strategies of each program, not so much -because of the path searching. (Autoconf was being developed by David -MacKenzie and others, and I was adapting it to TeX and friends.) - - I started to make a separate library that other programs could link -with on my birthday in April 1993, according to the ChangeLog. I don't -remember exactly why I finally took the time to make it a separate -library; a conversation with david zuhn that initiated it. Just seemed -like it was time. - - Dviljk got started in March 1994 after I bought a Laserjet 4. -(Kpathsea work got suspended while Norm Walsh and I, with Gustaf -Neumann's help, implemented a way for TeX to get at all those neat -builtin LJ4 fonts ... such a treat to have something to typeset in -besides Palatino!) - - By spring of 1995, I had implemented just about all the path-searching -features in Kpathsea that I plan to, driven beyond my initial goals by -Thomas Esser and others. I then started to integrate Web2c with -Kpathsea. After the release of a stable Web2c, I hope to be able to stop -development, and turn most of my attention back to making fonts for GNU. -(Always assuming Micros**t hasn't completely obliterated Unix by then, -or that software patents haven't stopped software development by anybody -smaller than a company with a million-dollar-a-year legal budget. Which -is actually what I think is likely to happen, but that's another -story...) - - [Olaf writes.] At the end of 1997, UNIX is still alive and kicking, -individuals still develop software, and Web2c development still -continues. Karl had been looking for some time for someone to take up -part of the burden, and I volunteered. - - -File: kpathsea.info, Node: Installation, Next: Path searching, Prev: Introduction, Up: Top - -Installation -************ - - (A copy of this chapter is in the distribution file -`kpathsea/INSTALL'.) - - The procedure for Kpathsea (and Web2c, etc.) configuration and -installation follows. If you encounter trouble, see *Note Common -problems::, a copy of which is in the file `kpathsea/BUGS'. - -* Menu: - -* Simple installation:: If you just want to do it. -* Custom installation:: If you want to change things around. -* Security:: Who can write what files, etc. -* TeX directory structure:: Managing the horde of TeX input files. -* unixtex.ftp:: Getting software via FTP, on CD-ROM, or on tape. -* Reporting bugs:: Where and how to report bugs. - - -File: kpathsea.info, Node: Simple installation, Next: Custom installation, Up: Installation - -Simple installation -=================== - - Installing TeX and friends for the first time can be a daunting -experience. Thus, you may prefer to skip this whole thing and just get -precompiled executables: see *Note unixtex.ftp::. - - This section explains what to do if you wish to take the defaults for -everything, and generally to install in the simplest possible way. Most -steps here refer to corresponding subsection in the next section which -explains how to override defaults and generally gives more details. - - By default everything will be installed under `/usr/local' and the -following discussion assumes this. However, if you already have TeX -installed, its location is used to derive the directory under which -everything is to be installed. - - 1. Be sure you have enough disk space: approximately 8 megabytes for - the compressed archives, 15MB for sources, 45MB for compilation, - 40MB for the (initial) installed system (including library files). - *Note Disk space::. - - 2. Retrieve these two distribution archives: - `ftp://ftp.tug.org/tex/texk.tar.gz' - These are the sources, which you will be compiling. - - `ftp://ftp.tug.org/tex/texmflib.tar.gz' - This is a basic set of input files. You should unpack it in - the directory `/usr/local/share'; doing so will create a - `texmf' subdirectory there. - - *Note Kpathsea application distributions::. - - 3. When using the default search paths, there is no need to edit any - distribution files. *Note Changing search paths::. - - 4. At the top level of the distribution, run `sh configure'. (If you - have the GNU Bash shell installed, run `bash configure'.) *Note - Running configure::. - - 5. `make'. *Note Running make::. If you are using a BSD 4.4 system - such as FreeBSD or NetBSD, use GNU make (often installed in - `/usr/local/bin'), not the BSD make. - - If you are using a HP-UX 10 system and the native compiler, - specify the `+u' flag in `XCFLAGS'. - - 6. `make install'. *Note Installing files::. - - 7. `make distclean'. *Note Cleaning up::. - - 8. Set up a cron job to rebuild the filename database that makes - searching faster. This line will rebuild it every midnight: - 0 0 * * * cd /usr/local/share/texmf && /BINDIR/mktexlsr - *Note Filename database generation::, and *Note Filename - database::. - - 9. If you're installing Dvips, you also need to set up configuration - files for your printers and make any additional PostScript fonts - available. *Note Installation: (dvips)Installation. If you have - any color printers, see *Note Color device configuration: - (dvips)Color device configuration. - - 10. The first time you run a DVI driver, a bunch of PK fonts will be - built by Metafont via `mktexpk' (and added to the filename - database). This will take some time. Don't be alarmed; they will - created only this first time (unless something is wrong with your - path definitions). - - By default, `mktexpk' will create these fonts in a hierarchy under - `/var/tmp/texfonts'; it simply assumes that `/var/tmp' exists and - is globally writable. If you need a different arrangement, see - *Note mktex configuration::. - - *Note mktex scripts::. - - 11. For some simple tests, try `tex story \\bye' and `latex sample2e'. - Then run `xdvi story' or `dvips sample2e' on the resulting DVI - files to preview/print the documents. *Note Installation - testing::. - - -File: kpathsea.info, Node: Custom installation, Next: Security, Prev: Simple installation, Up: Installation - -Custom installation -=================== - - Most sites need to modify the default installation procedure in some -way, perhaps merely changing the prefix from `/usr/local', perhaps -adding extra compiler or loader options to work around `configure' -bugs. This section explains how to override default choices. For -additional distribution-specific information: - * `dviljk/INSTALL'. - - * *Note Installation: (dvips)Installation. - - * *Note Installation: (web2c)Installation. - - * `xdvik/INSTALL'. - - These instructions are for Unix systems. Other operating-system -specific distributions have their own instructions. The code base -itself supports Amiga, DOS, OS/2, and VMS. - - Following are the same steps as in the previous section (which -describes the simplest installation), but with much more detail. - -* Menu: - -* Disk space:: -* Kpathsea application distributions:: -* Changing search paths:: -* Running configure:: -* Running make:: -* Installing files:: -* Cleaning up:: -* Filename database generation:: -* mktex scripts:: -* Installation testing:: - - -File: kpathsea.info, Node: Disk space, Next: Kpathsea application distributions, Up: Custom installation - -Disk space ----------- - - Here is a table showing the disk space needed for each distribution -(described in the next section). The `(totals)' line reflects the -`texk' source distribution and `texmflib'; the individual distributions -don't enter into it. Sizes are in megabytes. All numbers are -approximate. - -Distribution .tar.gz Unpacked Compiled Installed -dviljk .9 3.8 -dvipsk .9 3.2 -xdvik .7 2.5 -web2c 1.3 5.0 -web 1.9 6.5 - - -texk 3.8 14.1 43.1 23.5 -texmflib 3.8 15.0 - 15.0 -(totals) 7.6 29.1 43.1 38.5 - - -File: kpathsea.info, Node: Kpathsea application distributions, Next: Changing search paths, Prev: Disk space, Up: Custom installation - -Kpathsea application distributions ----------------------------------- - - The archive `ftp://ftp.tug.org/tex/texk.tar.gz' contains all of the -Kpathsea applications I maintain, and the library itself. For example, -since NeXT does not generally support X11, you'd probably want to skip -`xdvik' (or simply remove it after unpacking `texk.tar.gz'. If you are -not interested in all of them, you can also retrieve them separately: - -`dviljk.tar.gz' - DVI to PCL, for LaserJet printers. - -`dvipsk.tar.gz' - DVI to PostScript, for previewers, printers, or PDF generation. - -`web2c.tar.gz' - The software needed to compile TeX and friends. - -`web.tar.gz' - The original WEB source files, also used in compilation. - -`xdvik.tar.gz' - DVI previewing under the X window system. - - If you want to use the Babel LaTeX package for support of non-English -typesetting, you may need to retrieve additional files. See the file -`install.txt' in the Babel distribution. - - -File: kpathsea.info, Node: Changing search paths, Next: Running configure, Prev: Kpathsea application distributions, Up: Custom installation - -Changing search paths ---------------------- - - If the search paths for your installation differ from the standard -TeX directory structure (*note Introduction: (tds)Top.), edit the file -`kpathsea/texmf.in' as desired, before running `configure'. For -example, if you have all your fonts or macros in one big directory. - - You may also wish to edit the file `mktex.cnf', either before or -after installation, to control various aspects of `mktexpk' and -friends. *Note mktex configuration::. - - You do not need to edit `texmf.in' to change the default top-level or -other installation *directories* (only the paths). You can and should -do that when you run `configure' (next step). - - You also do not need to edit `texmf.in' if you are willing to rely on -`texmf.cnf' at runtime to define the paths, and let the compile-time -default paths be incorrect. Usually there is no harm in doing this. - - The section below explains default generation in more detail. - -* Menu: - -* Default path features:: -* Default path generation:: - - -File: kpathsea.info, Node: Default path features, Next: Default path generation, Up: Changing search paths - -Default path features -..................... - - The purpose of having all the different files described in the section -above is to avoid having the same information in more than one place. If -you change the installation directories or top-level prefix at -`configure'-time, those changes will propagate through the whole -sequence. And if you change the default paths in `texmf.in', those -changes are propagated to the compile-time defaults. - - The Make definitions are all repeated in several Makefile's; but -changing the top-level `Makefile' should suffice, as it passes down all -the variable definitions, thus overriding the submakes. (The -definitions are repeated so you can run Make in the subdirectories, if -you should have occasion to.) - - By default, the bitmap font paths end with `/$MAKETEX_MODE', thus -including the device name (usually a Metafont mode name such as -`ljfour'). This distinguishes two different devices with the same -resolution--a write/white from a write/black 300dpi printer, for -example. - - However, since most sites don't have this complication, Kpathsea -(specifically, the `kpse_init_prog' function in `kpathsea/proginit.c') -has a special case: if the mode has not been explicitly set by the user -(or in a configuration file), it sets `MAKETEX_MODE' to `/'. This -makes the default PK path, for example, expand into `.../pk//', so -fonts will be found even if there is no subdirectory for the mode (if -you arranged things that way because your site has only one printer, -for example) or if the program is mode-independent (e.g., `pktype'). - - To make the paths independent of the mode, simply edit `texmf.in' -before installation, or the installed `texmf.cnf', and remove the -`$MAKETEX_MODE'. - - *Note mktex script arguments::, for how this interacts with `mktexpk'. - - *Note TeX directory structure: TeX directory structure, for a -description of the default arrangement of the input files that comprise -the TeX system. The file `kpathsea/HIER' is a copy of that section. - - -File: kpathsea.info, Node: Default path generation, Prev: Default path features, Up: Changing search paths - -Default path generation -....................... - - This section describes how the default paths are constructed. - - You may wish to ignore the whole mess and simply edit `texmf.cnf' -after it is installed, perhaps even copying it into place beforehand so -you can complete the installation, if it seems necessary. - - To summarize the chain of events that go into defining the default -paths: - - 1. `configure' creates a `Makefile' from each `Makefile.in'. - - 2. When Make runs in the `kpathsea' directory, it creates a file - `texmf.sed' that substitutes the Make value of `$(var)' for a - string `@var@'. The variables in question are the one that define - the installation directories. - - 3. `texmf.sed' (together with a little extra magic--see - `kpathsea/Makefile') is applied to `texmf.in' to generate - `texmf.cnf'. This is the file that will eventually be installed - and used. - - 4. The definitions in `texmf.cnf' are recast as C `#define''s in - `paths.h'. These values will be the compile-time defaults; they - are not used at runtime unless no `texmf.cnf' file can be found. - - (That's a lie: the compile-time defaults are what any extra :'s in - `texmf.cnf' expand into; but the paths as distributed have no extra - :'s, and there's no particular reason for them to.) - - -File: kpathsea.info, Node: Running configure, Next: Running make, Prev: Changing search paths, Up: Custom installation - -Running `configure' -------------------- - - Run `sh configure OPTIONS' (in the top-level directory, the one -containing `kpathsea/'), possibly using a shell other than `sh' (*note -configure shells::.). - - `configure' adapts the source distribution to the present system via -`#define''s in `*/c-auto.h', which are created from the corresponding -`c-auto.in'. It also creates a `Makefile' from the corresponding -`Makefile.in', doing `@VAR@' and `ac_include' substitutions). - - `configure' is the best place to control the configuration, -compilation, and installed location of the software, either via -command-line options, or by setting environment variables before -invoking it. For example, you can disable `mktexpk' by default with -the option `--disable-mktexpk'. *Note configure options::. - -* Menu: - -* configure shells:: -* configure options:: -* configure environment:: -* configure scenarios:: -* Shared library:: - - -File: kpathsea.info, Node: configure shells, Next: configure options, Up: Running configure - -`configure' shells -.................. - - If you have Bash, the GNU shell, use it if `sh' runs into trouble -(*note Top: (features)Top.). - - Most Bourne shell variants other than Bash cannot handle `configure' -scripts as generated by GNU Autoconf (*note Introduction: -(autoconf)Top.). Specifically: -`ksh' - The Korn shell may be installed as `/bin/sh' on AIX. `/bin/bsh' - may serve instead. - -`ash' - Ash is sometimes installed as `/bin/sh' on NetBSD, FreeBSD, and - Linux systems. `/bin/bash' should be available. - -`Ultrix /bin/sh' - `/bin/sh' under Ultrix is a DEC-grown shell that is notably - deficient in many ways. `/bin/sh5' may be necessary. - - -File: kpathsea.info, Node: configure options, Next: configure environment, Prev: configure shells, Up: Running configure - -`configure' options -................... - - For a complete list of all `configure' options, run `configure ---help' or see *Note Running `configure' scripts: (autoconf)Invoking -configure, (a copy is in the file `kpathsea/README.CONFIGURE'). The -generic options are listed first in the `--help' output, and the -package-specific options come last. The environment variables -`configure' pays attention to are listed below. - - Options particularly likely to be useful are `--prefix', `--datadir', -and the like; see *Note configure scenarios::. - - This section gives pointers to descriptions of the `--with' and -`--enable' options to `configure' that Kpathsea-using programs accept. - -`--without-mktexmf-default' -`--without-mktexpk-default' -`--without-mktextfm-default' -`--with-mktextex-default' - Enable or disable the dynamic generation programs. *Note mktex - configuration::. - -`--enable-shared' - Build Kpathsea as a shared library, and link against it. Also - build the usual static library. *Note Shared library::. - -`--disable-static' - Build only the shared library. Implies `--enable-shared'. - -`--enable-maintainer-mode' - Enables make targets that are useful for the maintainer and likely - to be a pain for anyone else; the makefiles created when this - option is enabled may not work at all for you. You have been - warned. - - -File: kpathsea.info, Node: configure environment, Next: configure scenarios, Prev: configure options, Up: Running configure - -`configure' environment -....................... - - `configure' uses the value of the following environment variables in -determining your system's characteristics, and substitutes for them in -Makefile's: - -`CC' - The compiler to use: default is `gcc' if it's installed, otherwise - `cc'. - -`CFLAGS' - Options to give the compiler: default is `-g -O2' for `gcc', `-g' - otherwise. `CFLAGS' comes after any other options. You may need - to include `-w' here if your compilations commonly have useless - warnings (e.g., `NULL redefined'), or `configure' may fail to - detect the presence of header files (it takes the messages on - standard error to mean the header file doesn't exist). - -`CPPFLAGS' - Options to pass to the compiler preprocessor; this matters most for - configuration, not the actual source compilation. The `configure' - script often does only preprocessing (e.g., to check for the - existence of #include files), and `CFLAGS' is not used for this. - You may need to set this to something like - `-I/usr/local/include/wwwhatever' if you have the libwww library - installed for hyper-xdvik (see `xdvik/INSTALL'). - -`DEFS' - Additional preprocessor options, but not used by `configure'. - Provided for enabling or disabling program features, as documented - in the various program-specific installation instructions. `DEFS' - comes before any compiler options included by the distribution - `Makefile's or by `configure'. - -`LDFLAGS' - Additional options to give to the loader. `LDFLAGS' comes before - any other linker options. - -`LIBS' - Additional libraries to link with. - - -File: kpathsea.info, Node: configure scenarios, Next: Shared library, Prev: configure environment, Up: Running configure - -`configure' scenarios -..................... - - Here are some common installation scenarios: - - * Including X support in Metafont. This is disabled by default, - since many sites have no use for it, and it's a leading cause of - configuration problems. - configure --with-x-toolkit - - * Putting the binaries, TeX files, GNU info files, etc. into a single - TeX hierarchy, say `/texmf', requires overriding defaults in both - `configure' and `make': - configure --prefix=`/texmf' --datadir=`/texmf' - make texmf=`/texmf' - - * You can compile on multiple architectures simultaneously either by - building symbolic link trees with the `lndir' script from the X11 - distribution, or with the `--srcdir' option: - configure --srcdir=SRCDIR - - * If you are installing binaries for multiple architectures into a - single hierarchy, you will probably want to override the default - `bin' and `lib' directories, something like this: - configure --prefix=TEXMF --datadir=TEXMF \ - --bindir=TEXMF/ARCH/bin --libdir=TEXMF/ARCH/lib - make texmf=TEXMF - (Unless you make provisions for architecture-specific files in - other ways, e.g., with Depot or an automounter.) - - * To compile with optimization (to compile without debugging, remove - the `-g'): - env CFLAGS="-g -O" sh configure ... - For a potential problem if you optimize, see *Note TeX or - Metafont failing: TeX or Metafont failing. - - -File: kpathsea.info, Node: Shared library, Prev: configure scenarios, Up: Running configure - -Shared library -.............. - - You can compile Kpathsea as a shared library on a few systems, by -specifying the option `--enable-shared' when you run `configure'. - - The main advantage in doing this is that the executables can then -share the code, thus decreasing memory and disk space requirements. - - On some systems, you can record the location of shared libraries in a -binary, usually by giving certain options to the linker. Then -individual users do not need to set their system's environment variable -(e.g., `LD_LIBRARY_PATH') to find shared libraries. If you want to do -this, you will need to add the necessary options to `LDFLAGS' yourself; -for example, on Solaris, include something like `-R${prefix}/lib', on -IRIX or Linux, use `-rpath${prefix}/lib'. (Unfortunately, making this -happen by default is very difficult, because of interactions with an -existing installed shared library.) - - Currently, shared library support is implemented only on Linux, SunOS -4 (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6. If you're -interested and willing in adding support for other systems, please see -the `configure' mode in the `klibtool' script, especially the -host-specific case statement around line 250. - - -File: kpathsea.info, Node: Running make, Next: Installing files, Prev: Running configure, Up: Custom installation - -Running `make' --------------- - - `make' (still in the top-level directory). This also creates the -`texmf.cnf' and `paths.h' files that define the default search paths, -and (by default) the `plain' and `latex' TeX formats. - - You can override directory names and other values at `make'-time. -`make/paths.make' lists the variables most commonly reset. For -example, `make default_texsizes=600' changes the list of fallback -resolutions. - - You can also override each of `configure''s environment variables -(*note configure environment::.). The Make variables have the same -names. - - Finally, you can supply additional options via the following -variables. (`configure' does not use these.) - -`XCPPFLAGS' -`XDEFS' - Preprocessor options. - -`XCFLAGS' - Compiler options. - -`XLDFLAGS' - Loader options (included at beginning of link commands). - -`XLOADLIBES' - More loader options (included at end of link commands). - -`XMAKEARGS' - Additional Make arguments passed to all sub-`make''s. You may need - to include assignments to the other variables here via `XMAKEARGS'; - for example: `make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"'. - - It's generally a bad idea to use a different compiler (`CC') or -libraries (`LIBS') for compilation than you did for configuration, -since the values `configure' determined may then be incorrect. - - Adding compiler options to change the "universe" you are using -(typically BSD vs. system V) is generally a cause of trouble. It's -best to use the native environment, whatever that is; `configure' and -the software usually adapt best to that. In particular, under Solaris -2.x, you should not use the BSD-compatibility library (`libucb') or -include files (`ucbinclude'). - - If you want to use the Babel LaTeX package for support of non-English -typesetting, you need to modify some files before making the LaTeX -format. See the file `install.txt' in the Babel distribution. - - -File: kpathsea.info, Node: Installing files, Next: Cleaning up, Prev: Running make, Up: Custom installation - -Installing files ----------------- - - The basic command is the usual `make install'. For security issues, -*note Security::.. - - The first time you install any manual in the GNU Info system, you -should add a line (you choose where) to the file `dir' in your -`$(infodir)' directory. Sample text for this is given near the top of -the Texinfo source files (`kpathsea/kpathsea.texi', -`dvipsk/dvips.texi', and `web2c/doc/web2c.texi'). If you have a recent -version of the GNU Texinfo distribution installed -(`ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-3.9.tar.gz' or later), this -should happen automatically. - - On the offchance that this is your first Info installation, the `dir' -file I use is included in the distribution as `etc/dir-example'. - - You may wish to use one of the following targets, especially if you -are installing on multiple architectures: - * `make install-exec' to install in architecture-dependent - directories, i.e., ones that depend on the `$(exec_prefix)' Make - variable. This includes links to binaries, libraries, etc., not - just "executables". - - * `make install-data' to install in architecture-independent - directories, such as documentation, configuration files, pool - files, etc. - - If you use the Andrew File System, the normal path (e.g., PREFIX/bin) -only gets you to a read-only copy of the files, and you must specify a -different path for installation. The best way to do this is by setting -the `prefix' variable on the `make' command line. The sequence becomes -something like this: - configure --prefix=/whatever - make - make install prefix=/afs/.SYSTEM.NAME/system/1.3/@sys/whatever - With AFS, you will definitely want to use relative filenames in -`ls-R' (*note Filename database::.), not absolute filenames. This is -done by default, but check anyway. - - -File: kpathsea.info, Node: Cleaning up, Next: Filename database generation, Prev: Installing files, Up: Custom installation - -Cleaning up ------------ - -The basic command is `make distclean'. This removes all files created -by the build. - - Alternatively, - * `make mostlyclean' if you intend to compile on another - architecture. For Web2C, since the generated C files are portable, - they are not removed. If the `lex' vs. `flex' situation is going - to be different on the next machine, `rm web2c/lex.yy.c'. - - * `make clean' to remove files created by compiling, but leave - configuration files and Makefiles. - - * `make maintainer-clean' to remove everything that the Makefiles can - rebuild. This is more than `distclean' removes, and you should - only use it if you are thoroughly conversant with (and have the - necessary versions of) Autoconf. - - * `make extraclean' to remove other junk, e.g., core files, log - files, patch rejects. This is independent of the other `clean' - targets. - - -File: kpathsea.info, Node: Filename database generation, Next: mktex scripts, Prev: Cleaning up, Up: Custom installation - -Filename database generation ----------------------------- - - You will probably want to set up a `cron' entry on the appropriate -machine(s) to rebuild the filename database nightly or so, as in: - 0 0 * * * cd TEXMF && /BINDIR/mktexlsr - *Note Filename database::. - -Although the `mktex...' scripts make every effort to add newly-created -files on the fly, it can't hurt to make sure you get a fresh version -every so often. - - -File: kpathsea.info, Node: mktex scripts, Next: Installation testing, Prev: Filename database generation, Up: Custom installation - -`mktex' scripts ---------------- - - If Kpathsea cannot otherwise find a file, for some file types it is -configured by default to invoke an external program to create it -dynamically (*note mktex configuration::.). This is most useful for -fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as -the Sauter and EC fonts), since any given document can use fonts never -before referenced. Trying to build all fonts in advance is therefore -impractical, if not impossible. - - The script is passed the name of the file to create and possibly other -arguments, as explained below. It must echo the full pathname of the -file it created (and nothing else) to standard output; it can write -diagnostics to standard error. - -* Menu: - -* mktex configuration:: -* mktex script names:: -* mktex script arguments:: - - -File: kpathsea.info, Node: mktex configuration, Next: mktex script names, Up: mktex scripts - -`mktex' configuration -..................... - - The following file types can run an external program to create missing -files: `pk', `tfm', `mf', `tex'; the scripts are named `mktexpk', -`mktextfm', `mktexmf', and `mktextex'. - - In the absence of `configure' options specifying otherwise, -everything but `mktextex' will be enabled by default. The `configure' -options to change the defaults are: - - --without-mktexmf-default - --without-mktexpk-default - --without-mktextfm-default - --with-mktextex-default - - The `configure' setting is overridden if the environment variable or -configuration file value named for the script is set; e.g., `MKTEXPK' -(*note mktex script arguments::.). - - As distributed, all the scripts source a file `texmf/web2c/mktex.cnf' -if it exists, so you can override various defaults. See `mktex.opt', -for instance, which defines the default mode, resolution, some special -directory names, etc. If you prefer not to change the distributed -scripts, you can simply create `mktex.cnf' with the appropriate -definitions (you do not need to create it if you have nothing to put in -it). `mktex.cnf' has no special syntax; it's an arbitrary Bourne shell -script. The distribution contains a sample `mktex.cnf' for you to copy -and modify as you please (it is not installed anywhere). - - In addition, you can configure a number of features with the -`MT_FEATURES' variable, which you can define: - * in `mktex.opt', as just mentioned; - - * by editing the file `mktex.opt', either before `make install' (in - the source hierarchy) or after (in the installed hierarchy); - - * or in the environment. - - If none of the options below are enabled, `mktexpk', `mktextfm', and -`mktexmf' follow the following procedure to decide where fonts should -be installed. Find the tree where the font's sources are, and test the -permissions of the `fonts' directory of that tree to determine whether -it is writable. If it is, put the files in the tree in appropriate -locations. If it isn't writable, see whether the tree is a system tree -(named in `SYSTEXMF'). If so, the `VARTEXFONTS' tree is used. In all -other cases the working directory is used. - - The `appendonlydir' option is enabled by default. - -`appendonlydir' - Tell `mktexdir' to create directories append-only, i.e., set their - sticky bit (*note Mode Structure: (fileutils)Mode Structure.). - This feature is silently ignored on non-Unix platforms (e.g. - Windows/NT and MS-DOS) which don't support similar functionality. - This feature is enabled by default. - -`dosnames' - Use 8.3 names; e.g., `dpi600/cmr10.pk' instead of `cmr10.600pk'. - Note that this feature only affects filenames that would otherwise - clash with other TeX-related filenames; `mktex' scripts do nothing - about filenames which exceed the 8+3 MS-DOS limits but remain - unique when truncated (by the OS) to these limits, and nether do - the scripts care about possible clashes with files which aren't - related with TeX. For example, `cmr10.600pk' would clash with - `cmr10.600gf' and is therefore changed when `dosnames' is in - effect, but `mf.pool' and `mp.base' don't clash with any - TeX-related files and are therefore unchanged. - - This feature is turned on by default on MS-DOS. If you do not wish - `dosnames' to be set on an MS-DOS platform, you need to set the - `MT_FEATURES' environment variable to a value that doesn't include - `dosnames'. You can also change the default setting by editing - `mktex.opt', but only if you use the `mktex' shell scripts; the - emulation programs don't consult `mktex.opt'. - -`fontmaps' - Instead of deriving the location of a font in the destination tree - from the location of the sources, the aliases and directory names - from the Fontname distribution are used. (*note Introduction: - (fontname)Top.). - -`nomode' - Omit the directory level for the mode name; this is fine as long as - you generate fonts for only one mode. - -`stripsupplier' - Omit the font supplier name directory level. - -`striptypeface' - Omit the font typeface name directory level. - -`strip' - Omit the font supplier and typeface name directory levels. This - feature is deprecated in favour of `stripsupplier' and - `striptypeface'. - -`varfonts' - When this option is enabled, fonts that would otherwise be written - in system texmf tree go to the `VARTEXFONTS' tree instead. The - default value in `kpathsea/Makefile.in' is `/var/tmp/texfonts'. - The `Linux File System Standard' recommends `/var/tex/fonts'. - - The `varfonts' setting in `MT_FEATURES' is overridden by the - `USE_VARTEXFONTS' environment variable: if set to `1', the feature - is enabled, and if set to `0', the feature is disabled. - - -File: kpathsea.info, Node: mktex script names, Next: mktex script arguments, Prev: mktex configuration, Up: mktex scripts - -`mktex' script names -.................... - - The following table shows the default name of the script for each -possible file types. (The source is the variable `kpse_make_specs' in -`kpathsea/tex-make.c'.) - -`mktexpk' - Glyph fonts. - -`mktextex' - TeX input files. - -`mktexmf' - Metafont input files. - -`mktextfm' - TFM files. - -These names are overridden by an environment variable specific to the -program--for example, `DVIPSMAKEPK' for Dvipsk. - - If a `mktex...' script fails, the invocation is appended to a file -`missfont.log' (by default) in the current directory. You can then -execute the log file to create the missing files after fixing the -problem. - - If the current directory is not writable and the environment variable -or configuration file value `TEXMFOUTPUT' is set, its value is used. -Otherwise, nothing is written. The name `missfont.log' is overridden -by the `MISSFONT_LOG' environment variable or configuration file value. - - -File: kpathsea.info, Node: mktex script arguments, Prev: mktex script names, Up: mktex scripts - -`mktex' script arguments -........................ - - The first argument to a `mktex' script is always the name of the file -to be created. - - In the default `mktexpk' implementation, additional arguments may -also be passed: - -`--dpi NUM' - Sets the resolution of the generated font to NUM. - -`--mfmode NAME' - Sets the Metafont mode to NAME. - -`--bdpi NUM' - Sets the the "base dpi" for the font. This must match the mode - being used. - -`--mag STRING' - A "magstep" string suitable for the Metafont `mag' variable. This - must match the combination of BDPI and DPI being used. - -`--destdir STRING' - A directory name. If the directory is absolute, it is used as-is. - Otherwise, it is appended to the root destination directory set in - the script. - - -File: kpathsea.info, Node: Installation testing, Prev: mktex scripts, Up: Custom installation - -Installation testing --------------------- - - Besides the tests listed in *Note Simple installation::, you can try -running `make check'. This includes the torture tests (trip, trap, and -mptrap) that come with Web2c (*note Triptrap: (web2c)Triptrap.). - - -File: kpathsea.info, Node: Security, Next: TeX directory structure, Prev: Custom installation, Up: Installation - -Security -======== - - None of the programs in the TeX system require any special system -privileges, so there's no first-level security concern of people gaining -illegitimate root access. - - A TeX document, however, can write to arbitrary files, e.g., -`~/.rhosts', and thus an unwitting user who runs TeX on a random -document is vulnerable to a trojan horse attack. This loophole is -closed by default, but you can be permissive if you so desire in -`texmf.cnf'. *Note tex invocation: (web2c)tex invocation. MetaPost has -the same issue. - - Dvips, Xdvi, and TeX can also execute shell commands under some -circumstances. To disable this, see the `-R' option in *Note Option -details: (dvips)Option details, the xdvi man page, and *Note tex -invocation: (web2c)tex invocation, respectively. - - Another security issue arises because it's very useful--almost -necessary--to make arbitrary fonts on user demand with `mktexpk' and -friends. Where do these files get installed? By default, the -`mktexpk' distributed with Kpathsea assumes a world-writable `/var/tmp' -directory; this is a simple and convenient approach, but it may not -suit your situation because it means that a local cache of fonts is -created on every machine. - - To avoid this duplication, many people consider a shared, globally -writable font tree desirable, in spite of the potential security -problems. To do this you should change the value of `VARTEXFONTS' in -`texmf.cnf' to refer to some globally known directory. *Note mktex -configuration::. - - The first restriction you can apply is to make newly-created -directories under `texmf' be append-only with an option in `mktex.cnf'. -*Note mktex configuration::. - - Another approach is to establish a group (or user) for TeX files, -make the `texmf' tree writable only to that group (or user), and make -`mktexpk' et al. setgid to that group (or setuid to that user). Then -users must invoke the scripts to install things. (If you're worried -about the inevitable security holes in scripts, then you could write a -C wrapper to exec the script.) - - The `mktex...' scripts install files with the same read and write -permissions as the directory they are installed in. The executable, -sgid, suid, and sticky bits are always cleared. - - Any directories created by the `mktex...' scripts have the same -permissions as their parent directory, unless the `appendonlydir' -feature is used, in which case the sticky bit is always set. - - -File: kpathsea.info, Node: TeX directory structure, Next: unixtex.ftp, Prev: Security, Up: Installation - -TeX directory structure -======================= - - This section describes the default installation hierarchy of the -distribution. It conforms to both the GNU coding standards and the TeX -directory structure (TDS) standard. For rationale and further -explanation, please see those documents. The GNU standard is available -as `ftp://ftp.gnu.org/pub/gnu/standards/standards.texi' and -mirrors. The TDS document is available from `CTAN:/tex-archive/tds' -(*note unixtex.ftp::.). - - You can change the default paths in many ways (*note Changing search -paths::.). One common desire is to put everything (binaries and all) -under a single top-level directory such as `/usr/local/texmf' or -`/opt/texmf'--in the terms used below, make PREFIX and TEXMF the same. -For specific instructions on doing that, see *Note configure -scenarios::. - - Here is a skeleton of the default directory structure, extracted from -the TDS document: - - PREFIX/ installation root (`/usr/local' by default) - bin/ executables - man/ man pages - include/ C header files - info/ GNU info files - lib/ libraries (`libkpathsea.*') - share/ architecture-independent files - texmf/ TDS root - bibtex/ BibTeX input files - bib/ BibTeX databases - base/ base distribution (e.g., `xampl.bib') - misc/ single-file databases - PKG/ name of a package - bst/ BibTeX style files - base/ base distribution (e.g., `plain.bst', `acm.bst') - misc/ single-file styles - PKG/ name of a package - doc/ additional documentation - dvips/ `.pro', `.ps', `psfonts.map' - fonts/ font-related files - TYPE/ file type (e.g., `tfm', `pk') - MODE/ type of output device (types `pk' and `gf' only) - SUPPLIER/ name of a font supplier (e.g., `public') - TYPEFACE/ name of a typeface (e.g., `cm') - dpiNNN/ font resolution (types `pk' and `gf' only) - metafont/ Metafont (non-font) input files - base/ base distribution (e.g., `plain.mf') - misc/ single-file packages (e.g., `modes.mf') - PKG/ name of a package (e.g., `mfpic') - metapost/ MetaPost input files - base/ base distribution (e.g., `plain.mp') - misc/ single-file packages - PKG/ name of a package - support/ support files for MetaPost-related utilities (e.g., `trfonts.map') - mft/ `MFT' inputs (e.g., `plain.mft') - tex/ TeX input files - FORMAT/ name of a format (e.g., `plain') - base/ base distribution for FORMAT (e.g., `plain.tex') - misc/ single-file packages (e.g., `webmac.tex') - local/ local additions to or local configuration files for FORMAT - PKG/ name of a package (e.g., `graphics', `mfnfss') - generic/ format-independent packages - hyphen/ hyphenation patterns (e.g., `hyphen.tex') - images/ image input files (e.g., Encapsulated PostScript) - misc/ single-file format-independent packages (e.g., `null.tex'). - PKG/ name of a package (e.g., `babel') - web2c/ implementation-dependent files (`.pool', `.fmt', `texmf.cnf', etc.) - - Some concrete examples for most file types: - - /usr/local/bin/tex - /usr/local/man/man1/xdvi.1 - /usr/local/info/kpathsea.info - /usr/local/lib/libkpathsea.a - /usr/local/share/texmf/bibtex/bst/base/plain.bst - /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk - /usr/local/share/texmf/fonts/source/public/pandora/pnr10.mf - /usr/local/share/texmf/fonts/tfm/public/cm/cmr10.tfm - /usr/local/share/texmf/fonts/type1/adobe/utopia/putr.pfa - /usr/local/share/texmf/metafont/base/plain.mf - /usr/local/share/texmf/metapost/base/plain.mp - /usr/local/share/texmf/tex/plain/base/plain.tex - /usr/local/share/texmf/tex/generic/hyphen/hyphen.tex - /usr/local/share/texmf/web2c/tex.pool - /usr/local/share/texmf/web2c/tex.fmt - /usr/local/share/texmf/web2c/texmf.cnf - - -File: kpathsea.info, Node: unixtex.ftp, Next: Reporting bugs, Prev: TeX directory structure, Up: Installation - -`unixtex.ftp': Obtaining TeX -============================ - - This is `ftp://ftp.tug.org/tex/unixtex.ftp', last updated 18 March -1998. Also available as `http://www.tug.org/unixtex.ftp'. The IP -address is currently `[158.121.106.10]', and the canonical host name is -currently `tug.org'. It is also in Kpathsea source distributions as -`etc/unixtex.ftp' (although the network version is usually newer). -Mail <kb@mail.tug.org> with comments or questions. - - Following are general instructions for Unix or other sites who wish to -acquire the Web2c distribution, (plain) TeX, LaTeX (2e), BibTeX, -Metafont, MetaPost, DVI processors for the X window system, PostScript, -the PCL language in the HP LaserJet, and related programs. They are -oriented towards building from the original sources, though some -information on alternative packages is included in the last section. -See also `http://www.tug.org/web2c', the Web2c and Kpathsea home page. - - Please consider joining the TeX Users Group (TUG) to help support the -maintenance and development of the programs you retrieve. Email -<tug@tug.org> or see `http://www.tug.org' for information and a -membership form. - - For actual installation instructions after obtaining the necessary -sources, see *Note Installation::. A copy is in the distribution file -`kpathsea/INSTALL'. - -* Menu: - -* Electronic distribution:: CTAN and so forth. -* CD-ROM distribution:: -* Tape distribution:: -* Other TeX packages:: - - -File: kpathsea.info, Node: Electronic distribution, Next: CD-ROM distribution, Up: unixtex.ftp - -Electronic distribution ------------------------ - - In many places we refer to CTAN:. This is *both* a host name and a -directory name. Here are some primary locations: - - `ftp://ctan.tug.org/tex-archive' (California, USA) - `ftp://ftp.dante.de/tex-archive' (Germany) - `ftp://ftp.tex.ac.uk/tex-archive' (England) - -CTAN has many mirrors worldwide; see the top-level file -`README.mirrors' from one of the sites above, or finger -<ctan@ftp.tug.org>, or see `http://www.tug.org/CTAN.sites'. A list -current as of the time of distribution is in the top-level file -`./MIRROR'. - - You can also access CTAN via the World Wide Web, Gopher, electronic -mail, or NFS. The same `README.mirrors' file explains how. - - You will need to retrieve some or all of the following archives, -depending on your needs (don't forget to set binary mode for file -transfers): - -`CTAN:/systems/web2c/texmflib.tar.gz' - A basic collection of fonts (TFM files only) and macro packages - (including Texinfo and LaTeX 2e). It unpacks into `texmf/'; if - you change the structure of this hierarchy, you will also have to - change the default search paths (*note Changing search paths::.). - It is required unless you already have these files, in which case - you should change the default paths as necessary to find them. - There are other packages of library files, `etexlib.tar.gz', - `omegalib.tar.gz', and `pdftexlib.tar.gz', that are required as - well if you install e-TeX, Omega, or pdfTeX respectively. - -`CTAN:/systems/web2c/web.tar.gz' - The original WEB source files, written mostly by Don Knuth. - Required unless you already have this `web' version. (The WEB - sources change irregularly with respect to Web2c itself.) Unpacks - into `web2c-VERSION'. - -`CTAN:/systems/web2c/web2c.tar.gz' - The Web2c system. Required. Also unpacks into `web2c-VERSION'. - -`CTAN:/systems/web2c/web2c-etex.tar.gz' - Additions to the Web2c system for building e-TeX. Optional. Also - unpacks into `web2c-VERSION'. - -`CTAN:/systems/web2c/web2c-omega.tar.gz' - Additions to the Web2c system for building Omega. Optional. Also - unpacks into `web2c-VERSION'. - -`CTAN:/systems/web2c/web2c-pdftex.tar.gz' - Additions to the Web2c system for building pdfTeX. Optional. Also - unpacks into `web2c-VERSION'. - -`CTAN:/systems/web2c/texk.tar.gz' - The web and web2c sources, plus the additions for web2c, plus the - dvi drivers mentioned below, plus extra dvi drivers and tools not - packaged separately. Recommended if you want to build a complete - system. Unpacks into `texk-VERSION'. - -`CTAN:/dviware/dvipsk/dvipsk.tar.gz' - DVI-to-PostScript translator. Unpacks into `dvipsk-VERSION'. - Optional. - -`CTAN:/dviware/xdvik/xdvik.tar.gz' - X window system DVI previewer. Unpacks into `xdvik-VERSION'. - Optional. - -`CTAN:/dviware/dviljk/dviljk.tar.gz' - DVI-to-PCL (HP LaserJet) translator. Unpacks into - `dviljk-VERSION'. Optional. - - All that said, the originating host for the software above is -`ftp.tug.org'. You can retrieve these distributions (but not much -else) from the `tex/' directory on that host. - - -File: kpathsea.info, Node: CD-ROM distribution, Next: Tape distribution, Prev: Electronic distribution, Up: unixtex.ftp - -CD-ROM distribution -------------------- - - Numerous organizations distribute various TeX CD-ROM's: - - * TUG, UK TUG, and GUTenberg (French-speaking TeX user group) - collaborated to produce the `TeX Live' CD-ROM, based on teTeX, - which in turn is based on Web2c; email <tex-live@mail.tug.org> or - see `http://www.tug.org/tex-live.html'. - - * Dante (the German-speaking TeX user group) has produced a CD-ROM. - See `http://www.dante.de/dante/DANTE-CTAN-CD-ROM.html', and - `http://www.dante.de/tex-informationen/CD-ROMs.html' for - information about TeX CD's in general. Both are in German. - - * The Free Software Foundation's `Source Code CD-ROM' contains the - minimal TeX source distribution described in the previous section - (i.e., enough to print GNU documentation); email - <gnu@gnu.org>. - - * The Gateway! CD-ROM set contains a runnable NetBSD/Amiga - distribution and sources; see - `http://www.netbsd.org/Sites/cdroms.html'. - - * The InfoMagic CD-ROM is a copy of CTAN (see previous section); see - `http://www.infomagic.com'. - - * NTG (Dutch-speaking TeX user group) produced the 4allTeX CD-ROM; - email <ntg@nic.surfnet.nl>, or see `http://www.ntg.nl/4allcd/'. - This is a runnable system. - - * The Prime Time TeXcetera CD-ROM is also a copy of CTAN; email - <ptf@ctcl.com> or see `http://www.ptf.com/ptf/'. - - * Walnut Creek's TeX CD-ROM is also a copy of CTAN; email - <info@cdrom.com> or see `http://www.cdrom.com:/titles/tex.html'. - - * Most Linux distributions include some TeX package based on Web2c; - see the Linux documentation file `Distribution-HOWTO' for a - comparison of Linux distributions, available (for example) via - `http://www.linux.org'. - - If you know of additional TeX CD-ROM distributions to add to this -list, please inform <kb@mail.tug.org>. - - -File: kpathsea.info, Node: Tape distribution, Next: Other TeX packages, Prev: CD-ROM distribution, Up: unixtex.ftp - -Tape distribution ------------------ - - You can obtain a complete TeX distribution, including Web2c, on tape. -Contact: - Pierre MacKay / Denny Hall, Mail Stop DH-10 / Department of Classics - University of Washington / Seattle, WA 98195 / USA - phone: 206-543-2268; email: <unixtex@u.washington.edu> - - At this writing, the distribution is available in `tar' format on 1/4 -inch 4-track QIC-24 cartridges and 4mm DAT cartridges, and the cost is -US$210. Make checks payable to the University of Washington, drawn on -a U.S. bank. Purchase orders are acceptable, but they carry an extra -charge of $10 to pay for invoice processing. Overseas sites, please -add $20 for shipment via air parcel post, or $30 for shipment via -courier. - - -File: kpathsea.info, Node: Other TeX packages, Prev: Tape distribution, Up: unixtex.ftp - -Other TeX packages ------------------- - - Many other TeX implementations are available in `CTAN:/systems', -including ready-to-run distributions for Unix, Amiga, Acorn, VMS, -Macintosh, DOS, and Windows (in various forms). Although Web2c has -support in the source code for many operating systems, and in fact some -of the other distributions are based on it, it's unlikely to work as -distributed on anything but Unix. (Please contribute improvements!) - - The Unix distribution alluded to above is the teTeX distribution. -This includes both complete sources and precompiled binaries for many -popular Unix variants, including Linux. It is based on Web2c, and -contains many other TeX-related programs as well. - - The host labrea.stanford.edu is the original source for the files for -which Donald Knuth is directly responsible: `tex.web', `plain.tex', -etc. However, unless you want to build your TeX library tree ab initio, -it is more reliable and less work to retrieve these files as part of -the above packages. In any case, labrea is not the canonical source for -anything except what was created by Stanford TeX project, so do not -rely on all the files available at that ftp site being up-to-date. - - -File: kpathsea.info, Node: Reporting bugs, Prev: unixtex.ftp, Up: Installation - -Reporting bugs -============== - - (A copy of this chapter is in the file `kpathsea/BUGS'.) - - If you have problems or suggestions, please report them to -<tex-k@mail.tug.org> using the bug checklist below. - - Please report bugs in the documentation; not only factual errors or -inconsistent behavior, but unclear or incomplete explanations, typos, -wrong fonts, ... - -* Menu: - -* Bug checklist:: What to include in a good bug report. -* Mailing lists:: Joining the bugs or announcements mailing lists. -* Debugging:: Analyzing runtime problems. -* Logging:: Recording searches. -* Common problems:: When things go wrong. - - -File: kpathsea.info, Node: Bug checklist, Next: Mailing lists, Up: Reporting bugs - -Bug checklist -------------- - - Before reporting a bug, please check below to be sure it isn't already -known (*note Common problems::.). - - Bug reports should be sent via electronic mail to -<tex-k@mail.tug.org>, or by postal mail to 135 Center Hill Road / -Plymouth, MA 02360 / USA. - - The general principle is that a good bug report includes all the -information necessary for reproduction. Therefore, to enable -investigation, your report should include the following: - - * The version number(s) of the program(s) involved, and of Kpathsea - itself. You can get the former by giving a sole option `--version' - to the program, and the latter by running `kpsewhich --version'. - The `NEWS' and `ChangeLog' files also contain the version number. - - * The hardware, operating system (including version number), - compiler, and `make' program you are using (the output of `uname - -a' is a start on the first two, though often incomplete). If the - bug involves the X window system, include X version and supplier - information as well (examples: X11R6 from MIT; X11R4 from HP; - OpenWindows 3.3 bundled with SunOS 4.1.4). - - * Any options you gave to `configure'. This is recorded in the - `config.status' files. - - If you are reporting a bug in `configure' itself, it's probably - system-dependent, and it will be unlikely the maintainers can do - anything useful if you merely report that thus-and-such is broken. - Therefore, you need to do some additional work: for some bugs, you - can look in the file `config.log' where the test that failed should - appear, along with the compiler invocation and source program in - question. You can then compile it yourself by hand, and discover - why the test failed. Other `configure' bugs do not involve the - compiler; in that case, the only recourse is to inspect the - `configure' shell script itself, or the Autoconf macros that - generated `configure'. - - * The log of all debugging output, if the bug is in path searching. - You can get this by setting the environment variable - `KPATHSEA_DEBUG' to `-1' before running the program. Please look - at the log yourself to make sure the behavior is really a bug - before reporting it; perhaps "old" environment variable settings - are causing files not to be found, for example. - - * The contents of any input files necessary to reproduce the bug. - For bugs in DVI-reading programs, for example, this generally - means a DVI file (and any EPS or other files it uses)--TeX source - files are helpful, but the DVI file is necessary, because that's - the actual program input. - - GNU `shar', available from `ftp://gnu.org/pub/gnu/shar' is a - convenient way of packaging multiple (possibly binary) files for - electronic mail. If you feel your input files are too big to send - by email, you can ftp them to `ftp://ftp.tug.org/incoming' (that - directory is writable, but not readable). - - * If you are sending a patch (do so if you can!), please do so in - the form of a context diff (`diff -c') against the original - distribution source. Any other form of diff is either not as - complete or harder for me to understand. Please also include a - `ChangeLog' entry. - - * If the bug involved is an actual crash (i.e., core dump), it is - easy and useful to include a stack trace from a debugger (I - recommend the GNU debugger GDB, available from - `ftp://gnu/org/pub/gnu/gdb'). If the cause is apparent (a - `NULL' value being dereferenced, for example), please send the - details along. If the program involved is TeX or Metafont, and - the crash is happening at apparently-sound code, however, the bug - may well be in the compiler, rather than in the program or the - library (*note TeX or Metafont failing: TeX or Metafont failing.). - - * Any additional information that will be helpful in reproducing, - diagnosing, or fixing the bug. - - -File: kpathsea.info, Node: Mailing lists, Next: Debugging, Prev: Bug checklist, Up: Reporting bugs - -Mailing lists -------------- - - Web2c and Kpathsea in general are discussed on the mailing list -<tex-k@mail.tug.org>. To join, email <tex-k-request@mail.tug.org> with -a line consisting of - - subscribe YOU@YOUR.PREFERRED.EMAIL.ADDRESS - -in the body of the message. - - You do not need to join to submit a report, nor will it affect whether -you get a response. There is no Usenet newsgroup equivalent (if you can -be the one to set this up, email `tex-k-request'). Traffic on the list -is fairly light, and is mainly bug reports and enhancement requests to -the software. The best way to decide if you want to join or not is -read some of the archives from `ftp://ftp.tug.org/mail/archives/tex-k/'. - - Be aware that large data files are sometimes included in bug reports. -If this is a problem for you, do not join the list. - - If you only want announcements of new releases, not bug reports and -discussion, join <tex-archive@math.utah.edu> (via mail to -<tex-archive-request@math.utah.edu>). - - If you are looking for general TeX help, such as how to use LaTeX, -please use the mailing list <info-tex@shsu.edu> mailing list, which is -gatewayed to the `comp.text.tex' Usenet newsgroup (or post to the -newsgroup; the gateway is bidirectional). - - -File: kpathsea.info, Node: Debugging, Next: Logging, Prev: Mailing lists, Up: Reporting bugs - -Debugging ---------- - - Kpathsea provides a number of runtime debugging options, detailed -below by their names and corresponding numeric values. When the files -you expect aren't being found, the thing to do is enable these options -and examine the output. - - You can set these with some runtime argument (e.g., `-d') to the -program; in that case, you should use the numeric values described in -the program's documentation (which, for Dvipsk and Xdvik, are different -than those below). It's best to give the `-d' (or whatever) option -first, for maximal output. Dvipsk and Xdvik have additional -program-specific debugging options as well. - - You can also set the environment variable `KPATHSEA_DEBUG'; in this -case, you should use the numbers below. If you run the program under a -debugger and set the variable `kpathsea_debug', also use the numbers -below. - - In any case, by far the simplest value to use is `-1', which will -turn on all debugging output. This is usually better than guessing -which particular values will yield the output you need. - - Debugging output always goes to standard error, so you can redirect it -easily. For example, in Bourne-compatible shells: - dvips -d -1 ... 2>/tmp/debug - - It is sometimes helpful to run the standalone Kpsewhich utility -(*note Invoking kpsewhich::.), instead of the original program. - - In any case, you can *not* use the *names* below; you must always use -somebody's numbers. (Sorry.) To set more than one option, just sum -the corresponding numbers. - -`KPSE_DEBUG_STAT (1)' - Report `stat'(2) calls. This is useful for verifying that your - directory structure is not forcing Kpathsea to do many additional - file tests (*note Slow path searching::., and *note Subdirectory - expansion::.). If you are using an up-to-date `ls-R' database - (*note Filename database::.), this should produce no output unless - a nonexistent file that must exist is searched for. - -`KPSE_DEBUG_HASH (2)' - Report lookups in all hash tables: `ls-R' and `aliases' (*note - Filename database::.); font aliases (*note Fontmap::.); and config - file values (*note Config files::.). Useful when expected values - are not being found, e.g.., file searches are looking at the disk - instead of using `ls-R'. - -`KPSE_DEBUG_FOPEN (4)' - Report file openings and closings. Especially useful when your - system's file table is full, for seeing which files have been - opened but never closed. In case you want to set breakpoints in a - debugger: this works by redefining `fopen' (`fclose') to be - `kpse_fopen_trace' (`kpse_fclose_trace'). - -`KPSE_DEBUG_PATHS (8)' - Report general path information for each file type Kpathsea is - asked to search. This is useful when you are trying to track down - how a particular path got defined--from `texmf.cnf', `config.ps', - an environment variable, the compile-time default, etc. This is - the contents of the `kpse_format_info_type' structure defined in - `tex-file.h'. - -`KPSE_DEBUG_EXPAND (16)' - Report the directory list corresponding to each path element - Kpathsea searches. This is only relevant when Kpathsea searches - the disk, since `ls-R' searches don't look through directory lists - in this way. - -`KPSE_DEBUG_SEARCH (32)' - Report on each file search: the name of the file searched for, the - path searched in, whether or not the file must exist (when drivers - search for `cmr10.vf', it need not exist), and whether or not we - are collecting all occurrences of the file in the path (as with, - e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with - most lookups). This can help you correlate what Kpathsea is doing - with what is in your input file. - -`KPSE_DEBUG_VARS (64)' - Report the value of each variable Kpathsea looks up. This is - useful for verifying that variables do indeed obtain their correct - values. - -`GSFTOPK_DEBUG (128)' - Activates debugging printout specific to `gsftopk' program. - -`MAKETEX_DEBUG (512)' - If you use the optional `mktex' programs instead of the - traditional shell scripts, this will report the name of the site - file (`mktex.cnf' by default) which is read, directories created by - `mktexdir', the full path of the `ls-R' database built by - `mktexlsr', font map searches, `MT_FEATURES' in effect, parameters - from `mktexnam', filenames added by `mktexupd', and some - subsidiary commands run by the programs. - -`MAKETEX_FINE_DEBUG (1024)' - When the optional `mktex' programs are used, this will print - additional debugging info from functions internal to these - programs. - - Debugging output from Kpathsea is always written to standard error, -and begins with the string `kdebug:'. (Except for hash table buckets, -which just start with the number, but you can only get that output -running under a debugger. See comments at the `hash_summary_only' -variable in `kpathsea/db.c'.) - - -File: kpathsea.info, Node: Logging, Next: Common problems, Prev: Debugging, Up: Reporting bugs - -Logging -------- - - Kpathsea can record the time and filename found for each successful -search. This may be useful in finding good candidates for deletion when -your filesystem is full, or in discovering usage patterns at your site. - - To do this, define the environment or config file variable -`TEXMFLOG'. The value is the name of the file to append the -information to. The file is created if it doesn't exist, and appended -to if it does. - - Each successful search turns into one line in the log file: two words -separated by a space. The first word is the time of the search, as the -integer number of seconds since "the epoch", i.e., UTC midnight 1 -January 1970 (more precisely, the result of the `time' system call). -The second word is the filename. - - For example, after `setenv TEXMFLOG /tmp/log', running Dvips on -`story.dvi' appends the following lines: - - 774455887 /usr/local/share/texmf/dvips/config.ps - 774455887 /usr/local/share/texmf/dvips/psfonts.map - 774455888 /usr/local/share/texmf/dvips/texc.pro - 774455888 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmbx10.600pk - 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmsl10.600pk - 774455889 /usr/local/share/texmf/fonts/pk/ljfour/public/cm/cmr10.600pk - 774455889 /usr/local/share/texmf/dvips/texc.pro - -Only filenames that are absolute are recorded, to preserve some -semblance of privacy. - - -File: kpathsea.info, Node: Common problems, Prev: Logging, Up: Reporting bugs - -Common problems ---------------- - - Here are some common problems with configuration, compilation, -linking, execution, ... - -* Menu: - -* Unable to find files:: If your program can't find fonts (or whatever). -* Slow path searching:: If it takes forever to find anything. -* Unable to generate fonts:: If mktexpk fails. -* TeX or Metafont failing:: Likely compiler bugs. - -* Empty Makefiles:: When configure produces empty makefiles. -* XtStrings:: When _XtStrings is undefined. -* dlopen:: When dlopen is undefined. -* ShellWidgetClass:: For dynamic linking troubles under OpenWindows. -* Pointer combination warnings:: For old compilers that don't grok char *. - - -File: kpathsea.info, Node: Unable to find files, Next: Slow path searching, Up: Common problems - -Unable to find files -.................... - - If a program complains it cannot find fonts (or other input files), -any of several things might be wrong. In any case, you may find the -debugging options helpful. *Note Debugging::. - - * Perhaps you simply haven't installed all the necessary files; the - basic fonts and input files are distributed separately from the - programs. *Note unixtex.ftp::. - - * You have (perhaps unknowingly) told Kpathsea to use search paths - that don't reflect where the files actually are. One common cause - is having environment variables set from a previous installation, - thus overriding what you carefully set in `texmf.cnf' (*note - Supported file formats::.). System `/etc/profile' or other files - such may be the culprit. - - * Your files reside in a directory that is only pointed to via a - symbolic link, in a leaf directory and is not listed in `ls-R'. - - Unfortunately, Kpathsea's subdirectory searching has an - irremediable deficiency: If a directory D being searched for - subdirectories contains plain files and symbolic links to other - directories, but no true subdirectories, D will be considered a - leaf directory, i.e., the symbolic links will not be followed. - *Note Subdirectory expansion::. - - You can work around this problem by creating an empty dummy - subdirectory in D. Then D will no longer be a leaf, and the - symlinks will be followed. - - The directory immediately followed by the `//' in the path - specification, however, is always searched for subdirectories, - even if it is a leaf. Presumably you would not have asked for the - directory to be searched for subdirectories if you didn't want it - to be. - - * If the fonts (or whatever) don't already exist, `mktexpk' (or - `mktexmf' or `mktextfm') will try to create them. If these rather - complicated shell scripts fail, you'll eventually get an error - message saying something like `Can't find font FONTNAME'. The best - solution is to fix (or at least report) the bug in `mktexpk'; the - workaround is to generate the necessary fonts by hand with - Metafont, or to grab them from a CTAN site (*note unixtex.ftp::.). - - * There is a bug in the library. *Note Reporting bugs::. - - -File: kpathsea.info, Node: Slow path searching, Next: Unable to generate fonts, Prev: Unable to find files, Up: Common problems - -Slow path searching -................... - - If your program takes an excessively long time to find fonts or other -input files, but does eventually succeed, here are some possible -culprits: - - * Most likely, you just have a lot of directories to search, and that - takes a noticeable time. The solution is to create and maintain a - separate `ls-R' file that lists all the files in your main TeX - hierarchy. *Note Filename database::. Kpathsea always uses `ls-R' - if it's present; there's no need to recompile or reconfigure any - of the programs. - - * Your recursively-searched directories (e.g., - `/usr/local/share/texmf/fonts//'), contain a mixture of files and - directories. This prevents Kpathsea from using a useful - optimization (*note Subdirectory expansion::.). - - It is best to have only directories (and perhaps a `README') in the - upper levels of the directory structure, and it's very important - to have *only* files, and no subdirectories, in the leaf - directories where the dozens of TFM, PK, or whatever files reside. - - In any case, you may find the debugging options helpful in determining -precisely when the disk or network is being pounded. *Note Debugging::. - - -File: kpathsea.info, Node: Unable to generate fonts, Next: TeX or Metafont failing, Prev: Slow path searching, Up: Common problems - -Unable to generate fonts -........................ - - This can happen if either `mktexpk' hasn't been installed properly, -or if the local installation of Metafont isn't correct. - - If `mf' is a command not found by `mktexpk', then you need to install -Metafont (*note unixtex.ftp::.). - - If Metafont runs, but generates fonts at the wrong resolution, you -need to be sure the `M' and `D' lines in your Dvips configuration file -match (*note Config files: (dvips)Config files.). For example, if -`mktexpk' is generating 300dpi fonts, but you need 600dpi fonts, you -should have: - M ljfour - D 600 - - If Metafont runs but generates fonts at a resolution of 2602dpi (and -prints out the name of each character as well as just a character -number, and maybe tries to display the characters), then your Metafont -base file probably hasn't been made properly. (It's using the default -`proof' mode, instead of an actual device mode.) To make a proper -`plain.base', assuming the local mode definitions are contained in a -file `modes.mf', run the following command (assuming Unix): - - inimf "plain; input modes; dump" - -Then copy the `plain.base' file from the current directory to where the -base files are stored on your system (`/usr/local/share/texmf/web2c' by -default), and make a link (either hard or soft) from `plain.base' to -`mf.base' in that directory. *Note inimf invocation: (web2c)inimf -invocation. - - -File: kpathsea.info, Node: TeX or Metafont failing, Next: Empty Makefiles, Prev: Unable to generate fonts, Up: Common problems - -TeX or Metafont failing -....................... - - If TeX or Metafont get a segmentation fault or otherwise fail while -running a normal input file, the problem is usually a compiler bug -(unlikely as that may sound). Even if the trip and trap tests are -passed, problems may lurk. Optimization occasionally causes trouble in -programs other than TeX and Metafont themselves, too. - - Insufficient swap space may also cause core dumps or other erratic -behavior. - - For a workaround, if you enabled any optimization flags, it's best to -omit optimization entirely. In any case, the way to find the facts is -to run the program under the debugger and see where it's failing. - - Also, if you have trouble with a system C compiler, I advise trying -the GNU C compiler. And vice versa, unfortunately; but in that case I -also recommend reporting a bug to the GCC mailing list; see *Note Bugs: -(gcc)Bugs. - - To report compiler bugs effectively requires perseverance and -perspicacity: you must find the miscompiled line, and that usually -involves delving backwards in time from the point of error, checking -through TeX's (or whatever program's) data structures. Things are not -helped by all-too-common bugs in the debugger itself. Good luck. - - One known cause of trouble is the way arrays are handled. Some of the -Pascal arrays have a lower index other than 0, and the C code will take -the pointer to the allocated memory, subtract the lower index, and use -the resulting pointer for the array. While this trick often works, ANSI -C doesn't guarantee that it will. It it known to fail on HP-UX 10 -mchines when the native compiler is used, unless the `+u' compiler -switch was specified. Using GCC will work on this platform as well. - - -File: kpathsea.info, Node: Empty Makefiles, Next: XtStrings, Prev: TeX or Metafont failing, Up: Common problems - -Empty Makefiles -............... - - On some systems (NetBSD, FreeBSD, AIX 4.1, and Mach10), `configure' -may fail to properly create the Makefiles. Instead, you get an error -which looks something like this: - - prompt$ ./configure - ... - creating Makefile - sed: 1: "\\@^ac_include make/pat ...": \ can not be used as a string delimiter - - So far as I know, the bug here is in `/bin/sh' on these systems. I -don't have access to a machine running any of them, so if someone can -find a workaround that avoids the quoting bug, I'd be most grateful. -(Search for `ac_include' in the `configure' script to get to the -problematic code.) - - It should work to run `bash configure', instead of using `/bin/sh'. -You can get Bash from `ftp://gnu/org/pub/gnu/bash' and mirrors. - - Another possible cause (reported for NeXT) is a bug in the `sed' -command. In that case the error may look like this: - - Unrecognized command: \@^ac_include make/paths.make@r make/paths.make - - In this case, installing GNU `sed' should solve the problem. You can -get GNU `sed' from the same places as Bash. - - -File: kpathsea.info, Node: XtStrings, Next: dlopen, Prev: Empty Makefiles, Up: Common problems - -`XtStrings' -........... - - You may find that linking X programs results in an error from the -linker that `XtStrings' is undefined, something like this: - - gcc -o virmf ... - .../x11.c:130: undefined reference to `XtStrings' - - This generally happens because of a mismatch between the X include -files with which you compiled and the X libraries with which you linked; -often, the include files are from MIT and the libraries from Sun. - - The solution is to use the same X distribution for compilation and -linking. Probably `configure' was unable to guess the proper -directories from your installation. You can use the `configure' -options `--x-includes=PATH' and `--x-libraries=PATH' to explicitly -specify them. - - -File: kpathsea.info, Node: dlopen, Next: ShellWidgetClass, Prev: XtStrings, Up: Common problems - -`dlopen' -........ - - (This section adapted from the file `dlsym.c' in the X distribution.) - - The `Xlib' library uses the standard C function `wcstombs'. Under -SunOS 4.1, `wcstombs' uses the `dlsym' interface defined in `libdl.so'. -Unfortunately, the SunOS 4.1 distribution does not include a static -`libdl.a' library. - - As a result, if you try to link an X program statically under SunOS, -you may get undefined references to `dlopen', `dlsym', and `dlclose'. -One workaround is to include these definitions when you link: - - void *dlopen() { return 0; } - void *dlsym() { return 0; } - int dlclose() { return -1; } - -These are contained in the `dlsym.c' file in the MIT X distribution. - - -File: kpathsea.info, Node: ShellWidgetClass, Next: Pointer combination warnings, Prev: dlopen, Up: Common problems - -`ShellWidgetClass' -.................. - - (This section adapted from the comp.sys.sun.admin FAQ.) - - If you are linking with Sun's OpenWindows libraries in SunOS 4.1.x, -you may get undefined symbols `_get_wmShellWidgetClass' and -`_get_applicationShellWidgetClass' when linking. This problem does not -arise using the standard MIT X libraries under SunOS. - - The cause is bugs in the `Xmu' shared library as shipped from Sun. -There are several fixes: - - * Install the free MIT distribution from `ftp.x.org' and mirrors. - - * Get the OpenWindows patches listed below. - - * Statically link the `Xmu' library into the executable. - - * Avoid using `Xmu' at all. If you are compiling Metafont, see *Note - Online Metafont graphics: (web2c)Online Metafont graphics. If you - are compiling Xdvi, see the `-DNOTOOL' option in `xdvik/INSTALL'. - - * Ignore the errors. The binary runs fine regardless. - - Here is the information for getting the two patches: - - Patch ID: 100512-02 - Bug ID's: 1086793, 1086912, 1074766 - Description: 4.1.x OpenWindows 3.0 `libXt' jumbo patch - - Patch ID: 100573-03 - Bug ID: 1087332 - Description: 4.1.x OpenWindows 3.0 undefined symbols when using shared `libXmu'. - - The way to statically link with `libXmu' depends on whether you are -using a Sun compiler (e.g., `cc') or `gcc'. If the latter, alter the -`x_libs' Make variable to include - - -static -lXmu -dynamic - - If you are using the Sun compiler, use `-Bstatic' and `-Bdynamic'. - - -File: kpathsea.info, Node: Pointer combination warnings, Prev: ShellWidgetClass, Up: Common problems - -Pointer combination warnings -............................ - - When compiling with old C compilers, you may get some warnings about -"illegal pointer combinations". These are spurious; just ignore them. -I decline to clutter up the source with casts to get rid of them. - - -File: kpathsea.info, Node: Path searching, Next: TeX support, Prev: Installation, Up: Top - -Path searching -************** - - This chapter describes the generic path searching mechanism Kpathsea -provides. For information about searching for particular file types -(e.g., TeX fonts), see the next chapter. - -* Menu: - -* Searching overview:: Basic scheme for searching. -* Path sources:: Where search paths can be defined. -* Path expansion:: Special constructs in search paths. -* Filename database:: Using an externally-built list to search. -* Invoking kpsewhich:: Standalone path lookup. - - -File: kpathsea.info, Node: Searching overview, Next: Path sources, Up: Path searching - -Searching overview -================== - - A "search path" is a colon-separated list of "path elements", which -are directory names with a few extra frills. A search path can come -from (a combination of) many sources; see below. To look up a file -`foo' along a path `.:/dir', Kpathsea checks each element of the path -in turn: first `./foo', then `/dir/foo', returning the first match (or -possibly all matches). - - The "colon" and "slash" mentioned here aren't necessarily `:' and `/' -on non-Unix systems. Kpathsea tries to adapt to other operating -systems' conventions. - - To check a particular path element E, Kpathsea first sees if a -prebuilt database (*note Filename database::.) applies to E, i.e., if -the database is in a directory that is a prefix of E. If so, the path -specification is matched against the contents of the database. - - If the database does not exist, or does not apply to this path -element, or contains no matches, the filesystem is searched (if this -was not forbidden by the specification with `!!' and if the file being -searched for must exist). Kpathsea constructs the list of directories -that correspond to this path element, and then checks in each for the -file being searched for. (To help speed future lookups of files in the -same directory, the directory in which a file is found is floated to the -top of the directory list.) - - The "file must exist" condition comes into play with VF files and -input files read by the TeX `\openin' command. These files may not -exist (consider `cmr10.vf'), and so it would be wrong to search the -disk for them. Therefore, if you fail to update `ls-R' when you -install a new VF file, it will never be found. - - Each path element is checked in turn: first the database, then the -disk. If a match is found, the search stops and the result is -returned. This avoids possibly-expensive processing of path -specifications that are never needed on a particular run. (Unless the -search explicitly requested all matches.) - - Although the simplest and most common path element is a directory -name, Kpathsea supports additional features in search paths: layered -default values, environment variable names, config file values, users' -home directories, and recursive subdirectory searching. Thus, we say -that Kpathsea "expands" a path element, meaning transforming all the -magic specifications into the basic directory name or names. This -process is described in the sections below. It happens in the same -order as the sections. - - Exception to all of the above: If the filename being searched for is -absolute or explicitly relative, i.e., starts with `/' or `./' or -`../', Kpathsea simply checks if that file exists. - - Ordinarily, if Kpathsea tries to access a file or directory that -cannot be read, it gives a warning. This is so you will be alerted to -directories or files that accidentally lack read permission (for -example, a `lost+found'). If you prefer not to see these warnings, -include the value `readable' in the `TEX_HUSH' environment variable or -config file value. - - This generic path searching algorithm is implemented in -`kpathsea/pathsearch.c'. It is employed by a higher-level algorithm -when searching for a file of a particular type (*note File lookup::., -and *Note Glyph lookup::). - - -File: kpathsea.info, Node: Path sources, Next: Path expansion, Prev: Searching overview, Up: Path searching - -Path sources -============ - - A search path can come from many sources. In the order in which -Kpathsea uses them: - - 1. A user-set environment variable, e.g., `TEXINPUTS'. Environment - variables with an underscore and the program name appended - override; for example, `TEXINPUTS_latex' overrides `TEXINPUTS' if - the program being run is named `latex'. - - 2. A program-specific configuration file, e.g., an `S /a:/b' line in - Dvips' `config.ps' (*note Config files: (dvips)Config files.). - - 3. A line in a Kpathsea configuration file `texmf.cnf', e.g., - `TEXINPUTS=/c:/d' (see below). - - 4. The compile-time default (specified in `kpathsea/paths.h'). - - You can see each of these values for a given search path by using the -debugging options (*note Debugging::.). - - These sources may be combined via default expansion (*note Default -expansion::.). - -* Menu: - -* Config files:: Kpathsea's runtime config files (texmf.cnf). - - -File: kpathsea.info, Node: Config files, Up: Path sources - -Config files ------------- - - As mentioned above, Kpathsea reads "runtime configuration files" -named `texmf.cnf' for search path and other definitions. The search -path used to look for these configuration files is named `TEXMFCNF', -and is constructed in the usual way, as described above, except that -configuration files cannot be used to define the path, naturally; also, -an `ls-R' database is not used to search for them. - - Kpathsea reads *all* `texmf.cnf' files in the search path, not just -the first one found; definitions in earlier files override those in -later files. Thus, if the search path is `.:$TEXMF', values from -`./texmf.cnf' override those from `$TEXMF/texmf.cnf'. - - While (or instead of) reading this description, you may find it -helpful to look at the distributed `texmf.cnf', which uses or at least -mentions most features. The format of `texmf.cnf' files follows: - - * Comments start with `%' and continue to the end of the line. - - * Blank lines are ignored. - - * A `\' at the end of a line acts as a continuation character, i.e., - the next line is appended. Whitespace at the beginning of - continuation lines is not ignored. - - * Each remaining line must look like - - VARIABLE [. PROGNAME] [=] VALUE - - where the `=' and surrounding whitespace is optional. - - * The VARIABLE name may contain any character other than whitespace, - `=', or `.', but sticking to `A-Za-z_' is safest. - - * If `.PROGNAME' is present, the definition only applies if the - program that is running is named (i.e., the last component of - `argv[0]' is) PROGNAME or `PROGNAME.exe'. This allows different - flavors of TeX to have different search paths, for example. - - * VALUE may contain any characters except `%' and `@'. (These - restrictions are only necessary because of the processing done on - `texmf.cnf' at build time, so you can stick those characters in - after installation if you have to.) The `$VAR.PROG' feature is - not available on the right-hand side; instead, you must use an - additional variable (see below for example). A `;' in VALUE is - translated to `:' if running under Unix; this is useful to write a - single `texmf.cnf' which can be used under both Unix and NT. (If - you really want `;''s in your filenames, add - `-DALLOW_SEMICOLON_IN_FILENAMES' to `CFLAGS'.) - - * All definitions are read before anything is expanded, so you can - use variables before they are defined (like Make, unlike most other - programs). - -Here is a configuration file fragment illustrating most of these points: - - % TeX input files -- i.e., anything to be found by \input or \openin ... - latex209_inputs = .:$TEXMF/tex/latex209//:$TEXMF/tex// - latex2e_inputs = .:$TEXMF/tex/latex//:$TEXMF/tex// - TEXINPUTS = .:$TEXMF/tex// - TEXINPUTS.latex209 = $latex209_inputs - TEXINPUTS.latex2e = $latex2e_inputs - TEXINPUTS.latex = $latex2e_inputs - - Although this format has obvious similarities to Bourne shell -scripts--change the comment character to `#', disallow spaces around -the `=', and get rid of the `.NAME' convention, and it could be run -through the shell. But there seemed little advantage to doing this, -since all the information would have to passed back to Kpathsea and -parsed there anyway, since the `sh' process couldn't affect its -parent's environment. - - The implementation of all this is in `kpathsea/cnf.c'. - - -File: kpathsea.info, Node: Path expansion, Next: Filename database, Prev: Path sources, Up: Path searching - -Path expansion -============== - - Kpathsea recognizes certain special characters and constructions in -search paths, similar to that in shells. As a general example: -`~$USER/{foo,bar}//baz' expands to all subdirectories under directories -`foo' and `bar' in $USER's home directory that contain a directory or -file `baz'. These expansions are explained in the sections below. - -* Menu: - -* Default expansion:: a: or :a or a::b expands to a default. -* Variable expansion:: $foo and ${foo} expand to environment values. -* Tilde expansion:: ~ and ~user expand to home directories. -* Brace expansion:: a{foo,bar}b expands to afoob abarb. -* KPSE_DOT expansion:: . is replaced with $KPSE_DOT if it is defined. -* Subdirectory expansion:: a// and a//b recursively expand to subdirs. - - -File: kpathsea.info, Node: Default expansion, Next: Variable expansion, Up: Path expansion - -Default expansion ------------------ - - If the highest-priority search path (*note Path sources::.) contains -an "extra colon" (i.e., leading, trailing, or doubled), Kpathsea -inserts at that point the next-highest-priority search path that is -defined. If that inserted path has an extra colon, the same happens -with the next-highest. (An extra colon in the compile-time default -value has unpredictable results, so installers beware.) - - For example, given an environment variable setting - - setenv TEXINPUTS /home/karl: - -and a `TEXINPUTS' value from `texmf.cnf' of - - .:$TEXMF//tex - -then the final value used for searching will be: - - /home/karl:.:$TEXMF//tex - - Since Kpathsea looks for multiple configuration files, it would be -natural to expect that (for example) an extra colon in `./texmf.cnf' -would expand to the path in `$TEXMF/texmf.cnf'. Or, with Dvips' -configuration files, that an extra colon in `config.$PRINTER' would -expand to the path in `config.ps'. This doesn't happen. It's not -clear this would be desirable in all cases, and trying to devise a way -to specify the path to which the extra colon should expand seemed truly -baroque. - - Technicality: Since it would be useless to insert the default value in -more than one place, Kpathsea changes only one extra `:' and leaves any -others in place (they will eventually be ignored). Kpathsea checks -first for a leading `:', then a trailing `:', then a doubled `:'. - - You can trace this by debugging "paths" (*note Debugging::.). -Default expansion is implemented in the source file -`kpathsea/kdefault.c'. - - -File: kpathsea.info, Node: Variable expansion, Next: Tilde expansion, Prev: Default expansion, Up: Path expansion - -Variable expansion ------------------- - - `$foo' or `${foo}' in a path element is replaced by (1) the value of -an environment variable `foo' (if defined); (2) the value of `foo' from -`texmf.cnf' (if defined); (3) the empty string. - - If the character after the `$' is alphanumeric or `_', the variable -name consists of all consecutive such characters. If the character -after the `$' is a `{', the variable name consists of everything up to -the next `}' (braces may not be nested around variable names). -Otherwise, Kpathsea gives a warning and ignores the `$' and its -following character. - - You must quote the $'s and braces as necessary for your shell. -*Shell* variable values cannot be seen by Kpathsea, i.e., ones defined -by `set' in C shells and without `export' in Bourne shells. - - For example, given - setenv tex /home/texmf - setenv TEXINPUTS .:$tex:${tex}prev - the final `TEXINPUTS' path is the three directories: - .:/home/texmf:/home/texmfprev - - The `.PROGNAME' suffix on variables and `_PROGNAME' on environment -variable names are not implemented for general variable expansions. -These are only recognized when search paths are initialized (*note Path -sources::.). - - Variable expansion is implemented in the source file -`kpathsea/variable.c'. - - -File: kpathsea.info, Node: Tilde expansion, Next: Brace expansion, Prev: Variable expansion, Up: Path expansion - -Tilde expansion ---------------- - - A leading `~' in a path element is replaced by the value of the -environment variable `HOME', or `.' if `HOME' is not set. - - A leading `~USER' in a path element is replaced by USER's home -directory from the system `passwd' database. - - For example, - setenv TEXINPUTS ~/mymacros: - -will prepend a directory `mymacros' in your home directory to the -default path. - - As a special case, if a home directory ends in `/', the trailing -slash is dropped, to avoid inadvertently creating a `//' construct in -the path. For example, if the home directory of the user `root' is -`/', the path element `~root/mymacros' expands to just `/mymacros', not -`//mymacros'. - - Tilde expansion is implemented in the source file `kpathsea/tilde.c'. - - -File: kpathsea.info, Node: Brace expansion, Next: KPSE_DOT expansion, Prev: Tilde expansion, Up: Path expansion - -Brace expansion ---------------- - - `x{A:B}y' expands to `xAy:xBy'. For example: - - foo/{1:2}/baz - -expands to `foo/1/baz:foo/2/baz'. `:' is the path separator on the -current system; e.g., on a DOS system, it's `;'. - - Braces can be nested; for example, `x{A:B{1:2}}y' expands to -`xAy:xB1y:xB2y'. - - Multiple non-nested braces are expanded from right to left; for -example, `x{A:B}{1:2}y' expands to `x{A:B}1y:x{A:B}2y', which expands -to `xA1y:xB1y:xA2y:xB2:y'. - - This feature can be used to implement multiple TeX hierarchies, by -assigning a brace list to `$TEXMF', as mentioned in `texmf.in'. - - In old versions of the library you had to use a comma. While this -usage is deprecated, it is still supported for backwards compatibility -with old configurations. The last example could have been written -`x{A,B}{1,2}y'. - - Brace expansion is implemented in the source file -`kpathsea/expand.c'. It is a modification of the Bash sources, and is -thus covered by the GNU General Public License, rather than the Library -General Public License that covers the rest of Kpathsea. - - -File: kpathsea.info, Node: KPSE_DOT expansion, Next: Subdirectory expansion, Prev: Brace expansion, Up: Path expansion - -`KPSE_DOT' expansion --------------------- - - When `KPSE_DOT' is defined in the environment, it names a directory -that should be considered the current directory for the purpose of -looking up files in the search paths. This feature is needed by the -`mktex...' scripts *Note mktex scripts::, because these change the -working directory. You should not ever define it yourself. - - -File: kpathsea.info, Node: Subdirectory expansion, Prev: KPSE_DOT expansion, Up: Path expansion - -Subdirectory expansion ----------------------- - - Two or more consecutive slashes in a path element following a -directory D is replaced by all subdirectories of D: first those -subdirectories directly under D, then the subsubdirectories under -those, and so on. At each level, the order in which the directories are -searched is unspecified. (It's "directory order", and definitely not -alphabetical.) - - If you specify any filename components after the `//', only -subdirectories which match those components are included. For example, -`/a//b' would expand into directories `/a/1/b', `/a/2/b', `/a/1/1/b', -and so on, but not `/a/b/c' or `/a/1'. - - You can include multiple `//' constructs in the path. - - `//' at the beginning of a path is ignored; you didn't really want to -search every directory on the system, did you? - - I should mention one related implementation trick, which I took from -GNU find. Matthew Farwell suggested it, and David MacKenzie -implemented it. - - The trick is that in every real Unix implementation (as opposed to the -POSIX specification), a directory which contains no subdirectories will -have exactly two links (namely, one for `.' and one for `..'). That is -to say, the `st_nlink' field in the `stat' structure will be two. -Thus, we don't have to stat everything in the bottom-level (leaf) -directories--we can just check `st_nlink', notice it's two, and do no -more work. - - But if you have a directory that contains a single subdirectory and -500 regular files, `st_nlink' will be 3, and Kpathsea has to stat every -one of those 501 entries. Therein lies slowness. - - You can disable the trick by undefining `UNIX_ST_LINK' in -`kpathsea/config.h'. (It is undefined by default except under Unix.) - - Unfortunately, in some cases files in leaf directories are `stat''d: -if the path specification is, say, `$TEXMF/fonts//pk//', then files in -a subdirectory `.../pk', even if it is a leaf, are checked. The reason -cannot be explained without reference to the implementation, so read -`kpathsea/elt-dirs.c' (search for `may descend') if you are curious. -And if you can find a way to *solve* the problem, please let me know. - - Subdirectory expansion is implemented in the source file -`kpathsea/elt-dirs.c'. - - -File: kpathsea.info, Node: Filename database, Next: Invoking kpsewhich, Prev: Path expansion, Up: Path searching - -Filename database (`ls-R') -========================== - - Kpathsea goes to some lengths to minimize disk accesses for searches -(*note Subdirectory expansion::.). Nevertheless, at installations with -enough directories, searching each possible directory for a given file -can take an excessively long time (depending on the speed of the disk, -whether it's NFS-mounted, how patient you are, etc.). - - In practice, a font tree containing the standard PostScript and PCL -fonts is large enough for searching to be noticeably slow on typical -systems these days. Therefore, Kpathsea can use an externally-built -"database" file named `ls-R' that maps files to directories, thus -avoiding the need to exhaustively search the disk. - - A second database file `aliases' allows you to give additional names -to the files listed in `ls-R'. This can be helpful to adapt to "8.3" -filename conventions in source files. - - The `ls-R' and `aliases' features are implemented in the source file -`kpathsea/db.c'. - -* Menu: - -* ls-R:: The main filename database. -* Filename aliases:: Aliases for those names. -* Database format:: Syntax details of the database file. - - -File: kpathsea.info, Node: ls-R, Next: Filename aliases, Up: Filename database - -`ls-R' ------- - - As mentioned above, you must name the main filename database `ls-R'. -You can put one at the root of each TeX installation hierarchy you wish -to search (`$TEXMF' by default); most sites have only one hierarchy. -Kpathsea looks for `ls-R' files along the `TEXMFDBS' path, so that -should presumably match the list of hierarchies. - - The recommended way to create and maintain `ls-R' is to run the -`mktexlsr' script, which is installed in `$(bindir)' (`/usr/local/bin' -by default). That script goes to some trouble to follow symbolic links -as necessary, etc. It's also invoked by the distributed `mktex...' -scripts. - - At its simplest, though, you can build `ls-R' with the command - cd /YOUR/TEXMF/ROOT && ls -LAR ./ >ls-R - -presuming your `ls' produces the right output format (see the section -below). GNU `ls', for example, outputs in this format. Also presuming -your `ls' hasn't been aliased in a system file (e.g., `/etc/profile') -to something problematic, e.g., `ls --color=tty'. In that case, you -will have to disable the alias before generating `ls-R'. For the -precise definition of the file format, see *Note Database format::. - - Regardless of whether you use the supplied script or your own, you -will almost certainly want to invoke it via `cron', so when you make -changes in the installed files (say if you install a new LaTeX -package), `ls-R' will be automatically updated. - - The `-A' option to `ls' includes files beginning with `.' (except -for `.' and `..'), such as the file `.tex' included with the LaTeX -tools package. (On the other hand, *directories* whose names begin -with `.' are always ignored.) - - If your system does not support symbolic links, omit the `-L'. - - `ls -LAR /YOUR/TEXMF/ROOT' will also work. But using `./' avoids -embedding absolute pathnames, so the hierarchy can be easily -transported. It also avoids possible trouble with automounters or -other network filesystem conventions. - - Kpathsea warns you if it finds an `ls-R' file, but the file does not -contain any usable entries. The usual culprit is running plain `ls -R' -instead of `ls -LR ./' or `ls -R /YOUR/TEXMF/ROOT'. Another -possibility is some system directory name starting with a `.' (perhaps -if you are using AFS); Kpathsea ignores everything under such -directories. - - Because the database may be out-of-date for a particular run, if a -file is not found in the database, by default Kpathsea goes ahead and -searches the disk. If a particular path element begins with `!!', -however, *only* the database will be searched for that element, never -the disk. If the database does not exist, nothing will be searched. -Because this can surprise users ("I see the font `foo.tfm' when I do an -`ls'; why can't Dvips find it?"), it is not in any of the default -search paths. - - -File: kpathsea.info, Node: Filename aliases, Next: Database format, Prev: ls-R, Up: Filename database - -Filename aliases ----------------- - - In some circumstances, you may wish to find a file under several -names. For example, suppose a TeX document was created using a DOS -system and tries to read `longtabl.sty'. But now it's being run on a -Unix system, and the file has its original name, `longtable.sty'. The -file won't be found. You need to give the actual file `longtable.sty' -an alias `longtabl.sty'. - - You can handle this by creating a file `aliases' as a companion to -the `ls-R' for the hierarchy containing the file in question. (You -must have an `ls-R' for the alias feature to work.) - - The format of `aliases' is simple: two whitespace-separated words per -line; the first is the real name `longtable.sty', and second is the -alias (`longtabl.sty'). These must be base filenames, with no -directory components. `longtable.sty' must be in the sibling `ls-R'. - - Also, blank lines and lines starting with `%' or `#' are ignored in -`aliases', to allow for comments. - - If a real file `longtabl.sty' exists, it is used regardless of any -aliases. - - -File: kpathsea.info, Node: Database format, Prev: Filename aliases, Up: Filename database - -Database format ---------------- - - The "database" read by Kpathsea is a line-oriented file of plain -text. The format is that generated by GNU (and most other) `ls' -programs given the `-R' option, as follows. - - * Blank lines are ignored. - - * If a line begins with `/' or `./' or `../' and ends with a colon, - it's the name of a directory. (`../' lines aren't useful, - however, and should not be generated.) - - * All other lines define entries in the most recently seen directory. - /'s in such lines will produce possibly-strange results. - - * Files with no preceding directory line are ignored. - - For example, here's the first few lines of `ls-R' (which totals about -30K bytes) on my system: - - bibtex - dvips - fonts - ls-R - metafont - metapost - tex - web2c - - ./bibtex: - bib - bst - doc - - ./bibtex/bib: - asi.bib - btxdoc.bib - ... - - -File: kpathsea.info, Node: Invoking kpsewhich, Prev: Filename database, Up: Path searching - -`kpsewhich': Standalone path searching -====================================== - - The Kpsewhich program exercises the path searching functionality -independent of any particular application. This can also be useful as a -sort of `find' program to locate files in your TeX hierarchies, perhaps -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 -can start with either `-' or `--', and any unambiguous abbreviation is -accepted. - -* Menu: - -* Path searching options:: Changing the mode, resolution, etc. -* Auxiliary tasks:: Path and variable expansion. -* Standard options:: -help and -version. - - -File: kpathsea.info, Node: Path searching options, Next: Auxiliary tasks, Up: Invoking kpsewhich - -Path searching options ----------------------- - - Kpsewhich looks up each non-option argument on the command line as a -filename, and returns the first file found. There is no option to -return all the files with a particular name (you can run the Unix -`find' utility for that, *note Invoking find: (findutils)Invoking -find.). - - Various options alter the path searching behavior: - -`--dpi=NUM' - Set the resolution to NUM; this only affects `gf' and `pk' - lookups. `-D' is a synonym, for compatibility with Dvips. - Default is 600. - -`--format=NAME' - Set the format for lookup to NAME. By default, the format is - guessed from the filename, with `tex' being used if nothing else - fits. The recognized filename extensions (including any leading - `.') are also allowable NAMEs. - - All formats also have a name, which is the only way to specify - formats with no associated suffix. For example, for Dvips - configuration files you can use `--format="dvips config"'. (The - quotes are for the sake of the shell.) - - Here's the current list of recognized names and the associated - suffixes. *Note Supported file formats::, for more information on - each of these. - gf: gf - pk: pk - bitmap font - afm: .afm - base: .base - bib: .bib - bst: .bst - cnf: .cnf - ls-R: ls-R - fmt: .fmt - map: .map - mem: .mem - mf: .mf - mfpool: .pool - mft: .mft - mp: .mp - mppool: .pool - MetaPost support - ocp: .ocp - ofm: .ofm .tfm - opl: .opl - otp: .otp - ovf: .ovf - ovp: .ovp - graphic/figure: .eps .epsi - tex: .tex - TeX system documentation - texpool: .pool - TeX system sources - PostScript header/font: .pro - Troff fonts - tfm: .tfm - type1 fonts: .pfa .pfb - vf: .vf - dvips config - ist: .ist - truetype fonts: .ttf .ttc - type42 fonts - web2c files - other text files - other binary files - - This option and `--path' are mutually exclusive. - -`--interactive' - After processing the command line, read additional filenames to - look up from standard input. - -`-mktex=FILETYPE' -`-no-mktex=FILETYPE' - Turn on or off the `mktex' script associated with FILETYPE. The - only values that make sense for FILETYPE are `pk', `mf', `tex', - and `tfm'. By default, all are off in Kpsewhich. *Note mktex - scripts::. - -`--mode=STRING' - Set the mode name to STRING; this also only affects `gf' and `pk' - lookups. No default: any mode will be found. *Note mktex script - arguments::. - -`--must-exist' - Do everything possible to find the files, notably including - searching the disk. By default, only the `ls-R' database is - checked, in the interest of efficiency. - -`--path=STRING' - Search along the path STRING (colon-separated as usual), instead - of guessing the search path from the filename. `//' and all the - usual expansions are supported (*note Path expansion::.). This - option and `--format' are mutually exclusive. To output the - complete directory expansion of a path, instead of doing a - one-shot lookup, see `--expand-path' in the following section. - -`--progname=NAME' - Set the program name to NAME; default is `kpsewhich'. This can - affect the search paths via the `.PROGNAM' feature in - configuration files (*note Config files::.). - - -File: kpathsea.info, Node: Auxiliary tasks, Next: Standard options, Prev: Path searching options, Up: Invoking kpsewhich - -Auxiliary tasks ---------------- - - Kpsewhich provides some additional features not strictly related to -path lookup: - - * `--debug=NUM' sets the debugging options to NUM. *Note - Debugging::. - - * `--expand-braces=STRING' outputs the variable and brace expansion - of STRING. *Note Path expansion::. - - * `--expand-var=STRING' outputs the variable expansion of STRING. - For example, the `mktex...' scripts run `kpsewhich - --expand-var='$TEXMF'' to find the root of the TeX system - hierarchy. *Note Path expansion::. - - * `--expand-path=STRING' outputs the complete expansion of STRING as - a colon-separated path. This is useful to construct a search path - for a program that doesn't accept recursive subdirectory - specifications. - - For one-shot uses of an arbitrary (not built in to Kpathsea) path, - see `--path' in the previous section. - - * `--show-path=NAME' shows the path that would be used for file - lookups of file type NAME. Either a filename extension (`pk', - `.vf', etc.) or an integer can be used, just as with `--format', - described in the previous section. - - -File: kpathsea.info, Node: Standard options, Prev: Auxiliary tasks, Up: Invoking kpsewhich - -Standard options ----------------- - - Kpsewhich accepts the standard GNU options: - - * `--help' prints a help message on standard output and exits. - - * `--version' prints the Kpathsea version number and exits. - - -File: kpathsea.info, Node: TeX support, Next: Programming, Prev: Path searching, Up: Top - -TeX support -*********** - - Although the basic features in Kpathsea can be used for any type of -path searching, it came about (like all libraries) with a specific -application in mind: I wrote Kpathsea specifically for TeX system -programs. I had been struggling with the programs I was using (Dvips, -Xdvi, and TeX itself) having slightly different notions of how to -specify paths; and debugging was painful, since no code was shared. - - Therefore, Kpathsea provides some TeX-specific formats and features. -Indeed, many of the supposedly generic path searching features were -provided because they seemed useful in that conTeXt (font lookup, -particularly). - - Kpathsea provides a standard way to search for files of any of the -supported file types; glyph fonts are a bit different than all the rest. -Searches are based solely on filenames, not file contents--if a GF file -is named `cmr10.600pk', it will be found as a PK file. - -* Menu: - -* Supported file formats:: File types Kpathsea knows about. -* File lookup:: Searching for most kinds of files. -* Glyph lookup:: Searching for bitmap fonts. -* Suppressing warnings:: Avoiding warnings via TEX_HUSH. - - -File: kpathsea.info, Node: Supported file formats, Next: File lookup, Up: TeX support - -Supported file formats -====================== - - Kpathsea has support for a number of file types. Each file type has a -list of environment and config file variables that are checked to define -the search path, and most have a default suffix that plays a role in -finding files (see the next section). Some also define additional -suffixes, and/or a program to be run to create missing files on the fly. - - Since environment variables containing periods, such as -`TEXINPUTS.latex', are not allowed on some systems, Kpathsea looks for -environment variables with an underscore, e.g., `TEXINPUTS_latex' -(*note Config files::.). - - The following table lists the above information. - -`afm' - (Adobe font metrics, *note Metric files: (dvips)Metric files.) - `AFMFONTS'; suffix `.afm'. - -`base' - (Metafont memory dump, *note Memory dumps: (web2c)Memory dumps.) - `MFBASES', `TEXMFINI'; suffix `.base'. - -`bib' - (BibTeX bibliography source, *note bibtex invocation: - (web2c)bibtex invocation.) `BIBINPUTS', `TEXBIB'; suffix `.bib'. - -`bst' - (BibTeX style file, *note Basic BibTeX style files: (web2c)Basic - BibTeX style files.) `BSTINPUTS'; suffix `.bst'. - -`cnf' - (Runtime configuration files, *note Config files::.) `TEXMFCNF'; - suffix `.cnf'. - -`dvips config' - (Dvips `config.*' files, such as `config.ps', *note Config files: - (dvips)Config files.) `TEXCONFIG'. - -`fmt' - (TeX memory dump, *note Memory dumps: (web2c)Memory dumps.) - `TEXFORMATS', `TEXMFINI'; suffix `.fmt'. - -`gf' - (generic font bitmap, *note Glyph files: (dvips)Glyph files.) - `PROGRAMFONTS', `GFFONTS', `GLYPHFONTS', `TEXFONTS'; suffix `gf'. - -`graphic/figure' - (Encapsulated PostScript figures, *note PostScript figures: - (dvips)PostScript figures.) `TEXPICTS', `TEXINPUTS'; additional - suffixes: `.eps', `.epsi'. - -`ist' - (makeindex style files) `TEXINDEXSTYLE', `INDEXSTYLE'; suffix - `.ist'. - -`ls-R' - (Filename databases, *note Filename database::.) `TEXMFDBS'. - -`map' - (Fontmaps, *note Fontmap::.) `TEXFONTMAPS'; suffix `.map'. - -`mem' - (MetaPost memory dump, *note Memory dumps: (web2c)Memory dumps.) - `MPMEMS', `TEXMFINI'; suffix `.mem'. - -`MetaPost support' - (MetaPost support files, used by DMP; *note dmp invocation: - (web2c)dmp invocation.) `MPSUPPORT'. - -`mf' - (Metafont source, *note mf invocation: (web2c)mf invocation.) - `MFINPUTS'; suffix `.mf'; dynamic creation program: `mktexmf'. - -`mfpool' - (Metafont program strings, *note pooltype invocation: - (web2c)pooltype invocation.) `MFPOOL', `TEXMFINI'; suffix `.pool'. - -`mft' - (`MFT' style file, *note mft invocation: (web2c)mft invocation.) - `MFTINPUTS'; suffix `.mft'. - -`mp' - (MetaPost source, *note mpost invocation: (web2c)mpost invocation.) - `MPINPUTS'; suffix `.mp'. - -`mppool' - (MetaPost program strings, *note pooltype invocation: - (web2c)pooltype invocation.) `MPPOOL', `TEXMFINI'; suffix `.pool'. - -`ocp' - (Omega compiled process files) `OCPINPUTS'; - suffix `.ocp'; dynamic creation program: `MakeOmegaOCP'. - -`ofm' - (Omega font metrics) `OFMFONTS', `TEXFONTS'; - suffixes `.ofm', `.tfm'; dynamic creation program: `MakeOmegaOFM'. - -`opl' - (Omega property lists) `OPLFONTS', `TEXFONTS'; suffix `.opl'. - -`otp' - (Omega translation process files) `OTPINPUTS'; suffix `.otp'. - -`ovf' - (Omega virtual fonts) `OVFFONTS', `TEXFONTS'; suffix `.ovf'. - -`ovp' - (Omega virtual property lists) `OVPFONTS', `TEXFONTS'; suffix - `.ovp'. - -`pk' - (packed bitmap fonts, *note Glyph files: (dvips)Glyph files.) - `PROGRAMFONTS' (PROGRAM being `XDVI', etc.), `PKFONTS', `TEXPKS', - `GLYPHFONTS', `TEXFONTS'; suffix `pk'; dynamic creation program: - `mktexpk'. - -`PostScript header' - (downloadable PostScript, *note Header files: (dvips)Header files.) - `TEXPSHEADERS', `PSHEADERS'; additional suffix `.pro'. - -`tex' - (TeX source, *note tex invocation: (web2c)tex invocation.) - `TEXINPUTS'; suffix `.tex'; additional suffixes: none, because - such a list cannot be complete; dynamic creation program: - `mktextex'. - -`TeX system documentation' - (Documentation files for the TeX system) `TEXDOCS'. - -`TeX system sources' - (Source files for the TeX system) `TEXSOURCES'. - -`texpool' - (TeX program strings, *note pooltype invocation: (web2c)pooltype - invocation.) `TEXPOOL', `TEXMFINI'; suffix `.pool'. - -`tfm' - (TeX font metrics, *note Metric files: (dvips)Metric files.) - `TFMFONTS', `TEXFONTS'; suffix `.tfm'; dynamic creation program: - `mktextfm'. - -`Troff fonts' - (Troff fonts, used by DMP; *note DMP invocation: (web2c)DMP - invocation.) `TRFONTS'. - -`truetype fonts' - (TrueType outline fonts) `TTFONTS'; suffixes `.ttf', `.ttc'. - -`type1 fonts' - (Type 1 PostScript outline fonts, *note Glyph files: (dvips)Glyph - files.) `T1FONTS', `T1INPUTS', `TEXPSHEADERS', `DVIPSHEADERS'; - suffixes `.pfa', `.pfb'. - -`type42 fonts' - (Type 42 PostScript outline fonts) `T42FONTS'. - -`vf' - (virtual fonts, *note Virtual fonts: (dvips)Virtual fonts.) - `VFFONTS', `TEXFONTS'; suffix `.vf'. - - There are two special cases, because the paths and environment -variables always depend on the name of the program: the variable name is -constructed by converting the program name to upper case, and then -appending `INPUTS'. Assuming the program is called `foo', this gives -us the following table. - -`other text files' - (text files used by `foo') `FOOINPUTS'. - -`other binary files' - (binary files used by `foo') `FOOINPUTS'. - - If an environment variable by these names are set, the corresponding -`texmf.cnf' definition won't be looked at (unless, as usual, the -environment variable value has an extra `:'). *Note Default -expansion::. - - For the font variables, the intent is that: - * `TEXFONTS' is the default for everything. - - * `GLYPHFONTS' is the default for bitmap (or, more precisely, - non-metric) files. - - * Each font format has a variable of its own. - - * Each program has its own font override path as well; e.g., - `DVIPSFONTS' for Dvipsk. Again, this is for bitmaps, not metrics. - - -File: kpathsea.info, Node: File lookup, Next: Glyph lookup, Prev: Supported file formats, Up: TeX support - -File lookup -=========== - - This section describes how Kpathsea searches for most files (bitmap -font searches are the exception, as described in the next section). - - Here is the search strategy for a file NAME: - 1. If the file format defines default suffixes, and the suffix of - NAME name is not already a known suffix for that format, try the - name with each default appended, and use alternative names found - in the fontmaps if necessary. We postpone searching the disk as - long as possible. Example: given `foo.sty', look for `foo.sty.tex' - before `foo.sty'. This is unfortunate, but allows us to find - `foo.bar.tex' before `foo.bar' if both exist and we were given - `foo.bar'. - - 2. Search for NAME, and if necssary for alternative names found in - the fontmaps. Again we avoid searching the disk if possible. - Example: given `foo', we look for `foo'. - - 3. If the file format defines a program to invoke to create missing - files, run it (*note mktex scripts::.). - - This is implemented in the routine `kpse_find_file' in -`kpathsea/tex-file.c'. You can watch it in action with the debugging -options (*note Debugging::.). - - -File: kpathsea.info, Node: Glyph lookup, Next: Suppressing warnings, Prev: File lookup, Up: TeX support - -Glyph lookup -============ - - This section describes how Kpathsea searches for a bitmap font in GF -or PK format (or either) given a font name (e.g., `cmr10') and a -resolution (e.g., 600). - - Here is an outline of the search strategy (details in the sections -below) for a file NAME at resolution DPI. The search stops at the -first successful lookup. - - 1. Look for an existing file NAME.DPIFORMAT in the specified - format(s). - - 2. If NAME is an alias for a file F in the fontmap file - `texfonts.map', look for F.DPI. - - 3. Run an external program (typically named `mktexpk') to generate - the font (*note mktex scripts::.) - - 4. Look for FALLBACK.DPI, where FALLBACK is some last-resort font - (typically `cmr10'). - - This is implemented in `kpse_find_glyph_format' in -`kpathsea/tex-glyph.c'. - -* Menu: - -* Basic glyph lookup:: Features common to all glyph lookups. -* Fontmap:: Aliases for fonts. -* Fallback font:: Resolutions and fonts of last resort. - - -File: kpathsea.info, Node: Basic glyph lookup, Next: Fontmap, Up: Glyph lookup - -Basic glyph lookup ------------------- - - When Kpathsea looks for a bitmap font NAME at resolution DPI in a -format FORMAT, it first checks each directory in the search path for a -file `NAME.DPIFORMAT'; for example, `cmr10.600pk'. Kpathsea looks for -a PK file first, then a GF file. - - If that fails, Kpathsea looks for `dpiDPI/NAME.FORMAT'; for example, -`dpi600/cmr10.pk'. This is how fonts are typically stored on -filesystems (such as DOS) that permit only three-character extensions. - - If that fails, Kpathsea looks for a font with a close-enough DPI. -"Close enough" is defined by the macro `KPSE_BITMAP_TOLERANCE' in -`kpathsea/tex-glyph.h' to be `DPI / 500 + 1'. This is slightly more -than the 0.2% minimum allowed by the DVI standard -(`CTAN:/dviware/driv-standard/level-0'). - - -File: kpathsea.info, Node: Fontmap, Next: Fallback font, Prev: Basic glyph lookup, Up: Glyph lookup - -Fontmap -------- - - If a bitmap font or metric file is not found with the original name -(see the previous section), Kpathsea looks through any "fontmap" files -for an "alias" for the original font name. These files are named -`texfonts.map' and searched for along the `TEXFONTMAPS' -environment/config file variable. All `texfonts.map' files that are -found are read; earlier definitions override later ones. - - This feature is intended to help in two respects: - - 1. An alias name is limited in length only by available memory, not - by your filesystem. Therefore, if you want to ask for - `Times-Roman' instead of `ptmr', you can (you get `ptmr8r'). - - 2. A few fonts have historically had multiple names: specifically, - LaTeX's "circle font" has variously been known as `circle10', - `lcircle10', and `lcirc10'. Aliases can make all the names - equivalent, so that it no longer matters what the name of the - installed file is; TeX documents will find their favorite name. - - - The format of fontmap files is straightforward: - - * Comments start with `%' and continue to the end of the line. - - * Blank lines are ignored. - - * Each nonblank line is broken up into a series of "words": a - sequence of non-whitespace characters. - - * If the first word is `include', the second word is used as a - filename, and it is searched for and read. - - * Otherwise, the first word on each line is the true filename; - - * the second word is the alias; - - * subsequent words are ignored. - - If an alias has an extension, it matches only those files with that -extension; otherwise, it matches anything with the same root, regardless -of extension. For example, an alias `foo.tfm' matches only when -`foo.tfm' is being searched for; but an alias `foo' matches `foo.vf', -`foo.600pk', etc. - - As an example, here is an excerpt from the `texfonts.map' in the -Web2c distribution. It makes the circle fonts equivalent and includes -automatically generated maps for most PostScript fonts available from -various font suppliers. - - circle10 lcircle10 - circle10 lcirc10 - lcircle10 circle10 - lcircle10 lcirc10 - lcirc10 circle10 - lcirc10 lcircle10 - ... - include adobe.map - include apple.map - include bitstrea.map - ... - - Fontmaps are implemented in the file `kpathsea/fontmap.c'. The -Fontname distribution has much more information on font naming (*note -Introduction: (fontname)Introduction.). - - -File: kpathsea.info, Node: Fallback font, Prev: Fontmap, Up: Glyph lookup - -Fallback font -------------- - - If a bitmap font cannot be found or created at the requested size, -Kpathsea looks for the font at a set of "fallback resolutions". You -specify these resolutions as a colon-separated list (like search paths). -Kpathsea looks first for a program-specific environment variable (e.g., -`DVIPSSIZES' for Dvipsk), then the environment variable `TEXSIZES', -then a default specified at compilation time (the Make variable -`default_texsizes'). You can set this list to be empty if you prefer -to find fonts at their stated size or not at all. - - Finally, if the font cannot be found even at the fallback resolutions, -Kpathsea looks for a fallback font, typically `cmr10'. Programs must -enable this feature by assigning to the global variable -`kpse_fallback_font' or calling `kpse_init_prog' (*note Calling -sequence::.); the default is no fallback font. - - -File: kpathsea.info, Node: Suppressing warnings, Prev: Glyph lookup, Up: TeX support - -Suppressing warnings -==================== - - Kpathsea provides a way to suppress selected usually-harmless -warnings; this is useful at large sites where most users are not -administrators, and thus the warnings are merely a source of confusion, -not a help. To do this, you set the environment variable or -configuration file value `TEX_HUSH' to a colon-separated list of -values. Here are the possibilities: - -`all' - Suppress everything possible. - -`checksum' - Suppress mismatched font checksum warnings. - -`lostchar' - Suppress warnings when a character is missing from a font that a - DVI or VF file tries to typeset. - -`readable' - Suppress warnings about attempts to access a file whose permissions - render it unreadable. - -`special' - Suppresses warnings about an unimplemented or unparsable - `\special' command. - -`tex-hush.c' defines the function that checks the variable value. Each -driver implements its own checks where appropriate. - - -File: kpathsea.info, Node: Programming, Next: Index, Prev: TeX support, Up: Top - -Programming -*********** - - This chapter is for programmers who wish to use Kpathsea. *Note -Introduction::, for the conditions under which you may do so. - -* Menu: - -* Overview: Programming overview. Introduction. -* Calling sequence:: Specifics of what to call. -* Program-specific files:: How to handle these. -* Config: Programming with config files. Getting info from texmf.cnf. - - -File: kpathsea.info, Node: Programming overview, Next: Calling sequence, Up: Programming - -Programming overview -==================== - - Aside from this manual, your best source of information is the source -to the programs I've modified to use Kpathsea (*note Introduction::.). -Of those, Dviljk is probably the simplest, and hence a good place to -start. Xdvik adds VF support and the complication of X resources. -Dvipsk adds the complication of its own config files. Web2c is source -code I also maintain, so it uses Kpathsea rather straightforwardly, but -is of course complicated by the Web to C translation. Finally, -Kpsewhich is a small utility program whose sole purpose is to exercise -the main path-searching functionality. - - Beyond these examples, the `.h' files in the Kpathsea source describe -the interfaces and functionality (and of course the `.c' files define -the actual routines, which are the ultimate documentation). -`pathsearch.h' declares the basic searching routine. `tex-file.h' and -`tex-glyph.h' define the interfaces for looking up particular kinds of -files. You may wish to use `#include <kpathsea/kpathsea.h>', which -includes every Kpathsea header. - - The library provides no way for an external program to register new -file types: `tex-file.[ch]' must be modified to do this. For example, -Kpathsea has support for looking up Dvips config files, even though no -program other than Dvips will likely ever want to do so. I felt this -was acceptable, since along with new file types should also come new -defaults in `texmf.cnf' (and its descendant `paths.h'), since it's -simplest for users if they can modify one configuration file for all -kinds of paths. - - Kpathsea does not parse any formats itself; it barely opens any files. -Its primary purpose is to return filenames. The GNU font utilities does -contain libraries to read TFM, GF, and PK files, as do the programs -above, of course. - - -File: kpathsea.info, Node: Calling sequence, Next: Program-specific files, Prev: Programming overview, Up: Programming - -Calling sequence -================ - - The typical way to use Kpathsea in your program goes something like -this: - - 1. Call `kpse_set_program_name' with `argv[0]' as the first argument; - the second argument is a string or `NULL'. The second argument is - used by Kpathsea as the program name for the `.PROGRAM' feature of - config files (*note Config files::.). If the second argument is - `NULL', the value of the first argument is used. This function - must be called before any other use of the Kpathsea library. - - If necessary, `kpse_set_program_name' sets the global variables - `program_invocation_name' and `program_invocation_short_name'. - These variables are used in the error message macros defined in - `kpathsea/lib.h'. It sets the global variable `kpse_program_name' - to the program name it uses. It also initializes debugging - options based on the environment variable `KPATHSEA_DEBUG' (if - that is set). Finally, it sets the variables `SELFAUTOLOC', - `SELFAUTODIR' and `SELFAUTOPARENT' to the location, parent and - grandparent directory of the executable, removing `.' and `..' - path elements and resolving symbolic links. These are used in the - default configuration file to allow people to invoke TeX from - anywhere, specifically from a mounted CD-ROM. (You can use - `--expand-var=\$SELFAUTOLOC', etc., to see the values finds.) - - 2. The `kpse_set_progname' is deprecated. A call to - `kpse_set_progname' with `argv[0]' is equivalent to a call of - `kpse_set_program_name' with first argument `argv[0]' and second - argument `NULL'. The function is deprecated because it cannot - ensure that the `.PROGRAM' feature of config files will always - work (*note Config files::.). - - 3. Set debugging options. *Note Debugging::. If your program doesn't - have a debugging option already, you can define one and set - `kpathsea_debug' to the number that the user supplies (as in Dviljk - and Web2c), or you can just omit this altogether (people can - always set `KPATHSEA_DEBUG'). If you do have runtime debugging - already, you need to merge Kpathsea's options with yours (as in - Dvipsk and Xdvik). - - 4. If your program has its own configuration files that can define - search paths, you should assign those paths to the `client_path' - member in the appropriate element of the `kpse_format_info' array. - (This array is indexed by file type; see `tex-file.h'.) See - `resident.c' in Dvipsk for an example. - - 5. Call `kpse_init_prog' (see `proginit.c'). It's useful for the DVI - drivers, at least, but for other programs it may be simpler to - extract the parts of it that actually apply. This does not - initialize any paths, it just looks for (and sets) certain - environment variables and other random information. (A search - path is always initialized at the first call to find a file of - that type; this eliminates much useless work, e.g., initializing - the BibTeX search paths in a DVI driver.) - - 6. The routine to actually find a file of type FORMAT is - `kpse_find_FORMAT', defined in `tex-file.h'. These are macros that - expand to a call to `kpse_find_file'. You can call, say, - `kpse_find_tfm' after doing only the first of the initialization - steps above--Kpathsea automatically reads the `texmf.cnf' generic - config files, looks for environment variables, and does expansions - at the first lookup. - - 7. To find PK and/or GF bitmap fonts, the routines are `kpse_find_pk', - `kpse_find_gf' and `kpse_find_glyph', defined in `tex-glyph.h'. - These return a structure in addition to the resultant filename, - because fonts can be found in so many ways. See the documentation - in the source. - - 8. To actually open a file, not just return a filename, call - `kpse_open_file'. This function takes the name to look up and a - Kpathsea file format as arguments, and returns the usual `FILE *'. - It always assumes the file must exist, and thus will search the - disk if necessary (unless the search path specified `!!', etc.). - In other words, if you are looking up a VF or some other file that - need not exist, don't use this. - - - Kpathsea also provides many utility routines. Some are generic: hash -tables, memory allocation, string concatenation and copying, string -lists, reading input lines of arbitrary length, etc. Others are -filename-related: default path, tilde, and variable expansion, `stat' -calls, etc. (Perhaps someday I'll move the former to a separate -library.) - - The `c-*.h' header files can also help your program adapt to many -different systems. You will almost certainly want to use Autoconf for -configuring your software if you use Kpathsea; I strongly recommend -using Autoconf regardless. It is available from -`ftp://ftp.gnu.org/pub/gnu/autoconf'. - - -File: kpathsea.info, Node: Program-specific files, Next: Programming with config files, Prev: Calling sequence, Up: Programming - -Program-specific files -====================== - - Many programs will need to find some configuration files. Kpathsea -contains some support to make it easy to place them in their own -directories. The Standard TeX directory structure (*note Introduction: -(tds)Top.), specifies that such files should go into a subdirectory -named after the program, like `texmf/ttf2pk'. - - Two special formats, `kpse_program_text_format' and -`kpse_program_binary_format' exist, which use `.:$TEXMF/PROGRAM//' as -their compiled-in search path. To override this default, you can use -the variable `PROGRAMINPUTS' in the environment and/or `texmf.cnf'. -That is to say, the name of the variable is constructed by converting -the name of the program to upper case, and appending `INPUTS'. - - The only difference between these two formats is whether -`kpse_open_file' will open the files it finds in text or binary mode. - - -File: kpathsea.info, Node: Programming with config files, Prev: Program-specific files, Up: Programming - -Programming with config files -============================= - - You can (and probably should) use the same `texmf.cnf' configuration -file that Kpathsea uses for your program. This helps installers by -keeping all configuration in one place. - - To retrieve a value VAR from config files, the best way is to call -`kpse_var_value' on the string `VAR'. This will look first for an -environment variable VAR, then a config file value. The result will be -the value found or `NULL'. This function is declared in -`kpathsea/variable.h'. For an example, see the `shell_escape' code in -`web2c/lib/texmfmp.c'. - - The routine to do variable expansion in the context of a search path -(as opposed to simply retrieving a value) is `kpse_var_expand', also -declared in `kpathsea/variable.h'. It's generally only necessary to -set the search path structure components as explained in the previous -section, rather than using this yourself. - - If for some reason you want to retrieve a value *only* from a config -file, not automatically looking for a corresponding environment -variable, call `kpse_cnf_get' (declared in `kpathsea/cnf.h') with the -string VAR. - - No initialization calls are needed. - - -File: kpathsea.info, Node: Index, Prev: Programming, Up: Top - -Index -***** - -* Menu: - -* !! in path specifications: ls-R. -* $ expansion: Variable expansion. -* --color=tty: ls-R. -* --debug=NUM: Auxiliary tasks. -* --disable-static: configure options. -* --dpi=NUM: Path searching options. -* --enable options: configure options. -* --enable-maintainer-mode: configure options. -* --enable-shared <1>: Shared library. -* --enable-shared: configure options. -* --expand-braces=STRING: Auxiliary tasks. -* --expand-path=STRING: Auxiliary tasks. -* --expand-var=STRING: Auxiliary tasks. -* --format=NAME: Path searching options. -* --help: Standard options. -* --interactive: Path searching options. -* --mode=STRING: Path searching options. -* --must-exist: Path searching options. -* --path=STRING: Path searching options. -* --progname=NAME: Path searching options. -* --show-path=NAME: Auxiliary tasks. -* --srcdir, for building multiple architectures: configure scenarios. -* --version: Standard options. -* --with options: configure options. -* --with-mktextex-default: mktex configuration. -* --without-mktexmf-default: mktex configuration. -* --without-mktexpk-default: mktex configuration. -* --without-mktextfm-default: mktex configuration. -* -1 debugging value: Debugging. -* -A option to ls: ls-R. -* -Bdynamic: ShellWidgetClass. -* -Bstatic: ShellWidgetClass. -* -D NUM: Path searching options. -* -dynamic: ShellWidgetClass. -* -g, compiling without: configure scenarios. -* -L option to ls: ls-R. -* -mktex=FILETYPE: Path searching options. -* -no-mktex=FILETYPE: Path searching options. -* -O, compiling with: configure scenarios. -* -static: ShellWidgetClass. -* . directories, ignored: ls-R. -* . files: ls-R. -* .2602gf: Unable to generate fonts. -* .afm: Supported file formats. -* .base: Supported file formats. -* .bib: Supported file formats. -* .bst: Supported file formats. -* .cnf: Supported file formats. -* .eps: Supported file formats. -* .epsi: Supported file formats. -* .fmt: Supported file formats. -* .ist: Supported file formats. -* .map: Supported file formats. -* .mem: Supported file formats. -* .mf: Supported file formats. -* .mft: Supported file formats. -* .mp: Supported file formats. -* .ocp: Supported file formats. -* .ofm: Supported file formats. -* .opl: Supported file formats. -* .otp: Supported file formats. -* .ovf: Supported file formats. -* .ovp: Supported file formats. -* .pfa: Supported file formats. -* .pfb: Supported file formats. -* .pk: Supported file formats. -* .pool: Supported file formats. -* .pro: Supported file formats. -* .rhosts, writable by TeX: Security. -* .tex: Supported file formats. -* .tex file, included in ls-R: ls-R. -* .tfm: Supported file formats. -* .ttc: Supported file formats. -* .ttf: Supported file formats. -* .vf: Supported file formats. -* / may not be /: Searching overview. -* /, trailing in home directory: Tilde expansion. -* //: Subdirectory expansion. -* /afs/... , installing into: Installing files. -* /etc/profile: Unable to find files. -* /etc/profile and aliases: ls-R. -* /var/tmp/texfonts: mktex configuration. -* 2602gf: Unable to generate fonts. -* 4allTeX Live CD-ROM: CD-ROM distribution. -* 8.3 filenames, using: mktex configuration. -* : may not be :: Searching overview. -* :: expansion: Default expansion. -* @VAR@ substitutions: Running configure. -* \, line continuation in texmf.cnf: Config files. -* \openin: Searching overview. -* \special, suppressing warnings about: Suppressing warnings. -* absolute filenames: Searching overview. -* ac_include, Autoconf extension: Running configure. -* access warnings: Searching overview. -* Acorn TeX implementations: Other TeX packages. -* AFMFONTS: Supported file formats. -* AFS: Installing files. -* AIX 4.1 configure error: Empty Makefiles. -* AIX shells and configure: configure shells. -* aliases for fonts: Fontmap. -* aliases, for filenames: Filename aliases. -* all: Suppressing warnings. -* alphabetical order, not: Subdirectory expansion. -* Amiga support: Custom installation. -* Amiga TeX implementations: Other TeX packages. -* Andrew File System, installing with: Installing files. -* announcement mailing list: Mailing lists. -* ANSI C: TeX or Metafont failing. -* append-only directories and mktexpk: Security. -* appendonlydir: mktex configuration. -* architecture-(in)dependent files, installing only: Installing files. -* architectures, compiling multiple: configure scenarios. -* arguments to mktex: mktex script arguments. -* argv[0]: Calling sequence. -* ash, losing with configure: configure shells. -* autoconf, recommended: Calling sequence. -* automounter, and configuration: configure scenarios. -* automounter, and ls-R: ls-R. -* auxiliary tasks: Auxiliary tasks. -* Babel <1>: Running make. -* Babel: Kpathsea application distributions. -* Bach, Johann Sebastian: Default expansion. -* backbone of CTAN: Electronic distribution. -* backslash-newline: Config files. -* bash, recommended for running configure: configure shells. -* basic glyph lookup: Basic glyph lookup. -* Berry, Karl: History. -* BIBINPUTS: Supported file formats. -* binary mode, for file transfers: Electronic distribution. -* blank lines, in texmf.cnf: Config files. -* brace expansion: Brace expansion. -* BSD universe: Running make. -* bsh, ok with configure: configure shells. -* BSTINPUTS: Supported file formats. -* bug address: Reporting bugs. -* bug checklist: Bug checklist. -* bug mailing list: Mailing lists. -* bugs, reporting: Reporting bugs. -* c-*.h: Calling sequence. -* c-auto.in: Running configure. -* cache of fonts, local: Security. -* calling sequence: Calling sequence. -* CC: configure environment. -* cc warnings: Pointer combination warnings. -* cc, compiling with: configure environment. -* CD-ROM distributions: CD-ROM distribution. -* CFLAGS: configure environment. -* ChangeLog entry: Bug checklist. -* checklist for bug reports: Bug checklist. -* checksum: Suppressing warnings. -* circle fonts: Fontmap. -* clean Make target: Cleaning up. -* client_path in kpse_format_info: Calling sequence. -* cmr10, as fallback font: Fallback font. -* cmr10.vf: Searching overview. -* cnf.c: Config files. -* cnf.h: Programming with config files. -* code sharing: Shared library. -* color printers, configuring: Simple installation. -* comments, in fontmap files: Fontmap. -* comments, in texmf.cnf: Config files. -* comments, making: Introduction. -* common features in glyph lookup: Basic glyph lookup. -* common problems: Common problems. -* comp.sys.sun.admin FAQ: ShellWidgetClass. -* comp.text.tex: Mailing lists. -* compilation: Installation. -* compilation value, source for path: Path sources. -* compiler bugs: TeX or Metafont failing. -* compiler bugs, finding: TeX or Metafont failing. -* compiler options, additional: Running make. -* compiler options, specifying: configure environment. -* compiler, changing: Running make. -* compiling on HP-UX: TeX or Metafont failing. -* conditions for use: Introduction. -* config files: Config files. -* config files, for Kpathsea-using programs: Calling sequence. -* config files, programming with: Programming with config files. -* config.log: Bug checklist. -* config.ps, search path for: Supported file formats. -* config.status: Bug checklist. -* configuration: Installation. -* configuration bugs: Bug checklist. -* configuration compiler options: configure environment. -* configuration file, source for path: Path sources. -* configuration files as shell scripts.: Config files. -* configuration of mktex scripts: mktex configuration. -* configuration of optional features: configure options. -* configure error from sed: Empty Makefiles. -* configure options: configure options. -* configure options for mktex scripts: mktex configuration. -* configure, running: Running configure. -* context diff: Bug checklist. -* continuation character: Config files. -* core dumps, reporting: Bug checklist. -* CPPFLAGS: configure environment. -* crashes, reporting: Bug checklist. -* CTAN, defined: Electronic distribution. -* CTAN.sites: Electronic distribution. -* custom installation: Custom installation. -* Dante TeX CD-ROM: CD-ROM distribution. -* database search: Searching overview. -* database, for filenames: Filename database. -* database, format of: Database format. -* debug.h: Debugging. -* debugger: Bug checklist. -* debugging: Debugging. -* debugging options, in Kpathsea-using program: Calling sequence. -* debugging output: Debugging. -* debugging with -g, disabling: configure scenarios. -* DEC shells and configure: configure shells. -* default expansion: Default expansion. -* default path features: Default path features. -* default paths, changing: Default path generation. -* default paths, how they're made: Default path generation. -* default_texsizes: Fallback font. -* DEFS: configure environment. -* depot: configure scenarios. -* directories, changing default installation: Default path generation. -* directories, making append-only: mktex configuration. -* directory permissions: Security. -* directory structure, for TeX files: TeX directory structure. -* disabling mktex scripts: mktex configuration. -* disk search: Searching overview. -* disk searching, avoiding: ls-R. -* disk space, needed: Disk space. -* disk usage, reducing: Logging. -* distclean Make target: Cleaning up. -* distributions, compiling simultaneously: Kpathsea application distributions. -* distributions, not compiling: Kpathsea application distributions. -* distributions, on CD-ROM: CD-ROM distribution. -* distributions, on tape: Tape distribution. -* distributions, via ftp: Electronic distribution. -* dlclose: dlopen. -* dlopen: dlopen. -* dlsym: dlopen. -* dlsym.c: dlopen. -* doc files: Supported file formats. -* DOS compatible names: mktex configuration. -* DOS support: Custom installation. -* DOS TeX implementations: Other TeX packages. -* dosnames: mktex configuration. -* dot files: ls-R. -* doubled colons: Default expansion. -* dpiNNN directories: mktex configuration. -* DVI drivers: Kpathsea application distributions. -* DVILJMAKEPK: mktex script names. -* DVILJSIZES: Fallback font. -* DVIPSFONTS: Supported file formats. -* DVIPSHEADERS: Supported file formats. -* DVIPSMAKEPK: mktex script names. -* DVIPSSIZES: Fallback font. -* dynamic creation of files: mktex scripts. -* dynamic linking problems with OpenWin libraries: ShellWidgetClass. -* EC fonts, and dynamic source creation: mktex scripts. -* elt-dirs.c: Subdirectory expansion. -* email CTAN access: Electronic distribution. -* enabling mktex scripts: mktex configuration. -* environment variable, source for path: Path sources. -* environment variables for TeX: Supported file formats. -* environment variables in paths: Variable expansion. -* environment variables, old: Unable to find files. -* epoch, seconds since: Logging. -* error message macros: Calling sequence. -* excessive startup time: Slow path searching. -* expand.c: Brace expansion. -* expanding symlinks: Calling sequence. -* expansion, default: Default expansion. -* expansion, path element: Searching overview. -* expansion, search path: Path expansion. -* expansion, subdirectory: Subdirectory expansion. -* expansion, tilde: Tilde expansion. -* expansion, variable: Variable expansion. -* explicitly relative filenames: Searching overview. -* externally-built filename database: Filename database. -* extra colons: Default expansion. -* extraclean Make target: Cleaning up. -* failed mktex... script invocation: mktex script names. -* fallback font: Fallback font. -* fallback resolutions: Fallback font. -* fallback resolutions, overriding: Running make. -* FAQ, comp.sys.sun.admin: ShellWidgetClass. -* FAQ, Kpathsea: Common problems. -* Farwell, Matthew: Subdirectory expansion. -* features, of default paths: Default path features. -* file formats, supported: Supported file formats. -* file lookup: File lookup. -* file permissions: Security. -* file types, registering new: Programming overview. -* filename aliases: Filename aliases. -* filename database: Filename database. -* filename database generation: Filename database generation. -* filenames, absolute or explicitly relative: Searching overview. -* files, unable to find: Unable to find files. -* filesystem search: Searching overview. -* floating directories: Searching overview. -* font alias files: Fontmap. -* font generation failures: Unable to generate fonts. -* font of last resort: Fallback font. -* font set, infinite: mktex scripts. -* fontmap files: Fontmap. -* fontmaps: mktex configuration. -* fontname: mktex configuration. -* fontnames, arbitrary length: Fontmap. -* fonts, being created: Simple installation. -* FOOINPUTS: Supported file formats. -* fopen, redefined: Debugging. -* format of external database: Database format. -* Free Software Foundation: CD-ROM distribution. -* FreeBSD configure error: Empty Makefiles. -* FreeBSD shells and configure: configure shells. -* FSF Source Code CD-ROM: CD-ROM distribution. -* ftp retrieval: Electronic distribution. -* ftp.tug.org: unixtex.ftp. -* fundamental purpose of Kpathsea: Introduction. -* gcc, compiling with: configure environment. -* gdb, recommended: Bug checklist. -* generation of filename database: Filename database generation. -* German TeX CD info: CD-ROM distribution. -* get_applicationShellWidgetClass: ShellWidgetClass. -* get_wmShellWidgetClass: ShellWidgetClass. -* gf: Supported file formats. -* GFFONTS: Supported file formats. -* globally writable directories: Security. -* glyph lookup: Glyph lookup. -* glyph lookup bitmap tolerance: Basic glyph lookup. -* GLYPHFONTS: Supported file formats. -* GNU C compiler bugs: TeX or Metafont failing. -* GNU General Public License: Introduction. -* Gopher CTAN access: Electronic distribution. -* group-writable directories: Security. -* GSFTOPK_DEBUG (128): Debugging. -* GUTenberg: CD-ROM distribution. -* hash table buckets, printing: Debugging. -* hash table routines: Calling sequence. -* hash_summary_only variable for debugging: Debugging. -* help, mailing list for general TeX: Mailing lists. -* HIER: Default path features. -* history of Kpathsea: History. -* home directories in paths: Tilde expansion. -* HOME, as ~ expansion: Tilde expansion. -* HP-UX, compiling on: TeX or Metafont failing. -* identifiers, characters valid in: Config files. -* illegal pointer combination warnings: Pointer combination warnings. -* include fontmap directive: Fontmap. -* INDEXSTYLE: Supported file formats. -* info-tex@shsu.edu: Mailing lists. -* input lines, reading: Calling sequence. -* install-data Make target: Installing files. -* install-exec Make target: Installing files. -* installation: Installation. -* installation testing: Installation testing. -* installation, architecture-(in)dependent files only: Installing files. -* installation, changing default directories: Default path generation. -* installation, customized: Custom installation. -* installation, getting executables instead of: Simple installation. -* installation, simple: Simple installation. -* installing files: Installing files. -* interactive query: Path searching options. -* interface, not frozen: Introduction. -* introduction: Introduction. -* kdebug:: Debugging. -* kdefault.c: Default expansion. -* Knuth, Donald E.: History. -* Knuth, Donald E., archive of programs by: Other TeX packages. -* Knuth, Donald E., original author: Electronic distribution. -* Korn shell, losing with configure: configure shells. -* Kpathsea config file, source for path: Path sources. -* Kpathsea version number: Kpathsea application distributions. -* kpathsea.h: Programming overview. -* kpathsea/HIER: Default path features. -* kpathsea/README.CONFIGURE: Running configure. -* KPATHSEA_DEBUG: Calling sequence. -* kpathsea_debug: Debugging. -* KPATHSEA_DEBUG: Debugging. -* kpathsea_debug: Debugging. -* kpathsea_debug variable: Calling sequence. -* KPSE_BITMAP_TOLERANCE: Basic glyph lookup. -* kpse_cnf_get: Programming with config files. -* KPSE_DEBUG_EXPAND (16): Debugging. -* KPSE_DEBUG_FOPEN (4): Debugging. -* KPSE_DEBUG_HASH (2): Debugging. -* KPSE_DEBUG_PATHS (8): Debugging. -* KPSE_DEBUG_SEARCH (32): Debugging. -* KPSE_DEBUG_STAT (1): Debugging. -* KPSE_DEBUG_VARS (64): Debugging. -* KPSE_DOT expansion: KPSE_DOT expansion. -* kpse_fallback_font: Fallback font. -* kpse_find_*: Calling sequence. -* kpse_find_file <1>: Calling sequence. -* kpse_find_file: File lookup. -* kpse_find_glyph_format: Glyph lookup. -* kpse_format_info: Calling sequence. -* kpse_format_info_type: Debugging. -* kpse_init_prog: Calling sequence. -* kpse_init_prog, and MAKETEX_MODE: Default path features. -* kpse_make_specs: mktex script names. -* kpse_open_file: Calling sequence. -* kpse_program_name: Calling sequence. -* kpse_set_progname: Calling sequence. -* kpse_set_program_name: Calling sequence. -* kpse_var_value: Programming with config files. -* kpsewhich: Invoking kpsewhich. -* Kpsewhich, and debugging: Debugging. -* ksh, losing with configure: configure shells. -* labrea.stanford.edu: Other TeX packages. -* LaserJet drive: Kpathsea application distributions. -* last-resort font: Fallback font. -* LaTeX help mailing list: Mailing lists. -* lcircle10: Fontmap. -* LDFLAGS: configure environment. -* leading colons: Default expansion. -* leaf directories wrongly guessed: Unable to find files. -* leaf directory trick: Subdirectory expansion. -* libdl.a: dlopen. -* libraries, changing: Running make. -* libraries, specifying additional: configure environment. -* LIBS: configure environment. -* libucb, avoiding: Running make. -* license for using the library: Introduction. -* lines, reading arbitrary-length: Calling sequence. -* Linux File System Standard: mktex configuration. -* Linux shells and configure: configure shells. -* Linux, using Web2c: CD-ROM distribution. -* lndir for building symlink trees: configure scenarios. -* loader options: configure environment. -* loader options, final: Running make. -* loader options, initial: Running make. -* local cache of fonts: Security. -* log file: Logging. -* logging successful searches: Logging. -* lost+found directory: Searching overview. -* lostchar: Suppressing warnings. -* ls-R: Supported file formats. -* ls-R and AFS: Installing files. -* ls-R database file: ls-R. -* ls-R, simplest build: ls-R. -* Mach10 configure error: Empty Makefiles. -* Macintosh TeX implementations: Other TeX packages. -* MacKenzie, David <1>: Subdirectory expansion. -* MacKenzie, David: History. -* magic characters: Searching overview. -* mailing lists: Mailing lists. -* maintainer-clean Make target: Cleaning up. -* Make arguments, additional: Running make. -* make, running: Running make. -* Makefile.in: Running configure. -* Makefiles, empty: Empty Makefiles. -* MAKETEX_DEBUG (512): Debugging. -* MAKETEX_FINE_DEBUG (1024): Debugging. -* MAKETEX_MODE: Default path features. -* memory allocation routines: Calling sequence. -* Metafont failures: TeX or Metafont failing. -* Metafont installation: Unable to generate fonts. -* Metafont making too-large fonts: Unable to generate fonts. -* Metafont using the wrong resolution: Unable to generate fonts. -* MFBASES: Supported file formats. -* MFINPUTS: Supported file formats. -* MFPOOL: Supported file formats. -* MFTINPUTS: Supported file formats. -* mirrors, FTP: Electronic distribution. -* mismatched checksum warnings: Suppressing warnings. -* missfont.log: mktex script names. -* MISSFONT_LOG: mktex script names. -* missing character warnings: Suppressing warnings. -* mktex script configuration: mktex configuration. -* mktex script names: mktex script names. -* mktex scripts: mktex scripts. -* mktex.cnf: mktex configuration. -* mktex.opt: mktex configuration. -* mktexdir: mktex configuration. -* mktexmf: mktex script names. -* mktexpk: mktex script names. -* mktexpk , initial runs: Simple installation. -* mktextex: mktex script names. -* mktextfm: mktex script names. -* mode directory, omitting: mktex configuration. -* Morgan, Tim: History. -* mostlyclean Make target: Cleaning up. -* MPINPUTS: Supported file formats. -* MPMEMS: Supported file formats. -* MPPOOL: Supported file formats. -* MPSUPPORT: Supported file formats. -* MT_FEATURES: mktex configuration. -* multiple architectures, compiling on: configure scenarios. -* multiple architectures, directories for: configure scenarios. -* multiple architectures, installing on: Installing files. -* multiple TeX hierarchies: Brace expansion. -* must exist: Searching overview. -* names for mktex scripts: mktex script names. -* NetBSD configure error: Empty Makefiles. -* NetBSD shells and configure: configure shells. -* Neumann, Gustaf: History. -* newsgroup for TeX: Mailing lists. -* NeXT sed error: Empty Makefiles. -* NeXT, lacking X11: Kpathsea application distributions. -* NFS and ls-R: ls-R. -* NFS CTAN access: Electronic distribution. -* nomode: mktex configuration. -* non-English typesetting: Kpathsea application distributions. -* non-Unix operating systems: Custom installation. -* Northwest Computing Support Center: Tape distribution. -* NTG: CD-ROM distribution. -* null pointers, dereferencing: Bug checklist. -* numeric debugging values: Debugging. -* obtaining TeX: unixtex.ftp. -* obtaining TeX on tape: Tape distribution. -* obtaining Web2c by ftp: Electronic distribution. -* obtaining Web2c on CD-ROM: CD-ROM distribution. -* OCPINPUTS: Supported file formats. -* OFMFONTS: Supported file formats. -* online Metafont display, spurious: Unable to generate fonts. -* OpenWin libraries, dynamic linking problems: ShellWidgetClass. -* optimization caveat: TeX or Metafont failing. -* optimization, enabling: configure scenarios. -* options for debugging: Debugging. -* options to configure: configure options. -* OS/2 support: Custom installation. -* other TeX distributions: Other TeX packages. -* OTPINPUTS: Supported file formats. -* overview of path searching: Searching overview. -* overview of programming with Kpathsea: Programming overview. -* OVFFONTS: Supported file formats. -* OVPFONTS: Supported file formats. -* patches, Sun OpenWin: ShellWidgetClass. -* path expansion: Path expansion. -* path searching: Path searching. -* path searching options: Path searching options. -* path searching, overview: Searching overview. -* path searching, standalone: Invoking kpsewhich. -* path sources: Path sources. -* paths, changing default <1>: Default path generation. -* paths, changing default: Changing search paths. -* paths, device name included in: Default path features. -* paths.h: Default path generation. -* paths.h, creating: Running make. -* pathsearch.h: Programming overview. -* pc Pascal compiler: History. -* PCL driver: Kpathsea application distributions. -* PDF generation: Kpathsea application distributions. -* permission denied: Searching overview. -* permissions, directory: Security. -* permissions, file: Security. -* PKFONTS: Supported file formats. -* plain.base: Unable to generate fonts. -* pointer combination warnings: Pointer combination warnings. -* PostScript driver: Kpathsea application distributions. -* PostScript fonts, additional: Simple installation. -* precompiled executables, instead of installation: Simple installation. -* precompiled Unix binaries: Other TeX packages. -* preprocessor options: configure environment. -* preprocessor options, additional: Running make. -* Prime Time TeXcetera CD-ROM: CD-ROM distribution. -* printer configuration files: Simple installation. -* privacy, semblance of: Logging. -* problems, common: Common problems. -* proginit.c: Default path features. -* proginit.h: Calling sequence. -* program-varying paths: Supported file formats. -* program_invocation_name: Calling sequence. -* program_invocation_short_name: Calling sequence. -* programming overview: Programming overview. -* programming with config files: Programming with config files. -* programming with Kpathsea: Calling sequence. -* programs using the library: Introduction. -* proof mode: Unable to generate fonts. -* PSHEADERS: Supported file formats. -* pxp Pascal preprocessor: History. -* quoting variable values: Variable expansion. -* readable: Suppressing warnings. -* reading arbitrary-length lines: Calling sequence. -* README.CONFIGURE: Running configure. -* README.mirrors: Electronic distribution. -* recording successful searches: Logging. -* relative filenames: Searching overview. -* relative filenames in ls-R: Installing files. -* reporting bugs: Reporting bugs. -* resident.c: Calling sequence. -* resolution, setting: Path searching options. -* resolution, wrong: Unable to generate fonts. -* resolutions, last-resort: Fallback font. -* retrieving TeX: unixtex.ftp. -* right-hand side of variable assignments: Config files. -* Rokicki, Tom: History. -* root user: Tilde expansion. -* runtime configuration files: Config files. -* runtime debugging: Debugging. -* Sauter fonts, and dynamic source creation: mktex scripts. -* scripts for file creation: mktex scripts. -* search path, defined: Searching overview. -* search paths, changing default: Changing search paths. -* searching for files: File lookup. -* searching for glyphs: Glyph lookup. -* searching overview: Searching overview. -* searching the database: Searching overview. -* searching the disk: Searching overview. -* security considerations: Security. -* sed error from configure: Empty Makefiles. -* SELFAUTODIR: Calling sequence. -* SELFAUTOLOC: Calling sequence. -* SELFAUTOPARENT: Calling sequence. -* sending patches: Bug checklist. -* setgid scripts: Security. -* sh5, ok with configure: configure shells. -* shar, recommended: Bug checklist. -* shared library, making: Shared library. -* shell scripts as configuration files: Config files. -* shell variables: Variable expansion. -* shell_escape, example for code: Programming with config files. -* shells and configure: configure shells. -* simple installation: Simple installation. -* site overrides for mktex...: mktex configuration. -* size of distribution archives: Disk space. -* skeleton TeX directory: TeX directory structure. -* slow startup time: Slow path searching. -* Solaris BSD compatibility, not: Running make. -* source files: Supported file formats. -* sources for search paths: Path sources. -* special: Suppressing warnings. -* st_nlink: Subdirectory expansion. -* stack trace: Bug checklist. -* standalone path searching: Invoking kpsewhich. -* standard error and debugging output: Debugging. -* standard options: Standard options. -* startup time, excessive: Slow path searching. -* static linking: ShellWidgetClass. -* static linking and dlsym: dlopen. -* string routines: Calling sequence. -* strip: mktex configuration. -* stripsupplier: mktex configuration. -* striptypeface: mktex configuration. -* subdirectory searching: Subdirectory expansion. -* suggestions, making: Introduction. -* Sun 2: History. -* Sun OpenWin patches: ShellWidgetClass. -* supplier directory, omitting: mktex configuration. -* support organization: Tape distribution. -* supported file formats: Supported file formats. -* suppressing warnings: Suppressing warnings. -* symbolic link trees, for multiple architectures: configure scenarios. -* symbolic links not found: Unable to find files. -* symbolic links, and ls-R: ls-R. -* symlinks, resolving: Calling sequence. -* system C compiler bugs: TeX or Metafont failing. -* system dependencies: Running configure. -* system V universe: Running make. -* T1FONTS: Supported file formats. -* T1INPUTS: Supported file formats. -* T42FONTS: Supported file formats. -* tape distribution: Tape distribution. -* TDS: TeX directory structure. -* testing, post-installation: Installation testing. -* tests, simple: Simple installation. -* teTeX: Other TeX packages. -* TeX directory structure: TeX directory structure. -* TeX distributions besides Web2c: Other TeX packages. -* TeX environment variables: Supported file formats. -* TeX failures: TeX or Metafont failing. -* TeX file lookup: File lookup. -* TeX glyph lookup: Glyph lookup. -* TeX help mailing list: Mailing lists. -* TeX hierarchy, one: configure scenarios. -* TeX Live CD-ROM: CD-ROM distribution. -* TeX support: TeX support. -* TeX Users Group: Introduction. -* tex-archive@math.utah.edu: Mailing lists. -* tex-file.c: File lookup. -* tex-file.h: Programming overview. -* tex-glyph.c: Glyph lookup. -* tex-glyph.h: Programming overview. -* tex-k-request@mail.tug.org: Mailing lists. -* tex-k@mail.tug.org (bug address): Reporting bugs. -* tex-make.c: mktex script names. -* TEX_HUSH <1>: Suppressing warnings. -* TEX_HUSH: Searching overview. -* TEXBIB: Supported file formats. -* TEXCONFIG: Supported file formats. -* TEXDOCS: Supported file formats. -* TEXFONTMAPS: Supported file formats. -* TEXFONTS: Supported file formats. -* texfonts.map: Fontmap. -* TEXFORMATS: Supported file formats. -* TEXINDEXSTYLE: Supported file formats. -* TEXINPUTS: Supported file formats. -* TEXMF: TeX directory structure. -* texmf.cnf, and variable expansion: Variable expansion. -* texmf.cnf, creating: Running make. -* texmf.cnf, definition for: Config files. -* texmf.cnf, generated: Default path generation. -* texmf.cnf, source for path: Path sources. -* texmf.in: Default path generation. -* texmf.in, editing: Changing search paths. -* texmf.sed: Default path generation. -* TEXMFCNF <1>: Supported file formats. -* TEXMFCNF: Config files. -* TEXMFDBS <1>: Supported file formats. -* TEXMFDBS: ls-R. -* TEXMFINI: Supported file formats. -* TEXMFLOG: Logging. -* TEXMFOUTPUT: mktex script names. -* TEXPICTS: Supported file formats. -* TEXPKS: Supported file formats. -* TEXPOOL: Supported file formats. -* TEXPSHEADERS: Supported file formats. -* TEXSIZES: Fallback font. -* TEXSOURCES: Supported file formats. -* TFMFONTS: Supported file formats. -* tilde expansion: Tilde expansion. -* tilde.c: Tilde expansion. -* time system call: Logging. -* tolerance for glyph lookup: Basic glyph lookup. -* total disk space: Disk space. -* trailing / in home directory: Tilde expansion. -* trailing colons: Default expansion. -* TRFONTS: Supported file formats. -* trick for detecting leaf directories: Subdirectory expansion. -* trojan horse attack: Security. -* TTFONTS: Supported file formats. -* TUG: CD-ROM distribution. -* tug.org: unixtex.ftp. -* tug@tug.org: Introduction. -* typeface directory, omitting: mktex configuration. -* ucbinclude, avoiding: Running make. -* UKTUG: CD-ROM distribution. -* Ultrix shells and configure: configure shells. -* unable to find files: Unable to find files. -* unable to generate fonts: Unable to generate fonts. -* uname: Bug checklist. -* universe, BSD vs. system V: Running make. -* UNIX_ST_LINK: Subdirectory expansion. -* unixtex.ftp: unixtex.ftp. -* unixtex@u.washington.edu: Tape distribution. -* unknown special warnings: Suppressing warnings. -* unreadable file warnings: Suppressing warnings. -* unreadable files: Searching overview. -* unusable ls-R warning: ls-R. -* usage patterns, finding: Logging. -* USE_VARTEXFONTS: mktex configuration. -* Usenet TeX newsgroup: Mailing lists. -* varfonts: mktex configuration. -* variable expansion: Variable expansion. -* variable.c: Variable expansion. -* variable.h: Programming with config files. -* VARTEXFONTS: mktex configuration. -* VAX 11/750: History. -* version number, of Kpathsea: Kpathsea application distributions. -* version numbers, determining: Bug checklist. -* VF files, not found: Searching overview. -* VFFONTS: Supported file formats. -* VMS support: Custom installation. -* VMS TeX implementations: Other TeX packages. -* Vojta, Paul: History. -* Walnut Creek TeX CD-ROM: CD-ROM distribution. -* Walsh, Norman: History. -* warning about unusable ls-R: ls-R. -* warnings, file access: Searching overview. -* warnings, pointer combinations: Pointer combination warnings. -* warnings, suppressing: Suppressing warnings. -* wcstombs: dlopen. -* Weber, Olaf: History. -* whitespace, in fontmap files: Fontmap. -* whitespace, not ignored on continuation lines: Config files. -* Windows TeX implementations: Other TeX packages. -* World Wide Web CTAN access: Electronic distribution. -* www.tug.org: unixtex.ftp. -* X11 previewer: Kpathsea application distributions. -* X11, lacking on NeXT: Kpathsea application distributions. -* XCFLAGS: Running make. -* XCPPFLAGS: Running make. -* XDEFS: Running make. -* XDVIFONTS: Supported file formats. -* XDVIMAKEPK: mktex script names. -* XDVISIZES: Fallback font. -* XLDFLAGS: Running make. -* XLOADLIBES: Running make. -* XMAKEARGS: Running make. -* Xmu library problems: ShellWidgetClass. -* XtStrings: XtStrings. -* zuhn, david: History. -* { expansion: Brace expansion. -* ~ expansion: Tilde expansion. - - - -Tag Table: -Node: Top1441 -Node: Introduction2087 -Node: History4447 -Node: Installation8523 -Node: Simple installation9313 -Node: Custom installation12892 -Node: Disk space14058 -Node: Kpathsea application distributions14973 -Node: Changing search paths16077 -Node: Default path features17245 -Node: Default path generation19361 -Node: Running configure20788 -Node: configure shells21828 -Node: configure options22597 -Node: configure environment24088 -Node: configure scenarios25876 -Node: Shared library27499 -Node: Running make28816 -Node: Installing files30848 -Node: Cleaning up32783 -Node: Filename database generation33818 -Node: mktex scripts34372 -Node: mktex configuration35319 -Node: mktex script names40211 -Node: mktex script arguments41292 -Node: Installation testing42167 -Node: Security42519 -Node: TeX directory structure45072 -Node: unixtex.ftp49487 -Node: Electronic distribution51051 -Node: CD-ROM distribution54329 -Node: Tape distribution56314 -Node: Other TeX packages57174 -Node: Reporting bugs58463 -Node: Bug checklist59198 -Node: Mailing lists63288 -Node: Debugging64633 -Node: Logging69695 -Node: Common problems71193 -Node: Unable to find files72014 -Node: Slow path searching74413 -Node: Unable to generate fonts75776 -Node: TeX or Metafont failing77321 -Node: Empty Makefiles79180 -Node: XtStrings80392 -Node: dlopen81212 -Node: ShellWidgetClass82014 -Node: Pointer combination warnings83631 -Node: Path searching84006 -Node: Searching overview84651 -Node: Path sources88010 -Node: Config files89075 -Node: Path expansion92568 -Node: Default expansion93511 -Node: Variable expansion95189 -Node: Tilde expansion96578 -Node: Brace expansion97462 -Node: KPSE_DOT expansion98657 -Node: Subdirectory expansion99160 -Node: Filename database101491 -Node: ls-R102797 -Node: Filename aliases105674 -Node: Database format106839 -Node: Invoking kpsewhich107851 -Node: Path searching options108718 -Node: Auxiliary tasks112411 -Node: Standard options113669 -Node: TeX support113979 -Node: Supported file formats115266 -Node: File lookup121524 -Node: Glyph lookup122808 -Node: Basic glyph lookup123928 -Node: Fontmap124795 -Node: Fallback font127393 -Node: Suppressing warnings128349 -Node: Programming129406 -Node: Programming overview129917 -Node: Calling sequence131833 -Node: Program-specific files136856 -Node: Programming with config files137886 -Node: Index139176 - -End Tag Table
deleted file mode 100644 --- a/kpathsea/kpathsea.texi +++ /dev/null @@ -1,2157 +0,0 @@ -\input texinfo -@setfilename kpathsea.info -@settitle Kpathsea: A library for path searching - -@set version 3.2 -@set month-year October 1997 - -@c Define new indices for commands, filenames, and options. -@defcodeindex cm -@defcodeindex fl -@defcodeindex op - -@c Put everything in one index (arbitrarily chosen to be the concept index). -@syncodeindex cm cp -@syncodeindex fl cp -@syncodeindex fn cp -@syncodeindex ky cp -@syncodeindex op cp -@syncodeindex pg cp -@syncodeindex tp cp -@syncodeindex vr cp - -@dircategory TeX -@direntry -* Kpathsea: (kpathsea). File lookup along search paths. -* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching. -* mktexmf: (kpathsea)mktex scripts. MF source generation. -* mktexpk: (kpathsea)mktex scripts. PK bitmap generation. -* mktextex: (kpathsea)mktex scripts. TeX source generation. -* mktextfm: (kpathsea)mktex scripts. TeX font metric generation. -* mktexlsr: (kpathsea)Filename database. Update ls-R. -@end direntry - -@ifinfo -This file documents the Kpathsea library for path searching. - -Copyright (C) 1993, 94, 95, 96, 97 K. Berry & O. Weber. - -Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). -@end ignore - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation -approved by the Free Software Foundation. -@end ifinfo - - -@titlepage - -@title Kpathsea library -@subtitle for version @value{version} -@subtitle @value{month-year} -@author K. Berry (@email{kb@@mail.tug.org}) -@author O. Weber (@email{infovore@@xs4all.nl}) - -@page - -@vskip 0pt plus 1filll -Copyright @copyright{} 1993, 94, 95, 96, 97 K. Berry & O. Weber. - -Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation -approved by the Free Software Foundation. -@end titlepage - - -@ifinfo -@node Top -@top Kpathsea library - -This manual documents how to install and use the Kpathsea library for -filename lookup. It corresponds to version @value{version}, -released in @value{month-year}. - -@menu -* Introduction:: Overview. -* Installation:: Compilation, installation, and bug reporting. - -* Path searching:: How filename lookups work. -* TeX support:: Special support for TeX-related file lookups. - -* Programming:: How to use Kpathsea features in your program. - -* Index:: General index. -@end menu -@end ifinfo - - -@node Introduction -@chapter Introduction - -@cindex introduction -@cindex fundamental purpose of Kpathsea - -This manual corresponds to version @value{version} of the Kpathsea -library, released in @value{month-year}. - -The library's fundamental purpose is to return a filename from a list of -directories specified by the user, similar to what shells do when -looking up program names to execute. - -@cindex programs using the library -The following software, all of which we maintain, uses this library: - -@itemize @bullet -@item Dviljk (see the @samp{dvilj} man page) -@item Dvipsk (@pxref{Top, , Introduction, dvips, Dvips: A DVI driver}) -@item GNU font utilities (@pxref{Top, , Introduction, fontu, GNU font -utilities}) -@item Web2c (@pxref{Top, , Introduction, web2c, Web2c: A @TeX{} -implementation}) -@item Xdvik (see the @samp{xdvi} man page) -@end itemize - -@noindent Other software that we do not maintain also uses it. - -@cindex interface, not frozen -@cindex comments, making -@cindex suggestions, making -We are still actively maintaining the library (and probably always will -be, despite our hopes). If you have comments or suggestions, please send -them to us (@pxref{Reporting bugs}). - -@cindex conditions for use -@cindex license for using the library -@cindex GNU General Public License -We distribute the library under the GNU Library General Public License -(LGPL), with one exception (see below). In short, this means if you -write a program using the library, you must (offer to) distribute the -source to the library, along with any changes you have made, and allow -anyone to modify the library source and distribute their modifications. -It does not mean you have to distribute the source to your program, -although we hope you will. - -The exception is the part of the file @file{expand.c} which implements -brace expansion. We took this from Bash, which is covered by the GNU -General Public License (GPL). Therefore, if you wish to redistribute -the library under the LGPL, you must remove this code. (If you write a -replacement we can distribute, we hope you'll share it with us.) See the -files @file{COPYING} and @file{COPYING.LIB} for the text of the GNU licenses. - -@cindex @TeX{} Users Group -If you know enough about @TeX{} to be reading this manual, then you (or -your institution) should consider joining the @TeX{} Users Group (if -you're already a member, great!). TUG produces the periodical -@cite{TUGboat}, sponsors an annual meeting and publishes the -proceedings, and arranges courses on @TeX{} for all levels of users -throughout the world. Anyway, here is the address: - -@flindex tug@@tug.org -@display -@TeX{} Users Group -P.O. Box 1239 -Three Rivers, CA 93271-1239 -USA -phone: 1 209 561 0112 -fax: 1 209 561 4584 -email: @email{tug@@tug.org} -@end display - -@menu -* History:: -@end menu - - -@node History -@section History - -@cindex history of Kpathsea - -@cindex Knuth, Donald E. -(This section is for those people who are curious about how the library -came about.) (If you like to read historical accounts of software, we -urge you to seek out the GNU Autoconf manual and the ``Errors of -@TeX{}'' paper by Don Knuth, published in @cite{Software---Practice and -Experience} 19(7), July 1989.) - -@cindex Morgan, Tim -@cindex Rokicki, Tom -@cindex Berry, Karl -@cindex VAX 11/750 -@cindex Sun 2 -@pindex pxp @r{Pascal preprocessor} -@pindex pc @r{Pascal compiler} -[Karl writes.] My first ChangeLog entry for Web2c seems to be February -1990, but I may have done some work before then. In any case, Tim -Morgan and I were jointly maintaining it for a time. (I should mention -here that Tim had made Web2c into a real distribution long before I had -ever used it or even heard of it, and Tom Rokicki did the original -implementation. I was using @code{pxp} and @code{pc} on VAX 11/750's -and the hot new Sun 2 machines.) - -It must have been later in 1990 and 1991 that I started working on -@cite{@TeX{} for the Impatient}. Dvips, Xdvi, Web2c, and the GNU -fontutils (which I was also writing at the time) all used different -environment variables, and, more importantly, had different bugs in -their path searching. This became extremely painful, as I was stressing -everything to the limit working on the book. I also desperately wanted -to implement subdirectory searching, since I couldn't stand putting -everything in one big directory, and also couldn't stand having to -explicitly specify @file{cm}, @file{pandora}, @dots{} in a path. - -@cindex Vojta, Paul -In the first incarnation, I just hacked separately on each -program---that was the original subdirectory searching code in both Xdvi -and Dvips, though I think Paul Vojta has completely rewritten Xdvi's -support by now. That is, I tried to go with the flow in each program, -rather than changing the program's calling sequences to conform to -common routines. - -Then, as bugs inevitably appeared, I found I was fixing the same thing -three times (Web2c and fontutils were always sharing code, since I -maintained those---there was no Dvipsk or Xdvik or Dviljk at this -point). After a while, I finally started sharing source files. They -weren't yet a library, though. I just kept things up to date with shell -scripts. (I was developing on a 386 running ISC 2.2 at the time, and so -didn't have symbolic links. An awful experience.) - -@cindex MacKenzie, David -The ChangeLogs for Xdvik and Dvipsk record initial releases of those -distributions in May and June 1992. I think it was because I was tired -of the different configuration strategies of each program, not so much -because of the path searching. (Autoconf was being developed by David -MacKenzie and others, and I was adapting it to @TeX{} and friends.) - -@cindex zuhn, david -I started to make a separate library that other programs could link with -on my birthday in April 1993, according to the ChangeLog. I don't -remember exactly why I finally took the time to make it a separate -library; a conversation with david zuhn that initiated it. Just seemed -like it was time. - -@cindex Walsh, Norman -@cindex Neumann, Gustaf -Dviljk got started in March 1994 after I bought a Laserjet 4. (Kpathsea -work got suspended while Norm Walsh and I, with Gustaf Neumann's help, -implemented a way for @TeX{} to get at all those neat builtin LJ4 fonts -@dots{} such a treat to have something to typeset in besides Palatino!) - -By spring of 1995, I had implemented just about all the path-searching -features in Kpathsea that I plan to, driven beyond my initial goals by -Thomas Esser and others. I then started to integrate Web2c with -Kpathsea. After the release of a stable Web2c, I hope to be able to stop -development, and turn most of my attention back to making fonts for GNU. -(Always assuming Micros**t hasn't completely obliterated Unix by then, -or that software patents haven't stopped software development by anybody -smaller than a company with a million-dollar-a-year legal budget. Which -is actually what I think is likely to happen, but that's another -story@dots{}) - -@cindex Weber, Olaf -[Olaf writes.] At the end of 1997, UNIX is still alive and kicking, -individuals still develop software, and Web2c development still -continues. Karl had been looking for some time for someone to take up -part of the burden, and I volunteered. - - -@include install.texi -@include hier.texi -@include unixtex.texi -@include bugs.texi - - -@node Path searching -@chapter Path searching - -@cindex path searching - -This chapter describes the generic path searching mechanism Kpathsea -provides. For information about searching for particular file types -(e.g., @TeX{} fonts), see the next chapter. - -@menu -* Searching overview:: Basic scheme for searching. -* Path sources:: Where search paths can be defined. -* Path expansion:: Special constructs in search paths. -* Filename database:: Using an externally-built list to search. -* Invoking kpsewhich:: Standalone path lookup. -@end menu - - -@node Searching overview -@section Searching overview - -@cindex searching overview -@cindex path searching, overview -@cindex overview of path searching - -@cindex search path, defined -A @dfn{search path} is a colon-separated list of @dfn{path elements}, -which are directory names with a few extra frills. A search path can -come from (a combination of) many sources; see below. To look up a file -@samp{foo} along a path @samp{.:/dir}, Kpathsea checks each element of -the path in turn: first @file{./foo}, then @file{/dir/foo}, returning -the first match (or possibly all matches). - -@cindex magic characters -@kindex : @r{may not be :} -@kindex / @r{may not be /} -The ``colon'' and ``slash'' mentioned here aren't necessarily @samp{:} -and @samp{/} on non-Unix systems. Kpathsea tries to adapt to other -operating systems' conventions. - -@cindex database search -@cindex searching the database -To check a particular path element @var{e}, Kpathsea first sees if a -prebuilt database (@pxref{Filename database}) applies to @var{e}, i.e., -if the database is in a directory that is a prefix of @var{e}. If so, -the path specification is matched against the contents of the database. - -@cindex floating directories -@cindex filesystem search -@cindex disk search -@cindex searching the disk -If the database does not exist, or does not apply to this path element, -or contains no matches, the filesystem is searched (if this was not -forbidden by the specification with @samp{!!} and if the file being -searched for must exist). Kpathsea constructs the list of directories -that correspond to this path element, and then checks in each for the -file being searched for. (To help speed future lookups of files in the -same directory, the directory in which a file is found is floated to the -top of the directory list.) - -@cindex must exist -@cindex VF files, not found -@flindex cmr10.vf -@findex \openin -The ``file must exist'' condition comes into play with VF files and -input files read by the @TeX{} @samp{\openin} command. These files may -not exist (consider @file{cmr10.vf}), and so it would be wrong to search -the disk for them. Therefore, if you fail to update @file{ls-R} when -you install a new VF file, it will never be found. - -Each path element is checked in turn: first the database, then the disk. -If a match is found, the search stops and the result is returned. This -avoids possibly-expensive processing of path specifications that are -never needed on a particular run. (Unless the search explicitly -requested all matches.) - -@cindex expansion, path element -Although the simplest and most common path element is a directory name, -Kpathsea supports additional features in search paths: layered default -values, environment variable names, config file values, users' home -directories, and recursive subdirectory searching. Thus, we say that -Kpathsea @dfn{expands} a path element, meaning transforming all the -magic specifications into the basic directory name or names. This -process is described in the sections below. It happens in the same -order as the sections. - -@cindex absolute filenames -@cindex relative filenames -@cindex explicitly relative filenames -@cindex filenames, absolute or explicitly relative -Exception to all of the above: If the filename being searched for is -absolute or explicitly relative, i.e., starts with @samp{/} or @samp{./} -or @samp{../}, Kpathsea simply checks if that file exists. - -@cindex permission denied -@cindex unreadable files -@cindex access warnings -@cindex warnings, file access -@flindex lost+found @r{directory} -@vindex TEX_HUSH -Ordinarily, if Kpathsea tries to access a file or directory that cannot -be read, it gives a warning. This is so you will be alerted to -directories or files that accidentally lack read permission (for -example, a @file{lost+found}). If you prefer not to see these warnings, -include the value @samp{readable} in the @code{TEX_HUSH} environment -variable or config file value. - -This generic path searching algorithm is implemented in -@file{kpathsea/pathsearch.c}. It is employed by a higher-level -algorithm when searching for a file of a particular type (@pxref{File -lookup}, and @ref{Glyph lookup}). - - -@node Path sources -@section Path sources - -@cindex path sources -@cindex sources for search paths - -A search path can come from many sources. In the order in which -Kpathsea uses them: - -@enumerate -@item -@cindex environment variable, source for path -A user-set environment variable, e.g., @code{TEXINPUTS}. -Environment variables with an underscore and the program name appended -override; for example, @code{TEXINPUTS_latex} overrides @code{TEXINPUTS} -if the program being run is named @samp{latex}. - -@item -A program-specific configuration file, e.g., an @samp{S /a:/b} line in -Dvips' @file{config.ps} (@pxref{Config files,,, dvips, Dvips}). - -@item -@cindex configuration file, source for path -@cindex Kpathsea config file, source for path -@flindex texmf.cnf@r{, source for path} -A line in a Kpathsea configuration file @file{texmf.cnf}, e.g., -@samp{TEXINPUTS=/c:/d} (see below). - -@item -@cindex compilation value, source for path -The compile-time default (specified in @file{kpathsea/paths.h}). -@end enumerate - -You can see each of these values for a given search path by using the -debugging options (@pxref{Debugging}). - -These sources may be combined via default expansion (@pxref{Default -expansion}). - -@menu -* Config files:: Kpathsea's runtime config files (texmf.cnf). -@end menu - - -@node Config files -@subsection Config files - -@cindex config files -@flindex texmf.cnf@r{, definition for} - -@cindex runtime configuration files -@vindex TEXMFCNF -As mentioned above, Kpathsea reads @dfn{runtime configuration files} -named @file{texmf.cnf} for search path and other definitions. The -search path used to look for these configuration files is named -@code{TEXMFCNF}, and is constructed in the usual way, as described -above, except that configuration files cannot be used to define the -path, naturally; also, an @file{ls-R} database is not used to search for -them. - -Kpathsea reads @emph{all} @file{texmf.cnf} files in the search path, not -just the first one found; definitions in earlier files override those in -later files. Thus, if the search path is @samp{.:$TEXMF}, values from -@file{./texmf.cnf} override those from @file{$TEXMF/texmf.cnf}. - -While (or instead of) reading this description, you may find it helpful -to look at the distributed @file{texmf.cnf}, which uses or at least -mentions most features. The format of @file{texmf.cnf} files follows: - -@itemize @bullet -@item -@cindex comments, in @file{texmf.cnf} -Comments start with @samp{%} and continue to the end of the line. - -@item -@cindex blank lines, in @file{texmf.cnf} -Blank lines are ignored. - -@item -@cindex backslash-newline -@cindex continuation character -@cindex whitespace, not ignored on continuation lines -@kindex \@r{, line continuation in @file{texmf.cnf}} -A @samp{\} at the end of a line acts as a continuation character, i.e., -the next line is appended. Whitespace at the beginning of continuation -lines is not ignored. - -@item Each remaining line must look like - -@example -@var{variable} @r{[}. @var{progname}@r{]} @r{[}=@r{]} @var{value} -@end example - -@noindent where the @samp{=} and surrounding whitespace is optional. - -@item -@cindex identifiers, characters valid in -The @var{variable} name may contain any character other than whitespace, -@samp{=}, or @samp{.}, but sticking to @samp{A-Za-z_} is safest. - -@item If @samp{.@var{progname}} is present, the definition only -applies if the program that is running is named (i.e., the last -component of @code{argv[0]} is) @var{progname} or -@file{@var{progname}.exe}. This allows different flavors of @TeX{} to -have different search paths, for example. - -@item -@cindex right-hand side of variable assignments -@var{value} may contain any characters except @samp{%} and @samp{@@}. -(These restrictions are only necessary because of the processing done on -@file{texmf.cnf} at build time, so you can stick those characters in -after installation if you have to.) The @samp{$@var{var}.@var{prog}} -feature is not available on the right-hand side; instead, you must use -an additional variable (see below for example). A @samp{;} in -@var{value} is translated to @samp{:} if running under Unix; this is -useful to write a single @file{texmf.cnf} which can be used under both -Unix and NT. (If you really want @samp{;}'s in your filenames, add -@samp{-DALLOW_SEMICOLON_IN_FILENAMES} to @code{CFLAGS}.) - -@item All definitions are read before anything is expanded, so you can -use variables before they are defined (like Make, unlike most other -programs). -@end itemize - -@noindent Here is a configuration file fragment illustrating most of -these points: - -@example -% TeX input files -- i.e., anything to be found by \input or \openin ... -latex209_inputs = .:$TEXMF/tex/latex209//:$TEXMF/tex// -latex2e_inputs = .:$TEXMF/tex/latex//:$TEXMF/tex// -TEXINPUTS = .:$TEXMF/tex// -TEXINPUTS.latex209 = $latex209_inputs -TEXINPUTS.latex2e = $latex2e_inputs -TEXINPUTS.latex = $latex2e_inputs -@end example - -@cindex shell scripts as configuration files -@cindex configuration files as shell scripts. -Although this format has obvious similarities to Bourne shell -scripts---change the comment character to @code{#}, disallow spaces -around the @code{=}, and get rid of the @code{.@var{name}} convention, -and it could be run through the shell. But there seemed little -advantage to doing this, since all the information would have to passed -back to Kpathsea and parsed there anyway, since the @code{sh} process -couldn't affect its parent's environment. - -@flindex cnf.c -The implementation of all this is in @file{kpathsea/cnf.c}. - - -@node Path expansion -@section Path expansion - -@cindex path expansion -@cindex expansion, search path - -Kpathsea recognizes certain special characters and constructions in -search paths, similar to that in shells. As a general example: -@samp{~$USER/@{foo,bar@}//baz} expands to all subdirectories under -directories @file{foo} and @file{bar} in @t{$USER}'s home directory that -contain a directory or file @file{baz}. These expansions are explained -in the sections below. - -@menu -* Default expansion:: a: or :a or a::b expands to a default. -* Variable expansion:: $foo and $@{foo@} expand to environment values. -* Tilde expansion:: ~ and ~user expand to home directories. -* Brace expansion:: a@{foo,bar@}b expands to afoob abarb. -* KPSE_DOT expansion:: . is replaced with $KPSE_DOT if it is defined. -* Subdirectory expansion:: a// and a//b recursively expand to subdirs. -@end menu - - -@node Default expansion -@subsection Default expansion - -@kindex :: @r{expansion} -@cindex doubled colons -@cindex leading colons -@cindex trailing colons -@cindex extra colons -@cindex default expansion -@cindex expansion, default - -If the highest-priority search path (@pxref{Path sources}) contains an -@dfn{extra colon} (i.e., leading, trailing, or doubled), Kpathsea -inserts at that point the next-highest-priority search path that is -defined. If that inserted path has an extra colon, the same happens -with the next-highest. (An extra colon in the compile-time default -value has unpredictable results, so installers beware.) - -For example, given an environment variable setting - -@example -setenv TEXINPUTS /home/karl: -@end example - -@noindent and a @code{TEXINPUTS} value from @file{texmf.cnf} of - -@example -.:$TEXMF//tex -@end example - -@noindent then the final value used for searching will be: - -@example -/home/karl:.:$TEXMF//tex -@end example - -Since Kpathsea looks for multiple configuration files, it would be -natural to expect that (for example) an extra colon in -@file{./texmf.cnf} would expand to the path in @file{$TEXMF/texmf.cnf}. -Or, with Dvips' configuration files, that an extra colon in -@file{config.$PRINTER} would expand to the path in @file{config.ps}. -This doesn't happen. It's not clear this would be desirable in all -cases, and trying to devise a way to specify the path to which the extra -colon should expand seemed truly baroque. -@cindex Bach, Johann Sebastian - -Technicality: Since it would be useless to insert the default value in -more than one place, Kpathsea changes only one extra @samp{:} and leaves -any others in place (they will eventually be ignored). Kpathsea checks -first for a leading @samp{:}, then a trailing @samp{:}, then a doubled -@samp{:}. - -@flindex kdefault.c -You can trace this by debugging ``paths'' (@pxref{Debugging}). -Default expansion is implemented in the source file -@file{kpathsea/kdefault.c}. - - -@node Variable expansion -@subsection Variable expansion - -@kindex $ @r{expansion} -@cindex environment variables in paths -@cindex variable expansion -@cindex expansion, variable -@flindex texmf.cnf@r{, and variable expansion} - -@samp{$foo} or @samp{$@{foo@}} in a path element is replaced by (1) the -value of an environment variable @samp{foo} (if defined); (2) the value -of @samp{foo} from @file{texmf.cnf} (if defined); (3) the empty string. - -If the character after the @samp{$} is alphanumeric or @samp{_}, the -variable name consists of all consecutive such characters. If the -character after the @samp{$} is a @samp{@{}, the variable name consists -of everything up to the next @samp{@}} (braces may not be nested around -variable names). Otherwise, Kpathsea gives a warning and ignores the -@samp{$} and its following character. - -@cindex quoting variable values -@cindex shell variables -You must quote the @t{$}'s and braces as necessary for your shell. -@emph{Shell} variable values cannot be seen by Kpathsea, i.e., ones -defined by @code{set} in C shells and without @code{export} in Bourne -shells. - -For example, given -@example -setenv tex /home/texmf -setenv TEXINPUTS .:$tex:$@{tex@}prev -@end example -@noindent the final @code{TEXINPUTS} path is the three directories: -@example -.:/home/texmf:/home/texmfprev -@end example - -The @samp{.@var{progname}} suffix on variables and -@samp{_@var{progname}} on environment variable names are not implemented -for general variable expansions. These are only recognized when search -paths are initialized (@pxref{Path sources}). - -@flindex variable.c -Variable expansion is implemented in the source file -@file{kpathsea/variable.c}. - - -@node Tilde expansion -@subsection Tilde expansion - -@kindex ~ @r{expansion} -@cindex home directories in paths -@cindex tilde expansion -@cindex expansion, tilde - -@vindex HOME@r{, as ~ expansion} -A leading @samp{~} in a path element is replaced by the value of the -environment variable @code{HOME}, or @file{.} if @code{HOME} is not set. - -A leading @samp{~@var{user}} in a path element is replaced by -@var{user}'s home directory from the system @file{passwd} database. - -For example, -@example -setenv TEXINPUTS ~/mymacros: -@end example - -@noindent will prepend a directory @file{mymacros} in your home -directory to the default path. - -@cindex @t{root} user -@cindex trailing @samp{/} in home directory -@kindex /@r{, trailing in home directory} -As a special case, if a home directory ends in @samp{/}, the trailing -slash is dropped, to avoid inadvertently creating a @samp{//} construct -in the path. For example, if the home directory of the user @samp{root} -is @samp{/}, the path element @samp{~root/mymacros} expands to just -@samp{/mymacros}, not @samp{//mymacros}. - -@flindex tilde.c -Tilde expansion is implemented in the source file @file{kpathsea/tilde.c}. - - -@node Brace expansion -@subsection Brace expansion - -@kindex @{ @r{expansion} -@cindex brace expansion - -@samp{x@{@var{a}:@var{b}@}y} expands to @samp{x@var{a}y:x@var{b}y}. -For example: - -@example -foo/@{1:2@}/baz -@end example - -@noindent expands to @samp{foo/1/baz:foo/2/baz}. @samp{:} is the path -separator on the current system; e.g., on a DOS system, it's @samp{;}. - -Braces can be nested; for example, @samp{x@{A:B@{1:2@}@}y} expands to -@samp{xAy:xB1y:xB2y}. - -Multiple non-nested braces are expanded from right to left; for example, -@samp{x@{A:B@}@{1:2@}y} expands to @samp{x@{A:B@}1y:x@{A:B@}2y}, which -expands to @samp{xA1y:xB1y:xA2y:xB2:y}. - -@cindex multiple @TeX{} hierarchies -This feature can be used to implement multiple @TeX{} hierarchies, by -assigning a brace list to @code{$TEXMF}, as mentioned in -@file{texmf.in}. - -In old versions of the library you had to use a comma. While this usage -is deprecated, it is still supported for backwards compatibility with -old configurations. The last example could have been written -@samp{x@{A,B@}@{1,2@}y}. - -@flindex expand.c -Brace expansion is implemented in the source file -@file{kpathsea/expand.c}. It is a modification of the Bash sources, and -is thus covered by the GNU General Public License, rather than the -Library General Public License that covers the rest of Kpathsea. - - -@node KPSE_DOT expansion -@subsection @code{KPSE_DOT} expansion - -@kindex KPSE_DOT @r{expansion} - -When @code{KPSE_DOT} is defined in the environment, it names a directory -that should be considered the current directory for the purpose of -looking up files in the search paths. This feature is needed by the -@samp{mktex@dots{}} scripts @ref{mktex scripts}, because these -change the working directory. You should not ever define it yourself. - - -@node Subdirectory expansion -@subsection Subdirectory expansion - -@kindex // -@cindex subdirectory searching -@cindex expansion, subdirectory - -@cindex alphabetical order, not -Two or more consecutive slashes in a path element following a directory -@var{d} is replaced by all subdirectories of @var{d}: first those -subdirectories directly under @var{d}, then the subsubdirectories under -those, and so on. At each level, the order in which the directories are -searched is unspecified. (It's ``directory order'', and definitely not -alphabetical.) - -If you specify any filename components after the @samp{//}, only -subdirectories which match those components are included. For example, -@samp{/a//b} would expand into directories @file{/a/1/b}, @file{/a/2/b}, -@file{/a/1/1/b}, and so on, but not @file{/a/b/c} or @file{/a/1}. - -You can include multiple @samp{//} constructs in the path. - -@samp{//} at the beginning of a path is ignored; you didn't really want -to search every directory on the system, did you? - -@cindex trick for detecting leaf directories -@cindex leaf directory trick -@cindex Farwell, Matthew -@cindex MacKenzie, David -I should mention one related implementation trick, which I took from GNU -find. Matthew Farwell suggested it, and David MacKenzie implemented it. - -@vindex st_nlink -The trick is that in every real Unix implementation (as opposed to the -POSIX specification), a directory which contains no subdirectories will -have exactly two links (namely, one for @file{.} and one for @file{..}). -That is to say, the @code{st_nlink} field in the @samp{stat} structure -will be two. Thus, we don't have to stat everything in the bottom-level -(leaf) directories---we can just check @code{st_nlink}, notice it's two, -and do no more work. - -But if you have a directory that contains a single subdirectory and 500 -regular files, @code{st_nlink} will be 3, and Kpathsea has to stat every -one of those 501 entries. Therein lies slowness. - -@vindex UNIX_ST_LINK -You can disable the trick by undefining @code{UNIX_ST_LINK} in -@file{kpathsea/config.h}. (It is undefined by default except under Unix.) - -@flindex elt-dirs.c -Unfortunately, in some cases files in leaf directories are -@code{stat}'d: if the path specification is, say, -@samp{$TEXMF/fonts//pk//}, then files in a subdirectory -@samp{@dots{}/pk}, even if it is a leaf, are checked. The reason cannot -be explained without reference to the implementation, so read -@file{kpathsea/elt-dirs.c} (search for @samp{may descend}) if you are -curious. And if you can find a way to @emph{solve} the problem, please -let me know. - -@flindex elt-dirs.c -Subdirectory expansion is implemented in the source file -@file{kpathsea/elt-dirs.c}. - - -@node Filename database -@section Filename database (@code{ls-R}) - -@cindex filename database -@cindex database, for filenames -@cindex externally-built filename database - -Kpathsea goes to some lengths to minimize disk accesses for searches -(@pxref{Subdirectory expansion}). Nevertheless, at installations with -enough directories, searching each possible directory for a given file -can take an excessively long time (depending on the speed of the disk, -whether it's NFS-mounted, how patient you are, etc.). - -In practice, a font tree containing the standard PostScript and PCL -fonts is large enough for searching to be noticeably slow on typical -systems these days. Therefore, Kpathsea can use an externally-built -``database'' file named @file{ls-R} that maps files to directories, thus -avoiding the need to exhaustively search the disk. - -A second database file @file{aliases} allows you to give additional -names to the files listed in @file{ls-R}. This can be helpful to adapt -to ``8.3'' filename conventions in source files. - -The @file{ls-R} and @file{aliases} features are implemented in the -source file @file{kpathsea/db.c}. - -@menu -* ls-R:: The main filename database. -* Filename aliases:: Aliases for those names. -* Database format:: Syntax details of the database file. -@end menu - - -@node ls-R -@subsection @file{ls-R} - -@flindex ls-R @r{database file} -@vindex TEXMFDBS - -As mentioned above, you must name the main filename database -@file{ls-R}. You can put one at the root of each @TeX{} installation -hierarchy you wish to search (@code{$TEXMF} by default); most sites have -only one hierarchy. Kpathsea looks for @file{ls-R} files along the -@code{TEXMFDBS} path, so that should presumably match the list of -hierarchies. - -The recommended way to create and maintain @samp{ls-R} is to run the -@code{mktexlsr} script, which is installed in @samp{$(bindir)} -(@file{/usr/local/bin} by default). That script goes to some trouble to -follow symbolic links as necessary, etc. It's also invoked by the -distributed @samp{mktex@dots{}} scripts. - -@flindex ls-R@r{, simplest build} -At its simplest, though, you can build @file{ls-R} with the command -@example -cd @var{/your/texmf/root} && ls -LAR ./ >ls-R -@end example - -@noindent -@opindex --color=tty -@flindex /etc/profile @r{and aliases} -presuming your @code{ls} produces the right output format (see the -section below). GNU @code{ls}, for example, outputs in this format. -Also presuming your @code{ls} hasn't been aliased in a system file -(e.g., @file{/etc/profile}) to something problematic, e.g., @samp{ls ---color=tty}. In that case, you will have to disable the alias before -generating @file{ls-R}. For the precise definition of the file format, -see @ref{Database format}. - -Regardless of whether you use the supplied script or your own, you will -almost certainly want to invoke it via @code{cron}, so when you make -changes in the installed files (say if you install a new La@TeX{} -package), @file{ls-R} will be automatically updated. - -@opindex -A @r{option to @code{ls}} -@cindex dot files -@flindex . @r{files} -@flindex . @r{directories, ignored} -@flindex .tex @r{file, included in @file{ls-R}} -The @samp{-A} option to @code{ls} includes files beginning with @samp{.} -(except for @file{.} and @file{..}), such as the file @file{.tex} -included with the La@TeX{} tools package. (On the other hand, -@emph{directories} whose names begin with @samp{.} are always ignored.) - -@cindex symbolic links, and @file{ls-R} -@opindex -L @r{option to @code{ls}} -If your system does not support symbolic links, omit the @samp{-L}. - -@cindex automounter, and @file{ls-R} -@cindex NFS and @file{ls-R} -@code{ls -LAR @var{/your/texmf/root}} will also work. But using -@samp{./} avoids embedding absolute pathnames, so the hierarchy can be -easily transported. It also avoids possible trouble with automounters -or other network filesystem conventions. - -@cindex warning about unusable @file{ls-R} -@cindex unusable @file{ls-R} warning -Kpathsea warns you if it finds an @file{ls-R} file, but the file does -not contain any usable entries. The usual culprit is running plain -@samp{ls -R} instead of @samp{ls -LR ./} or @samp{ls -R -@var{/your/texmf/root}}. Another possibility is some system directory -name starting with a @samp{.} (perhaps if you are using AFS); Kpathsea -ignores everything under such directories. - -@kindex !! @r{in path specifications} -@cindex disk searching, avoiding -Because the database may be out-of-date for a particular run, if a file -is not found in the database, by default Kpathsea goes ahead and -searches the disk. If a particular path element begins with @samp{!!}, -however, @emph{only} the database will be searched for that element, -never the disk. If the database does not exist, nothing will be -searched. Because this can surprise users (``I see the font -@file{foo.tfm} when I do an @code{ls}; why can't Dvips find it?''), it -is not in any of the default search paths. - - -@node Filename aliases -@subsection Filename aliases - -@cindex filename aliases -@cindex aliases, for filenames - -In some circumstances, you may wish to find a file under several names. -For example, suppose a @TeX{} document was created using a DOS system -and tries to read @file{longtabl.sty}. But now it's being run on a Unix -system, and the file has its original name, @file{longtable.sty}. The -file won't be found. You need to give the actual file -@file{longtable.sty} an alias @samp{longtabl.sty}. - -@c As another example, suppose you are creating a @TeX{} distribution on a -@c CD-ROM or a DOS system; then the file @file{mf.base} gets stored as -@c @file{mf.bas}. But Metafont on Unix wants to find @file{mf.base}. Here -@c you need to give the actual file @file{mf.bas} an alias @samp{mf.base}. - -You can handle this by creating a file @file{aliases} as a companion to -the @file{ls-R} for the hierarchy containing the file in question. (You -must have an @file{ls-R} for the alias feature to work.) - -The format of @file{aliases} is simple: two whitespace-separated words -per line; the first is the real name @file{longtable.sty}, and second is -the alias (@file{longtabl.sty}). These must be base filenames, with no -directory components. @file{longtable.sty} must be in the sibling -@file{ls-R}. - -Also, blank lines and lines starting with @samp{%} or @samp{#} are -ignored in @file{aliases}, to allow for comments. - -If a real file @file{longtabl.sty} exists, it is used regardless of any -aliases. - - -@node Database format -@subsection Database format - -@cindex format of external database -@cindex database, format of - -The ``database'' read by Kpathsea is a line-oriented file of plain -text. The format is that generated by GNU (and most other) @code{ls} -programs given the @samp{-R} option, as follows. - -@itemize @bullet -@item -Blank lines are ignored. - -@item -If a line begins with @samp{/} or @samp{./} or @samp{../} and ends with -a colon, it's the name of a directory. (@samp{../} lines aren't useful, -however, and should not be generated.) - -@item -All other lines define entries in the most recently seen directory. -@t{/}'s in such lines will produce possibly-strange results. - -@item -Files with no preceding directory line are ignored. -@end itemize - -For example, here's the first few lines of @file{ls-R} (which totals -about 30K bytes) on my system: - -@example -bibtex -dvips -fonts -ls-R -metafont -metapost -tex -web2c - -./bibtex: -bib -bst -doc - -./bibtex/bib: -asi.bib -btxdoc.bib -@dots{} -@end example - - -@node Invoking kpsewhich -@section @code{kpsewhich}: Standalone path searching - -@pindex kpsewhich -@cindex path searching, standalone -@cindex standalone path searching - -The Kpsewhich program exercises the path searching functionality -independent of any particular application. This can also be useful as a -sort of @code{find} program to locate files in your @TeX{} hierarchies, -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 - -The options and filename(s) to look up can be intermixed. -Options can start with either @samp{-} or @samp{--}, and any unambiguous -abbreviation is accepted. - -@menu -* Path searching options:: Changing the mode, resolution, etc. -* Auxiliary tasks:: Path and variable expansion. -* Standard options:: --help and --version. -@end menu - - -@node Path searching options -@subsection Path searching options - -@cindex path searching options - -Kpsewhich looks up each non-option argument on the command line as a -filename, and returns the first file found. There is no option to -return all the files with a particular name (you can run the Unix -@samp{find} utility for that, @pxref{Invoking find,,, findutils, GNU -find utilities}). - -Various options alter the path searching behavior: - -@table @samp -@item --dpi=@var{num} -@opindex --dpi=@var{num} -@opindex -D @var{num} -@cindex resolution, setting -Set the resolution to @var{num}; this only affects @samp{gf} and -@samp{pk} lookups. @samp{-D} is a synonym, for compatibility with -Dvips. Default is 600. - -@item --format=@var{name} -@opindex --format=@var{name} -Set the format for lookup to @var{name}. By default, the format is -guessed from the filename, with @samp{tex} being used if nothing else -fits. The recognized filename extensions (including any leading -@samp{.}) are also allowable @var{name}s. - -All formats also have a name, which is the only way to specify formats -with no associated suffix. For example, for Dvips configuration files -you can use @samp{--format="dvips config"}. (The quotes are for the -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. -@example -gf: gf -pk: pk -bitmap font -afm: .afm -base: .base -bib: .bib -bst: .bst -cnf: .cnf -ls-R: ls-R -fmt: .fmt -map: .map -mem: .mem -mf: .mf -mfpool: .pool -mft: .mft -mp: .mp -mppool: .pool -MetaPost support -ocp: .ocp -ofm: .ofm .tfm -opl: .opl -otp: .otp -ovf: .ovf -ovp: .ovp -graphic/figure: .eps .epsi -tex: .tex -TeX system documentation -texpool: .pool -TeX system sources -PostScript header/font: .pro -Troff fonts -tfm: .tfm -type1 fonts: .pfa .pfb -vf: .vf -dvips config -ist: .ist -truetype fonts: .ttf .ttc -type42 fonts -web2c files -other text files -other binary files -@end example - -This option and @samp{--path} are mutually exclusive. - -@item --interactive -@opindex --interactive -@cindex interactive query -After processing the command line, read additional filenames to look up -from standard input. - -@item -mktex=@var{filetype} -@itemx -no-mktex=@var{filetype} -@opindex -mktex=@var{filetype} -@opindex -no-mktex=@var{filetype} -Turn on or off the @samp{mktex} script associated with @var{filetype}. -The only values that make sense for @var{filetype} are @samp{pk}, -@samp{mf}, @samp{tex}, and @samp{tfm}. By default, all are off in -Kpsewhich. @xref{mktex scripts}. - -@item --mode=@var{string} -@opindex --mode=@var{string} -Set the mode name to @var{string}; this also only affects @samp{gf} and -@samp{pk} lookups. No default: any mode will be found. @xref{mktex -script arguments}. - -@item --must-exist -@opindex --must-exist -Do everything possible to find the files, notably including searching -the disk. By default, only the @file{ls-R} database is checked, in the -interest of efficiency. - -@item --path=@var{string} -@opindex --path=@var{string} -Search along the path @var{string} (colon-separated as usual), instead -of guessing the search path from the filename. @samp{//} and all the -usual expansions are supported (@pxref{Path expansion}). This option -and @samp{--format} are mutually exclusive. To output the complete -directory expansion of a path, instead of doing a one-shot lookup, see -@samp{--expand-path} in the following section. - -@item --progname=@var{name} -@opindex --progname=@var{name} -Set the program name to @var{name}; default is @samp{kpsewhich}. This -can affect the search paths via the @samp{.@var{prognam}} feature in -configuration files (@pxref{Config files}). -@end table - - -@node Auxiliary tasks -@subsection Auxiliary tasks - -@cindex auxiliary tasks - -Kpsewhich provides some additional features not strictly related to path -lookup: - -@itemize @bullet -@item -@opindex --debug=@var{num} -@samp{--debug=@var{num}} sets the debugging options to @var{num}. -@xref{Debugging}. - -@item -@opindex --expand-braces=@var{string} -@samp{--expand-braces=@var{string}} outputs the variable and brace -expansion of @var{string}. @xref{Path expansion}. - -@item -@opindex --expand-var=@var{string} -@samp{--expand-var=@var{string}} outputs the variable expansion of -@var{string}. For example, the @samp{mktex@dots{}} scripts run -@samp{kpsewhich --expand-var='$TEXMF'} to find the root of the @TeX{} system -hierarchy. @xref{Path expansion}. - -@item -@opindex --expand-path=@var{string} -@samp{--expand-path=@var{string}} outputs the complete expansion of -@var{string} as a colon-separated path. This is useful to construct a -search path for a program that doesn't accept recursive subdirectory -specifications. - -For one-shot uses of an arbitrary (not built in to Kpathsea) path, see -@samp{--path} in the previous section. - -@item -@opindex --show-path=@var{name} -@samp{--show-path=@var{name}} shows the path that would be used for file -lookups of file type @var{name}. Either a filename extension -(@samp{pk}, @samp{.vf}, etc.) or an integer can be used, just as with -@samp{--format}, described in the previous section. -@end itemize - - -@node Standard options -@subsection Standard options - -@cindex standard options - -Kpsewhich accepts the standard GNU options: - -@itemize @bullet -@item -@opindex --help -@samp{--help} prints a help message on standard output and exits. - -@item -@opindex --version -@samp{--version} prints the Kpathsea version number and exits. -@end itemize - - -@node TeX support -@chapter @TeX{} support - -@cindex @TeX{} support - -Although the basic features in Kpathsea can be used for any type of path -searching, it came about (like all libraries) with a specific -application in mind: I wrote Kpathsea specifically for @TeX{} system -programs. I had been struggling with the programs I was using (Dvips, -Xdvi, and @TeX{} itself) having slightly different notions of how to -specify paths; and debugging was painful, since no code was shared. - -Therefore, Kpathsea provides some @TeX{}-specific formats and features. -Indeed, many of the supposedly generic path searching features were -provided because they seemed useful in that con@TeX{}t (font lookup, -particularly). - -Kpathsea provides a standard way to search for files of any of the -supported file types; glyph fonts are a bit different than all the rest. -Searches are based solely on filenames, not file contents---if a GF -file is named @file{cmr10.600pk}, it will be found as a PK file. - -@menu -* Supported file formats:: File types Kpathsea knows about. -* File lookup:: Searching for most kinds of files. -* Glyph lookup:: Searching for bitmap fonts. -* Suppressing warnings:: Avoiding warnings via TEX_HUSH. -@end menu - - -@node Supported file formats -@section Supported file formats - -@cindex supported file formats -@cindex file formats, supported - -@cindex environment variables for @TeX{} -@cindex @TeX{} environment variables - -Kpathsea has support for a number of file types. Each file type has a -list of environment and config file variables that are checked to define -the search path, and most have a default suffix that plays a role in -finding files (see the next section). Some also define additional -suffixes, and/or a program to be run to create missing files on the fly. - -@cindex program-varying paths -Since environment variables containing periods, such as -@samp{TEXINPUTS.latex}, are not allowed on some systems, Kpathsea looks -for environment variables with an underscore, e.g., -@samp{TEXINPUTS_latex} (@pxref{Config files}). - -The following table lists the above information. - -@table @samp -@item afm -@flindex .afm -@vindex AFMFONTS -(Adobe font metrics, @pxref{Metric files,,, dvips, Dvips}) -@code{AFMFONTS}; -suffix @samp{.afm}. - -@item base -@flindex .base -@vindex MFBASES -@vindex TEXMFINI -(Metafont memory dump, @pxref{Memory dumps,,, web2c, Web2c}) -@code{MFBASES}, @code{TEXMFINI}; -suffix @samp{.base}. - -@item bib -@flindex .bib -@vindex BIBINPUTS -@vindex TEXBIB -(Bib@TeX{} bibliography source, @pxref{bibtex invocation,,, web2c, Web2c}) -@code{BIBINPUTS}, @code{TEXBIB}; -suffix @samp{.bib}. - -@item bst -@flindex .bst -@vindex BSTINPUTS -(Bib@TeX{} style file, @pxref{Basic BibTeX style files,, Basic Bib@TeX{} -style files, web2c, Web2c}) -@code{BSTINPUTS}; -suffix @samp{.bst}. - -@item cnf -@flindex .cnf -@vindex TEXMFCNF -(Runtime configuration files, @pxref{Config files}) -@code{TEXMFCNF}; -suffix @samp{.cnf}. - -@item dvips config -@vindex TEXCONFIG -@flindex config.ps@r{, search path for} -(Dvips @samp{config.*} files, such as @file{config.ps}, @pxref{Config -files,,, dvips, Dvips}) -@code{TEXCONFIG}. - -@item fmt -@flindex .fmt -@vindex TEXFORMATS -@vindex TEXMFINI -(@TeX{} memory dump, @pxref{Memory dumps,,, web2c, Web2c}) -@code{TEXFORMATS}, @code{TEXMFINI}; -suffix @samp{.fmt}. - -@item gf -@flindex gf -@vindex GFFONTS -@vindex GLYPHFONTS -@vindex TEXFONTS -(generic font bitmap, @pxref{Glyph files,,, dvips, Dvips}) -@code{@var{program}FONTS}, @code{GFFONTS}, @code{GLYPHFONTS}, @code{TEXFONTS}; -suffix @samp{gf}. - -@item graphic/figure -@flindex .eps -@flindex .epsi -@vindex TEXPICTS -@vindex TEXINPUTS -(Encapsulated PostScript figures, @pxref{PostScript figures,,, dvips, Dvips}) -@code{TEXPICTS}, @code{TEXINPUTS}; -additional suffixes: @samp{.eps}, @samp{.epsi}. - -@item ist -@flindex .ist -@vindex TEXINDEXSTYLE -@vindex INDEXSTYLE -(makeindex style files) -@code{TEXINDEXSTYLE}, @code{INDEXSTYLE}; -suffix @samp{.ist}. - -@item ls-R -@flindex ls-R -@vindex TEXMFDBS -(Filename databases, @pxref{Filename database}) -@code{TEXMFDBS}. - -@item map -@flindex .map -@vindex TEXFONTMAPS -(Fontmaps, @pxref{Fontmap}) -@code{TEXFONTMAPS}; -suffix @samp{.map}. - -@item mem -@flindex .mem -@vindex MPMEMS -@vindex TEXMFINI -(MetaPost memory dump, @pxref{Memory dumps,,, web2c, Web2c}) -@code{MPMEMS}, @code{TEXMFINI}; -suffix @samp{.mem}. - -@item @r{MetaPost support} -@vindex MPSUPPORT -(MetaPost support files, used by DMP; @pxref{dmp invocation,,, web2c, Web2c}) -@code{MPSUPPORT}. - -@item mf -@flindex .mf -@vindex MFINPUTS -(Metafont source, @pxref{mf invocation,,, web2c, Web2c}) -@code{MFINPUTS}; -suffix @samp{.mf}; -dynamic creation program: @code{mktexmf}. - -@item mfpool -@flindex .pool -@vindex MFPOOL -(Metafont program strings, @pxref{pooltype invocation,,, web2c, Web2c}) -@code{MFPOOL}, @code{TEXMFINI}; -suffix @samp{.pool}. - -@item mft -@flindex .mft -@vindex MFTINPUTS -(@code{MFT} style file, @pxref{mft invocation,,, web2c, Web2c}) -@code{MFTINPUTS}; -suffix @samp{.mft}. - -@item mp -@flindex .mp -@vindex MPINPUTS -(MetaPost source, @pxref{mpost invocation,,, web2c, Web2c}) -@code{MPINPUTS}; -suffix @samp{.mp}. - -@item mppool -@flindex .pool -@vindex MPPOOL -(MetaPost program strings, @pxref{pooltype invocation,,, web2c, Web2c}) -@code{MPPOOL}, @code{TEXMFINI}; -suffix @samp{.pool}. - -@item ocp -@flindex .ocp -@vindex OCPINPUTS -(Omega compiled process files) -@code{OCPINPUTS}; @* -suffix @samp{.ocp}; -dynamic creation program: @code{MakeOmegaOCP}. - -@item ofm -@flindex .ofm -@vindex OFMFONTS -(Omega font metrics) -@code{OFMFONTS}, @code{TEXFONTS}; @* -suffixes @samp{.ofm}, @samp{.tfm}; -dynamic creation program: @code{MakeOmegaOFM}. - -@item opl -@flindex .opl -(Omega property lists) -@code{OPLFONTS}, @code{TEXFONTS}; -suffix @samp{.opl}. - -@item otp -@flindex .otp -@vindex OTPINPUTS -(Omega translation process files) -@code{OTPINPUTS}; -suffix @samp{.otp}. - -@item ovf -@flindex .ovf -@vindex OVFFONTS -(Omega virtual fonts) -@code{OVFFONTS}, @code{TEXFONTS}; -suffix @samp{.ovf}. - -@item ovp -@flindex .ovp -@vindex OVPFONTS -(Omega virtual property lists) -@code{OVPFONTS}, @code{TEXFONTS}; -suffix @samp{.ovp}. - -@item pk -@flindex .pk -@vindex PKFONTS -@vindex TEXPKS -@vindex GLYPHFONTS -@vindex TEXFONTS -(packed bitmap fonts, @pxref{Glyph files,,, dvips, Dvips}) -@code{@var{PROGRAM}FONTS} (@var{program} being @samp{XDVI}, etc.), -@code{PKFONTS}, @code{TEXPKS}, @code{GLYPHFONTS}, @code{TEXFONTS}; -suffix @samp{pk}; -dynamic creation program: @code{mktexpk}. - -@item PostScript header -@flindex .pro -@vindex TEXPSHEADERS -@vindex PSHEADERS -(downloadable PostScript, @pxref{Header files,,, dvips, Dvips}) -@code{TEXPSHEADERS}, @code{PSHEADERS}; -additional suffix @samp{.pro}. - -@item tex -@flindex .tex -@vindex TEXINPUTS -(@TeX{} source, @pxref{tex invocation,,, web2c, Web2c}) -@code{TEXINPUTS}; -suffix @samp{.tex}; -additional suffixes: none, because such a list cannot be complete; -dynamic creation program: @code{mktextex}. - -@item TeX system documentation -@flindex doc files -@vindex TEXDOCS -(Documentation files for the @TeX{} system) -@code{TEXDOCS}. - -@item TeX system sources -@flindex source files -@vindex TEXSOURCES -(Source files for the @TeX{} system) -@code{TEXSOURCES}. - -@item texpool -@flindex .pool -@vindex TEXPOOL -(@TeX{} program strings, @pxref{pooltype invocation,,, web2c, Web2c}) -@code{TEXPOOL}, @code{TEXMFINI}; -suffix @samp{.pool}. - -@item tfm -@flindex .tfm -@vindex TFMFONTS -@vindex TEXFONTS -(@TeX{} font metrics, @pxref{Metric files,,, dvips, Dvips}) -@code{TFMFONTS}, @code{TEXFONTS}; -suffix @samp{.tfm}; -dynamic creation program: @code{mktextfm}. - -@item Troff fonts -@vindex TRFONTS -(Troff fonts, used by DMP; @pxref{DMP invocation,,, web2c, Web2c}) -@code{TRFONTS}. - -@item truetype fonts -@flindex .ttf -@flindex .ttc -@vindex TTFONTS -(TrueType outline fonts) @code{TTFONTS}; suffixes @samp{.ttf}, -@samp{.ttc}. - -@item type1 fonts -@flindex .pfa -@flindex .pfb -@vindex T1FONTS -@vindex T1INPUTS -@vindex TEXPSHEADERS -@vindex DVIPSHEADERS -(Type 1 PostScript outline fonts, @pxref{Glyph files,,, dvips, Dvips}) -@code{T1FONTS}, @code{T1INPUTS}, @code{TEXPSHEADERS}, @code{DVIPSHEADERS}; -suffixes @samp{.pfa}, @samp{.pfb}. - -@item type42 fonts -@vindex T42FONTS -(Type 42 PostScript outline fonts) @code{T42FONTS}. - -@item vf -@flindex .vf -@vindex VFFONTS -@vindex TEXFONTS -(virtual fonts, @pxref{Virtual fonts,,, dvips, Dvips}) -@code{VFFONTS}, @code{TEXFONTS}; -suffix @samp{.vf}. -@end table - -There are two special cases, because the paths and environment variables -always depend on the name of the program: the variable name is -constructed by converting the program name to upper case, and then -appending @samp{INPUTS}. Assuming the program is called @samp{foo}, -this gives us the following table. - -@table @samp -@item other text files -@vindex FOOINPUTS -(text files used by @samp{foo}) -@code{FOOINPUTS}. - -@item other binary files -@vindex FOOINPUTS -(binary files used by @samp{foo}) -@code{FOOINPUTS}. -@end table - -If an environment variable by these names are set, the corresponding -@file{texmf.cnf} definition won't be looked at (unless, as usual, the -environment variable value has an extra @samp{:}). @xref{Default -expansion}. - -For the font variables, the intent is that: -@itemize @bullet -@item -@code{TEXFONTS} is the default for everything. - -@item -@code{GLYPHFONTS} is the default for bitmap (or, more precisely, -non-metric) files. - -@item -Each font format has a variable of its own. - -@item -@vindex XDVIFONTS -@vindex DVIPSFONTS -Each program has its own font override path as well; e.g., -@code{DVIPSFONTS} for Dvipsk. Again, this is for bitmaps, not metrics. - -@end itemize - - -@node File lookup -@section File lookup - -@cindex file lookup -@cindex searching for files -@cindex @TeX{} file lookup - -This section describes how Kpathsea searches for most files (bitmap font -searches are the exception, as described in the next section). - -Here is the search strategy for a file @var{name}: -@enumerate -@item -If the file format defines default suffixes, and the suffix of -@var{name} name is not already a known suffix for that format, try the -name with each default appended, and use alternative names found in the -fontmaps if necessary. We postpone searching the disk as long as -possible. Example: given @samp{foo.sty}, look for @samp{foo.sty.tex} -before @samp{foo.sty}. This is unfortunate, but allows us to find -@samp{foo.bar.tex} before @samp{foo.bar} if both exist and we were given -@samp{foo.bar}. - -@item -Search for @var{name}, and if necssary for alternative names found in -the fontmaps. Again we avoid searching the disk if possible. Example: -given @samp{foo}, we look for @samp{foo}. - -@item -If the file format defines a program to invoke to create missing files, -run it (@pxref{mktex scripts}). -@end enumerate - -@flindex tex-file.c -@findex kpse_find_file -This is implemented in the routine @code{kpse_find_file} in -@file{kpathsea/tex-file.c}. You can watch it in action with the -debugging options (@pxref{Debugging}). - - -@node Glyph lookup -@section Glyph lookup - -@cindex glyph lookup -@cindex searching for glyphs -@cindex @TeX{} glyph lookup - -This section describes how Kpathsea searches for a bitmap font in GF or -PK format (or either) given a font name (e.g., @samp{cmr10}) and a -resolution (e.g., 600). - -Here is an outline of the search strategy (details in the sections -below) for a file @var{name} at resolution @var{dpi}. The search stops -at the first successful lookup. - -@enumerate -@item -Look for an existing file @var{name}.@var{dpi}@var{format} in the -specified format(s). - -@item If @var{name} is an alias for a file @var{f} in the fontmap -file @file{texfonts.map}, look for @var{f}.@var{dpi}. - -@item Run an external program (typically named @samp{mktexpk}) to -generate the font (@pxref{mktex scripts}) - -@item Look for @var{fallback}.@var{dpi}, where @var{fallback} is some -last-resort font (typically @samp{cmr10}). -@end enumerate - -@flindex tex-glyph.c -@findex kpse_find_glyph_format -This is implemented in @code{kpse_find_glyph_format} in -@file{kpathsea/tex-glyph.c}. - -@menu -* Basic glyph lookup:: Features common to all glyph lookups. -* Fontmap:: Aliases for fonts. -* Fallback font:: Resolutions and fonts of last resort. -@end menu - - -@node Basic glyph lookup -@subsection Basic glyph lookup - -@cindex basic glyph lookup -@cindex common features in glyph lookup - -When Kpathsea looks for a bitmap font @var{name} at resolution @var{dpi} -in a format @var{format}, it first checks each directory in the search -path for a file @samp{@var{name}.@var{dpi}@var{format}}; for example, -@samp{cmr10.600pk}. Kpathsea looks for a PK file first, then a GF file. - -If that fails, Kpathsea looks for -@samp{dpi@var{dpi}/@var{name}.@var{format}}; for example, -@samp{dpi600/cmr10.pk}. This is how fonts are typically stored on -filesystems (such as DOS) that permit only three-character extensions. - -@cindex tolerance for glyph lookup -@cindex glyph lookup bitmap tolerance -@findex KPSE_BITMAP_TOLERANCE -If that fails, Kpathsea looks for a font with a close-enough @var{dpi}. -``Close enough'' is defined by the macro @code{KPSE_BITMAP_TOLERANCE} in -@file{kpathsea/tex-glyph.h} to be @code{@var{dpi} / 500 + 1}. This is -slightly more than the 0.2% minimum allowed by the DVI standard -(@url{@var{CTAN:}/dviware/driv-standard/level-0}). - - -@node Fontmap -@subsection Fontmap - -@cindex fontmap files -@cindex font alias files -@cindex aliases for fonts - -@flindex texfonts.map -If a bitmap font or metric file is not found with the original name (see -the previous section), Kpathsea looks through any @dfn{fontmap} files -for an @dfn{alias} for the original font name. These files are named -@file{texfonts.map} and searched for along the @code{TEXFONTMAPS} -environment/config file variable. All @file{texfonts.map} files that -are found are read; earlier definitions override later ones. - -This feature is intended to help in two respects: - -@enumerate - -@item -@cindex fontnames, arbitrary length -An alias name is limited in length only by available memory, not by your -filesystem. Therefore, if you want to ask for @samp{Times-Roman} -instead of @file{ptmr}, you can (you get @samp{ptmr8r}). - -@item -@cindex circle fonts -@flindex lcircle10 -A few fonts have historically had multiple names: specifically, -La@TeX{}'s ``circle font'' has variously been known as @file{circle10}, -@file{lcircle10}, and @file{lcirc10}. Aliases can make all the names -equivalent, so that it no longer matters what the name of the installed -file is; @TeX{} documents will find their favorite name. - -@end enumerate - -The format of fontmap files is straightforward: - -@itemize @bullet -@cindex comments, in fontmap files -@item Comments start with @samp{%} and continue to the end of the line. -@cindex whitespace, in fontmap files -@item Blank lines are ignored. -@item Each nonblank line is broken up into a series of @dfn{words}: - a sequence of non-whitespace characters. -@findex include @r{fontmap directive} -@item If the first word is @samp{include}, the second word is used as - a filename, and it is searched for and read. -@item Otherwise, the first word on each line is the true filename; -@item the second word is the alias; -@item subsequent words are ignored. -@end itemize - -If an alias has an extension, it matches only those files with that -extension; otherwise, it matches anything with the same root, regardless -of extension. For example, an alias @samp{foo.tfm} matches only when -@file{foo.tfm} is being searched for; but an alias @samp{foo} matches -@file{foo.vf}, @file{foo.600pk}, etc. - -As an example, here is an excerpt from the @file{texfonts.map} in the -Web2c distribution. It makes the circle fonts equivalent and includes -automatically generated maps for most PostScript fonts available from -various font suppliers. - -@example -circle10 lcircle10 -circle10 lcirc10 -lcircle10 circle10 -lcircle10 lcirc10 -lcirc10 circle10 -lcirc10 lcircle10 -@dots{} -include adobe.map -include apple.map -include bitstrea.map -@dots{} -@end example - -Fontmaps are implemented in the file @file{kpathsea/fontmap.c}. -The Fontname distribution has much more information on font naming -(@pxref{Introduction,,, fontname, Filenames for @TeX{} fonts}). - - -@node Fallback font -@subsection Fallback font - -@cindex fallback font -@cindex fallback resolutions -@cindex font of last resort -@cindex resolutions, last-resort -@cindex last-resort font - -@vindex DVIPSSIZES -@vindex XDVISIZES -@vindex DVILJSIZES -@vindex TEXSIZES -@vindex default_texsizes -If a bitmap font cannot be found or created at the requested size, -Kpathsea looks for the font at a set of @dfn{fallback resolutions}. You -specify these resolutions as a colon-separated list (like search paths). -Kpathsea looks first for a program-specific environment variable (e.g., -@code{DVIPSSIZES} for Dvipsk), then the environment variable -@code{TEXSIZES}, then a default specified at compilation time (the Make -variable @code{default_texsizes}). You can set this list to be empty if -you prefer to find fonts at their stated size or not at all. - -@flindex cmr10@r{, as fallback font} -@vindex kpse_fallback_font -Finally, if the font cannot be found even at the fallback resolutions, -Kpathsea looks for a fallback font, typically @file{cmr10}. Programs -must enable this feature by assigning to the global variable -@code{kpse_fallback_font} or calling @code{kpse_init_prog} -(@pxref{Calling sequence}); the default is no fallback font. - - -@node Suppressing warnings -@section Suppressing warnings - -@cindex warnings, suppressing -@cindex suppressing warnings - -@vindex TEX_HUSH -Kpathsea provides a way to suppress selected usually-harmless warnings; -this is useful at large sites where most users are not administrators, -and thus the warnings are merely a source of confusion, not a help. To -do this, you set the environment variable or configuration file value -@code{TEX_HUSH} to a colon-separated list of values. Here are the -possibilities: - -@vtable @samp -@item all -Suppress everything possible. - -@item checksum -@cindex mismatched checksum warnings -Suppress mismatched font checksum warnings. - -@item lostchar -@cindex missing character warnings -Suppress warnings when a character is missing from a font that a DVI or -VF file tries to typeset. - -@item readable -@cindex unreadable file warnings -Suppress warnings about attempts to access a file whose permissions -render it unreadable. - -@item special -@cindex unknown special warnings -@findex \special@r{, suppressing warnings about} -Suppresses warnings about an unimplemented or unparsable -@samp{\special} command. -@end vtable - -@noindent @file{tex-hush.c} defines the function that checks the -variable value. Each driver implements its own checks where -appropriate. - - -@node Programming -@chapter Programming - -This chapter is for programmers who wish to use Kpathsea. -@xref{Introduction}, for the conditions under which you may do so. - -@menu -* Overview: Programming overview. Introduction. -* Calling sequence:: Specifics of what to call. -* Program-specific files:: How to handle these. -* Config: Programming with config files. Getting info from texmf.cnf. -@end menu - - -@node Programming overview -@section Programming overview - -@cindex programming overview -@cindex overview of programming with Kpathsea - -Aside from this manual, your best source of information is the source to -the programs I've modified to use Kpathsea (@pxref{Introduction}). Of -those, Dviljk is probably the simplest, and hence a good place to start. -Xdvik adds VF support and the complication of X resources. Dvipsk adds -the complication of its own config files. Web2c is source code I also -maintain, so it uses Kpathsea rather straightforwardly, but is of course -complicated by the Web to C translation. Finally, Kpsewhich is a small -utility program whose sole purpose is to exercise the main -path-searching functionality. - -@flindex pathsearch.h -@flindex tex-file.h -@flindex tex-glyph.h -@flindex kpathsea.h -Beyond these examples, the @file{.h} files in the Kpathsea source -describe the interfaces and functionality (and of course the @file{.c} -files define the actual routines, which are the ultimate documentation). -@file{pathsearch.h} declares the basic searching routine. -@file{tex-file.h} and @file{tex-glyph.h} define the interfaces for -looking up particular kinds of files. You may wish to use -@code{#include <kpathsea/kpathsea.h>}, which includes every Kpathsea header. - -@cindex file types, registering new -The library provides no way for an external program to register new file -types: @file{tex-file.[ch]} must be modified to do this. For example, -Kpathsea has support for looking up Dvips config files, even though no -program other than Dvips will likely ever want to do so. I felt this -was acceptable, since along with new file types should also come new -defaults in @file{texmf.cnf} (and its descendant @file{paths.h}), since -it's simplest for users if they can modify one configuration file for -all kinds of paths. - -Kpathsea does not parse any formats itself; it barely opens any files. -Its primary purpose is to return filenames. The GNU font utilities does -contain libraries to read TFM, GF, and PK files, as do the programs -above, of course. - - -@node Calling sequence -@section Calling sequence - -@cindex programming with Kpathsea -@cindex calling sequence - -The typical way to use Kpathsea in your program goes something like this: - -@enumerate - -@item -@findex kpse_set_program_name -@vindex argv[0] -Call @code{kpse_set_program_name} with @code{argv[0]} as the first -argument; the second argument is a string or @code{NULL}. The second -argument is used by Kpathsea as the program name for the -@code{.@var{program}} feature of config files (@pxref{Config files}). -If the second argument is @code{NULL}, the value of the first argument -is used. This function must be called before any other use of the -Kpathsea library. - -@vindex program_invocation_name -@vindex program_invocation_short_name -@vindex kpse_program_name -@vindex KPATHSEA_DEBUG -@cindex SELFAUTOLOC -@cindex SELFAUTODIR -@cindex SELFAUTOPARENT -@cindex error message macros -@cindex symlinks, resolving -@cindex expanding symlinks -If necessary, @code{kpse_set_program_name} sets the global variables -@code{program_invocation_name} and @code{program_invocation_short_name}. -These variables are used in the error message macros defined in -@file{kpathsea/lib.h}. It sets the global variable -@code{kpse_program_name} to the program name it uses. It also -initializes debugging options based on the environment variable -@code{KPATHSEA_DEBUG} (if that is set). Finally, it sets the variables -@code{SELFAUTOLOC}, @code{SELFAUTODIR} and @code{SELFAUTOPARENT} to the -location, parent and grandparent directory of the executable, removing -@file{.} and @file{..} path elements and resolving symbolic links. -These are used in the default configuration file to allow people to -invoke TeX from anywhere, specifically from a mounted CD-ROM. (You can -use @samp{--expand-var=\$SELFAUTOLOC}, etc., to see the values finds.) - -@item -@findex kpse_set_progname -@vindex argv[0] -The @code{kpse_set_progname} is deprecated. A call to -@code{kpse_set_progname} with @code{argv[0]} is equivalent to a call of -@code{kpse_set_program_name} with first argument @code{argv[0]} and -second argument @code{NULL}. The function is deprecated because it -cannot ensure that the @code{.@var{program}} feature of config files -will always work (@pxref{Config files}). - -@item -@vindex kpathsea_debug @r{variable} -@cindex debugging options, in Kpathsea-using program -Set debugging options. @xref{Debugging}. If your program doesn't have a -debugging option already, you can define one and set -@code{kpathsea_debug} to the number that the user supplies (as in Dviljk -and Web2c), or you can just omit this altogether (people can always set -@code{KPATHSEA_DEBUG}). If you do have runtime debugging already, you -need to merge Kpathsea's options with yours (as in Dvipsk and Xdvik). - -@item -@vindex client_path @r{in @code{kpse_format_info}} -@vindex kpse_format_info -@flindex resident.c -@cindex config files, for Kpathsea-using programs -If your program has its own configuration files that can define search -paths, you should assign those paths to the @code{client_path} member in -the appropriate element of the @code{kpse_format_info} array. (This -array is indexed by file type; see @file{tex-file.h}.) See -@file{resident.c} in Dvipsk for an example. - -@item -@findex kpse_init_prog -@flindex proginit.h -Call @code{kpse_init_prog} (see @file{proginit.c}). It's useful for the -DVI drivers, at least, but for other programs it may be simpler to -extract the parts of it that actually apply. This does not initialize -any paths, it just looks for (and sets) certain environment variables -and other random information. (A search path is always initialized at -the first call to find a file of that type; this eliminates much useless -work, e.g., initializing the Bib@TeX{} search paths in a DVI driver.) - -@item -@findex kpse_find_* -@findex kpse_find_file -The routine to actually find a file of type @var{format} is -@code{kpse_find_@var{format}}, defined in @file{tex-file.h}. These are -macros that expand to a call to @file{kpse_find_file}. You can call, -say, @code{kpse_find_tfm} after doing only the first of the -initialization steps above---Kpathsea automatically reads the -@file{texmf.cnf} generic config files, looks for environment variables, -and does expansions at the first lookup. - -@item -To find PK and/or GF bitmap fonts, the routines are @code{kpse_find_pk}, -@code{kpse_find_gf} and @code{kpse_find_glyph}, defined in -@file{tex-glyph.h}. These return a structure in addition to the -resultant filename, because fonts can be found in so many ways. See the -documentation in the source. - -@item -@findex kpse_open_file -To actually open a file, not just return a filename, call -@code{kpse_open_file}. This function takes the name to look up and a -Kpathsea file format as arguments, and returns the usual @code{FILE *}. -It always assumes the file must exist, and thus will search the disk if -necessary (unless the search path specified @samp{!!}, etc.). In other -words, if you are looking up a VF or some other file that need not -exist, don't use this. - -@end enumerate - -@cindex hash table routines -@cindex memory allocation routines -@cindex string routines -@cindex reading arbitrary-length lines -@cindex input lines, reading -@cindex lines, reading arbitrary-length -Kpathsea also provides many utility routines. Some are generic: hash -tables, memory allocation, string concatenation and copying, string -lists, reading input lines of arbitrary length, etc. Others are -filename-related: default path, tilde, and variable expansion, -@code{stat} calls, etc. (Perhaps someday I'll move the former to a -separate library.) - -@flindex c-*.h -@pindex autoconf@r{, recommended} -The @file{c-*.h} header files can also help your program adapt to many -different systems. You will almost certainly want to use Autoconf for -configuring your software if you use Kpathsea; I strongly recommend -using Autoconf regardless. It is available from -@url{ftp://ftp.gnu.org/pub/gnu/autoconf}. - - -@node Program-specific files -@section Program-specific files - -Many programs will need to find some configuration files. Kpathsea -contains some support to make it easy to place them in their own -directories. The Standard @TeX{} directory structure (@pxref{Top,, -Introduction, tds, A Directory Structure for @TeX{} files}), specifies -that such files should go into a subdirectory named after the program, -like @samp{texmf/ttf2pk}. - -Two special formats, @samp{kpse_program_text_format} and -@samp{kpse_program_binary_format} exist, which use -@code{.:$TEXMF/@var{program}//} as their compiled-in search path. To -override this default, you can use the variable -@code{@var{PROGRAM}INPUTS} in the environment and/or @samp{texmf.cnf}. -That is to say, the name of the variable is constructed by converting -the name of the program to upper case, and appending @code{INPUTS}. - -The only difference between these two formats is whether -@code{kpse_open_file} will open the files it finds in text or binary -mode. - - -@node Programming with config files -@section Programming with config files - -@cindex programming with config files -@cindex config files, programming with - -You can (and probably should) use the same @code{texmf.cnf} -configuration file that Kpathsea uses for your program. This helps -installers by keeping all configuration in one place. - -@findex kpse_var_value -@flindex variable.h -@vindex shell_escape@r{, example for code} -To retrieve a value @var{var} from config files, the best way is to call -@code{kpse_var_value} on the string @code{@var{var}}. This will look -first for an environment variable @var{var}, then a config file value. -The result will be the value found or @samp{NULL}. This function is -declared in @file{kpathsea/variable.h}. For an example, see the -@code{shell_escape} code in @file{web2c/lib/texmfmp.c}. - -The routine to do variable expansion in the context of a search path (as -opposed to simply retrieving a value) is @code{kpse_var_expand}, also -declared in @file{kpathsea/variable.h}. It's generally only necessary -to set the search path structure components as explained in the previous -section, rather than using this yourself. - -@findex kpse_cnf_get -@flindex cnf.h -If for some reason you want to retrieve a value @emph{only} from a -config file, not automatically looking for a corresponding environment -variable, call @code{kpse_cnf_get} (declared in @file{kpathsea/cnf.h}) -with the string @var{var}. - -No initialization calls are needed. - - -@node Index -@unnumbered Index - -@printindex cp - -@contents - -@bye
deleted file mode 100644 --- a/kpathsea/kpathsea.version +++ /dev/null @@ -1,3 +0,0 @@ -# Version information for Klibtool. -# MAJOR MINOR DELTA -kpathsea 3 2 0
deleted file mode 100644 --- a/kpathsea/kpsestat.c +++ /dev/null @@ -1,129 +0,0 @@ -/* kpsestat -- show file permissions of a file in octal form. - Copyright (C) 1997 Olaf Weber. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-stat.h> -#include <stdio.h> -#include <stdlib.h> - -#ifdef WIN32 -#include <string.h> -#endif - -/* - * kpsestat mode x - * Print stat bits of file x on stdout, as modified by mode. - */ - -int main (argc, argv) - int argc; - char *argv[]; -{ - char * mode_string; - int to_set, to_keep, to_clear; - int result; - struct stat f; - - if (argc > 1 && strcmp (argv[1], "--help") == 0) { - printf ("Usage: %s MODE FILE\n\ - Print octal permissions of FILE as modified by MODE on standard output.\n\ - MODE is a subset of the symbolic permissions accepted by chmod.\n\ - Use MODE = to obtain the unchanged permissions.\n\ -\n\ ---help display this help and exit\n\ ---version output version information and exit\n\n", argv[0]); - fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout); - exit(0); - } else if (argc > 1 && strcmp (argv[1], "--version") == 0) { - printf ("%s (%s)\n\ -Copyright (C) 1997 Olaf Weber.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the file named COPYING.\n\ -Primary author of %s: Olaf Weber.\n", -argv[0], KPSEVERSION, argv[0]); - exit (0); - } - - /* insist on exactly two args */ - if (argc != 3) { - fprintf (stderr, "%s: Need exactly two arguments.\n\ -Try `%s --help' for more information.\n", argv[0], argv[0]); - exit(1); - } - - mode_string = argv[1]; - to_set = to_keep = to_clear = 0; - for (;;++mode_string) { - int affected = 0; - int action = 0; - int value = 0; - - for (;;++mode_string) - switch (*mode_string) { - case 'u': affected |= 04700; break; - case 'g': affected |= 02070; break; - case 'o': affected |= 01007; break; - case 'a': affected |= 07777; break; - default: goto no_more_affected; - } - no_more_affected: - if (affected == 0) - affected = 07777; - action = *mode_string; - ++mode_string; - for (;;++mode_string) - switch (*mode_string) { - case 'r': value |= 00444 & affected; break; - case 'w': value |= 00222 & affected; break; - case 'x': value |= 00111 & affected; break; - case 's': value |= 06000 & affected; break; - case 't': value |= 01000 & affected; break; - default: goto no_more_values; - } - no_more_values: - switch (action) { - case '-': to_clear |= value; break; - case '=': to_keep |= value; break; - case '+': to_set |= value; break; - default: - fprintf(stderr, "%s: Invalid mode\n", argv[0]); - exit(1); - } - if (*mode_string != ',') - break; - } - if (*mode_string != 0) { - fprintf(stderr, "%s: Invalid mode.\n", argv[0]); - exit(1); - } - - /* does the file exist? */ - if (stat (argv[2], &f) < 0) { - perror(argv[0]); - return 1; - } - - result = f.st_mode & ~S_IFMT; - result |= to_set; - result |= to_keep & result; - result &= ~to_clear; - - printf("%o\n", result); - - return 0; -}
deleted file mode 100644 --- a/kpathsea/kpsestat.man +++ /dev/null @@ -1,56 +0,0 @@ -.TH KPSESTAT 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -kpsestat \- compute octal mode from mode of existing file -.SH SYNOPSIS -.B kpsestat -.I mode -.I file -.\"===================================================================== -.SH DESCRIPTION -.B kpsestat -prints the octal permission of -.I file -modified according to -.I mode -on standard output. The -.I mode -parameter accepts a subset of the symbolic permissions accepted by -.BR chmod (1). -Use -.I = -as the mode to obtain the unchanged permissions. -.\"===================================================================== -.SH OPTIONS -.B kpsestat -accepts the following additional options: -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH BUGS -The error message when the file doesn't exist is rather cryptic. -.\"===================================================================== -.SH "SEE ALSO" -.BR chmod (1).
deleted file mode 100644 --- a/kpathsea/kpsewhich.c +++ /dev/null @@ -1,388 +0,0 @@ -/* kpsewhich -- standalone path lookup and variable expansion for Kpathsea. - Ideas from Thomas Esser and Pierre MacKay. - -Copyright (C) 1995, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-ctype.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/expand.h> -#include <kpathsea/getopt.h> -#include <kpathsea/line.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/proginit.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/tex-glyph.h> -#include <kpathsea/variable.h> -#include <kpathsea/progname.h> - - -/* Base resolution. (-D, -dpi) */ -unsigned dpi = 600; - -/* For variable and path expansion. (-expand-var, -expand-path, - -show-path, -separator) */ -string var_to_expand = NULL; -string braces_to_expand = NULL; -string path_to_expand = NULL; -string path_to_show = NULL; - -/* The file type and path for lookups. (-format, -path) */ -kpse_file_format_type user_format = kpse_last_format; -string user_format_string; -string user_path; - -/* Interactively ask for names to look up? (-interactive) */ -boolean interactive = false; - -/* Search the disk as well as ls-R? (-must-exist) */ -boolean must_exist = false; - - -/* The device name, for $MAKETEX_MODE. (-mode) */ -string mode = NULL; - -/* The program name, for `.PROG' construct in texmf.cnf. (-program) */ -string progname = NULL; - -/* Return the <number> substring in `<name>.<number><stuff>', if S has - that form. If it doesn't, return 0. */ - -static unsigned -find_dpi P1C(string, s) -{ - unsigned dpi_number = 0; - string extension = find_suffix (s); - - if (extension != NULL) - sscanf (extension, "%u", &dpi_number); - - return dpi_number; -} - -/* Use the file type from -format if that was specified, 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. */ - -static kpse_file_format_type -find_format P2C(string, name, boolean, is_filename) -{ - kpse_file_format_type ret; - - if (is_filename && user_format != kpse_last_format) { - ret = user_format; - } else if (FILESTRCASEEQ (name, "psfonts.map")) { - ret = kpse_dvips_config_format; - } else { - kpse_file_format_type f; - boolean found = false; - unsigned name_len = strlen (name); - -/* Have to rely on `try_len' being declared here, since we can't assume - GNU C and statement expressions. */ -#define TRY_SUFFIX(try) (\ - try_len = (try) ? strlen (try) : 0, \ - (try) && try_len <= name_len \ - && FILESTRCASEEQ (try, name + name_len - try_len)) - - for (f = 0; !found && f < kpse_last_format; f++) { - unsigned try_len; - const_string *ext; - const_string try; - - if (!kpse_format_info[f].type) - kpse_init_format (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. */ - try = kpse_format_info[f].type; - found = TRY_SUFFIX (try); - } - 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); - } - } - /* If there was a match, f will be one past the correct value. */ - ret = f < kpse_last_format ? f - 1 : kpse_last_format; - } - - return ret; -} - -/* Look up a single filename NAME. Return 0 if success, 1 if failure. */ - -static unsigned -lookup P1C(string, name) -{ - string ret; - unsigned local_dpi; - kpse_glyph_file_type glyph_ret; - - if (user_path) { - ret = kpse_path_search (user_path, name, must_exist); - - } else { - /* No user-specified search path, check user format or guess from NAME. */ - kpse_file_format_type fmt = find_format (name, true); - - switch (fmt) { - case kpse_pk_format: - case kpse_gf_format: - case kpse_any_glyph_format: - /* Try to extract the resolution from the name. */ - local_dpi = find_dpi (name); - if (!local_dpi) - local_dpi = dpi; - ret = kpse_find_glyph (remove_suffix (name), local_dpi, fmt, &glyph_ret); - break; - - case kpse_last_format: - /* If the suffix isn't recognized, assume it's a tex file. */ - fmt = kpse_tex_format; - /* fall through */ - - default: - ret = kpse_find_file (name, fmt, must_exist); - } - } - - if (ret) - puts (ret); - - return ret == NULL; -} - -/* Reading the options. */ - -#define USAGE "\ - Standalone path lookup and expansion for Kpathsea.\n\ -\n\ --debug=NUM set debugging flags.\n\ --D, -dpi=NUM use a base resolution of NUM; default 600.\n\ --expand-braces=STRING output variable and brace expansion of STRING.\n\ --expand-path=STRING output complete path expansion of STRING.\n\ --expand-var=STRING output variable expansion of STRING.\n\ --format=NAME use file type NAME (see list below).\n\ --help print this message and exit.\n\ --interactive ask for additional filenames to look up.\n\ -[-no]-mktex=FMT disable/enable mktexFMT generation (FMT=pk/mf/tex/tfm).\n\ --mode=STRING set device name for $MAKETEX_MODE to STRING;\n\ - no default.\n\ --must-exist search the disk as well as ls-R if necessary\n\ --path=STRING search in the path STRING.\n\ --progname=STRING set program name to STRING.\n\ --show-path=NAME output search path for file type NAME (see list below).\n\ --version print version number and exit.\n\ -" - -/* Test 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) - -/* SunOS cc can't initialize automatic structs. */ -static struct option long_options[] - = { { "D", 1, 0, 0 }, - { "debug", 1, 0, 0 }, - { "dpi", 1, 0, 0 }, - { "expand-braces", 1, 0, 0 }, - { "expand-path", 1, 0, 0 }, - { "expand-var", 1, 0, 0 }, - { "format", 1, 0, 0 }, - { "help", 0, 0, 0 }, - { "interactive", 0, (int *) &interactive, 1 }, - { "mktex", 1, 0, 0 }, - { "mode", 1, 0, 0 }, - { "must-exist", 0, (int *) &must_exist, 1 }, - { "path", 1, 0, 0 }, - { "no-mktex", 1, 0, 0 }, - { "progname", 1, 0, 0 }, - { "separator", 1, 0, 0 }, - { "show-path", 1, 0, 0 }, - { "version", 0, 0, 0 }, - { 0, 0, 0, 0 } }; - -static void -read_command_line P2C(int, argc, string *, argv) -{ - int g; /* `getopt' return code. */ - int option_index; - - for (;;) { - g = getopt_long_only (argc, argv, "", long_options, &option_index); - - if (g == -1) - break; - - if (g == '?') - exit (1); /* Unknown option. */ - - assert (g == 0); /* We have no short option names. */ - - if (ARGUMENT_IS ("debug")) { - kpathsea_debug |= atoi (optarg); - - } else if (ARGUMENT_IS ("dpi") || ARGUMENT_IS ("D")) { - dpi = atoi (optarg); - - } else if (ARGUMENT_IS ("expand-braces")) { - braces_to_expand = optarg; - - } else if (ARGUMENT_IS ("expand-path")) { - path_to_expand = optarg; - - } else if (ARGUMENT_IS ("expand-var")) { - var_to_expand = optarg; - - } else if (ARGUMENT_IS ("format")) { - user_format_string = optarg; - - } else if (ARGUMENT_IS ("help")) { - kpse_file_format_type f; - extern DllImport char *kpse_bug_address; /* from version.c */ - - printf ("Usage: %s [OPTION]... [FILENAME]...\n", argv[0]); - fputs (USAGE, stdout); - putchar ('\n'); - fputs (kpse_bug_address, stdout); - - /* Have to set this for init_format to work. */ - kpse_set_program_name (argv[0], progname); - - puts ("\nRecognized format names and their suffixes:"); - for (f = 0; f < kpse_last_format; f++) { - const_string *ext; - kpse_init_format (f); - printf ("%s:", kpse_format_info[f].type); - for (ext = kpse_format_info[f].suffix; ext && *ext; ext++) { - putchar (' '); - fputs (*ext, stdout); - } - for (ext = kpse_format_info[f].alt_suffix; ext && *ext; ext++) { - putchar (' '); - fputs (*ext, stdout); - } - putchar ('\n'); - } - - exit (0); - - } else if (ARGUMENT_IS ("mktex")) { - kpse_maketex_option (optarg, true); - - } else if (ARGUMENT_IS ("mode")) { - mode = optarg; - - } else if (ARGUMENT_IS ("no-mktex")) { - kpse_maketex_option (optarg, false); - - } else if (ARGUMENT_IS ("path")) { - user_path = optarg; - - } else if (ARGUMENT_IS ("progname")) { - progname = optarg; - - } else if (ARGUMENT_IS ("show-path")) { - path_to_show = optarg; - user_format_string = optarg; - - } else if (ARGUMENT_IS ("version")) { - extern DllImport char *kpathsea_version_string; /* from version.c */ - puts (kpathsea_version_string); - puts ("Copyright (C) 1997 K. Berry.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the files named COPYING."); - exit (0); - } - - /* Else it was just a flag; getopt has already done the assignment. */ - } - - if (user_path && user_format_string) { - fprintf (stderr, "-path (%s) and -format (%s) are mutually exclusive.\n", - user_path, user_format_string); - fputs ("Try `kpsewhich --help' for more information.\n", stderr); - exit (1); - } - - if (optind == argc && !var_to_expand && !braces_to_expand - && !path_to_expand && !path_to_show) { - fputs ("Missing argument. Try `kpsewhich --help' for more information.\n", - stderr); - exit (1); - } -} - -int -main P2C(int, argc, string *, argv) -{ - unsigned unfound = 0; - - read_command_line (argc, argv); - - kpse_set_program_name (argv[0], progname); - - /* NULL for no fallback font. */ - kpse_init_prog (uppercasify (kpse_program_name), dpi, mode, NULL); - - /* Have to do this after setting the program name. */ - if (user_format_string) - user_format = find_format (user_format_string, false); - - /* Variable expansion. */ - if (var_to_expand) - puts (kpse_var_expand (var_to_expand)); - - if (braces_to_expand) - puts (kpse_brace_expand (braces_to_expand)); - - /* Path expansion. */ - if (path_to_expand) - puts (kpse_path_expand (path_to_expand)); - - /* Show a search path. */ - if (path_to_show) { - if (user_format != kpse_last_format) { - if (!kpse_format_info[user_format].type) /* needed if arg was numeric */ - kpse_init_format (user_format); - puts (kpse_format_info[user_format].path); - } else { - WARNING1 ("kpsewhich: Ignoring unknown file type `%s'", path_to_show); - } - } - - for (; optind < argc; optind++) { - unfound += lookup (argv[optind]); - } - - if (interactive) { - for (;;) { - string name = read_line (stdin); - if (!name || STREQ (name, "q") || STREQ (name, "quit")) break; - unfound += lookup (name); - free (name); - } - } - - return unfound > 255 ? 1 : unfound; -}
deleted file mode 100644 --- a/kpathsea/kpsewhich.man +++ /dev/null @@ -1,145 +0,0 @@ -.TH KPSEWHICH 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -kpsewhich \- standalone path lookup and and expansion for kpathsea -.SH SYNOPSIS -.B kpsewhich -.RI [ options ] -.RI [ filenames ] -.\"===================================================================== -.SH DESCRIPTION -This manual page is not meant to be exhaustive. The complete -documentation for this version of \*(TX can be found in the info file -or manual -.IR "Kpathsea: A library for path searching" . -.PP -.B kpsewhich -is used as a standalone front-end of the kpathsea library that can be -used to examine variables and find files. -.\"===================================================================== -.SH OPTIONS -.B kpsewhich -accepts the following options: -.TP -.BI --debug \ num -.rb -Set debugging flags. -.TP -.BI -D \ num -.rb -Use a base resolution of -.IR num ; -the default, set by the installer, is typically 600. -.TP -.BI --dpi \ num -As -.BR -D. -.TP -.BI --expand-braces \ string -.rb -Print variable and brace expansion of -.IR string . -.TP -.BI --expand-path \ string -.rb -Print complete path expansion of -.IR string . -.TP -.BI --expand-var \ string -.rb -Print variable expansion of -.BR string . -.TP -.BI --format \ name -.rb -Use file type -.IR name . -See the info manual for a list of valid names, or use the -.B --help -option to print the list. -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --interactive -.rb -Ask for additional filenames to look up. -.TP -.BI --mktex \ fmt -.rb -enable -.RI mktex fmt -generation. -.RI ( fmt =pk/mf/tex/tfm) -.TP -.BI --mode \ string -.rb -Set device name for -.I $MAKETEX_MODE -to -.IR string ; -no default. -.TP -.B --must-exist -.rb -Search the disk as well as ls-R if necessary. -.TP -.BI --no-mktex \ fmt -.rb -disable -.RI mktex fmt -generation. -.RI ( fmt =pk/mf/tex/tfm) -.TP -.BI --path \ string -Search in the path -.IR string . -.TP -.BI --progname \ string -.rb -Set program name to -.IR string . -.TP -.B --separator \ string -.rb -.I string -separates components in -.B --path -output; default is -.I : -on UNIX systems. -.TP -.BI --show-path \ name -.rb -Output search path for file type -.IR name . -See the info manual for a list of valid names, or use the -.B --help -option to print the list. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH "SEE ALSO" -.BR mktexlsr (1), -.BR mktexmf (1), -.BR mktexpk (1), -.BR mktextfm (1).
deleted file mode 100644 --- a/kpathsea/lib.h +++ /dev/null @@ -1,179 +0,0 @@ -/* lib.h: declarations for common, low-level routines in kpathsea. - -Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_LIB_H -#define KPATHSEA_LIB_H - -#include <kpathsea/types.h> - -/* Define common sorts of messages. */ - -/* This should be called only after a system call fails. Don't exit - with status `errno', because that might be 256, which would mean - success (exit statuses are truncated to eight bits). */ -#define FATAL_PERROR(str) do { \ - fprintf (stderr, "%s: ", program_invocation_name); \ - perror (str); exit (EXIT_FAILURE); } while (0) - -#define START_FATAL() do { \ - fprintf (stderr, "%s: fatal: ", program_invocation_name); -#define END_FATAL() fputs (".\n", stderr); exit (1); } while (0) - -#define FATAL(str) \ - START_FATAL (); fputs (str, stderr); END_FATAL () -#define FATAL1(str, e1) \ - START_FATAL (); fprintf (stderr, str, e1); END_FATAL () -#define FATAL2(str, e1, e2) \ - START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL () -#define FATAL3(str, e1, e2, e3) \ - START_FATAL (); fprintf (stderr, str, e1, e2, e3); END_FATAL () -#define FATAL4(str, e1, e2, e3, e4) \ - START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4); END_FATAL () -#define FATAL5(str, e1, e2, e3, e4, e5) \ - START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5); END_FATAL () -#define FATAL6(str, e1, e2, e3, e4, e5, e6) \ - START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5, e6); END_FATAL () - - -#define START_WARNING() do { fputs ("warning: ", stderr) -#define END_WARNING() fputs (".\n", stderr); fflush (stderr); } while (0) - -#define WARNING(str) \ - START_WARNING (); fputs (str, stderr); END_WARNING () -#define WARNING1(str, e1) \ - START_WARNING (); fprintf (stderr, str, e1); END_WARNING () -#define WARNING2(str, e1, e2) \ - START_WARNING (); fprintf (stderr, str, e1, e2); END_WARNING () -#define WARNING3(str, e1, e2, e3) \ - START_WARNING (); fprintf (stderr, str, e1, e2, e3); END_WARNING () -#define WARNING4(str, e1, e2, e3, e4) \ - START_WARNING (); fprintf (stderr, str, e1, e2, e3, e4); END_WARNING () - - -/* I find this easier to read. */ -#define STREQ(s1, s2) (strcmp (s1, s2) == 0) -#define STRNEQ(s1, s2, n) (strncmp (s1, s2, n) == 0) - -/* Support for FAT/ISO-9660 filesystems. Theoretically this should be - done at runtime, per filesystem, but that's painful to program. */ -#ifdef MONOCASE_FILENAMES -#define FILESTRCASEEQ(s1, s2) (strcasecmp (s1, s2) == 0) -#define FILESTRNCASEEQ(s1, s2, l) (strncasecmp (s1, s2, l) == 0) -#define FILECHARCASEEQ(c1, c2) (toupper (c1) == toupper (c2)) -#else -#define FILESTRCASEEQ STREQ -#define FILESTRNCASEEQ STRNEQ -#define FILECHARCASEEQ(c1, c2) ((c1) == (c2)) -#endif - -/* This is the maximum number of numerals that result when a 64-bit - integer is converted to a string, plus one for a trailing null byte, - plus one for a sign. */ -#define MAX_INT_LENGTH 21 - -/* If the environment variable TEST is set, return it; otherwise, - DEFAULT. This is useful for paths that use more than one envvar. */ -#define ENVVAR(test, default) (getenv (test) ? (test) : (default)) - -/* Return a fresh copy of S1 followed by S2, et al. */ -extern DllImport string concat P2H(const_string s1, const_string s2); -extern DllImport string concat3 P3H(const_string, const_string, const_string); -/* `concatn' is declared in its own include file, to avoid pulling in - all the varargs stuff. */ - -/* A fresh copy of just S. */ -extern DllImport string xstrdup P1H(const_string s); - -/* Convert all lowercase characters in S to uppercase. */ -extern DllImport string uppercasify P1H(const_string s); - -/* Like `atoi', but disallow negative numbers. */ -extern DllImport unsigned atou P1H(const_string); - -/* True if FILENAME1 and FILENAME2 are the same file. If stat fails on - either name, return false, no error message. - Cf. `SAME_FILE_P' in xstat.h. */ -extern DllImport boolean same_file_p P2H(const_string filename1, - const_string filename2); - -#ifndef HAVE_BASENAME -/* Return NAME with any leading path stripped off. This returns a - pointer into NAME. */ -extern DllImport const_string basename P1H(const_string name); -#endif /* not HAVE_BASENAME */ - -#ifndef HAVE_STRSTR -extern string strstr P2H(const_string haystack, const_string needle); -#endif - -/* If NAME has a suffix, return a pointer to its first character (i.e., - the one after the `.'); otherwise, return NULL. */ -extern DllImport string find_suffix P1H(const_string name); - -/* Return NAME with any suffix removed. */ -extern DllImport string remove_suffix P1H(const_string name); - -/* Return S with the suffix SUFFIX, removing any suffix already present. - For example, `make_suffix ("/foo/bar.baz", "quux")' returns - `/foo/bar.quux'. Returns a string allocated with malloc. */ -extern DllImport string make_suffix P2H(const_string s, const_string suffix); - -/* Return NAME with STEM_PREFIX prepended to the stem. For example, - `make_prefix ("/foo/bar.baz", "x")' returns `/foo/xbar.baz'. - Returns a string allocated with malloc. */ -extern DllImport string make_prefix P2H(string stem_prefix, string name); - -/* If NAME has a suffix, simply return it; otherwise, return - `NAME.SUFFIX'. */ -extern DllImport string extend_filename P2H(const_string name, - const_string suffix); - -/* Call putenv with the string `VAR=VALUE' and abort on error. */ -extern DllImport void xputenv P2H(const_string var, const_string value); -extern DllImport void xputenv_int P2H(const_string var, int value); - -/* Return the current working directory. */ -extern DllImport string xgetcwd P1H(void); - -/* Returns true if FN is a directory or a symlink to a directory. */ -extern DllImport boolean dir_p P1H(const_string fn); - -/* If FN is a readable directory, return the number of links it has. - Otherwise, return -1. */ -extern DllImport int dir_links P1H(const_string fn); - -/* Like their stdio counterparts, but abort on error, after calling - perror(3) with FILENAME as its argument. */ -extern DllImport FILE *xfopen P2H(const_string filename, const_string mode); -extern DllImport void xfclose P2H(FILE *, const_string filename); -extern DllImport void xfseek P4H(FILE *, long, int, string filename); -extern DllImport unsigned long xftell P2H(FILE *, string filename); - -/* These call the corresponding function in the standard library, and - abort if those routines fail. Also, `xrealloc' calls `xmalloc' if - OLD_ADDRESS is null. */ -extern DllImport address xmalloc P1H(unsigned size); -extern DllImport address xrealloc P2H(address old_address, unsigned new_size); -extern DllImport address xcalloc P2H(unsigned nelem, unsigned elsize); - -/* (Re)Allocate N items of type T using xmalloc/xrealloc. */ -#define XTALLOC(n, t) ((t *) xmalloc ((n) * sizeof (t))) -#define XTALLOC1(t) XTALLOC (1, t) -#define XRETALLOC(addr, n, t) ((addr) = (t *) xrealloc (addr, (n) * sizeof(t))) - -#endif /* not KPATHSEA_LIB_H */
deleted file mode 100644 --- a/kpathsea/line.c +++ /dev/null @@ -1,71 +0,0 @@ -/* line.c: return the next line from a file, or NULL. - -Copyright (C) 1992, 93, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/line.h> - -/* Allocate in increments of this size. */ -#define BLOCK_SIZE 75 - -char * -read_line (f) - FILE *f; -{ - int c; - unsigned limit = BLOCK_SIZE; - unsigned loc = 0; - char *line = xmalloc (limit); - - while ((c = getc (f)) != EOF && c != '\n' && c != '\r') - { - line[loc] = c; - loc++; - - /* By testing after the assignment, we guarantee that we'll always - have space for the null we append below. We know we always - have room for the first char, since we start with BLOCK_SIZE. */ - if (loc == limit) - { - limit += BLOCK_SIZE; - line = xrealloc (line, limit); - } - } - - /* If we read anything, return it. This can't represent a last - ``line'' which doesn't end in a newline, but so what. */ - if (c != EOF) - { - /* Terminate the string. We can't represent nulls in the file, - either. Again, it doesn't matter. */ - line[loc] = 0; - /* Absorb LF of a CRLF pair. */ - if (c == '\r') { - c = getc (f); - if (c != '\n') - ungetc (c, f); - } - } - else /* At end of file. */ - { - free (line); - line = NULL; - } - - return line; -} -
deleted file mode 100644 --- a/kpathsea/line.h +++ /dev/null @@ -1,31 +0,0 @@ -/* line.h: read an arbitrary-length input line. - -Copyright (C) 1992 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef LINE_H -#define LINE_H - -#include <stdio.h> -#include <kpathsea/types.h> - - -/* Return NULL if we are at EOF, else the next line of F. The newline - character at the end of string is removed. The string is allocated - with malloc. */ -extern string read_line P1H(FILE *f); - -#endif /* not LINE_H */
deleted file mode 100644 --- a/kpathsea/magstep.c +++ /dev/null @@ -1,100 +0,0 @@ -/* magstep.c: fix up fixed-point vs. floating-point. - -Copyright (C) 1994, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/magstep.h> - - -/* Return true magstep N, where the lsb of N means ``half'' (see - magstep.h) for resolution BDPI. From Tom Rokicki's dvips. */ - -static int -magstep P2C(int, n, int, bdpi) -{ - double t; - int step; - int neg = 0; - - if (n < 0) - { - neg = 1; - n = -n; - } - - if (n & 1) - { - n &= ~1; - t = 1.095445115; - } - else - t = 1.0; - - while (n > 8) - { - n -= 8; - t = t * 2.0736; - } - - while (n > 0) - { - n -= 2; - t = t * 1.2; - } - - step = 0.5 + (neg ? bdpi / t : bdpi * t); - return step; -} - -/* This is adapted from code written by Tom Rokicki for dvips. It's - part of Kpathsea now so all the drivers can use it. The idea is to - return the true dpi corresponding to DPI with a base resolution of - BDPI. If M_RET is non-null, we also set that to the mag value. */ - -/* Don't bother trying to use fabs or some other ``standard'' routine - which can only cause trouble; just roll our own simple-minded - absolute-value function that is all we need. */ -#undef ABS /* be safe */ -#define ABS(expr) ((expr) < 0 ? -(expr) : (expr)) - -#define MAGSTEP_MAX 40 - -unsigned -kpse_magstep_fix P3C(unsigned, dpi, unsigned, bdpi, int *, m_ret) -{ - int m; - int mdpi = -1; - unsigned real_dpi = 0; - int sign = dpi < bdpi ? -1 : 1; /* negative or positive magsteps? */ - - for (m = 0; !real_dpi && m < MAGSTEP_MAX; m++) /* don't go forever */ - { - mdpi = magstep (m * sign, bdpi); - if (ABS (mdpi - (int) dpi) <= 1) /* if this magstep matches, quit */ - real_dpi = mdpi; - else if ((mdpi - (int) dpi) * sign > 0) /* if gone too far, quit */ - real_dpi = dpi; - } - - /* If requested, return the encoded magstep (the loop went one too far). */ - if (m_ret) - *m_ret = real_dpi == mdpi ? (m - 1) * sign : 0; - - /* Always return the true dpi found. */ - return real_dpi ? real_dpi : dpi; -}
deleted file mode 100644 --- a/kpathsea/magstep.h +++ /dev/null @@ -1,45 +0,0 @@ -/* magstep.h: declaration for magstep fixing. - -Copyright (C) 1994 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_MAGSTEP_H -#define KPATHSEA_MAGSTEP_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* If DPI is close enough to some magstep of BDPI, return the true dpi - value, and the magstep found (or zero) in M_RET (if - non-null). ``Close enough'' means within one pixel. - - M_RET is slightly encoded: the least significant bit is on for a - half-magstep, off otherwise. Thus, a returned M_RET of 1 means - \magstephalf, i.e., sqrt(1.2), i.e., 1.09544. Put another way, - return twice the number of magsteps. - - In practice, this matters for magstephalf. Floating-point computation - with the fixed-point DVI representation leads to 328 (for BDPI == - 300); specifying `at 11pt' yields 330; the true \magstephalf is 329 - (that's what you get if you run Metafont with mag:=magstep(.5)). - - The time to call this is after you read the font spec from the DVI - file, but before you look up any files -- do the usual floating-point - computations, and then fix up the result. */ - -extern unsigned kpse_magstep_fix P3H(unsigned dpi, unsigned bdpi, int *m_ret); - -#endif /* not KPATHSEA_MAGSTEP_H */
deleted file mode 100644 --- a/kpathsea/make-suffix.c +++ /dev/null @@ -1,50 +0,0 @@ -/* make-suffix.c: unconditionally add a filename suffix. - -Copyright (C) 1992, 93, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-pathch.h> - -/* Return a new string: S suffixed with SUFFIX, regardless of what it - was before. This returns a newly allocated string. */ - -string -make_suffix P2C(const_string, s, const_string, suffix) -{ - string new_s; - const_string dot_pos = strrchr (s, '.'); - const_string slash_pos; - - for (slash_pos = s + strlen (s) - 1; slash_pos > dot_pos && slash_pos > s; - slash_pos--) { - if (IS_DIR_SEP (*slash_pos)) - break; - } - - if (dot_pos == NULL || slash_pos > dot_pos ) - new_s = concat3 (s, ".", suffix); - else - { - unsigned past_dot_index = dot_pos + 1 - s; - - new_s = xmalloc (past_dot_index + strlen (suffix) + 1); - strncpy (new_s, s, dot_pos + 1 - s); - strcpy (new_s + past_dot_index, suffix); - } - - return new_s; -}
deleted file mode 100644 --- a/kpathsea/make/ChangeLog +++ /dev/null @@ -1,803 +0,0 @@ -Thu Mar 12 20:22:00 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * rdepend.make (depend): Add sed pattern for readlink. - -Tue Mar 10 22:09:59 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * dist.make: Account for presence of withenable.ac in top source - dir. - -Tue Feb 24 13:21:58 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * man.make: Additions from Vladimir Volovich <vvv@vvv.vsu.ru>. - -Mon Feb 16 09:44:30 1998 Olaf Weber <olaf@infovore.xs4all.nl> - - * makevars.make: Add vartexfonts to the variables being passed - around. - - * paths.make: Add vartexfonts variable to make configuring - VARTEXFONTS directory easier. - -Tue Feb 10 17:58:44 1998 Olaf Weber <infovore@xs4all.nl> - - * man.make: Change sed delimiter from ! to %, in case !! is used - in any of the variables being substituted. Spotted by Thomas - Esser. - -Fri Feb 6 17:57:27 1998 Olaf Weber <infovore@xs4all.nl> - - * dist.make: Correct ../contrib material. - - * common.make: Add -pipe to gcc flags for maintainer. - -Tue Feb 3 22:13:56 1998 Olaf Weber <infovore@xs4all.nl> - - * dist.make [MAINT]: Improve handling of contrib dir. - -Thu Jan 29 16:20:12 1998 Olaf Weber <infovore@xs4all.nl> - - * paths.make: Let texmf be @texmfmain@, which is determined in - ../kpathsea/withenable.ac. - - * clean.make (distclean): Imply extraclean. - -Wed Jan 28 20:48:48 1998 Olaf Weber <infovore@xs4all.nl> - - * dist.make: Add unbackslsh.awk to top_files. Account for contrib - dir. - - * paths.make: A friendly warning: we're going full TDS in - texmf.in. - - * rdepend.make: Since c-auto.h is generated, it must receive - special treatment like paths.h. - -Fri Jan 9 21:12:23 1998 Olaf Weber <infovore@xs4all.nl> - - * clean.make (distclean): Add stamp-tangle stamp-otangle to files - being removed. - -Sun Jan 4 15:56:57 1998 Olaf Weber <infovore@xs4all.nl> - - * man.make: Add end-of-file comment. - - * Add man.make with rules for making manual pages. - -Fri Dec 12 10:30:25 1997 Olaf Weber <infovore@xs4all.nl> - - * dist.make (dist): Reflect change of install-sh to install.sh. - Add djgpp directory to distributions. - -Tue Dec 2 16:12:53 1997 Olaf Weber <infovore@xs4all.nl> - - * clean.make (extraclean): Remove *.*pk and *.*gf, rather than *pk - and *gf. - -Mon Nov 24 19:07:23 1997 Olaf Weber <infovore@xs4all.nl> - - * texi.make: A change to get texi2dvi to work on the maintainer's - system. - -Thu Nov 20 00:03:29 1997 Olaf Weber <infovore@xs4all.nl> - - * dist.make (dist): Be less exuberant with write permissions when - creating a distribution. - -Tue Nov 18 13:46:49 1997 Olaf Weber <infovore@xs4all.nl> - - * rdepend.make (depend depend.make): Correct lex.yy to - $(LEX_OUTPUT_ROOT). - -Mon Nov 10 13:12:28 1997 Olaf Weber <infovore@xs4all.nl> - - * paths.make [mandir]: Corrected definition, which contained one - 'man' too many. From Sebastian Rahtz. - -Tue Oct 28 21:34:42 1997 Olaf Weber <infovore@xs4all.nl> - - * dist.make: Use cp -p when creating a distribution. - -Tue Oct 21 23:33:16 1997 Olaf Weber <infovore@xs4all.nl> - - * rdepend.make: Handle kpsestat and access when generating - dependencies. - -Mon Oct 20 11:38:09 1997 Olaf Weber <infovore@xs4all.nl> - - * clean.make, config.make, paths.make, tkpathsea.make: Renamed - texmf.cnf.in to texmf.in / c-auto.h.in to c-auto.in. - -Thu Oct 16 10:32:59 1997 Olaf Weber <infovore@xs4all.nl> - - * clean.make: Remove stamp-auto files for distclean and - configclean targets. Remove *.exe files in clean target. After - Peter Breitenlohner. - -Wed Oct 15 21:37:20 1997 Olaf Weber <infovore@xs4all.nl> - - * config.make: Don't try to create stamp-auto in source directory. - - * dist.make: Do not bother to distribute stamp-auto. - -Mon Oct 6 09:27:18 1997 Olaf Weber <infovore@xs4all.nl> - - * config.make: Ensure that maintainer mode, once enabled, remains - enabled if the Makefiles are regenerated. - - * rdepend.make (depend, depend.make): Add unbackslsh.awk filter. - -Tue Sep 30 12:14:55 1997 Olaf Weber <infovore@xs4all.nl> - - * texi.make (MAKEINFO_FLAGS): removed -I$(HOME)/gnu/gnuorg and - comment, added -I$(srcdir). - -Mon Sep 29 17:26:36 1997 Olaf Weber <infovore@xs4all.nl> - - * paths.make: Fixed mandir definition. (Bruno BEAUFILS - <Bruno.Beaufils@lifl.fr>) - -Tue Sep 16 15:22:48 1997 Olaf Weber <infovore@xs4all.nl> - - * config.make: ac_dir is now /home/olaf/web2c/src/autoconf. Use - -m $(ac_dir) in calls. - - * rdepend.make: Enabled make depend. - -Thu Feb 6 17:35:18 1997 Karl Berry <karl@cs.umb.edu> - - * Kpathsea 3.0, Web2c 7.0, etc. - -Sat Feb 1 14:51:16 1997 Karl Berry <karl@cs.umb.edu> - - * dist.make: Copy acsite.m4 to etc/autoconf instead of ./aclocal.m4. - -Sat Jan 18 17:07:22 1997 Karl Berry <karl@cs.umb.edu> - - * dist.make (dist): Depend on depend, not depend.make, so we will - always make depend at dist time. - - * rdepend.make (depend): Remove dependency on paths.h; why should - we remake depend.make then? - -Thu Jan 16 14:59:01 1997 Karl Berry <karl@cs.umb.edu> - - * dist.make (top_files): Add dir. - -Tue Dec 10 15:02:52 1996 Karl Berry <karl@cs.umb.edu> - - * dist.make: Remove autoconf stuff, just create the necessary stuff - in etc/. - -Tue Dec 3 17:32:48 1996 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Include -I$(c_auto_h_dir) for web2c/window. - -Sun Nov 24 16:32:01 1996 Karl Berry <karl@cs.umb.edu> - - * config.make (configure_in): Add xt.ac from Kpathsea. - - * dist.make (dist): Copy new etc/ directory. - (top_files): Remove various informational files now in etc/. - -Fri Nov 15 16:20:58 1996 Karl Berry <karl@cs.umb.edu> - - * common.make (INSTALL_SCRIPT): Define as $(INSTALL_PROGRAM). - -Fri Oct 25 16:52:00 1996 Karl Berry <karl@cs.umb.edu> - - * clean.make (mostlyclean): Do not remove PROF etc. here, - they are only in kpathsea. - - * dist.make (top_files): Include the empty dir file from the - Texinfo distribution. - -Tue Oct 15 17:45:28 1996 Karl Berry <karl@cs.umb.edu> - - * dist.make (top_files): Add klibtool, config.guess, config.sub, - acklibtool.m4; unixtex.ftp. - -Sat Oct 5 17:21:08 1996 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Oops, need to parenthesize the extra - kpathsea stuff. - -Sun Sep 22 16:01:38 1996 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Generate dependencies for .lo instead of - .o in kpathsea (except for kpsewhich). - -Fri Sep 6 16:38:49 1996 Karl Berry <karl@cs.umb.edu> - - * common.make (INSTALL_LIBTOOL_PROG): We will name this - install-prog, not install-progs. - -Tue Sep 3 19:10:57 1996 Karl Berry <karl@cs.umb.edu> - - * config.make (configure_in): Add acklibtool.m4 as a dependency. - -Sun Sep 1 17:25:24 1996 Karl Berry <karl@cs.umb.edu> - - * common.make (LIBTOOL): Define as @LIBTOOL@ for Autoconf expansion. - -Sat Jul 27 14:44:34 1996 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend: Depend on $(kpathsea_dir)/paths.h. - -Fri Jul 26 15:26:01 1996 Karl Berry <karl@cs.umb.edu> - - * clean.make (clean): Move binary/library removal from - mostlyclean, and also remove *.bad (the libtool wrapper scripts). - (mostlyclean): Remove *.lo, PROF, PROF_SHARED, SHARED, and STATIC. - - * programs.make (kpathsea_link): Use $(link_command) here, libtool 0.5. - * common.make (compile): New variable. - (kpathsea): Now $(kpathsea_dir)/libkpathsea.la. - (INSTALL_LIBTOOL_*): New install variables. - * co.make: Move .c.o rule back to common.make, remove this. - -Fri Jun 7 18:44:15 1996 K. Berry <kb@cs.umb.edu> - - * tkpathsea.make (.c.o): Move here. - * common.make: FRom here. - -Thu Jun 6 19:42:48 1996 K. Berry <kb@cs.umb.edu> - - * config.make (config.status): Remove --verbose. - - * programs.make: Remove our sharedlib stuff. - -Sat Jun 1 13:47:17 1996 Karl Berry <karl@cs.umb.edu> - - * dist.make (dist): Check for ` ::' in Texinfo files. - -Sun Apr 28 14:58:27 1996 Karl Berry <karl@cs.umb.edu> - - * common.make (ALL_CPPFLAGS): Move $(prog_cflags) to be before - -I$(kpathsea_srcdir_parent), so subdirs of web2c find the right - c-auto.h. - From: Peter Breitenlohner <peb@MPPMU.MPG.DE>. - -Fri Apr 26 13:36:03 1996 Karl Berry <karl@cs.umb.edu> - - * paths.make (dvi{ps,lj}_{plain,latex}_macrodir): Add these. - (install_fonts, install_macros): Remove these. - * common.make (CP_R): Remove this. - * makevars.make (makevars): Remove install_fonts and - install_macros, add dvi*_macrodir. - -Tue Feb 13 14:31:24 1996 Karl Berry <karl@cs.umb.edu> - - * programs.make: Doc fix. - -Fri Feb 9 15:49:01 1996 Karl Berry <karl@cs.umb.edu> - - * config.make (configure_in): Add dependency withenable.ac. - -Tue Feb 6 16:40:17 1996 Karl Berry <karl@cs.umb.edu> - - * makevars.make (makevars): Include install_macros. - -Sat Feb 3 15:14:53 1996 Karl Berry <karl@cs.umb.edu> - - * common.make (DEFS): Add this. - -Fri Dec 29 17:07:02 1995 Karl Berry <karl@cs.umb.edu> - - * clean.make: Rename from misc.make. - - * rdepend.make (TAGS): Add rule for TAGS. - - * dist.make (dist): Do not depend on TAGS. - -Sat Dec 9 19:42:18 1995 Ulrik Vieth <vieth@thphy.uni-duesseldorf.de> - - * paths.make (mftinputdir): Add search path for MFT style files - since they have a separate directory in the TDS. - -Sat Nov 18 17:13:07 1995 Karl Berry <karl@cs.umb.edu> - - * misc.make (mostlyclean): Include $(library).a again, for web2c/lib. - -Fri Nov 17 13:33:46 1995 Karl Berry <karl@cs.umb.edu> - - * paths.make (bindir, etc.): Use @bindir@, etc., since Autoconf - 2.4.2 substitutes for these (and has options to set them). - - * common.make (sharedlibname, staticlibname): New variables for - convenience. - (sharedlib, staticlib): Use them. - - * dist.make (dist): Keep name of unixtex.ftp. - - * misc.make (extraclean): Remove *.mpx and mpout.*. - -Sun Nov 12 17:18:34 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (shared_env): Oops, had @shared_envvar@ instead of - @sharedlib_envvar@. - -Sat Nov 11 16:39:35 1995 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Use ALL_CPPFLAGS rather than just CPPFLAGS. - -Sun Oct 22 16:54:18 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (shared_env): New variable to set LD_LIBRARY_PATH or - whatever. - -Mon Oct 2 16:18:23 1995 Karl Berry <karl@cs.umb.edu> - - * misc.make (mostlyclean): Remove lib$(library).*, not $(library).a. - -Fri Sep 29 11:25:35 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (ALL_CPPFLAGS): Rename from CPPFLAGS, so users can - set the CPPFLAGS envvar a la CFLAGS. - -Thu Sep 21 16:34:50 1995 Karl Berry <karl@cs.umb.edu> - - * (many files): Avoid unnecessary blank lines. - -Tue Sep 19 17:18:42 1995 Karl Berry <karl@cs.umb.edu> - - * paths.make (datadir): Change to $(prefix)/share. - Change other variables for TDS compliance. - -Sat Sep 2 17:40:55 1995 Karl Berry <karl@cs.umb.edu> - - * misc.make (distclean): Do not remove MakeTeXPK anymore. - -Fri Sep 1 13:24:19 1995 Karl Berry <karl@cs.umb.edu> - - * programs.make (LOADLIBES): Put the -L/-l here. - * common.make (kpathsea): Define as the real filename. - (shared_ext, etc.): Move there. - -Thu Aug 31 17:39:10 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (kpathsea): Use -L and -l instead of giving the .a - file, for the shared case. - -Tue Aug 29 17:35:08 1995 Karl Berry <karl@cs.umb.edu> - - * config.make: Use date instead of echo to update timestamps, for - ``some old BSD systems''. - -Mon Aug 28 17:54:44 1995 Karl Berry <karl@cs.umb.edu> - - * programs.make: Add shared library variables. - -Fri Aug 25 12:07:45 1995 Karl Berry <karl@cs.umb.edu> - - * tkpathsea.make: Use && instead of ; after the cd. - - * rdepend.make (depend): Replace all leading ../'s with - $(kpathsea_srcdir), not just one. - -Tue Aug 22 14:04:04 1995 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (c_auto_h_dir): New variable so subdirs of web2c - can use this. - -Sun Aug 20 14:49:46 1995 Karl Berry <karl@cs.umb.edu> - - * misc.make (TAGS): Remove this. - - * paths.make (dcfontdir): Remove this. - -Thu Aug 10 19:22:20 1995 Karl Berry <karl@cs.umb.edu> - - * paths.make (default_texsizes): Note this list must be sorted in - ascending order. - -Thu Aug 3 11:26:10 1995 Karl Berry <karl@cs.umb.edu> - - * dist.make (dist): Depend on all. - -Sat Jul 29 17:31:47 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (transform): Remove this. It's not worth it. - -Fri Jul 28 15:37:37 1995 Karl Berry <karl@cs.umb.edu> - - * rdepend.make: Comment this out in the distribution. - From Greg. - -Sat Jul 22 17:13:57 1995 Karl Berry <karl@cs.umb.edu> - - * paths.make (mppooldir, memdir, mpinputdir): Add these. - * makevars.make (makevars): Include mpinputdir, memdir, and - mppooldir. - -Tue Jul 18 14:32:55 1995 Karl Berry <karl@cs.umb.edu> - - * common.make (transform): Include this, another configure - substitution. - -Mon Jul 17 15:58:40 1995 Karl Berry <karl@cs.umb.edu> - - * tkpathsea.make: Doc fix. - -Sun Jul 16 14:09:41 1995 Karl Berry <karl@cs.umb.edu> - - * config.make (stamp-auto.in): acconfig.h is now always in kpathsea. - -Tue May 16 15:52:50 1995 Karl Berry <karl@cs.umb.edu> - - * tkpathsea.make: Mention that the dependencies are wrong :-(. - - * common.make (XDEFS): Add -D__USE_FIXED_PROTOTYPES__ for - development use under SunOS 4.1.3. - -Tue Apr 25 13:49:38 1995 Karl Berry <karl@cs.umb.edu> - - * misc.make (distclean): No need to remove .pool here, no one has - pool files but web2c. - -Fri Feb 24 15:11:39 1995 Karl Berry <karl@cs.umb.edu> - - * dist.make (ln_files): Don't include TAGS in the distributions. - -Sun Jan 8 12:16:36 1995 Karl Berry <karl@cs.umb.edu> - - * kpathsea 2.6/dviljk 2.5/dvipsk 5.58f/xdvik 18f. - -Wed Jan 4 12:41:25 1995 Karl Berry <karl@cs.umb.edu> - - * tkpathsea.make (kpathsea): Don't depend on texmf.cnf, since it - doesn't exist at the first make. - -Tue Jan 3 13:43:12 1995 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): paths.h is not in the srcdir. - - * config.make (autoconf): Add acsite.m4. - - * dist.make (top_files): FTP belongs here, not in ln_files. - -Sun Jan 1 14:02:42 1995 Karl Berry <karl@cs.umb.edu> - - * makevars.make (makevars): Include web2cdir. - * paths.make (web2cdir): New directory. Suggested by Joachim. - -Sat Dec 31 14:35:29 1994 Karl Berry <karl@cs.umb.edu> - - * tmtpk.make: Just incorporate this in kpathsea/Makefile.in now. - - * rdepend.make (depend): Depend on ourselves. - -Fri Dec 30 15:50:37 1994 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Use kpathsea_srcdir, not kpathsea_dir. - From Joachim. - -Wed Dec 28 14:16:50 1994 Karl Berry <karl@cs.umb.edu> - - * dist.make (ln_files): Add FTP. - -Mon Dec 26 10:31:14 1994 Karl Berry <karl@cs.umb.edu> - - * dist.make (dist): Copy aclocal.m4 from acsite.m4. - Suggested by interran@uluru.Stanford.EDU (John Interrante). - -Wed Dec 14 15:17:42 1994 Karl Berry <karl@cs.umb.edu> - - * kpathsea 2.5/dviljk 2.4/dvipsk 5.58e/xdvik 18e. - -Sun Dec 11 13:23:12 1994 Karl Berry <karl@cs.umb.edu> - - * rdepend.make (depend): Remove system include files that are - alone on a line. - -Fri Nov 25 09:21:02 1994 Karl Berry <karl@cs.umb.edu> - - * tmtpk.make (MakeTeXPK): Depend on the new filename. - -Tue Nov 15 15:28:14 1994 Karl Berry <karl@cs.umb.edu> - - * tkpathsea.make (makeargs): Change MAKEARGS to XMAKEARGS. - - * targets.make (makeargs): Don't bother to pass $(SHELL). - -Tue Nov 8 19:12:45 1994 Karl Berry <karl@cs.umb.edu> - - * common.make (CFLAGS): Don't include -g, since now it's automatic. - -Sun Nov 6 15:53:36 1994 Karl Berry <karl@cs.umb.edu> - - * paths.make (prefix, exec_prefix): These value are now @prefix@ - and @exec_prefix@. - - * common.make: Call @SET_MAKE@. - - * misc.make (distclean): Remove config.log and config.cache. - - * programs.make (LDFLAGS): Add @LDFLAGS@. - * common.make (CPPFLAGS): Add @CPPFLAGS@. - (CFLAGS): Add @CFLAGS@. - - * dist.make (top_files): Distribute install-sh, not install.sh, - for Autoconf 2.0. - -Sun Oct 30 16:15:34 1994 Karl Berry <karl@cs.umb.edu> - - * config.make (ac_dir): This is now $(gnu)/share. - -Tue Oct 25 17:48:02 1994 Karl Berry <karl@cs.umb.edu> - - * kpathsea 2.3/dviljk 2.3/dvipsk 5.58c/xdvik 18d. - -Sun Oct 23 17:33:56 1994 Karl Berry <karl@cs.umb.edu> - - * targets.make (MakeTeXPK): Make sed substitutions global. - Reported by wfranzki@hlrserv.hlrz.kfa-juelich.de. - -Mon Oct 17 13:28:41 1994 Karl Berry <karl@cs.umb.edu> - - * paths.make (mfpooldir): Doc fix. - -Fri Oct 14 10:31:35 1994 Karl Berry <karl@cs.umb.edu> - - * kpathsea 2.2/dviljk 2.2/dvipsk 5.58b/xdvik 18c. - -Mon Oct 10 15:31:06 1994 Karl Berry <karl@cs.umb.edu> - - * common.make (.SUFFIXES): Declare .c.o. - - * programs.make (LOADLIBES): Omit LEXLIB here. - -Sun Sep 25 15:54:36 1994 Karl Berry <karl@cs.umb.edu> - - * rdepend.make: Doc fix. - - * library.make: New file. - - * makevars.make (makevars): Remove MAKEARGS from here. - - * programs.make (CCLD, link_command): New variables. - (LOADLIBES): Add proglib, LEXLIB. - -Mon Sep 12 11:06:14 1994 Karl Berry (karl@cs.umb.edu) - - * kpathsea 2.1/dviljk 2.1/dvipsk 5.58a/xdvik 18b. - -Sun Sep 11 14:44:21 1994 Karl Berry (karl@cs.umb.edu) - - * targets.make (install-MakeTeXPK): Install this if it didn't - exist, and mkdirchain $(scriptdir). - - * dist.make (top_files): Include aclocal.m4. - -Sat Sep 10 13:40:10 1994 Karl Berry (karl@cs.umb.edu) - - * texi.make (.texi.dvi): No -o option to texi2dvi. - -Thu Sep 8 14:31:59 1994 Karl Berry (karl@cs.umb.edu) - - * kpathsea 2.0, dviljk 2.0, dvipsk 5.55b, xdvik 18a. - -Tue Sep 6 11:39:06 1994 Karl Berry (karl@cs.umb.edu) - - * targets.make (MakeTeXPK): Use psheaderdir, not psconfigdir, and - depend on ourselves. - -Sat Sep 3 08:37:11 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make (psconfigdir): Toss this. - - * misc.make (distclean): Add MakeTeXPK. - - * rdepend.make: Rename from depend.make. - -Fri Sep 2 13:29:14 1994 Karl Berry (karl@cs.umb.edu) - - * targets.make (makeargs, installargs): Declare these here. - - * makevars.make (makevars): No need for ??_fontdir or psmacrodir. - - * misc.make (TAGS): Omit -t, use -i, for Emacs 19.25's etags. - -Thu Sep 1 17:51:10 1994 Karl Berry (karl@cs.umb.edu) - - * dist.make (top_files): Add install.sh. - -Tue Aug 30 14:46:18 1994 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Touch *.info* if they exist. - -Mon Aug 29 16:28:19 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make (dcfontdir, sauterdir): Move these here, since - everyone has MakeTeXPK now. - -Sun Aug 28 17:09:09 1994 Karl Berry (karl@cs.umb.edu) - - * common.make (INSTALL_FONTS): New variable. - -Thu Aug 25 17:04:43 1994 Karl Berry (karl@cs.umb.edu) - - * kpathsea.make (kpathsea): Also depend on texmf.cnf.in. - - * paths.make (texmf_prefix): Rename to texmf; change uses. - -Sun Aug 21 11:03:48 1994 Karl Berry (karl@cs.umb.edu) - - * programs.make: New file for driver-specific stuff. - - * paths.make (fontnamedir): New definition. - (configdir, headerdir): Prepend with `ps'. - -Sat Aug 13 17:19:53 1994 Karl Berry (karl@cs.umb.edu) - - * misc.make (mostlyclean): Don't remove $(lib), since we've tossed - that. - -Sun Jul 31 14:18:28 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make (DB_DIR, DB_NAME): Remove from here. - -Fri Jul 29 14:56:47 1994 Karl Berry (karl@cs.umb.edu) - - * depend.make (depend): Add dvilj4l.o to the special cases. - -Sun Jul 17 11:37:57 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make (db_dir): Use $TEXMF. - -Mon Jun 27 17:32:47 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make (db_dir): Use $TEXMFROOT. - -Tue Jun 14 12:41:33 1994 Karl Berry (karl@cs.umb.edu) - - * depend.make (depend): No need for depend_encies, I think. - -Mon May 30 13:50:34 1994 Karl Berry (karl@cs.umb.edu) - - * common.make (LDFLAGS): Don't include $(CFLAGS), for Linux's sake. - -Tue May 24 13:26:05 1994 Karl Berry (karl@cs.umb.edu) - - * config.make (stamp-auto, stamp-auto.in): New targets, to avoid - rerunning autoheader/autoconf even when they don't change the main - output files. - -Sun Apr 17 16:11:34 1994 Karl Berry (karl@ra.cs.umb.edu) - - * config.make (configure): Change ; to && in case the cd fails. - -Thu Mar 24 11:12:56 1994 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Don't append kutil/ChangeLog to the source - ChangeLog. - - * misc.make (extraclean): Don't delete patch*, since that kills - patchlevel.h. - -Sat Mar 5 13:48:15 1994 Karl Berry (karl@cs.umb.edu) - - * common.make (LOADLIBES): Include XLOADLIBES. - -Fri Feb 25 14:21:17 1994 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Append kutil/ChangeLog to the top level, not - the main program. - -Thu Feb 24 16:11:37 1994 Karl Berry (karl@cs.umb.edu) - - * misc.make (clean): Remove *.lj here. - - * paths.make ({bh,cg,mt}_fontdir, install_fonts): Add these. - -Mon Feb 21 14:04:26 1994 Karl Berry (karl@cs.umb.edu) - - * misc.make (distclean): remove pool files here. - -Wed Feb 16 15:18:13 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make: Doc fix. - -Sun Jan 23 17:17:37 1994 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Don't fake kpathsea/MACHINES any more, now we - have a real one. - -Fri Jan 14 14:53:12 1994 Karl Berry (karl@cs.umb.edu) - - * paths.make ({tex,mf}pooldir, fmtdir, basedir): Use - $(texmf_prefix)/ini for all these. - -Tue Dec 21 19:23:29 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (LDFLAGS): Don't include $(x_lib_flags) here -- - winds up getting included twice for virmf - -Tue Dec 14 17:40:23 1993 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Dist the top-level and kutil/ChangeLog. - - * paths.make (formatdir): Rename to fmtdir. - (texprefix): Rename to texmf_prefix, change uses accordingly. - -Fri Dec 10 17:50:39 1993 Karl Berry (karl@cs.umb.edu) - - * paths.make (dvipsprefix): Rename to dvips_prefix. - -Sun Nov 14 11:52:33 1993 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Do not depend on depend.make and TAGS, since - web2c doesn't have them. - - * paths.make: Change defaults for new hierarchy. - -Thu Nov 11 11:07:22 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (CPPFLAGS, LDFLAGS): xincludedir, xlibdir, wlibs - names have changed. - -Sun Nov 7 15:22:32 1993 Karl Berry (karl@cs.umb.edu) - - * paths.h: Give dire warning that editing Makefiles will not - rebuild paths.h. - -Fri Oct 29 14:01:57 1993 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): chmod a+rw. - -Thu Oct 28 17:48:01 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (CPPFLAGS): Include -I. before -I$(srcdir). - -Fri Oct 22 13:08:19 1993 Karl Berry (karl@cs.umb.edu) - - * paths.make: Remove the paths, and add the dvips directories. - - * common.make (kpathsea_srcdir{,_parent}): Define. From - simon@lia.di.epfl.ch. - -Tue Oct 19 15:59:03 1993 Karl Berry (karl@cs.umb.edu) - - * config.make (stamp-c-auto): New target. - (c-auto.h): Depend on it. - -Sat Oct 9 07:04:45 1993 Karl Berry (karl@cs.umb.edu) - - * misc.make (mostlyclean): Remove programs. - -Sun Oct 3 12:44:04 1993 Karl Berry (karl@cs.umb.edu) - - * misc.make (extraclean): Also remove .blg and .bbl, .vf and .vpl. - (clean): Remove *.pool. - -Tue Sep 28 13:11:01 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (CPPFLAGS): Add $(xincludedir) again; when did I - remove it? - -Fri Sep 24 07:53:45 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (warn_more) [kpathsea]: Move to kpathsea's Makefile. - - * texi.make (.texi.dvi): New rule. - - * common.make (warn_more): Had -pointer-arith twice. - -Thu Sep 23 17:42:42 1993 Karl Berry (karl@cs.umb.edu) - - * common.make (autoconf): Toss aclocal.m4. - * dist.make (top_files): Ditto. - - * common.make (autoheader): New variable, split off from autoconf. - -Sun Aug 29 11:30:39 1993 Karl Berry (karl@cs.umb.edu) - - * dist.make (dist): Remove MACHINES in kpathsea. - - * common.make (CPPFLAGS): Remove the -I. Why did I put it there? - -Sat Aug 28 07:01:52 1993 Karl Berry (karl@cs.umb.edu) - - * unbackslsh.awk: New file. - - * common.make (CPPFLAGS): Add -I before $(xincludedir).
deleted file mode 100644 --- a/kpathsea/make/README +++ /dev/null @@ -1,6 +0,0 @@ -make -- this subdirectory contains Makefile fragments. - -configure substitutes them for ac_include lines in Makefile.in. -(This is an enhancement to standard Autoconf; see aclocal.m4.) - -kb@mail.tug.org
deleted file mode 100644 --- a/kpathsea/make/clean.make +++ /dev/null @@ -1,26 +0,0 @@ -# clean.make -- cleaning. -mostlyclean:: - rm -f *.o - -clean:: mostlyclean - rm -f $(program) $(programs) squeeze lib$(library).* $(library).a *.bad - rm -f *.exe *.dvi *.lj - -distclean:: extraclean clean - rm -f Makefile - rm -f config.status config.log config.cache c-auto.h - rm -f stamp-auto stamp-tangle stamp-otangle - -# Although we can remake configure and c-auto.in, we don't remove -# them, since many people may lack Autoconf. Use configclean for that. -maintainer-clean:: distclean - rm -f *.info* - -extraclean:: - rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.pl *.tfm *.vf *.vpl - rm -f *.*pk *.*gf *.mpx *.i *.s *~ *.orig *.rej *\#* - rm -f CONTENTS.tex a.out core mfput.* texput.* mpout.* - -configclean: - rm -f configure c-auto.in c-auto.h stamp-* -# End of clean.make.
deleted file mode 100644 --- a/kpathsea/make/common.make +++ /dev/null @@ -1,46 +0,0 @@ -# common.make -- used by all Makefiles. -SHELL = /bin/sh -@SET_MAKE@ -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -CC = @CC@ -CFLAGS = @CFLAGS@ $(XCFLAGS) -CPPFLAGS = @CPPFLAGS@ $(XCPPFLAGS) -DEFS = @DEFS@ $(XDEFS) - -# Kpathsea needs this for compiling, programs need it for linking. -LIBTOOL = $(kpathsea_srcdir_parent)/klibtool - -# You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but -# please don't change ALL_CPPFLAGS or ALL_CFLAGS. -# prog_cflags is set by subdirectories of web2c. -ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) $(prog_cflags) \ - -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) $(CPPFLAGS) -ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -c -compile = $(CC) $(ALL_CFLAGS) - -.SUFFIXES: .c .o # in case the suffix list has been cleared, e.g., by web2c -.c.o: - $(compile) $< - -# Installation. -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = $(INSTALL_PROGRAM) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LIBTOOL_LIBS = INSTALL_DATA='$(INSTALL_DATA)' $(LIBTOOL) install-lib -INSTALL_LIBTOOL_PROG = INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(LIBTOOL) install-prog - -# Creating (symbolic) links. -LN = @LN_S@ - -# We use these for many things. -kpathsea_parent = .. -kpathsea_dir = $(kpathsea_parent)/kpathsea -kpathsea_srcdir_parent = $(top_srcdir)/.. -kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea -kpathsea = $(kpathsea_dir)/libkpathsea.la - -# End of common.make.
deleted file mode 100644 --- a/kpathsea/make/config.make +++ /dev/null @@ -1,19 +0,0 @@ -# config.make -- autoconf rules to remake the Makefile, c-auto.h, etc. - -config.status: $(srcdir)/configure - $(SHELL) $(srcdir)/configure --no-create $(enablemaintflag) - -Makefile: $(srcdir)/Makefile.in config.status $(top_srcdir)/../make/*.make - $(SHELL) config.status - -# This rule isn't used for the top-level Makefile, but it doesn't hurt. -# We don't depend on config.status because configure always rewrites -# config.status, even when it doesn't change. Thus it might be newer -# than c-auto.h when we don't need to remake the latter. -c-auto.h: stamp-auto -stamp-auto: $(srcdir)/c-auto.in - $(SHELL) config.status - date >stamp-auto - - -# End of config.make.
deleted file mode 100644 --- a/kpathsea/make/dist.make +++ /dev/null @@ -1,2 +0,0 @@ -# dist.make -- making distribution tar files. -# End of dist.make.
deleted file mode 100644 --- a/kpathsea/make/library.make +++ /dev/null @@ -1,5 +0,0 @@ -# library.make -- stuff only useful for libraries. -AR = ar -ARFLAGS = cq -RANLIB = @RANLIB@ -# End of library.make.
deleted file mode 100644 --- a/kpathsea/make/makevars.make +++ /dev/null @@ -1,16 +0,0 @@ -# makevars.make -- the directory names we pass. -# It's important that none of these values contain [ @%], for the sake -# of kpathsea/texmf.sed. -makevars = prefix=$(prefix) exec_prefix=$(exec_prefix) \ - bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \ - datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \ - manext=$(manext) mandir=$(mandir) \ - texmf=$(texmf) web2cdir=$(web2cdir) vartexfonts=$(vartexfonts)\ - texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) mpinputdir=$(mpinputdir)\ - fontdir=$(fontdir) fmtdir=$(fmtdir) basedir=$(basedir) memdir=$(memdir) \ - texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) mppooldir=$(mppooldir) \ - dvips_plain_macrodir=$(dvips_plain_macrodir) \ - dvilj_latex2e_macrodir=$(dvilj_latex2e_macrodir) \ - dvipsdir=$(dvipsdir) psheaderdir=$(psheaderdir) \ - default_texsizes='$(default_texsizes)' -# End of makevars.make.
deleted file mode 100644 --- a/kpathsea/make/man.make +++ /dev/null @@ -1,75 +0,0 @@ -# man.make: Makefile fragment for web2c manual pages. - -#DITROFF = ditroff -DITROFF = groff - -# The edited file always has extension .1; we change it when we install. -.SUFFIXES: .man .1 .txt .ps .dvi -.man.1: - sed -f sedscript $< >$@ -.1.dvi: - $(DITROFF) -Tdvi -man $< >$@ -.1.ps: - $(DITROFF) -Tps -man $< >$@ -.1.txt: - $(DITROFF) -Tascii -man $< | col -b | expand >$@ - -all: $(manfiles) -.PHONY: dw - -$(manfiles): sedscript - -manfiles: $(manfiles) -dvi: $(manfiles:.1=.dvi) -ps: $(manfiles:.1=.ps) -txt: $(manfiles:.1=.txt) - -# We do not depend on the top-level Makefile since the top-level -# Makefile can change for reasons that do not affect the man pages. -# At present, all but VERSION should be unused. -sedscript: - cp /dev/null sedscript - for f in $(kpathsea_dir)/paths.h; do \ - sed -n -e '/^#define/s/#define[ ][ ]*\([A-Z_a-z][A-Z_a-z]*\)[ ][ ]*\(.*\)/s%@\1@%\2%/p' \ - $$f \ - | sed -e 's/"//g' -e 's/[ ]*\/\*[^*]*\*\///g' >>sedscript;\ - done - echo 's%@VERSION@%$(version)%' >>sedscript - echo 's%@BINDIR@%$(bindir)%' >>sedscript - echo 's%@INFODIR@%$(infodir)%' >>sedscript - echo 's%@TEXINPUTDIR@%$(texinputdir)%' >>sedscript - echo 's%@MFINPUTDIR@%$(mfinputdir)%' >>sedscript - echo 's%@MPINPUTDIR@%$(mpinputdir)%' >>sedscript - echo 's%@FONTDIR@%$(fontdir)%' >>sedscript - echo 's%@FMTDIR@%$(fmtdir)%' >>sedscript - echo 's%@BASEDIR@%$(basedir)%' >>sedscript - echo 's%@MEMDIR@%$(memdir)%' >>sedscript - echo 's%@TEXPOOLDIR@%$(texpooldir)%' >>sedscript - echo 's%@MFPOOLDIR@%$(mfpooldir)%' >>sedscript - echo 's%@MPPOOLDIR@%$(mppooldir)%' >>sedscript - echo 's%@FONTMAPDIR@%$(dvipsdir)%' >>sedscript - echo 's%@LOCALMODES@%$(localmodes)%' >>sedscript - -install-man: manfiles - $(top_srcdir)/../mkinstalldirs $(mandir) - for nameone in $(manfiles); do \ - name=`basename $${nameone} .1`; \ - $(INSTALL_DATA) $${name}.1 $(mandir)/$${name}.$(manext); \ - done - -uninstall-man: - for nameone in $(manfiles); do \ - name=`basename $${nameone} .1`; \ - rm -f $(mandir)/$${name}.$(manext); \ - done - -install-data: install-man -uninstall-data: uninstall-man - -mostlyclean:: - rm -f *.1 - -clean:: - rm -f sedscript - -# end of man.make
deleted file mode 100644 --- a/kpathsea/make/paths.make +++ /dev/null @@ -1,94 +0,0 @@ -# paths.make -- installation directories. -# -# The compile-time paths are defined in kpathsea/paths.h, which is built -# from kpathsea/texmf.in and these definitions. See kpathsea/INSTALL -# for how the various path-related files are used and created. - -# Do not change prefix and exec_prefix in Makefile.in! -# configure doesn't propagate the change to the other Makefiles. -# Instead, give the -prefix/-exec-prefix options to configure. -# (See kpathsea/INSTALL for more details.) This is arguably -# a bug, but it's not likely to change soon. -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# Architecture-dependent executables. -bindir = @bindir@ - -# Architecture-independent executables. -scriptdir = $(bindir) - -# Architecture-dependent files, such as lib*.a files. -libdir = @libdir@ - -# Architecture-independent files. -datadir = @datadir@ - -# Header files. -includedir = @includedir@ - -# GNU .info* files. -infodir = @infodir@ - -# Unix man pages. -manext = 1 -mandir = @mandir@/man$(manext) - -# TeX system-specific directories. Not all of the following are relevant -# for all programs, but it seems cleaner to collect everything in one place. - -# The default paths are now in kpathsea/texmf.in. Passing all the -# paths to sub-makes can make the arg list too long on system V. -# Note that if you make changes below, you will have to make the -# corresponding changes to texmf.in or texmf.cnf yourself. - -# The root of the main tree. -texmf = @texmfmain@ - -# The directory used by varfonts. -vartexfonts = /var/tmp/texfonts - -# Regular input files. -texinputdir = $(texmf)/tex -mfinputdir = $(texmf)/metafont -mpinputdir = $(texmf)/metapost -mftinputdir = $(texmf)/mft - -# dvips's epsf.tex, rotate.tex, etc. get installed here; -# ditto for dvilj's fonts support. -dvips_plain_macrodir = $(texinputdir)/plain/dvips -dvilj_latex2e_macrodir = $(texinputdir)/latex/dvilj - -# mktex.cnf, texmf.cnf, etc. -web2cdir = $(texmf)/web2c - -# The top-level font directory. -fontdir = $(texmf)/fonts - -# Memory dumps (.fmt/.base/.mem). -fmtdir = $(web2cdir) -basedir = $(fmtdir) -memdir = $(fmtdir) - -# Pool files. -texpooldir = $(web2cdir) -mfpooldir = $(texpooldir) -mppooldir = $(texpooldir) - -# Where the .map files from fontname are installed. -fontnamedir = $(texmf)/fontname - -# For dvips configuration files, psfonts.map, etc. -dvipsdir = $(texmf)/dvips - -# For dvips .pro files, gsftopk's render.ps, etc. -psheaderdir = $(dvipsdir) - -# If a font can't be found close enough to its stated size, we look for -# each of these sizes in the order given. This colon-separated list is -# overridden by the envvar TEXSIZES, and by a program-specific variable -# (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips). -# This list must be sorted in ascending order. -default_texsizes = 300:600 - -# End of paths.make.
deleted file mode 100644 --- a/kpathsea/make/programs.make +++ /dev/null @@ -1,19 +0,0 @@ -# programs.make -- used by Makefiles for executables only. - -# Don't include $(CFLAGS), since ld -g under Linux forces -# static libraries, e.g., libc.a and libX*.a. -LDFLAGS = @LDFLAGS@ $(XLDFLAGS) - -# proglib is for web2c; -# XLOADLIBES is for the installer. -LIBS = @LIBS@ -LOADLIBES = $(proglib) $(kpathsea) $(LIBS) -lm $(XLOADLIBES) - -# May as well separate linking from compiling, just in case. -CCLD = $(CC) -link_command = $(CCLD) -o $@ $(LDFLAGS) - -# When we link with Kpathsea, have to take account that it might be a -# shared library, etc. -kpathsea_link = $(LIBTOOL) link $(link_command) -# End of programs.make.
deleted file mode 100644 --- a/kpathsea/make/rdepend.make +++ /dev/null @@ -1,12 +0,0 @@ -# rdepend.make -- rules for remaking the dependencies. - -# Let's stick a rule for TAGS here, just in case someone wants them. -# (We don't put them in the distributions, to keep them smaller.) -TAGS: *.c *.h - pwd | grep kpathsea >/dev/null && append=../kpathsea/TAGS; \ - etags $$append *.[ch] - -# Prevent GNU make 3.[59,63) from overflowing arg limit on system V. -.NOEXPORT: - -# End of rdepend.make.
deleted file mode 100644 --- a/kpathsea/make/texi.make +++ /dev/null @@ -1,22 +0,0 @@ -# texi.make -- making .dvi and .info from .texi. -MAKEINFO = makeinfo -MAKEINFO_FLAGS = --paragraph-indent=2 -I$(srcdir) - -TEXI2DVI = texi2dvi - -TEXI2HTML = texi2html -TEXI2HTML_FLAGS = -expandinfo -number -menu -split_chapter -# If you prefer one big .html file instead of several, remove -# -split-node or replace it by -split_chapter. - -# For making normal text files out of Texinfo source. -one_info = --no-headers --no-split --no-validate - -.SUFFIXES: .info .dvi .html .texi -.texi.info: - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ -.texi.dvi: - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< -.texi.html: - $(TEXI2HTML) $(TEXI2HTML_FLAGS) $< -# End of texi.make.
deleted file mode 100644 --- a/kpathsea/make/tkpathsea.make +++ /dev/null @@ -1,9 +0,0 @@ -# tkpathsea.make -- target for remaking kpathsea. -makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' $(XMAKEARGS) - -# This is wrong: the library doesn't depend on kpsewhich.c or -# acconfig.h. But what to do? -$(kpathsea): $(kpathsea_srcdir)/*.c $(kpathsea_srcdir)/*.h \ - $(kpathsea_srcdir)/texmf.in $(top_srcdir)/make/paths.make - cd $(kpathsea_dir) && $(MAKE) $(makeargs) -# End of tkpathsea.make.
deleted file mode 100644 --- a/kpathsea/mktex.cnf +++ /dev/null @@ -1,15 +0,0 @@ -# The mktex.cnf file, if it exists, can be used to tailor a setup to -# local conditions. If you use the mktex scripts, this file can contain -# generic bourne shell code. However, the C emulations of the scripts -# do not handle anything beyond simple assignment of variables, and doing -# more is not exactly recommended. -# -# To assign variables, use constructs like the examples below, which only -# set unassigned variables. The scripts may malfunction if you do -# otherwise. -# -# Some examples of what you can the mktex.cnf file for: -# : ${MT_FEATURES=appendonlydir:varfonts} -# : ${MODE=ljfour} -# : ${BDPI=600} -# : ${ps_to_pk=gsftopk}
deleted file mode 100755 --- a/kpathsea/mktex.opt +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# mktex.opt -- common mktex* options, etc. -# Meant to be sourced after $usage and $version and $TEXMF have been set. -# -# te@informatik.uni-hannover.de and kb@mail.tug.org. Public domain. -# $Id: mktex.opt,v 1.23 1998/03/17 18:35:26 olaf Exp $ - -if test "x$1" = x--help || test "x$1" = x-help; then - echo "$usage" - exit 0 -elif test "x$1" = x--version || test "x$1" = x-version; then - echo "`basename $0` $version" - kpsewhich --version - exit 0 -elif test $# -lt ${mt_min_args-1}; then - echo "$0: Missing argument(s)." >&2 - echo "Try \``basename $0` --help' for more information." >&2 - exit 1 -elif test $# -gt ${mt_max_args-1}; then - num=$# - while test $# -gt `expr $num - ${mt_max_args-1}`; do shift; done - echo "$0: Extra arguments $*." >&2 - echo "Try \``basename $0` --help' for more information." >&2 - exit 1 -fi - -# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate -# directories in path lists whereas Unix uses `:'. -# Create a variable that holds the right character to be used by the scripts. -if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi - -# TEMPDIR needs to be unique to each process because of the possibility of two -# people running dvips (or whatever) simultaneously. -TEMPDIR="${TMPDIR-/tmp}/mt$$.tmp" - -# We want to output only filenames to standard output, but it's too -# error-prone to write the scripts that way, so we direct stdout here. -STDOUT="$TEMPDIR/mt$$.out" - -# We will change search paths to include $KPSE_DOT. This is necessary -# since we cd to $TEMPDIR. -: ${KPSE_DOT=`pwd`}; export KPSE_DOT - -# Clean up on normal or abnormal exit. -# The "cd /" is for MS-DOS and MS-Windows, where there is a separate -# current directory on each drive, and therefore "cd $KPSE_DOT" might -# still leave $TMPDIR current directory on its drive, in which case it -# cannot be removed. -trap 'cd /; cd "$KPSE_DOT"; test -f "$STDOUT" && cat "$STDOUT"; rm -rf "$TEMPDIR"; exit 0' \ - 0 1 2 15 - -mkdir "$TEMPDIR" || exit 1 -cd "$TEMPDIR" || exit 1 - -# The alternative location for fonts. The directory need not exist, -# so we use --expand-var here. We also perform a sanity check. -: ${MT_VARTEXFONTS=`kpsewhich --expand-var='$VARTEXFONTS' | sed 's%^!!%%'`} -if test -z "$MT_VARTEXFONTS"; then - echo "$0: VARTEXFONTS is not defined. Defaulting to \`$KPSE_DOT'." >&2 - MT_VARTEXFONTS='$KPSE_DOT' -fi - -# The supporting scripts: -: ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`} -test -n "$MT_MKTEXNAM" || MT_MKTEXNAM="$MT_TEXMFMAIN/web2c/mktexnam" -: ${MT_MKTEXNAM_OPT=`kpsewhich --format='web2c files' mktexnam.opt`} -test -n "$MT_MKTEXNAM_OPT" || MT_MKTEXNAM_OPT="$MT_TEXMFMAIN/web2c/mktexnam.opt" -: ${MT_MKTEXDIR=`kpsewhich --format='web2c files' mktexdir`} -test -n "$MT_MKTEXDIR" || MT_MKTEXDIR="$MT_TEXMFMAIN/web2c/mktexdir" -: ${MT_MKTEXDIR_OPT=`kpsewhich --format='web2c files' mktexdir.opt`} -test -n "$MT_MKTEXDIR_OPT" || MT_MKTEXDIR_OPT="$MT_TEXMFMAIN/web2c/mktexdir.opt" -: ${MT_MKTEXUPD=`kpsewhich --format='web2c files' mktexupd`} -test -n "$MT_MKTEXUPD" || MT_MKTEXUPD="$MT_TEXMFMAIN/web2c/mktexupd" - -# mktexupd and mktexlsr make sure they're coordinated via this. A copy of -# the first string is found in mktexlsr. -ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.' -# Old ls-R files should continue to work. -old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.' - -# Read defaults from mktex.cnf if that file exists. Can be used to -# overwrite anything defined below. Please use the same syntax as -# given here (e.g. ``: ${MODE=ljfour}'', not just ``MODE=ljfour'', as -# this can cause trouble (e.g. when the mode for mktexnam is -# already specified on the command line). -: ${MT_MKTEX_CNF=`kpsewhich --format='web2c files' mktex.cnf`} -test -n "$MT_MKTEX_CNF" && test -r "$MT_MKTEX_CNF" && . "$MT_MKTEX_CNF" - -# Possible features: appendonlydir dosnames fontmaps nomode stripsupplier -# striptypeface varfonts. -if test -n "$COMSPEC"; then - : ${MT_FEATURES=appendonlydir:dosnames} -else - : ${MT_FEATURES=appendonlydir} -fi -: ${MODE=ljfour} -: ${BDPI=600} -: ${ps_to_pk=gsftopk} # some prefer ps2pk - -# Allow fonts to be read and written (especially in case we make -# directories) by everyone. -umask 0 - -# Cache values that may be useful for recursive calls. -export MT_MKTEX_OPT MT_MKTEX_CNF -export MT_MKTEXNAM MT_MKTEXNAM_OPT -export MT_MKTEXDIR MT_MKTEXDIR_OPT -export MT_MKTEXUPD -export MT_TEXMFMAIN MT_VARTEXFONTS
deleted file mode 100755 --- a/kpathsea/mktexdir +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# mkinstalldirs --- make directory hierarchy (now mktexdir). -# Author: Noah Friedman <friedman@gnu.org>, created: 1993-05-16. -# Public domain. -# -# Modified for sticky directory creation, --help, --version. -# te@informatik.uni-hannover.de and kb@mail.tug.org. - -version='$Id: mktexdir,v 1.10 1998/03/16 23:15:36 olaf Exp $' -usage="Usage: $0 DIRS... - Create each DIR, including any missing leading directories." - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$0: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -test -n "$MT_MKTEXDIR_OPT" && . "$MT_MKTEXDIR_OPT" - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - - if test ! -d "$pathcomp"; then - mkdir "$pathcomp" || errstatus=$? - chmod `kpsestat ${MT_APPEND_MASK:-=} "$pathcomp"/..` "$pathcomp" - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus
deleted file mode 100644 --- a/kpathsea/mktexdir.opt +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# mktexdir.opt to determine various manipulations of the filenames. -# Sourced from mktexdir. -# -# te@informatik.uni-hannover.de and kb@mail.tug.org. Public domain. -# $Id: mktexdir.opt,v 1.2 1997/11/30 12:29:46 olaf Exp $ - -# Set append-only bit on created directories. -case "$MT_FEATURES" in - *appendonlydir*) MT_APPEND_MASK=+t;; -esac
deleted file mode 100755 --- a/kpathsea/mktexlsr +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -# original mktexlsr -- create or rebuild ls-R. -# -# (If you change or delete the word `original' on the previous line, -# installation won't write this script over yours.) -# -# Suitable for calling from cron, as in: -# 0 * * * * cd /your/texmf/root && /usr/local/bin/mktexlsr -# unless the scripts live in a different directory than the 'access', -# 'kpsestat', 'readlink', and 'kpsewhich' binaries. -# -# Originally written as `texhash' by Thomas Esser -# <te@informatik.uni-hannover.de>, Okt., 1994. -# Public domain. - -version='$Id: mktexlsr,v 1.21 1998/03/17 22:26:01 olaf Exp $' -progname=`echo $0 | sed 's%.*/%%'` -usage="Usage: $progname [DIRS ...] - -Rebuild all necessary ls-R filename databases completely. If one or -more arguments DIRS are given, these are used as texmf directories to -build ls-R for. Else all directories in the search path for ls-R files -(\$TEXMFDBS) are used." - -# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate -# directories in path lists whereas Unix uses `:'. -# Create a variable that holds the right character to be used by the scripts. -if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi - -# Add the location of the script to the PATH if necessary. This must -# be done before kpsewhich can be called, and thus cannot be put into -# mktex.opt. -dirname=`echo $0 | sed 's%/*[^/][^/]*$%%'` -case $dirname in - "") # Do nothing - ;; - /* | [A-z]:/*) # Absolute name - PATH="$dirname$SEP$PATH" ;; - *) # Relative name - PATH="`pwd`/$dirname$SEP$PATH" ;; -esac - -# A copy of some stuff from mktex.opt, so we can run in the presence of -# terminally damaged ls-R files. -if test "x$1" = x--help || test "x$1" = x-help; then - echo "$usage" - exit 0 -elif test "x$1" = x--version || test "x$1" = x-version; then - echo "`basename $0` $version" - kpsewhich --version - exit 0 -fi - -# mktexupd and mktexlsr make sure they're coordinated via this. A copy -# is found mktex.opt. -ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.' - - -trap 'cd / ; rm -f "$db_file_tmp"; exit' 1 2 15 - -test $# = 0 && { - OIFS=$IFS; IFS=$SEP; set x `kpsewhich --show-path=ls-R`; shift; IFS=$OIFS -} -for TEXMFLS_R in "$@"; do - # Prepend cwd if the directory was relative. - case "$TEXMFLS_R" in - "") continue ;; - /* | [A-z]:/*) ;; - *) TEXMFLS_R="`pwd`/$TEXMFLS_R" - esac - # Follow a possible symlink to get the right filesystem, - db_file=`readlink "$TEXMFLS_R/ls-R" 2>/dev/null` - case "$db_file" in - "") db_file="$TEXMFLS_R/ls-R" ;; - /* | [A-z]:/*) ;; - *) db_file="$TEXMFLS_R/$db_file" - esac - db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname - db_file_tmp="$db_dir/lsR$$.tmp" - - test -d "$db_dir" || continue - test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; } - - if test ! -f "$db_file"; then - cp /dev/null "$db_file" - # Use same permissions as parent directory, minus x,s, or t bits. - chmod `kpsestat -xst "$db_dir"` "$db_file" - fi - - # Skip if we cannot write the file: - access -w "$db_file" || { echo "$progname: $db_file: no write permission. Skipping..." >&2; continue; } - - rm -f "$db_file_tmp" - - tty -s && echo "$progname: Updating $db_file... " - echo "$ls_R_magic" >"$db_file_tmp" - - # The main task. We ls two things so the top-level directory name ends - # up in the output, so top-level files can be found via ls-R. Probably - # irrelevant in practice. - # The sed command is because on new FreeBSD/NetBSD systems, ls -LAR ./ - # produces .//. Sigh. - (cd "$TEXMFLS_R" && \ls -LRa /dev/null ./ 2>/dev/null) | - sed 's%\.//%./%; /^\.$/d; /^\.\.$/d' >>"$db_file_tmp" - - # To be really safe, a loop. - until PERMS=`kpsestat = "$db_file"`; do sleep 1; done - chmod $PERMS "$db_file_tmp" - rm -f "$db_file" - mv "$db_file_tmp" "$db_file" -done -tty -s && echo "$progname: Done." -exit 0
deleted file mode 100644 --- a/kpathsea/mktexlsr.man +++ /dev/null @@ -1,46 +0,0 @@ -.TH MKTEXLSR 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -mktexlsr \- create ls-R databases -.SH SYNOPSIS -.B mktexlsr -.RI [ directories ] -.\"===================================================================== -.SH DESCRIPTION -This manual page is not meant to be exhaustive. The complete -documentation for this version of \*(TX can be found in the info file -or manual -.IR "Kpathsea: A library for path searching" . -.PP -.B mktexlsr -is used to generate the ls-R databases used by the kpathsea library. -It will create them for the specified directories, or for a default -list if no directories are specified. -.\"===================================================================== -.SH OPTIONS -.B mktexlsr -accepts the following options: -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit.
deleted file mode 100755 --- a/kpathsea/mktexmf +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# original mktexmf -- make a new MF file, because one wasn't found. -# -# (If you change or delete the word `original' on the previous line, -# installation won't write this script over yours.) -# -# te@informatik.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl. -# Public domain. - -version='$Id: mktexmf,v 1.13 1998/02/20 16:26:17 olaf Exp $' -progname=`echo $0 | sed 's%.*/%%'` -usage="Usage: $progname FONT. - -Makes the Metafont source file for FONT, if possible. For example, -\`ecr12' or \`cmr11'." - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$progname: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -( -# See comments in mktexpk. -name="`echo $1 | sed 's%.*/%%; s%\.mf$%%'`" -rootname=`echo "$name" | sed 's/[0-9]*$//'` -pointsize=`echo "$name" | sed "s/^$rootname//"` - -sauterroot=`kpsewhich b-$rootname.mf 2>/dev/null` -if test -n "$sauterroot"; then - rootfile=$sauterroot -else - case $rootname in - wn*) - lhname=`echo $name | sed 's/^wn/lh/'` - rootfile=`kpsewhich $lhname.mf 2>/dev/null`;; - *) - rootfile=`kpsewhich $rootname.mf 2>/dev/null`;; - esac -fi -{ test -z "$rootfile" || test ! -f "$rootfile"; } && exit 1 - -#if test -z "$MT_MFNAME"; then -OIFS=$IFS; IFS=$SEP -set x `"$MT_MKTEXNAM" $name`; shift -IFS=$OIFS -MT_MFNAME="$3" -#fi - -destdir=`echo "$MT_MFNAME" | sed 's%/[^/][^/]*$%%'` -test -d "$destdir" || "$MT_MKTEXDIR" "$destdir" || exit 1 -cd "$destdir" >/dev/null 2>&1 || exit 1 - -case "$pointsize" in - "") echo "$progname: no pointsize."; exit 1;; - 11) realsize=10.95444;; # \magstephalf - 14) realsize=14.4;; # \magstep2 - 17) realsize=17.28;; # \magstep3 - 20) realsize=20.74;; # \magstep4 - 25) realsize=24.88;; # \magstep5 - # The new convention is to have three or four letters for the - # font name and four digits for the pointsize. The number is - # pointsize * 100. We effectively divide by 100 by ignoring the - # last two digits. - ????|?????) realsize=`echo "$pointsize" | sed 's/\(..\)$/.\1/'`;; - *) realsize="$pointsize";; -esac - -mfname="$name.mf" -if test -r "$mfname"; then - echo "$progname: $destdir/$mfname already exists." - echo "$destdir/$mfname" >$STDOUT - "$MT_MKTEXUPD" "$destdir" "$mfname" - exit 0 -fi - -case "$name" in - ec*|tc*) - cat > "mf$$.tmp" <<END -if unknown exbase: input exbase fi; -gensize:=$realsize; -generate $rootname; -END - ;; - dc*) - cat > "mf$$.tmp" <<END -if unknown dxbase: input dxbase fi; -gensize:=$realsize; -generate $rootname; -END - ;; - wn*) - cat > "mf$$.tmp" <<END -wncoding:=1; -input $lhname; -END - ;; - *) - cat > "mf$$.tmp" <<END -design_size := $realsize; -input b-$rootname; -END - ;; -esac - -chmod `kpsestat -xst,go-w .` "mf$$.tmp" -rm -f "$mfname" -mv "mf$$.tmp" "$mfname" - -echo "$destdir/$mfname" >$STDOUT -echo "$progname: $destdir/$mfname: successfully generated." >&2 -"$MT_MKTEXUPD" "$destdir" "$mfname" -exit 0 -) 1>&2 </dev/null
deleted file mode 100644 --- a/kpathsea/mktexmf.man +++ /dev/null @@ -1,59 +0,0 @@ -.TH MKTEXMF 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -mktexmf \- create a Metafont source file -.SH SYNOPSIS -.B mktexmf -.I font -.\"===================================================================== -.SH DESCRIPTION -This manual page is not meant to be exhaustive. The complete -documentation for this version of \*(TX can be found in the info file -or manual -.IR "Kpathsea: A library for path searching" . -.PP -.B mktexmf -is used to generate the \*(MF source file for -.IR font , -if possible. For example, -.I ecrm1200 -or -.IR cmr11 . -.PP -The name of the generated file is printed on standard output. -.PP -.B mktexmf -is typically called by other programs, rather than from the command -line. -.\"===================================================================== -.SH OPTIONS -.B mktexmf -accepts the following options: -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH "SEE ALSO" -.BR mktexpk (1), -.BR mktextfm (1).
deleted file mode 100755 --- a/kpathsea/mktexnam +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# maketexnam -- find PK and TFM names. -# te@informatik.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl. -# Public domain. - -version='$Id: mktexnam,v 1.20 1998/03/16 18:25:12 olaf Exp $' -usage="Usage: $0 NAME [DPI MODE] [DESTDIR]. - Output the PK, TFM, and MF names for a font NAME." -mt_max_args=4 - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$0: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -NAME=$1 -case $# in -1|2) DPI=$BDPI; DEST=$2;; -3|4) DPI=$2; MODE=$3; DEST=$4;; -*) help;; -esac - -MT_PKDESTDIR='$MT_DESTROOT/$MT_PKDESTREL' -MT_TFMDESTDIR='$MT_DESTROOT/$MT_TFMDESTREL' -MT_MFDESTDIR='$MT_DESTROOT/$MT_MFDESTREL' -MT_PKMODEPART='$MT_PKPART/$MT_MODE' -MT_PKBASE='$NAME.${DPI}pk' -MT_TFMBASE='$NAME.tfm' -MT_MFBASE='$NAME.mf' -MT_DEFAULT_SUPPLIER=unknown -MT_DEFAULT_TYPEFACE=unknown -MT_DEFAULT_NAMEPART=tmp -MT_DEFAULT_PKDESTREL='' -MT_DEFAULT_TFMDESTREL='' -MT_DEFAULT_MFDESTREL='' -MT_DEFAULT_DESTROOT='$KPSE_DOT' - -# Find the font: test tfm first, then mf, then possible sauterized mf. -fullname=`kpsewhich "$NAME.tfm" 2>/dev/null` -test -z "$fullname" && fullname=`kpsewhich "$NAME.mf" 2>/dev/null` -if test -z "$fullname"; then - rootname=`echo $NAME | sed 's/[0-9]*$//'` - fullname=`kpsewhich "b-$rootname.mf" 2>/dev/null` - # Fonts starting with wn* get special treatment: - if test -z "$fullname"; then - case $rootname in - wn*) lhname=`echo $NAME | sed 's/^wn/lh/'` - fullname=`kpsewhich "$lhname.mf" 2>/dev/null`;; - *) fullname=`kpsewhich "$rootname.mf" 2>/dev/null` - esac - fi -fi - -# After all this, do we _have_ a font? -if test -z "$fullname"; then - # We have found nothing, so force using the fontmaps as a last resort. - # This also means mktexnam can be queried for advice on where to - # place fonts. - MT_FEATURES="$MT_FEATURES:fontmaps" - MT_DESTROOT="$MT_VARTEXFONTS" -else - # Normalize $fullname. - fullname=`echo "$fullname" | sed 's%//*%/%g'` - # See if $fullname comes from a standard location. - OIFS=$IFS;IFS=$SEP - for i in `kpsewhich --expand-path='$TEXMF/fonts'"$SEP$MT_VARTEXFONTS"` - do - case "$fullname" in - $i/*) - # We now have a preliminary value for the destination root. - MT_DESTROOT="$i" - # When we're done, relfmt contains one of these: - # "/source/$MT_NAMEPART/" - # "/$MT_NAMEPART/source/" - # while namepart contains the actual namepart. - relfmt=`echo "$fullname" | \ - sed -e 's%^'"$i"'\(/.*/\)[^/]*$%\1%' \ - -e 's%^/tfm/%/source/%' \ - -e 's%/tfm/$%/source/%'` - namepart=`echo "$relfmt" | sed -e 's%/source/%/%'` - # See if namepart is empty. - if test "$namepart" != "/"; then - relfmt=`echo "$relfmt" | \ - sed -e 's%'"$namepart"'%/$MT_NAMEPART/%'` - else - # Assume TDS. - relfmt='/source/$MT_NAMEPART/' - namepart='' - fi - # Determine supplier and typeface from namepart. If there is - # only one part in the namepart, we take it to be the typeface. - MT_SUPPLIER=`echo $namepart | sed 's%^/\([^/]*\)/\(.*\)$%\1%'` - MT_TYPEFACE=`echo $namepart | sed 's%^/\([^/]*\)/\(.*\)$%\2%'` - if test -z "$MT_TYPEFACE"; then - MT_TYPEFACE="$MT_SUPPLIER"; - MT_SUPPLIER='' - fi - # Phew. Now we create the relative paths for pk, tfm and source. - MT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE' - MT_PKDESTREL=`echo "$relfmt" | sed 's%/source/%/pk/$MT_MODE/%'` - MT_TFMDESTREL=`echo "$relfmt" | sed 's%/source/%/tfm/%'` - MT_MFDESTREL=`echo "$relfmt"` - # And we're done with the loop now. - break - esac - done - IFS=$OIFS -fi - -# In case some variables remain unset. -: ${MT_DESTROOT=$MT_DEFAULT_DESTROOT} -: ${MT_SUPPLIER=$MT_DEFAULT_SUPPLIER} -: ${MT_TYPEFACE=$MT_DEFAULT_TYPEFACE} -: ${MT_NAMEPART=$MT_DEFAULT_NAMEPART} -: ${MT_PKDESTREL=$MT_DEFAULT_PKDESTREL} -: ${MT_TFMDESTREL=$MT_DEFAULT_TFMDESTREL} -: ${MT_MFDESTREL=$MT_DEFAULT_MFDESTREL} - -# Handle the options. -test -n "$MT_MKTEXNAM_OPT" && . "$MT_MKTEXNAM_OPT" - -# Adjust MT_DESTROOT, if necessary. -if test "x$MT_DESTROOT" != "x$MT_DEFAULT_DESTROOT"; then - # Do we have write access and permission? - access -w "$MT_DESTROOT" || USE_ALTERNATE=1 - test -w "$MT_DESTROOT" || USE_ALTERNATE=1 - # We distinguish system trees from the rest. - systexmf="`kpsewhich --expand-path='{$SYSTEXMF}/fonts'`$SEP$MT_VARTEXFONTS" - case "$SEP$systexmf$SEP" in - *$SEP$MT_DESTROOT$SEP*) # A system tree, check for varfonts. - if test "x$USE_VARTEXFONTS" = x1 || test "x$USE_ALTERNATE" = x1; then - MT_DESTROOT=$MT_VARTEXFONTS - fi ;; - *) # A non-system tree. - test "x$USE_ALTERNATE" = x1 && MT_DESTROOT=$MT_DEFAULT_DESTROOT ;; - esac -fi - -case "$DEST" in - "") ;; - /* | [A-z]:/*) # Absolute, explicit destdir => use it. - MT_PKDESTDIR=$DEST - MT_TFMDESTDIR=$DEST - MT_MFDESTDIR=$DEST - MT_NAMEPART=;; - *) # Relative destdir => append to the default. - MT_NAMEPART=$DEST;; -esac - -eval MT_MODE=\"$MODE\" -eval MT_NAMEPART=\"$MT_NAMEPART\" -eval MT_DESTROOT=\"$MT_DESTROOT\" -eval MT_PKDESTREL=\"$MT_PKDESTREL\" -eval MT_TFMDESTREL=\"$MT_TFMDESTREL\" -eval MT_MFDESTREL=\"$MT_MFDESTREL\" -eval MT_PKDESTDIR=\"$MT_PKDESTDIR\" -eval MT_TFMDESTDIR=\"$MT_TFMDESTDIR\" -eval MT_MFDESTDIR=\"$MT_MFDESTDIR\" -eval MT_PKNAME=\"$MT_PKDESTDIR/$MT_PKBASE\" -eval MT_TFMNAME=\"$MT_TFMDESTDIR/$MT_TFMBASE\" -eval MT_MFNAME=\"$MT_MFDESTDIR/$MT_MFBASE\" - -echo "$MT_PKNAME$SEP$MT_TFMNAME$SEP$MT_MFNAME" | sed 's%//*%/%g'
deleted file mode 100644 --- a/kpathsea/mktexnam.opt +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh -# mktexnam.opt to determine various manipulations of the filenames. -# Sourced from mktexnam. -# -# te@informatik.uni-hannover.de and kb@mail.tug.org. Public domain. -# $Id: mktexnam.opt,v 1.9 1998/02/24 12:16:55 olaf Exp $ - -# Get 8.3 filenames like dpiNNN/NAME.pk. -case "$MT_FEATURES" in - *dosnames*) MT_PKBASE='dpi$DPI/$NAME.pk';; -esac - -# Omit the mode directory (e.g., ljfour): -case "$MT_FEATURES" in - *nomode*) MODE="";; -esac - -########################################################################### -# Use this feature if you wish to use the alias files from the -# ftp://ftp.tug.org/tex/fontname.tar.gz distribution. -########################################################################### -case "$MT_FEATURES" in -*fontmaps*) - MT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE' - MT_PKDESTREL='pk/$MT_MODE/$MT_NAMEPART' - MT_TFMDESTREL='tfm/$MT_NAMEPART' - MT_MFDESTREL='source/$MT_NAMEPART' - SPECIALMAP=`kpsewhich special.map` - TYPEFACEMAP=`kpsewhich typeface.map` - SUPPLIERMAP=`kpsewhich supplier.map` - if test -r "$SPECIALMAP"; then - set x `awk \ - '{if ($1 == NAME || (substr (NAME, 1, length ($1)) == $1 \ - && substr (NAME, length (NAME), 1) ~ /[0-9]/ \ - && substr ($1, length ($1), 1) ~ /[^0-9]/)) \ - { print $2 " " $3; exit; }}' NAME=$NAME "$SPECIALMAP"` - shift; SUPPLIER=$1; TYPEFACE=$2 - - if test -z "$SUPPLIER"; then - # Try the normal case. Source first. - s_abbrev=`echo $NAME | sed 's/^\(.\).*$/\1/'` - SUPPLIER=`awk '{ if ($1 == s_abbrev) { print $2; exit; }}' \ - s_abbrev=$s_abbrev "$SUPPLIERMAP"` - if test -n "$SUPPLIER"; then - # We found the source. Try for the typeface. - t_abbrev=`echo $NAME | sed 's/^.//;s/\(..\).*$/\1/'` - TYPEFACE=`awk '{ if ($1 == t_abbrev) { print $2; exit; }}' \ - t_abbrev=$t_abbrev "$TYPEFACEMAP"` - fi - fi - fi - - if test -z "$SUPPLIER"; then - echo "$0: Could not map source abbreviation $s_abbrev for $NAME." >&2 - echo "$0: Need to update $SPECIALMAP?" >&2 - MT_SUPPLIER="$MT_DEFAULT_SUPPLIER" - MT_TYPEFACE="$MT_DEFAULT_TYPEFACE" - else - MT_SUPPLIER="$SUPPLIER" - if test -z "$TYPEFACE"; then - echo "$0: Could not map typeface abbreviation $t_abbrev for $NAME." >&2 - echo "$0: Need to update $SPECIALMAP?" >&2 - MT_TYPEFACE="$MT_DEFAULT_TYPEFACE" - else - MT_TYPEFACE="$TYPEFACE" - fi - fi -esac - -########################################################################### -# Use this feature to strip the "supplier" part (e.g. ams) -# of the target name: -########################################################################### - -case "$MT_FEATURES" in -*stripsupplier*) - MT_SUPPLIER="" -esac - -########################################################################### -# Use this feature to strip the "typeface" part (e.g. euler) -# of the target name: -########################################################################### - -case "$MT_FEATURES" in -*striptypeface*) - MT_TYPEFACE="" -esac - -# Put new fonts into the directory named by the VARTEXFONTS environment -# variable or config file value. (A default value for VARTEXFONTS is -# already set in the default texmf.cnf, q.v.) -# -# A user can override this setting in either direction by setting -# USE_VARTEXFONTS to 1 or 0. -case "$MT_FEATURES" in - *varfonts*) test "$USE_VARTEXFONTS" != 0 && USE_VARTEXFONTS=1;; -esac
deleted file mode 100755 --- a/kpathsea/mktexpk +++ /dev/null @@ -1,215 +0,0 @@ -#!/bin/sh -# original mktexpk -- make a new PK font, because one wasn't found. -# -# (If you change or delete the word `original' on the previous line, -# installation won't write this script over yours.) -# -# te@informatik.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl. -# Public domain. - -version='$Id: mktexpk,v 1.21 1998/02/20 16:23:22 olaf Exp $' -progname=`echo $0 | sed 's%.*/%%'` -usage="Usage: $progname [OPTION] NAME [REDIRECT], - Create a PK font. - ---dpi DPI use resolution DPI. ---bdpi BDPI use base resolution BDPI. ---mag MAG use magnificiation MAG. ---mfmode MODE use MODE as the METAFONT mode. ---destdir DESTDIR write fonts in DESTDIR. - -Try to create a PK file for NAME at resolution DPI, with an assumed -device base resolution of BDPI, and a Metafont \`mag' of MAG. Use MODE -for the METAFONT mode. Use DESTDIR for the root of where to install -into, either the absolute directory name to use (if it starts with a -/) or relative to the default DESTDIR (if not). REDIRECT, if supplied, -is a string of the form '>&n', where n is the number of the file -descriptor which is to receive, instead of stdout, the name of the -newly created pk file." - -# Handle non-positional options, except for --version/--help -while test $# -gt 0; do - case "$1" in - --destdir) shift; DEST="$1"; shift ;; - --dpi) shift; DPI="$1"; shift ;; - --bdpi) shift; BDPI="$1"; shift ;; - --mfmode) shift; test "x$1" != "x/" && MODE="$1"; shift ;; - --mag) shift; MAG="$1"; shift;; - --version|-version) break ;; - --help|-help) break ;; - *) break ;; - esac -done - -if test "x$2" != x; then - tail="`echo \"x$2\" | sed 's/^x>&//' | grep '^[0-9]*$'`" - if test -z "$tail"; then - echo "$progname: argument '$2' ignored - bad file number" >&2 - elif test "$tail" != 1; then - eval 'exec 1>&$tail' - fi -fi - -mt_max_args=2 - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$progname: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -# Since we want to pass the generated filename and only that filename -# back to the caller on standard output, we do some redirections so -# regular echo's will end up on stderr, and do an echo >$STDOUT at the end. -# Then the contents of $STDOUT will be echoed to stdout by a trap. - -# start of redirection stdout -> stderr, stdin <- /dev/null -( - -NAME=$1 - -# grep for the font in $PSMAPFILE. These are base font names, such as -# rpplr (the original) or pplr0 (an interim step) or pplr8r (current). -: ${PSMAPFILE=`kpsewhich psfonts.map`} -pattern="^$NAME"'([ ]|$)' -psline=`egrep "$pattern" $PSMAPFILE` -if test -n "$psline"; then - MODE=modeless - # ps_to_pk is set in mktex.opt - case $ps_to_pk in - ps2pk) - set x `echo "$psline" | sed 's%[<["]%%g'` - shift; shift; shift; - encoding=; psname=; slant=; extend= - while test ! -z "$1"; do - case "$1" in - *.enc) encoding="-e $1";; - *.pf[ab]) psname="$1";; - *SlantFont) slant="-S $lastopt";; - *ExtendFont) extend="-E $lastopt";; - esac - lastopt="$1" - shift - done - test -n "$psname" || - { pfa=`(kpsewhich $NAME.pfa 2>/dev/null)`; psname=$pfa; } - test -n "$psname" || - { pfb=`(kpsewhich $NAME.pfb 2>/dev/null)`; psname=$pfb; } - ANAME=`echo $NAME | sed 's/8r$/8a/'` - test -n "$psname" || - { pfa=`(kpsewhich $ANAME.pfa 2>/dev/null)`; psname=$pfa; } - test -n "$psname" || - { pfb=`(kpsewhich $ANAME.pfb 2>/dev/null)`; psname=$pfb; } - if [ -z "$psname" ]; then - echo "$progname: cannot find $NAME.pfa or $NAME.pfb. Trying gsftopk." >&2 - cmd="gsftopk $NAME $DPI" - else - cmd="ps2pk -v -X$DPI -R$BDPI $slant $extend $encoding $psname $NAME.${DPI}pk" - fi - ;; - *) - cmd="$ps_to_pk $NAME $DPI" - ;; - esac -else - # Check that $BDPI and $MODE are consistent; if not, ignore the mode and - # hope we can correctly guess it from bdpi. (People like to specify the - # resolution on the command line, not the mode so much.) - if test -n "$MODE"; then - mf_bdpi=`mf \ -'\mode:='$MODE';mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.'\ - </dev/null \ - | awk '/DPI=/ {print $2}'` - if test "x$mf_bdpi" != x$BDPI; then - echo "$progname: Mismatched mode $MODE and resolution $BDPI; ignoring mode." >&2 - MODE= - fi - fi - - # If an explicit mode is not supplied, try to guess. You can get a - # list of extant modes from ftp://ftp.tug.org/tex/modes.mf. - if test -z "$MODE" || test "x$MODE" = xdefault; then - case "$BDPI" in - 85) MODE=sun;; - 100) MODE=nextscrn;; - 180) MODE=toshiba;; - 300) MODE=cx;; - 400) MODE=nexthi;; - 600) MODE=ljfour;; - 1270) MODE=linoone;; - *) echo "$progname: Can't guess mode for $BDPI dpi devices." >&2 - echo "$progname: Use a config file, or update me." >&2 - exit 1 - esac - fi - - # Run Metafont. Always use plain Metafont, since reading cmbase.mf - # does not noticeably slow things down. - cmd="mf \mode:=$MODE; mag:=$MAG; nonstopmode; input $NAME" -fi - -OIFS=$IFS; IFS=$SEP -set x `"$MT_MKTEXNAM" $NAME $DPI $MODE $DEST`; shift -IFS=$OIFS - -PKDEST="$1" -PKDESTDIR=`echo "$PKDEST" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname -PKNAME=`basename "$PKDEST"` -GFNAME=$NAME.${DPI}gf - -if test -r "$PKDESTDIR/$PKNAME"; then - echo "$progname: $PKDESTDIR/$PKNAME already exists." >&2 - echo "$PKDESTDIR/$PKNAME" >$STDOUT - "$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME - exit 0 -fi - -"$MT_MKTEXDIR" "$PKDESTDIR" -if test ! -d "$PKDESTDIR"; then - echo "$progname: mktexdir $PKDESTDIR failed." >&2 - exit 1 -fi - -echo "$progname: Running $cmd" -$cmd </dev/null || { - # Don't abort if only "Strange path" errors occurr. - grep '^!' $NAME.log >$$.errs 2>/dev/null - grep '^! Strange path' $$.errs >$$.strange 2>/dev/null - if cmp $$.errs $$.strange >/dev/null 2>&1 \ - && test -s $$.strange >/dev/null 2>&1; then - echo "$progname: warning: \`$cmd' caused strange path errors." >&2 - else - echo "$progname: \`$cmd' failed." >&2 - test -s $NAME.log && mv -f $NAME.log "$KPSE_DOT" - exit 1; - fi -} - -test -r $GFNAME && { gftopk ./$GFNAME $PKNAME || exit 1; } -test ! -f $PKNAME && test -f $NAME.${DPI}pk && mv $NAME.${DPI}pk $PKNAME -if test ! -s $PKNAME; then - echo "$progname: \`$cmd' failed to make $PKNAME." >&2 - exit 1 -fi - -# Install the PK file carefully, since others may be working simultaneously. -# Use cp when mv fails, since DOS will fail mv for deeply-nested directories. -mv $PKNAME "$PKDESTDIR/pk$$.tmp" 2>/dev/null \ - || cp $PKNAME "$PKDESTDIR/pk$$.tmp" || exit 1 -cd $PKDESTDIR || exit 1 -chmod `kpsestat -xst,go-w .` pk$$.tmp -test -r $PKNAME || mv pk$$.tmp $PKNAME || exit 1 - -# Update ls-R if necessary. -"$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME - -# If this line (or an equivalent) is not present, dvipsk/xdvik/dviljk -# will think mktexpk failed. Any other output to stdout will also lose. -echo "$PKDESTDIR/$PKNAME" >$STDOUT -echo "$progname: $PKDESTDIR/$PKNAME: successfully generated." >&2 -) 1>&2 </dev/null
deleted file mode 100644 --- a/kpathsea/mktexpk.man +++ /dev/null @@ -1,122 +0,0 @@ -.TH MKTEXPK 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -mktexpk \- create a PK file for a font -.SH SYNOPSIS -.B mktexpk -.RI [ options ] -.I font -.RI [ redirect ] -.\"===================================================================== -.SH DESCRIPTION -This manual page is not meant to be exhaustive. The complete -documentation for this version of \*(TX can be found in the info file -or manual -.IR "Kpathsea: A library for path searching" . -.PP -.B mktexpk -is used to generate a -.I pk -file from the \*(MF source files or type1 sources for -.IR font , -if possible. -.PP -If -.I redirect -is given, it must be string of the form -.I >&n -where -.I n -is the number of the file descriptor which is to receive, instead of -standard output, the name of the generated file. -.PP -.B mktexpk -is typically called by other programs, rather than from the command -line. -.\"===================================================================== -.SH OPTIONS -.B mktexpk -accepts the following options: -.TP -.BI --bdpi \ num -Set the base device resolution. -.rb -.TP -.BI --dpi \ num -Generate the font at resolution -.IR num . -.rb -.TP -.B --help -.rb -Print help message and exit. -.TP -.BI --mag \ mag -The \*(MF magnification that corresponds to the combination of -.I bdpi -and -.I dpi -that has been specified. -.rb -.TP -.BI --mfmode \ mode -The \*(MF mode to use. -.rb -.TP -.BI --destdir \ dir -A directory name. If the directory is absolute, it is used as-is. -Otherwise, it is appended to the root destination directory set in the -script. -.rb -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH BUGS -If the -.I mode -is not specified, -.B mktexpk -tries to determine it from -.IR bdpi . -The manner in which this is done is primitive. Since -.I bpdi -doesn't provide sufficient information to uniquely determine a -.I mode -it is strongly recommended that it be specified explicitly. -.PP -If the -.I mode -and -.I bpdi -don't match, the -.I mode -is discarded. -.PP -The -.I dpi -parameter is redundant, but is not checked for consistency. Worse, -the program will fail if the wrong -.I dpi -is specified. -.\"===================================================================== -.SH "SEE ALSO" -.BR mktexmf (1), -.BR mktextfm (1).
deleted file mode 100755 --- a/kpathsea/mktextfm +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# original mktextfm -- make a new TFM file, because one wasn't found. -# -# (If you change or delete the word `original' on the previous line, -# installation won't write this script over yours.) -# -# te@informatik.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl. -# Public domain. - -version='$Id: mktextfm,v 1.17 1998/02/16 08:56:13 olaf Exp $' -progname=`echo $0 | sed 's%.*/%%'` -usage="Usage: $progname [--destdir DESTDIR] FONT. - -Makes a TFM file for FONT, if possible. Use DESTDIR for the root of where -to install into, either the absolute directory name to use (if it starts -with a /) or relative to the default DESTDIR (if not)." - -# Handle non-positional options, except for --version/--help -while test $# -gt 0; do - case "$1" in - --destdir) shift; DEST="$1"; shift ;; - --version|-version) break ;; - --help|-help) break ;; - *) break ;; - esac -done - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$progname: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -# start of redirection stdout -> stderr, stdin <- /dev/null -( - -NAME=`basename "$1" .tfm` -MAG=1 -#DEST="$2" -DPI=$BDPI - -OIFS=$IFS; IFS=$SEP -set x `"$MT_MKTEXNAM" $NAME $DPI $MODE $DEST`; shift -IFS=$OIFS - -PKDEST="$1" -TFMDEST="$2" -PKDESTDIR=`echo "$PKDEST" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname -TFMDESTDIR=`echo "$TFMDEST" | sed 's%/[^/][^/]*$%%'` -PKNAME=`basename "$PKDEST"` -TFMNAME=$NAME.tfm -GFNAME=$NAME.$DPI'gf' - -if test -r "$TFMDESTDIR/$TFMNAME"; then - echo "$progname: $TFMDESTDIR/$TFMNAME already exists." >&2 - echo "$TFMDESTDIR/$TFMNAME" >$STDOUT - "$MT_MKTEXUPD" "$TFMDESTDIR" $TFMNAME - exit -fi - -# Try to create the destdir first. Do not create fonts, if this fails. -"$MT_MKTEXDIR" "$TFMDESTDIR" -if test ! -d "$TFMDESTDIR"; then - echo "$progname: mktexdir $TFMDESTDIR failed." - exit 1 -fi - -cmd="mf \mode:=$MODE; mag:=$MAG; nonstopmode; input $NAME" -echo "$progname: Running $cmd" - -$cmd </dev/null || { - grep '^!' $NAME.log >$$.errs 2>/dev/null - grep '^! Strange path' $$.errs >$$.strange 2>/dev/null - if cmp $$.errs $$.strange >/dev/null 2>&1 \ - && test -s $$.strange >/dev/null 2>&1; then - echo "$progname: warning: \`$cmd' caused strange path errors." >&2 - else - echo "$progname: \`$cmd' failed." >&2 - test -s $NAME.log && mv -f $NAME.log "$KPSE_DOT" - exit 1; - fi -} - -test -r $TFMNAME || { echo "$progname: \`$cmd' failed to make $TFMNAME."; exit 1; } - -# Install the TFM file carefully, since others may be working simultaneously. -# Use cp when mv fails, since DOS will fail mv for deeply-nested directories. -mv $TFMNAME "$TFMDESTDIR/tfm$$.tmp" 2>/dev/null \ - || cp $TFMNAME "$TFMDESTDIR/tfm$$.tmp" || exit 1 -cd "$TFMDESTDIR" || exit 1 -chmod `kpsestat -xst,go-w .` tfm$$.tmp -test -r $TFMNAME || mv tfm$$.tmp $TFMNAME || exit 1 - -# OK, success with the TFM. -"$MT_MKTEXUPD" "$TFMDESTDIR" $TFMNAME -echo "$TFMDESTDIR/$TFMNAME" >$STDOUT -echo "$progname: $TFMDESTDIR/$TFMNAME: successfully generated." >&2 - -# Since we probably made a GF(->PK) file, too, may as well install it if -# it's needed. -cd $TEMPDIR -if test -r $GFNAME && test ! -f "$PKDESTDIR/$PKNAME"; then - gftopk ./$GFNAME $PKNAME || exit 1 - "$MT_MKTEXDIR" "$PKDESTDIR" - mv $PKNAME "$PKDESTDIR/pk$$.tmp" 2>/dev/null \ - || cp $PKNAME "$PKDESTDIR/pk$$.tmp" || exit 1 - cd "$PKDESTDIR" || exit 1 - if test -f $PKNAME; then - rm -f pk$$.tmp - else - chmod `kpsestat -xst,go-w .` pk$$.tmp - mv pk$$.tmp $PKNAME - "$MT_MKTEXUPD" "$PKDESTDIR" $PKNAME - fi -fi -) 1>&2 </dev/null
deleted file mode 100644 --- a/kpathsea/mktextfm.man +++ /dev/null @@ -1,68 +0,0 @@ -.TH MKTEXTFM 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -mktextfm \- create a TFM file for a font -.SH SYNOPSIS -.B mktextfm -.RI [--destdir destdir ] -.I font -.\"===================================================================== -.SH DESCRIPTION -This manual page is not meant to be exhaustive. The complete -documentation for this version of \*(TX can be found in the info file -or manual -.IR "Kpathsea: A library for path searching" . -.PP -.B mktextfm -is used to generate a -.I tfm -file from the \*(MF source files for -.IR font , -if possible. If -.I destdir -is given, the generated file will be installed there, otherwise a -(rather complicated) heuristic is used. -.PP -The name of the generated file is printed on standard output. -.PP -.B mktextfm -is typically called by other programs, rather than from the command -line. -.\"===================================================================== -.SH OPTIONS -.B mktextfm -accepts the following options: -.TP -.BI --destdir \ dir -.rb -A directory name. If the directory is absolute, it is used as-is. -Otherwise, it is appended to the root destination directory set in the -script. -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH "SEE ALSO" -.BR mktexmf (1), -.BR mktexpk (1).
deleted file mode 100755 --- a/kpathsea/mktexupd +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# mktexupd -- update ls-R with a new entry. -# -# te@informatik.uni-hannover.de and kb@mail.tug.org. Public domain. - -version='$Id: mktexupd,v 1.13 1998/02/20 16:22:58 olaf Exp $' -usage="Usage: $0 DIR FILE. - Update the ls-R file with an entry for FILE in DIR." -mt_min_args=2 -mt_max_args=2 - -# Common code for all scripts. -: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`} -: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} -test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt" -if test ! -f "$MT_MKTEX_OPT"; then - echo "$0: Cannot find mktex.opt; check your installation." >&2 - exit 1 -fi - -. "$MT_MKTEX_OPT" - -dir=$1 -file=$2 -test -d "$dir" || { echo "$0: $dir not a directory." >&2; exit 1; } -test -f "$dir/$file" || { echo "$0: $dir/$file not a file." >&2; exit 1; } - -OIFS=$IFS; IFS=$SEP; set x `kpsewhich -show-path=ls-R`; shift; IFS=$OIFS -TEXMFLS_R= -for d in "$@"; do - case $dir in - ${d}*) TEXMFLS_R="$d"; break;; - esac -done -test -n "$TEXMFLS_R" || exit 0 -db_file="$TEXMFLS_R/ls-R" - -test -f "$db_file" || mktexlsr "$TEXMFLS_R" -test -w "$db_file" || { echo "$0: $db_file unwritable." >&2; exit 1; } - -test "x`sed 1q \"$db_file\"`" = "x$ls_R_magic" \ - || test "x`sed 1q \"$db_file\"`" = "x$old_ls_R_magic" \ - || { echo "$0: $db_file lacks magic string \`$ls_R_magic'." >&2; exit 1; } - -# Change `$TEXMFLS_R/' to `./'. -dir=`echo $dir | sed "s%^$TEXMFLS_R/%./%g"` - -# May as well always put in a new directory entry; presumably cron will -# come along soon enough and clean things up. -echo "$dir:" >>"$db_file" -echo "$file" >>"$db_file" - -exit 0
deleted file mode 100644 --- a/kpathsea/path-elt.c +++ /dev/null @@ -1,145 +0,0 @@ -/* path-elt.c: Return the stuff between colons. - -Copyright (C) 1993, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> -#include <kpathsea/pathsearch.h> - - -/* The static (but dynamically allocated) area we return the answer in, - and how much we've currently allocated for it. */ -static string elt = NULL; -static unsigned elt_alloc = 0; - -/* The path we're currently working on. */ -static const_string path = NULL; - - -/* Upon entry, the static `path' is at the first (and perhaps last) - character of the return value, or else NULL if we're at the end (or - haven't been called). I make no provision for caching the results; - thus, we parse the same path over and over, on every lookup. If that - turns out to be a significant lose, it can be fixed, but I'm guessing - disk accesses overwhelm everything else. If ENV_P is true, use - IS_ENV_SEP; else use IS_DIR_SEP. */ - -static string -element P2C(const_string, passed_path, boolean, env_p) -{ - const_string p; - string ret; - int brace_level; - unsigned len; - - if (passed_path) - path = passed_path; - /* Check if called with NULL, and no previous path (perhaps we reached - the end). */ - else if (!path) - return NULL; - - /* OK, we have a non-null `path' if we get here. */ - assert (path); - p = path; - - /* Find the next colon not enclosed by braces (or the end of the path). */ - brace_level = 0; - while (*p != 0 && !(brace_level == 0 - && (env_p ? IS_ENV_SEP (*p) : IS_DIR_SEP (*p)))) { - if (*p == '{') ++brace_level; - else if (*p == '}') --brace_level; - ++p; - } - - /* Return the substring starting at `path'. */ - len = p - path; - - /* Make sure we have enough space (including the null byte). */ - if (len + 1 > elt_alloc) - { - elt_alloc = len + 1; - elt = xrealloc (elt, elt_alloc); - } - - strncpy (elt, path, len); - elt[len] = 0; - ret = elt; - - /* If we are at the end, return NULL next time. */ - if (path[len] == 0) - path = NULL; - else - path += len + 1; - - return ret; -} - -string -kpse_path_element P1C(const_string, p) -{ - return element (p, true); -} - -string -kpse_filename_component P1C(const_string, p) -{ - return element (p, false); -} - -#ifdef TEST - -void -print_path_elements (const_string path) -{ - string elt; - printf ("Elements of `%s':", path ? path : "(null)"); - - for (elt = kpse_path_element (path); elt != NULL; - elt = kpse_path_element (NULL)) - { - printf (" %s", *elt ? elt : "`'"); - } - - puts ("."); -} - -int -main () -{ - /* All lists end with NULL. */ - print_path_elements (NULL); /* */ - print_path_elements (""); /* "" */ - print_path_elements ("a"); /* a */ - print_path_elements (ENV_SEP_STRING); /* "", "" */ - print_path_elements (ENV_SEP_STRING ENV_SEP_STRING); /* "", "", "" */ - print_path_elements ("a" ENV_SEP_STRING); /* a, "" */ - print_path_elements (ENV_SEP_STRING "b"); /* "", b */ - print_path_elements ("a" ENV_SEP_STRING "b"); /* a, b */ - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -standalone-compile-command: "gcc -g -I. -I.. -DTEST path-elt.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/pathsearch.c +++ /dev/null @@ -1,670 +0,0 @@ -/* pathsearch.c: look up a filename in a path. - -Copyright (C) 1993, 94, 95, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-fopen.h> -#include <kpathsea/absolute.h> -#include <kpathsea/expand.h> -#include <kpathsea/db.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/readable.h> -#include <kpathsea/str-list.h> -#include <kpathsea/str-llist.h> -#include <kpathsea/variable.h> - -#include <time.h> /* for `time' */ - -#ifdef __DJGPP__ -#include <sys/stat.h> /* for stat bits */ -#endif - -/* The very first search is for texmf.cnf, called when someone tries to - initialize the TFM path or whatever. init_path calls kpse_cnf_get - which calls kpse_all_path_search to find all the texmf.cnf's. We - need to do various special things in this case, since we obviously - don't yet have the configuration files when we're searching for the - configuration files. */ -static boolean first_search = true; - - - -/* This function is called after every search (except the first, since - we definitely want to allow enabling the logging in texmf.cnf) to - record the filename(s) found in $TEXMFLOG. */ - -static void -log_search P1C(str_list_type, filenames) -{ - static FILE *log_file = NULL; - static boolean first_time = true; /* Need to open the log file? */ - - if (first_time) { - /* Get name from either envvar or config file. */ - string log_name = kpse_var_value ("TEXMFLOG"); - first_time = false; - if (log_name) { - log_file = fopen (log_name, FOPEN_A_MODE); - if (!log_file) - perror (log_name); - free (log_name); - } - } - - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH) || log_file) { - unsigned e; - - /* FILENAMES should never be null, but safety doesn't hurt. */ - for (e = 0; e < STR_LIST_LENGTH (filenames) && STR_LIST_ELT (filenames, e); - e++) { - string filename = STR_LIST_ELT (filenames, e); - - /* Only record absolute filenames, for privacy. */ - if (log_file && kpse_absolute_p (filename, false)) - fprintf (log_file, "%lu %s\n", (long unsigned) time (NULL), - filename); - - /* And show them online, if debugging. We've already started - the debugging line in `search', where this is called, so - just print the filename here, don't use DEBUGF. */ - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - fputs (filename, stderr); - } - } -} - -/* Concatenate each element in DIRS with NAME (assume each ends with a - /, to save time). If SEARCH_ALL is false, return the first readable - regular file. Else continue to search for more. In any case, if - none, return a list containing just NULL. - - We keep a single buffer for the potential filenames and reallocate - only when necessary. I'm not sure it's noticeably faster, but it - does seem cleaner. (We do waste a bit of space in the return - value, though, since we don't shrink it to the final size returned.) */ - -#define INIT_ALLOC 75 /* Doesn't much matter what this number is. */ - -static str_list_type -dir_list_search P3C(str_llist_type *, dirs, const_string, name, - boolean, search_all) -{ - str_llist_elt_type *elt; - str_list_type ret; - unsigned name_len = strlen (name); - unsigned allocated = INIT_ALLOC; - string potential = xmalloc (allocated); - - ret = str_list_init (); - - for (elt = *dirs; elt; elt = STR_LLIST_NEXT (*elt)) - { - const_string dir = STR_LLIST (*elt); - unsigned dir_len = strlen (dir); - - while (dir_len + name_len + 1 > allocated) - { - allocated += allocated; - XRETALLOC (potential, allocated, char); - } - - strcpy (potential, dir); - strcat (potential, name); - - if (kpse_readable_file (potential)) - { - str_list_add (&ret, potential); - - /* Move this element towards the top of the list. */ - str_llist_float (dirs, elt); - - /* If caller only wanted one file returned, no need to - terminate the list with NULL; the caller knows to only look - at the first element. */ - if (!search_all) - return ret; - - /* Start new filename. */ - allocated = INIT_ALLOC; - potential = xmalloc (allocated); - } - } - - /* If we get here, either we didn't find any files, or we were finding - all the files. But we're done with the last filename, anyway. */ - free (potential); - - return ret; -} - -/* This is called when NAME is absolute or explicitly relative; if it's - readable, return (a list containing) it; otherwise, return NULL. */ - -static str_list_type -absolute_search P1C(string, name) -{ - str_list_type ret_list; - string found = kpse_readable_file (name); - - /* Some old compilers can't initialize structs. */ - ret_list = str_list_init (); - - /* If NAME wasn't found, free the expansion. */ - if (name != found) - free (name); - - /* Add `found' to the return list even if it's null; that tells - the caller we didn't find anything. */ - str_list_add (&ret_list, found); - - return ret_list; -} - -/* This is the hard case -- look for NAME in PATH. If ALL is false, - return the first file found. Otherwise, search all elements of PATH. */ - -static str_list_type -path_search P4C(const_string, path, string, name, - boolean, must_exist, boolean, all) -{ - string elt; - str_list_type ret_list; - boolean done = false; - ret_list = str_list_init (); /* some compilers lack struct initialization */ - - for (elt = kpse_path_element (path); !done && elt; - elt = kpse_path_element (NULL)) { - str_list_type *found; - boolean allow_disk_search = true; - - if (*elt == '!' && *(elt + 1) == '!') { - /* Those magic leading chars in a path element means don't search the - disk for this elt. And move past the magic to get to the name. */ - allow_disk_search = false; - elt += 2; - } - - /* Do not touch the device if present */ - if (NAME_BEGINS_WITH_DEVICE (elt)) { - while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) { - *(elt + 2) = *(elt + 1); - *(elt + 1) = *elt; - elt++; - } - } else { - /* We never want to search the whole disk. */ - while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) - elt++; - } - - /* Try ls-R, unless we're searching for texmf.cnf. Our caller - (search), also tests first_search, and does the resetting. */ - found = first_search ? NULL : kpse_db_search (name, elt, all); - - /* Search the filesystem if (1) the path spec allows it, and either - (2a) we are searching for texmf.cnf ; or - (2b) no db exists; or - (2c) no db's are relevant to this elt; or - (3) MUST_EXIST && NAME was not in the db. - In (2*), `found' will be NULL. - In (3), `found' will be an empty list. */ - if (allow_disk_search && (!found || (must_exist && !STR_LIST (*found)))) { - str_llist_type *dirs = kpse_element_dirs (elt); - if (dirs && *dirs) { - if (!found) - found = XTALLOC1 (str_list_type); - *found = dir_list_search (dirs, name, all); - } - } - - /* Did we find anything anywhere? */ - if (found && STR_LIST (*found)) - if (all) - str_list_concat (&ret_list, *found); - else { - str_list_add (&ret_list, STR_LIST_ELT (*found, 0)); - done = true; - } - - /* Free the list space, if any (but not the elements). */ - if (found) { - str_list_free (found); - free (found); - } - } - - /* Free the expanded name we were passed. It can't be in the return - list, since the path directories got unconditionally prepended. */ - free (name); - - return ret_list; -} - -/* Search PATH for ORIGINAL_NAME. If ALL is false, or ORIGINAL_NAME is - absolute_p, check ORIGINAL_NAME itself. Otherwise, look at each - element of PATH for the first readable ORIGINAL_NAME. - - Always return a list; if no files are found, the list will - contain just NULL. If ALL is true, the list will be - terminated with NULL. */ - -static string * -search P4C(const_string, path, const_string, original_name, - boolean, must_exist, boolean, all) -{ - str_list_type ret_list; - string name; - boolean absolute_p; - -#ifdef __DJGPP__ - /* We will use `stat' heavily, so let's request for - the fastest possible version of `stat', by telling - it what members of struct stat do we really need. - - We need to set this on each call because this is a - library function; the caller might need other options - from `stat'. Thus save the flags and restore them - before exit. - - This call tells `stat' that we do NOT need to recognize - executable files (neither by an extension nor by a magic - signature); that we do NOT need time stamp of root directories; - and that we do NOT need the write access bit in st_mode. - - Note that `kpse_set_progname' needs the EXEC bits, - but it was already called by the time we get here. */ - unsigned short save_djgpp_flags = _djstat_flags; - - _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT - | _STAT_ROOT_TIME | _STAT_WRITEBIT; -#endif - - /* Make a leading ~ count as an absolute filename, and expand $FOO's. */ - name = kpse_expand (original_name); - - /* If the first name is absolute or explicitly relative, no need to - consider PATH at all. */ - absolute_p = kpse_absolute_p (name, true); - - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - DEBUGF4 ("start search(file=%s, must_exist=%d, find_all=%d, path=%s).\n", - name, must_exist, all, path); - - /* Find the file(s). */ - ret_list = absolute_p ? absolute_search (name) - : path_search (path, name, must_exist, all); - - /* Append NULL terminator if we didn't find anything at all, or we're - supposed to find ALL and the list doesn't end in NULL now. */ - if (STR_LIST_LENGTH (ret_list) == 0 - || (all && STR_LIST_LAST_ELT (ret_list) != NULL)) - str_list_add (&ret_list, NULL); - - /* The very first search is for texmf.cnf. We can't log that, since - we want to allow setting TEXMFLOG in texmf.cnf. */ - if (first_search) { - first_search = false; - } else { - /* Record the filenames we found, if desired. And wrap them in a - debugging line if we're doing that. */ - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - DEBUGF1 ("search(%s) =>", original_name); - log_search (ret_list); - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - putc ('\n', stderr); - } - -#ifdef __DJGPP__ - /* Undo any side effects. */ - _djstat_flags = save_djgpp_flags; -#endif - - return STR_LIST (ret_list); -} - -/* Search PATH for the first NAME. */ - -string -kpse_path_search P3C(const_string, path, const_string, name, - boolean, must_exist) -{ - static string *ret_list = 0; - - if (ret_list) - { - free (ret_list); - ret_list = 0; /* Don't let an interrupt in search() cause trouble */ - } - - ret_list = search (path, name, must_exist, false); - - return *ret_list; /* Freeing this is caller's responsibility */ -} - - -/* Search all elements of PATH for files named NAME. Not sure if it's - right to assert `must_exist' here, but it suffices now. */ - -string * -kpse_all_path_search P2C(const_string, path, const_string, name) -{ - string *ret = search (path, name, true, true); - return ret; -} - -/* This is the hard case -- look in each element of PATH for each - element of NAMES. If ALL is false, return the first file found. - Otherwise, search all elements of PATH. */ - -static str_list_type -path_find_first_of P4C(const_string, path, const_string *, names, - boolean, must_exist, boolean, all) -{ - const_string *p; - string elt; - const_string name; - str_list_type ret_list; - boolean done = false; - ret_list = str_list_init (); /* some compilers lack struct initialization */ - - for (elt = kpse_path_element (path); !done && elt; - elt = kpse_path_element (NULL)) - { - str_llist_type *dirs; - str_llist_elt_type *dirs_elt; - str_list_type *found; - boolean allow_disk_search = true; - - if (*elt == '!' && *(elt + 1) == '!') - { - /* Those magic leading chars in a path element means don't - search the disk for this elt. And move past the magic to - get to the name. */ - - allow_disk_search = false; - elt += 2; - } - - /* Do not touch the device if present */ - - if (NAME_BEGINS_WITH_DEVICE (elt)) - { - while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) - { - *(elt + 2) = *(elt + 1); - *(elt + 1) = *elt; - elt++; - } - } - else - { - /* We never want to search the whole disk. */ - while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) - elt++; - } - - /* We have to search one directory at a time. */ - dirs = kpse_element_dirs (elt); - for (dirs_elt = *dirs; dirs_elt; dirs_elt = STR_LLIST_NEXT (*dirs_elt)) - { - string dir = STR_LLIST (*dirs_elt); - - for (p = names; !done && *p; p++) - { - name = *p; - - /* Try ls-R, unless we're searching for texmf.cnf. Our caller - (find_first_of), also tests first_search, and does the - resetting. */ - found = first_search ? NULL : kpse_db_search (name, dir, all); - - /* Search the filesystem if (1) the path spec allows it, - and either - - (2a) we are searching for texmf.cnf ; or - (2b) no db exists; or - (2c) no db's are relevant to this elt; or - (3) MUST_EXIST && NAME was not in the db. - - In (2*), `found' will be NULL. - In (3), `found' will be an empty list. */ - - if (allow_disk_search - && (!found || (must_exist && !STR_LIST (*found)))) - { - static str_llist_type *tmp = 0; - - if (! tmp) - { - tmp = XTALLOC1 (str_llist_type); - *tmp = NULL; - str_llist_add (tmp, ""); - } - - STR_LLIST (*(*tmp)) = dir; - - if (!found) - found = XTALLOC1 (str_list_type); - - *found = dir_list_search (tmp, name, all); - } - - /* Did we find anything anywhere? */ - if (found && STR_LIST (*found)) - { - if (all) - str_list_concat (&ret_list, *found); - else - { - str_list_add (&ret_list, STR_LIST_ELT (*found, 0)); - done = true; - } - } - - /* Free the list space, if any (but not the elements). */ - if (found) - { - str_list_free (found); - free (found); - } - } - } - } - - return ret_list; -} - -static string * -find_first_of P4C(const_string, path, const_string *, names, - boolean, must_exist, boolean, all) -{ - str_list_type ret_list; - boolean absolute_p; - -#ifdef __DJGPP__ - /* We will use `stat' heavily, so let's request for - the fastest possible version of `stat', by telling - it what members of struct stat do we really need. - - We need to set this on each call because this is a - library function; the caller might need other options - from `stat'. Thus save the flags and restore them - before exit. - - This call tells `stat' that we do NOT need to recognize - executable files (neither by an extension nor by a magic - signature); that we do NOT need time stamp of root directories; - and that we do NOT need the write access bit in st_mode. - - Note that `kpse_set_progname' needs the EXEC bits, - but it was already called by the time we get here. */ - unsigned short save_djgpp_flags = _djstat_flags; - - _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT - | _STAT_ROOT_TIME | _STAT_WRITEBIT; -#endif - - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - { - const_string *p; - fputs ("start find_first_of((", stderr); - for (p = names; *p; p++) - { - if (p == names) - fputs (*p, stderr); - else - fprintf (stderr, ", %s", *p); - } - fprintf (stderr, "), path=%s, must_exist=%d).\n", path, must_exist); - } - - /* Find the file. */ - ret_list = path_find_first_of (path, names, must_exist, all); - - /* Append NULL terminator if we didn't find anything at all, or we're - supposed to find ALL and the list doesn't end in NULL now. */ - if (STR_LIST_LENGTH (ret_list) == 0 - || (all && STR_LIST_LAST_ELT (ret_list) != NULL)) - str_list_add (&ret_list, NULL); - - /* The very first search is for texmf.cnf. We can't log that, since - we want to allow setting TEXMFLOG in texmf.cnf. */ - if (first_search) { - first_search = false; - } else { - /* Record the filenames we found, if desired. And wrap them in a - debugging line if we're doing that. */ - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - { - const_string *p; - fputs ("find_first_of(", stderr); - for (p = names; *p; p++) - { - if (p == names) - fputs (*p, stderr); - else - fprintf (stderr, ", %s", *p); - } - fputs (") =>", stderr); - } - log_search (ret_list); - if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) - putc ('\n', stderr); - } - -#ifdef __DJGPP__ - /* Undo any side effects. */ - _djstat_flags = save_djgpp_flags; -#endif - - return STR_LIST (ret_list); -} - -/* Search each element of PATH for each element of NAMES. Return the - first one found. */ - -string -kpse_path_find_first_of P3C(const_string, path, const_string *, names, - boolean, must_exist) -{ - static string *ret_list = 0; - - if (ret_list) - { - free (ret_list); - ret_list = 0; /* Don't let an interrupt in search() cause trouble */ - } - - ret_list = find_first_of (path, names, must_exist, false); - - return *ret_list; /* Freeing this is caller's responsibility */ -} - -/* Search each element of PATH for each element of NAMES and return a - list containing everything found, in the order found. */ - -string * -kpse_all_path_find_first_of P2C(const_string, path, const_string *, names) -{ - string *ret = find_first_of (path, names, true, true); - return ret; -} - - -#ifdef TEST - -void -test_path_search (const_string path, const_string file) -{ - string answer; - string *answer_list; - - printf ("\nSearch %s for %s:\t", path, file); - answer = kpse_path_search (path, file); - puts (answer ? answer : "(nil)"); - - printf ("Search %s for all %s:\t", path, file); - answer_list = kpse_all_path_search (path, file); - putchar ('\n'); - while (*answer_list) - { - putchar ('\t'); - puts (*answer_list); - answer_list++; - } -} - -#define TEXFONTS "/usr/local/lib/tex/fonts" - -int -main () -{ - /* All lists end with NULL. */ - test_path_search (".", "nonexistent"); - test_path_search (".", "/nonexistent"); - test_path_search ("/k" ENV_SEP_STRING ".", "kpathsea.texi"); - test_path_search ("/k" ENV_SEP_STRING ".", "/etc/fstab"); - test_path_search ("." ENV_SEP_STRING TEXFONTS "//", "cmr10.tfm"); - test_path_search ("." ENV_SEP_STRING TEXFONTS "//", "logo10.tfm"); - test_path_search (TEXFONTS "//times" ENV_SEP_STRING "." - ENV_SEP_STRING ENV_SEP_STRING, "ptmr.vf"); - test_path_search (TEXFONTS "/adobe//" ENV_SEP_STRING - "/usr/local/src/TeX+MF/typefaces//", "plcr.pfa"); - - test_path_search ("~karl", ".bashrc"); - test_path_search ("/k", "~karl/.bashrc"); - - xputenv ("NONEXIST", "nonexistent"); - test_path_search (".", "$NONEXISTENT"); - xputenv ("KPATHSEA", "kpathsea"); - test_path_search ("/k" ENV_SEP_STRING ".", "$KPATHSEA.texi"); - test_path_search ("/k" ENV_SEP_STRING ".", "${KPATHSEA}.texi"); - test_path_search ("$KPATHSEA" ENV_SEP_STRING ".", "README"); - test_path_search ("." ENV_SEP_STRING "$KPATHSEA", "README"); - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -test-compile-command: "gcc -posix -g -I. -I.. -DTEST pathsearch.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/pathsearch.h +++ /dev/null @@ -1,93 +0,0 @@ -/* pathsearch.h: mostly-generic path searching. - -Copyright (C) 1993, 94, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_PATHSEARCH_H -#define KPATHSEA_PATHSEARCH_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/str-llist.h> -#include <kpathsea/types.h> - -/* If PATH is non-null, return its first element (as defined by - IS_ENV_SEP). If it's NULL, return the next element in the previous - path, a la strtok. Leading, trailing, or doubled colons result in - the empty string. When at the end of PATH, return NULL. In any - case, return a pointer to an area that may be overwritten on - subsequent calls. */ -extern string kpse_path_element P1H(const_string path); - -/* Like `kpse_path_element', but for filename components (using - IS_DIR_SEP). Uses same area as `kpse_path_element'. */ -extern string kpse_filename_component P1H(const_string path); - - -/* Given a path element ELT, return a pointer to a NULL-terminated list - of the corresponding (existing) directory or directories, with - trailing slashes, or NULL. If ELT is the empty string, check the - current working directory. - - It's up to the caller to expand ELT. This is because this routine is - most likely only useful to be called from `kpse_path_search', which - has already assumed expansion has been done. */ -extern str_llist_type *kpse_element_dirs P1H(const_string elt); - - -/* Call `kpse_expand' on NAME. If the result is an absolute or - explicitly relative filename, check whether it is a readable - (regular) file. - - Otherwise, look in each of the directories specified in PATH (also do - tilde and variable expansion on elements in PATH), using a prebuilt - db (see db.h) if it's relevant for a given path element. - - If the prebuilt db doesn't exist, or if MUST_EXIST is true and NAME - isn't found in the prebuilt db, look on the filesystem. (I.e., if - MUST_EXIST is false, and NAME isn't found in the db, do *not* look on - the filesystem.) - - The caller must expand PATH. This is because it makes more sense to - do this once, in advance, instead of for every search using it. - - In any case, return the complete filename if found, otherwise NULL. */ -extern string kpse_path_search P3H(const_string path, const_string name, - boolean must_exist); - - -/* Like `kpse_path_search' with MUST_EXIST true, but return a list of - all the filenames (or NULL if none), instead of taking the first. */ -extern string *kpse_all_path_search P2H(const_string path, const_string name); - -/* Search each element of PATH for each element in the list of NAMES. - Return the first one found. */ -extern string kpse_path_find_first_of P3H(const_string path, - const_string *names, - boolean must_exist); - -/* Like `kpse_path_find_first_of' with MUST_EXIST true, but return a - list of all the filenames (or NULL if none), instead of taking the - first. */ -extern string *kpse_all_path_find_first_of P2H(const_string path, - const_string *names); - -#if 0 -/* Clear the directory cache. */ -extern void kpse_clear_dir_cache P1H(void); -#endif - -#endif /* not KPATHSEA_PATHSEARCH_H */ -
deleted file mode 100644 --- a/kpathsea/proginit.c +++ /dev/null @@ -1,76 +0,0 @@ -/* proginit.c: useful initializations for DVI drivers. - -Copyright (C) 1994, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/proginit.h> -#include <kpathsea/tex-file.h> - - -/* These initializations were common to all the drivers modified for - kpathsea, so a single routine seemed in order. Kind of a bollixed-up - mess, but still better than repeating the code. */ - -void -kpse_init_prog P4C(const_string, prefix, unsigned, dpi, const_string, mode, - const_string, fallback) -{ - string font_var = concat (prefix, "FONTS"); - string header_var = concat (prefix, "HEADERS"); - string makepk_var = concat (prefix, "MAKEPK"); - string size_var = concat (prefix, "SIZES"); - - /* Do both `pk_format' and `any_glyph_format' for the sake of xdvi; in - general, mktexpk might apply to either, and the program will ask - for the one it wants. */ - - /* Might have a program-specific name for mktexpk itself. */ - if (getenv (makepk_var)) { - /* If we did, we want to enable the program, I think. */ - kpse_set_program_enabled (kpse_pk_format, 1, kpse_src_env); - kpse_set_program_enabled (kpse_any_glyph_format, 1, kpse_src_env); - - kpse_format_info[kpse_pk_format].program - = kpse_format_info[kpse_any_glyph_format].program - = getenv (makepk_var); - } - - /* A couple font paths have traditionally had application-specific - environment variables to override all else; namely, XDVIFONTS and - DVIPSHEADERS. So set those if we have them. */ - kpse_format_info[kpse_pk_format].override_path - = kpse_format_info[kpse_gf_format].override_path - = kpse_format_info[kpse_any_glyph_format].override_path - = kpse_format_info[kpse_tfm_format].override_path - = getenv (font_var); - - kpse_format_info[kpse_tex_ps_header_format].override_path - = getenv (header_var); - - kpse_init_fallback_resolutions (size_var); - xputenv_int ("MAKETEX_BASE_DPI", dpi); - kpse_fallback_font = fallback; - - /* Ugliness. See comments in kpse_make_tex in kpathsea/tex-make.c. */ - xputenv ("MAKETEX_MODE", mode ? mode : DIR_SEP_STRING); - - free (font_var); - free (header_var); - free (makepk_var); - free (size_var); -}
deleted file mode 100644 --- a/kpathsea/proginit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* proginit.h: declarations for DVI driver initializations. - -Copyright (C) 1994, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_PROGINIT_H -#define KPATHSEA_PROGINIT_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* Common initializations for DVI drivers -- check for `PREFIX'SIZES and - `PREFIX'FONTS environment variables, setenv MAKETEX_MODE to MODE, - etc., etc. See the source. */ - -extern void -kpse_init_prog P4H(const_string prefix, unsigned dpi, const_string mode, - const_string fallback); - -#endif /* not KPATHSEA_PROGINIT_H */
deleted file mode 100644 --- a/kpathsea/progname.c +++ /dev/null @@ -1,617 +0,0 @@ -/* progname.c: the executable name we were invoked as; general initialization. - -Copyright (C) 1994, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/absolute.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-stat.h> -#include <kpathsea/pathsearch.h> -/* For kpse_reset_progname */ -#include <kpathsea/tex-file.h> - -#ifdef WIN32 -#include <kpathsea/c-pathmx.h> -#endif - -/* NeXT does not define the standard macros, but has the equivalent. - WIN32 doesn't define them either, and doesn't have them. - From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de>. */ -#ifndef S_IXUSR -#ifdef WIN32 -#define S_IXUSR 0 -#define S_IXGRP 0 -#define S_IXOTH 0 -#else /* not WIN32 */ -#define S_IXUSR 0100 -#endif /* not WIN32 */ -#endif /* not S_IXUSR */ -#ifndef S_IXGRP -#define S_IXGRP 0010 -#endif -#ifndef S_IXOTH -#define S_IXOTH 0001 -#endif - -#ifndef HAVE_PROGRAM_INVOCATION_NAME -/* Don't redefine the variables if glibc already has. */ -string program_invocation_name = NULL; -string program_invocation_short_name = NULL; -#endif -/* And the variable for the program we pretend to be. */ -string kpse_program_name = NULL; - -/* Return directory for NAME. This is "." if NAME contains no directory - separators (should never happen for selfdir), else whatever precedes - the final directory separator, but with multiple separators stripped. - For example, `my_dirname ("/foo//bar.baz")' returns "/foo". Always - return a new string. */ - -static string -my_dirname P1C(const_string, name) -{ - string ret; - unsigned loc = strlen (name); - - for (loc = strlen (name); loc > 0 && !IS_DIR_SEP (name[loc-1]); loc--) - ; - - if (loc) { - /* If have ///a, must return /, so don't strip off everything. */ - unsigned limit = NAME_BEGINS_WITH_DEVICE (name) ? 3 : 1; - while (loc > limit && IS_DIR_SEP (name[loc-1]) - && !IS_DEVICE_SEP (name[loc-1])) { - loc--; - } - ret = xmalloc (loc + 1); - strncpy (ret, name, loc); - ret[loc] = 0; - } else { - /* No directory separators at all, so return the current directory. - The way this is used in kpathsea, this should never happen. */ - ret = xstrdup ("."); - } - - return ret; -} - -#ifndef WIN32 -/* From a standalone program `ll' to expand symlinks written by Kimbo Mundy. - Don't bother to compile if we don't have symlinks; thus we can assume - / as the separator. Also don't try to use basename, etc., or - handle arbitrary filename length. Mixed case function names because - that's what kimbo liked. */ - -#ifdef S_ISLNK -static int ll_verbose = 0; -static int ll_loop = 0; - -#undef BSIZE -#define BSIZE 2048 /* sorry */ - - -/* Read link FN into SYM. */ - -static void -ReadSymLink (fn, sym) - char *fn, *sym; -{ - register int n = readlink (fn, sym, BSIZE); - if (n < 0) { - perror (fn); - exit (1); - } - sym[n] = 0; -} - - -/* Strip first component from S, and also return it in a static buffer. */ - -static char * -StripFirst (s) - register char *s; -{ - static char buf[BSIZE]; - register char *s1; - - /* Find the end of the first path element */ - for (s1 = s; *s1 && (*s1 != '/' || s1 == s); s1++) - ; - - /* Copy it into buf and null-terminate it. */ - strncpy (buf, s, s1 - s); - buf[s1 - s] = 0; - - /* Skip over the leading / (if any) */ - if (*s1 == '/') - ++s1; - - /* Squeeze out the element */ - while ((*s++ = *s1++) != 0) - ; - - return buf; -} - - -/* Strip last component from S, and also return it in a static buffer. */ - -static char * -StripLast (s) - register char *s; -{ - static char buf[BSIZE]; - register char *s1; - - for (s1 = s + strlen (s); s1 > s && *s1 != '/'; s1--) - ; - strcpy (buf, s1 + (*s1 == '/')); - *s1 = 0; - - return buf; -} - - -/* Copy first path element from B to A, removing it from B. */ - -static void -CopyFirst (a, b) - register char *a; - char *b; -{ - register int length = strlen (a); - - if (length > 0 && a[length - 1] != '/') { - a[length] = '/'; - a[length + 1] = 0; - } - strcat (a, StripFirst (b)); -} - -/* Returns NULL on error. Prints intermediate results if global - `ll_verbose' is nonzero. */ - -#define EX(s) (strlen (s) && strcmp (s, "/") ? "/" : "") -#define EXPOS EX(post) -#define EXPRE EX(pre) - -static char * -expand_symlinks (s) - char *s; -{ - static char pre[BSIZE]; /* return value */ - char post[BSIZE], sym[BSIZE], tmp[BSIZE], before[BSIZE]; - char *cp; - char a; - struct stat st; - int done; - - /* Check for symlink loops. It's difficult to check for all the - possibilities ourselves, so let the kernel do it. And make it - conditional so that people can see where the infinite loop is - being caused (see engtools#1536). */ - if (!ll_loop) { - FILE *f = fopen (s, "r"); - if (!f && errno == ELOOP) { - /* Not worried about other errors, we'll get to them in due course. */ - perror (s); - return NULL; - } - if (f) fclose (f); - } - - strcpy (post, s); - strcpy (pre, ""); - - while (strlen (post) != 0) { - CopyFirst (pre, post); - - if (lstat (pre, &st) != 0) { - fprintf (stderr, "lstat(%s) failed ...\n", pre); - perror (pre); - return NULL; - } - - if (S_ISLNK (st.st_mode)) { - ReadSymLink (pre, sym); - - if (!strncmp (sym, "/", 1)) { - if (ll_verbose) - printf ("[%s]%s%s -> [%s]%s%s\n", pre, EXPOS, post, sym, EXPOS,post); - strcpy (pre, ""); - - } else { - a = pre[0]; /* handle links through the root */ - strcpy (tmp, StripLast (pre)); - if (!strlen (pre) && a == '/') - strcpy (pre, "/"); - - if (ll_verbose) { - sprintf (before, "%s%s[%s]%s%s", pre, EXPRE, tmp, EXPOS, post); - printf ("%s -> %s%s[%s]%s%s\n", before, pre, EXPRE, sym, EXPOS,post); - } - - /* Strip "../" path elements from the front of sym; print - new result if there were any such elements. */ - done = 0; - a = pre[0]; /* handle links through the root */ - while (!strncmp (sym, "..", 2) - && (sym[2] == 0 || sym[2] == '/') - && strlen (pre) != 0 - && strcmp (pre, ".") - && strcmp (pre, "..") - && (strlen (pre) < 3 - || strcmp (pre + strlen (pre) - 3, "/.."))) { - done = 1; - StripFirst (sym); - StripLast (pre); - } - - if (done && ll_verbose) { - for (cp = before; *cp;) - *cp++ = ' '; - if (strlen (sym)) - printf ("%s == %s%s%s%s%s\n", before, pre, EXPRE, sym, EXPOS,post); - else - printf ("%s == %s%s%s\n", before, pre, EXPOS, post); - } - if (!strlen (pre) && a == '/') - strcpy (pre, "/"); - } - - if (strlen (post) != 0 && strlen (sym) != 0) - strcat (sym, "/"); - - strcat (sym, post); - strcpy (post, sym); - } - } - - return pre; -} -#else /* not S_ISLNK */ -#define expand_symlinks(s) (s) -#endif /* not S_ISLNK */ - -/* Remove .'s and ..'s in DIR, to avoid problems with relative symlinks - as the program name, etc. This does not canonicalize symlinks. */ - -static string -remove_dots P1C(string, dir) -{ -#ifdef AMIGA - return dir; -#else - string c; - unsigned len; - string ret = (string) ""; /* We always reassign. */ - - for (c = kpse_filename_component (dir); c; - c = kpse_filename_component (NULL)) { - if (STREQ (c, ".")) { - /* If leading ., replace with cwd. Else ignore. */ - if (*ret == 0) { - ret = xgetcwd (); - } - - } else if (STREQ (c, "..")) { - /* If leading .., start with my_dirname (cwd). Else remove last - component from ret, if any. */ - if (*ret == 0) { - string dot = xgetcwd (); - ret = my_dirname (dot); - free (dot); - } else { - unsigned last; - for (last = strlen (ret); - last > (NAME_BEGINS_WITH_DEVICE (ret) ? 2 : 0); - last--) { - if (IS_DIR_SEP (ret[last - 1])) { - /* If we have `/../', that's the same as `/'. */ - if (last > 1) { - ret[last] = 0; - } - break; - } - } - } - - } else { - /* Not . or ..; just append. Include a directory separator unless - our string already ends with one. This also changes all directory - separators into the canonical DIR_SEP_STRING. */ - string temp; - len = strlen (ret); - temp = concat3 (ret, ((len > 0 && ret[len - 1] == DIR_SEP) - || (NAME_BEGINS_WITH_DEVICE (c) && *ret == 0)) - ? "" : DIR_SEP_STRING, - c); - if (*ret) - free (ret); - ret = temp; - } - } - - /* Remove a trailing /, just in case it snuck in. */ - len = strlen (ret); - if (len > 0 && ret[len - 1] == DIR_SEP) { - ret[len - 1] = 0; - } - - return ret; -#endif /* not AMIGA */ -} - -/* Return directory ARGV0 comes from. Check PATH if ARGV0 is not - absolute. */ - -static string -selfdir P1C(const_string, argv0) -{ - string ret = NULL; - string self = NULL; - - if (kpse_absolute_p (argv0, true)) { - self = xstrdup (argv0); - } else { -#ifdef AMIGA -#include <dos.h> -#include <proto/dos.h> -#include <proto/exec.h> - BPTR lock; - struct DosLibrary *DOSBase - = (struct DosLibrary *) OpenLibrary ("dos.library", 0L); - assert (DOSBase); - - self = xmalloc (BUFSIZ); - lock = findpath (argv0); - if (lock != ((BPTR) -1)) { - if (getpath (lock, self) == -1) { - *self = '\0'; - } else { - strcat (self,DIR_SEP_STRING); - strcat (self,argv0); - } - UnLock (lock); - } - CloseLibrary((struct Library *) DOSBase); -#else /* not AMIGA */ - string elt; - struct stat s; - - /* Have to check PATH. But don't call kpse_path_search since we don't - want to search any ls-R's or do anything special with //'s. */ - for (elt = kpse_path_element (getenv ("PATH")); !self && elt; - elt = kpse_path_element (NULL)) { - string name = concat3 (elt, DIR_SEP_STRING, argv0); - - /* In order to do this perfectly, we'd have to check the owner bits only - if we are the file owner, and the group bits only if we belong - to the file group. That's a lot of work, though, and it's not - likely that kpathsea will ever be used with a program that's - only executable by some classes and not others. See the - `file_status' function in execute_cmd.c in bash for what's - necessary if we were to do it right. */ - if (stat (name, &s) == 0 && s.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) { - /* Do not stop at directories. */ - if (!S_ISDIR(s.st_mode)) - self = name; - } - } -#endif /* not AMIGA */ - } - - /* If argv0 is somehow dir/exename, `self' will still be NULL. */ - if (!self) - self = concat3 (".", DIR_SEP_STRING, argv0); - - ret = my_dirname (remove_dots (expand_symlinks (self))); - - free (self); - - return ret; -} -#endif /* not WIN32 */ - -void -kpse_set_program_name P2C(const_string, argv0, const_string, progname) -{ - string ext, sdir, sdir_parent, sdir_grandparent; - string s = getenv ("KPATHSEA_DEBUG"); -#ifdef WIN32 - string debug_output = getenv("KPATHSEA_DEBUG_OUTPUT"); - int err, olderr; -#endif - - /* Set debugging stuff first, in case we end up doing debuggable stuff - during this initialization. */ - if (s) { - kpathsea_debug |= atoi (s); - } - -#ifndef HAVE_PROGRAM_INVOCATION_NAME -#if defined(WIN32) - /* redirect stderr to debug_output. Easier to send logfiles. */ - if (debug_output) { - if ((err = _open(debug_output, _O_CREAT | _O_TRUNC | _O_RDWR, - _S_IREAD | _S_IWRITE)) == -1) { - WARNING1("Can't open %s for stderr redirection!\n", debug_output); - perror(debug_output); - } else if ((olderr = _dup(fileno(stderr))) == -1) { - WARNING("Can't dup() stderr!\n"); - close(err); - } else if (_dup2(err, fileno(stderr)) == -1) { - WARNING1("Can't redirect stderr to %s!\n", debug_output); - close(olderr); - close(err); - } else { - close(err); - } - } - /* Win95 always gives the short filename for argv0, not the long one. - There is only this way to catch it. It makes all the selfdir stuff - useless for win32. */ - { - char path[PATH_MAX], *fp; - HANDLE hnd; - WIN32_FIND_DATA ffd; - - /* SearchPath() always gives back an absolute directory */ - if (SearchPath(NULL, argv0, ".exe", PATH_MAX, path, &fp) == 0) - FATAL1("Can't determine where the executable %s is.\n", argv0); - if ((hnd = FindFirstFile(path, &ffd)) == NULL) - FATAL1("The following path points to an invalid file : %s\n", path); - /* slashify the dirname */ - for (fp = path; fp && *fp; fp++) - if (IS_DIR_SEP(*fp)) *fp = DIR_SEP; - /* sdir will be the directory where the executable resides, ie: c:/TeX/bin */ - sdir = my_dirname(path); - program_invocation_name = xstrdup(ffd.cFileName); - } - -#elif defined(__DJGPP__) - - /* DJGPP programs support long filenames on Windows 95, but ARGV0 there - is always made with the short 8+3 aliases of all the pathname elements. - If long names are supported, we need to convert that to a long name. - - All we really need is to call `_truename', but most of the code - below is required to deal with the special case of networked drives. */ - if (pathconf (argv0, _PC_NAME_MAX) > 12) { - char long_progname[PATH_MAX]; - - if (_truename (argv0, long_progname)) { - char *fp; - - if (long_progname[1] != ':') { - /* A complication: `_truename' returns network-specific string at - the beginning of `long_progname' when the program resides on a - networked drive, and DOS calls cannot grok such pathnames. We - need to convert the filesystem name back to a drive letter. */ - char rootname[PATH_MAX], rootdir[4]; - - if (argv0[0] && argv0[1] == ':') - rootdir[0] = argv0[0]; /* explicit drive in `argv0' */ - else - rootdir[0] = getdisk () + 'A'; - rootdir[1] = ':'; - rootdir[2] = '\\'; - rootdir[3] = '\0'; - if (_truename (rootdir, rootname)) { - /* Find out where `rootname' ends in `long_progname' and replace - it with the drive letter. */ - int root_len = strlen (rootname); - - if (IS_DIR_SEP (rootname[root_len - 1])) - root_len--; /* keep the trailing slash */ - long_progname[0] = rootdir[0]; - long_progname[1] = ':'; - memmove (long_progname + 2, long_progname + root_len, - strlen (long_progname + root_len) + 1); - } - } - - /* Convert everything to canonical form. */ - if (long_progname[0] >= 'A' && long_progname[0] <= 'Z') - long_progname[0] += 'a' - 'A'; /* make drive lower case, for beauty */ - for (fp = long_progname; *fp; fp++) - if (IS_DIR_SEP (*fp)) - *fp = DIR_SEP; - - program_invocation_name = xstrdup (long_progname); - } - else - /* If `_truename' failed, God help them, because we won't... */ - program_invocation_name = xstrdup (argv0); - } - else - program_invocation_name = xstrdup (argv0); - -#else /* !WIN32 && !__DJGPP__ */ - - program_invocation_name = xstrdup (argv0); - -#endif -#endif /* not HAVE_PROGRAM_INVOCATION_NAME */ - - /* We need to find SELFAUTOLOC *before* removing the ".exe" suffix from - the program_name, otherwise the PATH search inside selfdir will fail, - since `prog' doesn't exists as a file, there's `prog.exe' instead. */ -#ifndef WIN32 - sdir = selfdir (program_invocation_name); -#endif - /* SELFAUTODIR is actually the parent of the invocation directory, - and SELFAUTOPARENT the grandparent. This is how teTeX did it. */ - xputenv ("SELFAUTOLOC", sdir); - sdir_parent = my_dirname (sdir); - xputenv ("SELFAUTODIR", sdir_parent); - sdir_grandparent = my_dirname (sdir_parent); - xputenv ("SELFAUTOPARENT", sdir_grandparent); - - free (sdir); - free (sdir_parent); - free (sdir_grandparent); - -#ifndef HAVE_PROGRAM_INVOCATION_NAME - program_invocation_short_name = (string)basename (program_invocation_name); -#endif - - if (progname) { - kpse_program_name = xstrdup (progname); - } else { - /* If configured --enable-shared and running from the build directory - with the wrapper scripts (e.g., for make check), the binaries will - be named foo.exe instead of foo. Or possibly if we're running on a - DOSISH system. */ - ext = find_suffix (program_invocation_short_name); - if (ext && FILESTRCASEEQ (ext, "exe")) { - kpse_program_name = remove_suffix (program_invocation_short_name); - } else { - kpse_program_name = xstrdup (program_invocation_short_name); - } - } -} - -/* This function is deprecated, because when we pretend to have a different - name it will look for _that_ name in the PATH if program_invocation_name - is not defined. */ -void -kpse_set_progname P1C(const_string, argv0) -{ - kpse_set_program_name (argv0, NULL); -} - -#ifdef TEST -void -main (int argc, char **argv) -{ - puts (remove_dots ("/w/kpathsea")); - puts (remove_dots ("/w//kpathsea")); - puts (remove_dots ("/w/./kpathsea")); - puts (remove_dots (".")); - puts (remove_dots ("./")); - puts (remove_dots ("./.")); - puts (remove_dots ("../kpathsea")); - puts (remove_dots ("/../w/kpathsea")); - puts (remove_dots ("/../w/kpathsea/.")); -} -/* -Local variables: -standalone-compile-command: "gcc -g -I. -I.. -DTEST progname.c STATIC/libkpathsea.a" -End: -*/ -#endif /* TEST */
deleted file mode 100644 --- a/kpathsea/progname.h +++ /dev/null @@ -1,52 +0,0 @@ -/* progname.h: Declarations for argv[0] equivalents. - -Copyright (C) 1994, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_PROGNAME_H -#define KPATHSEA_PROGNAME_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -extern DllImport string program_invocation_name; -extern DllImport string program_invocation_short_name; -extern DllImport string kpse_program_name; - -/* Set the first two variables above (if they're not predefined) to a copy - of ARGV0 and everything in ARGV0 after the last directory separator, - respectively. Set kpse_program_name to a copy of PROGNAME or the - or the value of program_invocation_short_name if PROGNAME is NULL. - This function also determines the AUTO* variables. */ - -extern void kpse_set_program_name P2H(const_string argv0, - const_string progname); - -/* See also `kpse_reset_program_name' which is defined in tex-file.c - - That function is to be used to set kpse_program_name to a different - value. It clears the path searching information, to ensure that - the search paths are appropriate to the new name. */ - -/* DEPRECATED - Set first two variables above (if they're not predefined) to a copy of - ARGV0 and everything in ARGV0 after the last directory separator, - respectively. kpse_program_name is _always_ set to a copy of everything - in ARGV0 after the last directory separator. */ - -extern void kpse_set_progname P1H(const_string argv0); - -#endif /* not KPATHSEA_PROGNAME_H */
deleted file mode 100644 --- a/kpathsea/putenv.c +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************/ -/* */ -/* putenv(3) */ -/* */ -/* Change or add an environment entry */ -/* */ -/****************************************************************/ -/* origination 1987-Oct-7 T. Holm */ -/****************************************************************/ - -/* -Path: hoptoad!pacbell!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm -From: tholm@uvicctr.UUCP (Terrence W. Holm) -Newsgroups: comp.os.minix -Subject: putenv(3) -Message-ID: <395@uvicctr.UUCP> -Date: 5 May 88 06:40:52 GMT -Organization: University of Victoria, Victoria B.C. Canada - -EFTH Minix report #2 - May 1988 - putenv(3) - -This is an implementation of putenv(3) that we -wrote for Minix. Please consider this a public -domain program. -*/ - -#define NULL 0 -#define PSIZE sizeof(char *) - -extern char **environ; - -char *strchr(); -char *malloc(); - -/****************************************************************/ -/* */ -/* int */ -/* putenv( entry ) */ -/* */ -/* The "entry" should follow the form */ -/* "NAME=VALUE". This routine will search the */ -/* user environment for "NAME" and replace its */ -/* value with "VALUE". */ -/* */ -/* Note that "entry" is not copied, it is used */ -/* as the environment entry. This means that it */ -/* must not be unallocated or otherwise modifed */ -/* by the caller, unless it is replaced by a */ -/* subsequent putenv(). */ -/* */ -/* If the name is not found in the environment, */ -/* then a new vector of pointers is allocated, */ -/* "entry" is put at the end and the global */ -/* variable "environ" is updated. */ -/* */ -/* This function normally returns 0, but -1 */ -/* is returned if it can not allocate enough */ -/* space using malloc(3), or "entry" does not */ -/* contain a '='. */ -/* */ -/****************************************************************/ - - -int -putenv( entry ) - char *entry; -{ - unsigned length; - unsigned size; - char *temp; - char **p; - char **new_environ; - - /* Find the length of the "NAME=" */ - - temp = strchr(entry,'='); - if ( temp == 0 ) - return( -1 ); - - length = (unsigned) (temp - entry + 1); - - - /* Scan through the environment looking for "NAME=" */ - - for ( p=environ; *p != 0 ; p++ ) - if ( strncmp( entry, *p, length ) == 0 ) - { - *p = entry; - return( 0 ); - } - - - /* The name was not found, build a bigger environment */ - - size = p - environ; - - new_environ = (char **) malloc( (size+2)*PSIZE ); - - if ( new_environ == (char **) NULL ) - return( -1 ); - - memcpy ((char *) new_environ, (char *) environ, size*PSIZE ); - - new_environ[size] = entry; - new_environ[size+1] = NULL; - - environ = new_environ; - - return(0); -}
deleted file mode 100644 --- a/kpathsea/readable.c +++ /dev/null @@ -1,82 +0,0 @@ -/* readable.c: check if a filename is a readable non-directory file. - -Copyright (C) 1993, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> -#include <kpathsea/c-stat.h> -#include <kpathsea/readable.h> -#include <kpathsea/tex-hush.h> -#include <kpathsea/truncate.h> - - -/* If access can read FN, run stat (assigning to stat buffer ST) and - check that fn is not a directory. Don't check for just being a - regular file, as it is potentially useful to read fifo's or some - kinds of devices. */ - -#ifdef __DJGPP__ -/* `stat' is way too expensive for such a simple job. */ -#define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) -#elif WIN32 -#define READABLE(fn, st) \ - (GetFileAttributes(fn) != 0xFFFFFFFF && \ - !(GetFileAttributes(fn) & FILE_ATTRIBUTE_DIRECTORY)) -#else -#define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) -#endif - -/* POSIX invented the brain-damage of not necessarily truncating - filename components; the system's behavior is defined by the value of - the symbol _POSIX_NO_TRUNC, but you can't change it dynamically! - - Generic const return warning. See extend-fname.c. */ - -string -kpse_readable_file P1C(const_string, name) -{ - struct stat st; - string ret; - - if (READABLE (name, st)) { - ret = (string) name; - -#ifdef ENAMETOOLONG - } else if (errno == ENAMETOOLONG) { - ret = kpse_truncate_filename (name); - - /* Perhaps some other error will occur with the truncated name, so - let's call access again. */ - if (!READABLE (ret, st)) - { /* Failed. */ - if (ret != name) free (ret); - ret = NULL; - } -#endif /* ENAMETOOLONG */ - - } else { /* Some other error. */ - if (errno == EACCES) { /* Maybe warn them if permissions are bad. */ - if (!kpse_tex_hush ("readable")) { - perror (name); - } - } - ret = NULL; - } - - return ret; -}
deleted file mode 100644 --- a/kpathsea/readable.h +++ /dev/null @@ -1,31 +0,0 @@ -/* readable.h: Is a file readable? - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_READABLE_H -#define KPATHSEA_READABLE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* If NAME is readable and is a regular file, return it. If the error is - ENAMETOOLONG, truncate any too-long path components, and if the - result is a readable file, return that. Otherwise return NULL. */ - -extern string kpse_readable_file P1H(const_string name); - -#endif /* not KPATHSEA_READABLE_H */
deleted file mode 100644 --- a/kpathsea/readlink.c +++ /dev/null @@ -1,78 +0,0 @@ -/* readlink -- obtain contents of symlink. - Copyright (C) 1998 Olaf Weber. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include <kpathsea/config.h> -#include <kpathsea/c-pathmx.h> -#include <kpathsea/c-unistd.h> -#include <kpathsea/c-stat.h> - -#ifdef WIN32 -#include <string.h> -#endif - -/* - * readlink name - * Returns 0 if name exists and is a symlink, 1 otherwise. The contents - * of the link are printed on standard output. - */ - -int main (argc, argv) - int argc; - char *argv[]; -{ -#ifdef S_ISLNK - int status; - char path[PATH_MAX]; -#endif - - if (argc > 1 && strcmp (argv[1], "--help") == 0) { - printf("Usage: %s FILE\n\ - If FILE exists and is a symlink, print the contents of the link and\n\ - exit successfully. Otherwise print nothing and fail.\n\ -\n\ ---help display this help and exit\n\ ---version output version information and exit\n\n", argv[0]); - fputs ("Email bug reports to tex-k@mail.tug.org.\n", stdout); - exit(0); - } else if (argc > 1 && strcmp (argv[1], "--version") == 0) { - printf ("%s (%s)\n\ -Copyright (C) 1998 Olaf Weber.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU General Public License\n\ -For more information about these matters, see the file named COPYING.\n\ -Primary author of %s: Olaf Weber.\n", -argv[0], KPSEVERSION, argv[0]); - exit (0); - } - - /* insist on exactly one arg */ - if (argc != 2) { - fprintf(stderr, "%s: Need exactly one argument.\n\ -Try `access --help' for more information.\n", argv[0]); - exit(1); - } - -#ifdef S_ISLNK - status = readlink(argv[1], path, PATH_MAX); - if (status != -1) { - printf("%.*s\n", status, path); - return 0; - } -#endif - return 1; -}
deleted file mode 100644 --- a/kpathsea/readlink.man +++ /dev/null @@ -1,48 +0,0 @@ -.TH READLINK 1 "4 January 1998" "Kpathsea @VERSION@" -.\"===================================================================== -.if n .ds MP MetaPost -.if t .ds MP MetaPost -.if n .ds MF Metafont -.if t .ds MF M\s-2ETAFONT\s0 -.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP -.if n .ds TX TeX -.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP\" for troff -.el .ds OX TeX\" for nroff -.\" the same but obliqued -.\" BX definition must follow TX so BX can use TX -.if t .ds BX \fRB\s-2IB\s0\fP\*(TX -.if n .ds BX BibTeX -.\" LX definition must follow TX so LX can use TX -.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX -.if n .ds LX LaTeX -.\"===================================================================== -.SH NAME -readlink \- print contents of symbolic link -.SH SYNOPSIS -.B readlink -.I file -.\"===================================================================== -.SH DESCRIPTION -If -.I file -is a symbolic link, print its contents (what it links to), and exit -successfully. Exit with a failure otherwise. -.PP -On systems that do not support symbolic links, -.B readlink -will always fail. -.\"===================================================================== -.SH OPTIONS -.B readlink -accepts the following additional options: -.TP -.B --help -.rb -Print help message and exit. -.TP -.B --version -.rb -Print version information and exit. -.\"===================================================================== -.SH "SEE ALSO" -.BR readlink (2)
deleted file mode 100644 --- a/kpathsea/rm-suffix.c +++ /dev/null @@ -1,42 +0,0 @@ -/* rm-suffix.c: remove any suffix. - -Copyright (C) 1992, 93, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -/* Generic const warning -- see extend-fname.c. */ - -string -remove_suffix P1C(const_string, s) -{ - string ret; - const_string suffix = find_suffix (s); - - if (suffix) - { - /* Back up to before the dot. */ - suffix--; - ret = (string) xmalloc (suffix - s + 1); - strncpy (ret, s, suffix - s); - ret[suffix - s] = 0; - } - else - ret = (string) s; - - return ret; -}
deleted file mode 100644 --- a/kpathsea/stamp-auto.in +++ /dev/null @@ -1,1 +0,0 @@ -Mon Mar 9 07:26:52 CET 1998
deleted file mode 100644 --- a/kpathsea/str-list.c +++ /dev/null @@ -1,75 +0,0 @@ -/* str-list.c: define routines for string lists. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/str-list.h> - - -/* See the .h file for comments. */ - - -str_list_type -str_list_init P1H(void) -{ - str_list_type ret; - - STR_LIST_LENGTH (ret) = 0; - STR_LIST (ret) = NULL; - - return ret; -} - - -void -str_list_add P2C(str_list_type *, l, string, s) -{ - STR_LIST_LENGTH (*l)++; - XRETALLOC (STR_LIST (*l), STR_LIST_LENGTH (*l), string); - STR_LIST_LAST_ELT (*l) = s; -} - - -/* May as well save some reallocations and do everything in a chunk - instead of calling str_list_add on each element. */ - -void -str_list_concat P2C(str_list_type *, target, str_list_type, more) -{ - unsigned e; - unsigned prev_len = STR_LIST_LENGTH (*target); - - STR_LIST_LENGTH (*target) += STR_LIST_LENGTH (more); - XRETALLOC (STR_LIST (*target), STR_LIST_LENGTH (*target), string); - - for (e = 0; e < STR_LIST_LENGTH (more); e++) - STR_LIST_ELT (*target, prev_len + e) = STR_LIST_ELT (more, e); -} - - -/* Free the list (but not the elements within it). */ - -void -str_list_free P1C(str_list_type *, l) -{ - if (STR_LIST (*l)) - { - free (STR_LIST (*l)); - STR_LIST (*l) = NULL; - } -}
deleted file mode 100644 --- a/kpathsea/str-list.h +++ /dev/null @@ -1,54 +0,0 @@ -/* str-list.h: Declarations for string lists. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_STR_LIST_H -#define KPATHSEA_STR_LIST_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* Lists of strings; used for, e.g., directory lists. */ - -typedef struct -{ - unsigned length; - string *list; -} str_list_type; - -#define STR_LIST_LENGTH(l) ((l).length) -#define STR_LIST(l) ((l).list) -#define STR_LIST_ELT(l, n) STR_LIST (l)[n] -#define STR_LIST_LAST_ELT(l) STR_LIST_ELT (l, STR_LIST_LENGTH (l) - 1) - -/* Return a new, empty, list. */ -extern str_list_type str_list_init P1H(void); - -/* Append the string S to the list L. It's up to the caller to not - deallocate S; we don't copy it. Also up to the caller to terminate - the list with a null entry. */ -extern void str_list_add P2H(str_list_type *l, string s); - -/* Append all the elements from MORE to TARGET. */ -extern void str_list_concat P2H(str_list_type * target, str_list_type more); - -/* Free the space for the list elements (but not the list elements - themselves). */ -extern void str_list_free P1H(str_list_type *l); - -#endif /* not KPATHSEA_STR_LIST_H */
deleted file mode 100644 --- a/kpathsea/str-llist.c +++ /dev/null @@ -1,94 +0,0 @@ -/* str-llist.c: Implementation of a linked list of strings. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/str-llist.h> - - -/* Add the new string STR to the end of the list L. */ - -void -str_llist_add P2C(str_llist_type *, l, string, str) -{ - str_llist_elt_type *e; - str_llist_elt_type *new_elt = XTALLOC1 (str_llist_elt_type); - - /* The new element will be at the end of the list. */ - STR_LLIST (*new_elt) = str; - STR_LLIST_MOVED (*new_elt) = false; - STR_LLIST_NEXT (*new_elt) = NULL; - - /* Find the current end of the list. */ - for (e = *l; e && STR_LLIST_NEXT (*e); e = STR_LLIST_NEXT (*e)) - ; - - if (!e) - *l = new_elt; - else - STR_LLIST_NEXT (*e) = new_elt; -} - -/* Move an element towards the top. The idea is that when a file is - found in a given directory, later files will likely be in that same - directory, and looking for the file in all the directories in between - is thus a waste. */ - -void -str_llist_float P2C(str_llist_type *, l, str_llist_elt_type *, mover) -{ - str_llist_elt_type *last_moved, *unmoved; - - /* If we've already moved this element, never mind. */ - if (STR_LLIST_MOVED (*mover)) - return; - - /* Find the first unmoved element (to insert before). We're - guaranteed this will terminate, since MOVER itself is currently - unmoved, and it must be in L (by hypothesis). */ - for (last_moved = NULL, unmoved = *l; STR_LLIST_MOVED (*unmoved); - last_moved = unmoved, unmoved = STR_LLIST_NEXT (*unmoved)) - ; - - /* If we are the first unmoved element, nothing to relink. */ - if (unmoved != mover) - { /* Remember `mover's current successor, so we can relink `mover's - predecessor to it. */ - str_llist_elt_type *before_mover; - str_llist_elt_type *after_mover = STR_LLIST_NEXT (*mover); - - /* Find `mover's predecessor. */ - for (before_mover = unmoved; STR_LLIST_NEXT (*before_mover) != mover; - before_mover = STR_LLIST_NEXT (*before_mover)) - ; - - /* `before_mover' now links to `after_mover'. */ - STR_LLIST_NEXT (*before_mover) = after_mover; - - /* Insert `mover' before `unmoved' and after `last_moved' (or at - the head of the list). */ - STR_LLIST_NEXT (*mover) = unmoved; - if (!last_moved) - *l = mover; - else - STR_LLIST_NEXT (*last_moved) = mover; - } - - /* We've moved it. */ - STR_LLIST_MOVED (*mover) = true; -}
deleted file mode 100644 --- a/kpathsea/str-llist.h +++ /dev/null @@ -1,56 +0,0 @@ -/* str-llist.h: A linked list of strings, - -It's pretty disgusting that both this and str-list exist; the reason is -that C cannot express iterators very well, and I don't want to change -all the for loops right now. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef STR_LLIST_H -#define STR_LLIST_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* It's a little bizarre to be using the same type for the list and the - elements of the list, but no reason not to in this case, I think -- - we never need a NULL string in the middle of the list, and an extra - NULL/NULL element always at the end is inconsequential. */ - -struct str_llist_elt -{ - string str; - boolean moved; - struct str_llist_elt *next; -}; -typedef struct str_llist_elt str_llist_elt_type; -typedef struct str_llist_elt *str_llist_type; - -#define STR_LLIST(sl) ((sl).str) -#define STR_LLIST_MOVED(sl) ((sl).moved) -#define STR_LLIST_NEXT(sl) ((sl).next) - - -/* Add the new string E to the end of the list L. */ -extern void str_llist_add P2H(str_llist_type *l, string e); - -/* Reorganize L so that E is below only other elements that have already - been moved. Set `moved' member for E. */ -extern void str_llist_float P2H(str_llist_type *l, str_llist_elt_type *e); - -#endif /* not STR_LLIST_H */
deleted file mode 100644 --- a/kpathsea/strcasecmp.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. -This file was part of the GNU C Library. Modified by kb@mail.tug.org to -avoid glibc-isms. - -This file is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This file is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file COPYING.LIB. If not, write -to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <ctype.h> - -/* Compare S1 and S2, ignoring case, returning less than, equal to or - greater than zero if S1 is lexiographically less than, - equal to or greater than S2. */ -int -strcasecmp (s1, s2) - const char *s1; - const char *s2; -{ - register const unsigned char *p1 = (const unsigned char *) s1; - register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - if (p1 == p2) - return 0; - - do - { - c1 = tolower (*p1++); - c2 = tolower (*p2++); - if (c1 == '\0') - break; - } - while (c1 == c2); - - return c1 - c2; -} - -int -strncasecmp (s1, s2, n) - const char *s1; - const char *s2; - unsigned n; -{ - register const unsigned char *p1 = (const unsigned char *) s1; - register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - if (p1 == p2 || n == 0) - return 0; - - do - { - c1 = tolower (*p1++); - c2 = tolower (*p2++); - if (c1 == '\0' || c1 != c2) - return c1 - c2; - } while (--n > 0); - - return c1 - c2; -}
deleted file mode 100644 --- a/kpathsea/strstr.c +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (C) 1994, 95 Free Software Foundation, Inc. -This file was part of the GNU C Library. Modified by kb@mail.tug.org. - -This file is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This file is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file COPYING.LIB. If not, write -to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* - * My personal strstr() implementation that beats most other algorithms. - * Until someone tells me otherwise, I assume that this is the - * fastest implementation of strstr() in C. - * I deliberately chose not to comment it. You should have at least - * as much fun trying to understand it, as I had to write it :-). - * - * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -typedef unsigned chartype; - -char * -strstr (phaystack, pneedle) - const char *phaystack; - const char *pneedle; -{ - register const unsigned char *haystack, *needle; - register chartype b, c; - - haystack = (const unsigned char *) phaystack; - needle = (const unsigned char *) pneedle; - - b = *needle; - if (b != '\0') - { - haystack--; /* possible ANSI violation */ - do - { - c = *++haystack; - if (c == '\0') - goto ret0; - } - while (c != b); - - c = *++needle; - if (c == '\0') - goto foundneedle; - ++needle; - goto jin; - - for (;;) - { - register chartype a; - register const unsigned char *rhaystack, *rneedle; - - do - { - a = *++haystack; - if (a == '\0') - goto ret0; - if (a == b) - break; - a = *++haystack; - if (a == '\0') - goto ret0; -shloop: } - while (a != b); - -jin: a = *++haystack; - if (a == '\0') - goto ret0; - - if (a != c) - goto shloop; - - rhaystack = haystack-- + 1; - rneedle = needle; - a = *rneedle; - - if (*rhaystack == a) - do - { - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = *++needle; - if (*rhaystack != a) - break; - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = *++needle; - } - while (*rhaystack == a); - - needle = rneedle; /* took the register-poor aproach */ - - if (a == '\0') - break; - } - } -foundneedle: - return (char*) haystack; -ret0: - return 0; -}
deleted file mode 100644 --- a/kpathsea/strtol.c +++ /dev/null @@ -1,291 +0,0 @@ -/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. - -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place, -Suite 330, Boston, MA 02111 USA. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#ifdef _LIBC -# define USE_NUMBER_GROUPING -# define STDC_HEADERS -# define HAVE_LIMITS_H -#endif - -#include <ctype.h> -#include <errno.h> -#ifndef errno -extern int errno; -#endif - -#ifdef HAVE_LIMITS_H -# include <limits.h> -#endif - -#ifdef STDC_HEADERS -# include <stddef.h> -# include <stdlib.h> -#else -# ifndef NULL -# define NULL 0 -# endif -#endif - -#ifdef USE_NUMBER_GROUPING -# include "../locale/localeinfo.h" -#endif - -/* Nonzero if we are defining `strtoul' or `strtouq', operating on - unsigned integers. */ -#ifndef UNSIGNED -# define UNSIGNED 0 -# define INT LONG int -#else -# define strtol strtoul -# define INT unsigned LONG int -#endif - -/* If QUAD is defined, we are defining `strtoq' or `strtouq', - operating on `long long int's. */ -#ifdef QUAD -# if UNSIGNED -# define strtoul strtouq -# else -# define strtol strtoq -# endif -# define LONG long long -# undef LONG_MIN -# define LONG_MIN LONG_LONG_MIN -# undef LONG_MAX -# define LONG_MAX LONG_LONG_MAX -# undef ULONG_MAX -# define ULONG_MAX ULONG_LONG_MAX -# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 - /* Work around gcc bug with using this constant. */ - static const unsigned long long int maxquad = ULONG_LONG_MAX; -# undef ULONG_MAX -# define ULONG_MAX maxquad -# endif -#else -# define LONG long -#endif - -#ifdef __STDC__ -# define INTERNAL(x) INTERNAL1(x) -# define INTERNAL1(x) __##x##_internal -#else -# define INTERNAL(x) __/**/x/**/_internal -#endif - -#ifdef USE_NUMBER_GROUPING -/* This file defines a function to check for correct grouping. */ -# include "grouping.h" -#endif - - -/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. - If BASE is 0 the base is determined by the presence of a leading - zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. - If BASE is < 2 or > 36, it is reset to 10. - If ENDPTR is not NULL, a pointer to the character after the last - one converted is stored in *ENDPTR. */ - -INT -INTERNAL (strtol) (nptr, endptr, base, group) - const char *nptr; - char **endptr; - int base; - int group; -{ - int negative; - register unsigned LONG int cutoff; - register unsigned int cutlim; - register unsigned LONG int i; - register const char *s; - register unsigned char c; - const char *save, *end; - int overflow; - -#ifdef USE_NUMBER_GROUPING - /* The thousands character of the current locale. */ - wchar_t thousands; - /* The numeric grouping specification of the current locale, - in the format described in <locale.h>. */ - const char *grouping; - - if (group) - { - grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); - if (*grouping <= 0 || *grouping == CHAR_MAX) - grouping = NULL; - else - { - /* Figure out the thousands separator character. */ - if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP), - strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0) - thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP); - if (thousands == L'\0') - grouping = NULL; - } - } - else - grouping = NULL; -#endif - - if (base < 0 || base == 1 || base > 36) - base = 10; - - s = nptr; - - /* Skip white space. */ - while (isspace (*s)) - ++s; - if (*s == '\0') - goto noconv; - - /* Check for a sign. */ - if (*s == '-') - { - negative = 1; - ++s; - } - else if (*s == '+') - { - negative = 0; - ++s; - } - else - negative = 0; - - if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X') - s += 2; - - /* If BASE is zero, figure it out ourselves. */ - if (base == 0) - if (*s == '0') - { - if (toupper (s[1]) == 'X') - { - s += 2; - base = 16; - } - else - base = 8; - } - else - base = 10; - - /* Save the pointer so we can check later if anything happened. */ - save = s; - -#ifdef USE_NUMBER_GROUPING - if (group) - { - /* Find the end of the digit string and check its grouping. */ - end = s; - for (c = *end; c != '\0'; c = *++end) - if (c != thousands && !isdigit (c) && - (!isalpha (c) || toupper (c) - 'A' + 10 >= base)) - break; - if (*s == thousands) - end = s; - else - end = correctly_grouped_prefix (s, end, thousands, grouping); - } - else -#endif - end = NULL; - - cutoff = ULONG_MAX / (unsigned LONG int) base; - cutlim = ULONG_MAX % (unsigned LONG int) base; - - overflow = 0; - i = 0; - for (c = *s; c != '\0'; c = *++s) - { - if (s == end) - break; - if (isdigit (c)) - c -= '0'; - else if (isalpha (c)) - c = toupper (c) - 'A' + 10; - else - break; - if (c >= base) - break; - /* Check for overflow. */ - if (i > cutoff || (i == cutoff && c > cutlim)) - overflow = 1; - else - { - i *= (unsigned LONG int) base; - i += c; - } - } - - /* Check if anything actually happened. */ - if (s == save) - goto noconv; - - /* Store in ENDPTR the address of one character - past the last character we converted. */ - if (endptr != NULL) - *endptr = (char *) s; - -#if !UNSIGNED - /* Check for a value that is within the range of - `unsigned LONG int', but outside the range of `LONG int'. */ - if (i > (negative ? - -(unsigned LONG int) LONG_MIN : (unsigned LONG int) LONG_MAX)) - overflow = 1; -#endif - - if (overflow) - { - errno = ERANGE; -#if UNSIGNED - return ULONG_MAX; -#else - return negative ? LONG_MIN : LONG_MAX; -#endif - } - - /* Return the result of the appropriate sign. */ - return (negative ? -i : i); - -noconv: - /* There was no number to convert. */ - if (endptr != NULL) - *endptr = (char *) nptr; - return 0L; -} - -/* External user entry point. */ - -#ifdef weak_symbol -weak_symbol (strtol) -#endif - -INT -strtol (nptr, endptr, base) - const char *nptr; - char **endptr; - int base; -{ - return INTERNAL (strtol) (nptr, endptr, base, 0); -}
deleted file mode 100644 --- a/kpathsea/systypes.h +++ /dev/null @@ -1,30 +0,0 @@ -/* c-systypes.h: include <sys/types.h>. It's too bad we need this file, - but some systems don't protect <sys/types.h> from multiple - inclusions, and I'm not willing to put up with that. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef C_SYSTYPES_H -#define C_SYSTYPES_H - -#include <sys/types.h> - -/* This is the symbol that X uses to determine if <sys/types.h> has been - read, so we define it. */ -#define __TYPES__ - -#endif /* not C_SYSTYPES_H */
deleted file mode 100644 --- a/kpathsea/tex-file.c +++ /dev/null @@ -1,767 +0,0 @@ -/* tex-file.c: high-level file searching by format. - -Copyright (C) 1993, 94, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-fopen.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-vararg.h> -#include <kpathsea/cnf.h> -#include <kpathsea/concatn.h> -#include <kpathsea/default.h> -#include <kpathsea/expand.h> -#include <kpathsea/fontmap.h> -#include <kpathsea/paths.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/tex-make.h> -#include <kpathsea/variable.h> - - -/* See tex-file.h. */ -const_string kpse_fallback_font = NULL; -const_string kpse_fallback_resolutions_string = NULL; -unsigned *kpse_fallback_resolutions = NULL; -kpse_format_info_type kpse_format_info[kpse_last_format]; - -/* These are not in the structure - because it's annoying to initialize lists in C. */ -#define GF_ENVS "GFFONTS", GLYPH_ENVS -#define PK_ENVS "PKFONTS", "TEXPKS", GLYPH_ENVS -#define GLYPH_ENVS "GLYPHFONTS", "TEXFONTS" -#define TFM_ENVS "TFMFONTS", "TEXFONTS" -#define AFM_ENVS "AFMFONTS" -#define BASE_ENVS "MFBASES", "TEXMFINI" -#define BIB_ENVS "BIBINPUTS", "TEXBIB" -#define BST_ENVS "BSTINPUTS" -#define CNF_ENVS "TEXMFCNF" -#define DB_ENVS "TEXMFDBS" -#define FMT_ENVS "TEXFORMATS", "TEXMFINI" -#define FONTMAP_ENVS "TEXFONTMAPS" -#define MEM_ENVS "MPMEMS", "TEXMFINI" -#define MF_ENVS "MFINPUTS" -#define MFPOOL_ENVS "MFPOOL", "TEXMFINI" -#define MFT_ENVS "MFTINPUTS" -#define MP_ENVS "MPINPUTS" -#define MPPOOL_ENVS "MPPOOL", "TEXMFINI" -#define MPSUPPORT_ENVS "MPSUPPORT" -#define OCP_ENVS "OCPINPUTS" -#define OFM_ENVS "OFMFONTS", "TEXFONTS" -#define OPL_ENVS "OPLFONTS", "TEXFONTS" -#define OTP_ENVS "OTPINPUTS" -#define OVF_ENVS "OVFFONTS", "TEXFONTS" -#define OVP_ENVS "OVPFONTS", "TEXFONTS" -#define PICT_ENVS "TEXPICTS", TEX_ENVS -#define TEX_ENVS "TEXINPUTS" -#define TEXDOC_ENVS "TEXDOCS" -#define TEXPOOL_ENVS "TEXPOOL", "TEXMFINI" -#define TEXSOURCE_ENVS "TEXSOURCES" -#define TEX_PS_HEADER_ENVS "TEXPSHEADERS", "PSHEADERS" -#define TROFF_FONT_ENVS "TRFONTS" -#define TYPE1_ENVS "T1FONTS", "T1INPUTS", TEX_PS_HEADER_ENVS -#define VF_ENVS "VFFONTS", "TEXFONTS" -#define DVIPS_CONFIG_ENVS "TEXCONFIG" -#define IST_ENVS "TEXINDEXSTYLE", "INDEXSTYLE" -#define TRUETYPE_ENVS "TTFONTS" -#define TYPE42_ENVS "T42FONTS" -#define WEB2C_ENVS "WEB2C" - -/* The compiled-in default list, DEFAULT_FONT_SIZES, is intended to be - set from the command line (presumably via the Makefile). */ - -#ifndef DEFAULT_FONT_SIZES -#define DEFAULT_FONT_SIZES "" -#endif - -void -kpse_init_fallback_resolutions P1C(string, envvar) -{ - string size, orig_size_list; - const_string size_var = ENVVAR (envvar, "TEXSIZES"); - string size_str = getenv (size_var); - unsigned *last_resort_sizes = NULL; - unsigned size_count = 0; - const_string default_sizes = kpse_fallback_resolutions_string - ? kpse_fallback_resolutions_string - : DEFAULT_FONT_SIZES; - string size_list = kpse_expand_default (size_str, default_sizes); - - orig_size_list = size_list; /* For error messages. */ - - /* Initialize the list of last-resort sizes. */ - for (size = kpse_path_element (size_list); size != NULL; - size = kpse_path_element (NULL)) - { - unsigned s; - if (! *size) /* Skip empty elements. */ - continue; - - s = atoi (size); - if (size_count && s < last_resort_sizes[size_count - 1]) { - WARNING1 ("kpathsea: last resort size %s not in ascending order, ignored", - size); - } else { - size_count++; - XRETALLOC (last_resort_sizes, size_count, unsigned); - last_resort_sizes[size_count - 1] = atoi (size); - } - } - - /* Add a zero to mark the end of the list. */ - size_count++; - XRETALLOC (last_resort_sizes, size_count, unsigned); - last_resort_sizes[size_count - 1] = 0; - - /* If we didn't expand anything, we won't have allocated anything. */ - if (size_str && size_list != size_str) - free (size_list); - - kpse_fallback_resolutions = last_resort_sizes; -} - -/* We should be able to set the program arguments in the same way. Not - to mention the path values themselves. */ - -void -kpse_set_program_enabled P3C(kpse_file_format_type, fmt, boolean, value, - kpse_src_type, level) -{ - kpse_format_info_type *f = &kpse_format_info[fmt]; - if (level >= f->program_enable_level) { - f->program_enabled_p = value; - f->program_enable_level = level; - } -} - - -/* Web2c and kpsewhich have command-line options to set this stuff. May - as well have a common place. */ - -void -kpse_maketex_option P2C(const_string, fmtname, boolean, value) -{ - kpse_file_format_type fmt; - - /* Trying to match up with the suffix lists unfortunately doesn't work - well, since that would require initializing the formats. */ - if (FILESTRCASEEQ (fmtname, "pk")) { - fmt = kpse_pk_format; - } else if (FILESTRCASEEQ (fmtname, "mf")) { - fmt = kpse_mf_format; - } else if (FILESTRCASEEQ (fmtname, "tex")) { - fmt = kpse_tex_format; - } else if (FILESTRCASEEQ (fmtname, "tfm")) { - fmt = kpse_tfm_format; - } else if (FILESTRCASEEQ (fmtname, "ofm")) { - fmt = kpse_ofm_format; - } else if (FILESTRCASEEQ (fmtname, "ocp")) { - fmt = kpse_ocp_format; - } - kpse_set_program_enabled (fmt, value, kpse_src_cmdline); -} - -/* Macro subroutines for `init_path'. TRY_ENV checks if an envvar ENAME - is set and non-null, and sets var to ENAME if so. */ -#define TRY_ENV(ename) do { \ - string evar = ename; \ -} while (0) - -/* And EXPAND_DEFAULT calls kpse_expand_default on try_path and the - present info->path. */ -#define EXPAND_DEFAULT(try_path, source_string) \ - if (try_path) { \ - info->raw_path = try_path; \ - info->path = kpse_expand_default (try_path, info->path); \ - info->path_source = source_string; \ - } - -/* Find the final search path to use for the format entry INFO, given - the compile-time default (DEFAULT_PATH), and the environment - variables to check (the remaining arguments, terminated with NULL). - We set the `path' and `path_source' members of INFO. The - `client_path' member must already be set upon entry. */ - -static void -init_path PVAR2C(kpse_format_info_type *, info, const_string, default_path, ap) -{ - string env_name; - string var = NULL; - - info->default_path = default_path; - - /* First envvar that's set to a nonempty value will exit the loop. If - none are set, we want the first cnf entry that matches. Find the - cnf entries simultaneously, to avoid having to go through envvar - list twice -- because of the PVAR?C macro, that would mean having - to create a str_list and then use it twice. Yuck. */ - while ((env_name = va_arg (ap, string)) != NULL) { - /* Since sh doesn't like envvar names with `.', check PATH_prog - rather than PATH.prog. */ - if (!var) { - string evar = concat3 (env_name, "_", kpse_program_name); - string env_value = getenv (evar); - if (env_value && *env_value) { - var = evar; - } else { - free (evar); - - /* Try simply PATH. */ - env_value = getenv (env_name); - if (env_value && *env_value) { - var = env_name; - } - } - } - - /* If we are initializing the cnf path, don't try to get any - values from the cnf files; that's infinite loop time. */ - if (!info->cnf_path && info != &kpse_format_info[kpse_cnf_format]) - info->cnf_path = kpse_cnf_get (env_name); - - if (var && info->cnf_path) - break; - } - va_end (ap); - - /* Expand any extra :'s. For each level, we replace an extra : with - the path at the next lower level. For example, an extra : in a - user-set envvar should be replaced with the path from the cnf file. - things are complicated because none of the levels above the very - bottom are guaranteed to exist. */ - - /* Assume we can reliably start with the compile-time default. */ - info->path = info->raw_path = info->default_path; - info->path_source = "compile-time paths.h"; - - EXPAND_DEFAULT (info->cnf_path, "texmf.cnf"); - EXPAND_DEFAULT (info->client_path, "program config file"); - if (var) - EXPAND_DEFAULT (getenv (var), concat (var, " environment variable")); - EXPAND_DEFAULT (info->override_path, "application override variable"); - info->path = kpse_brace_expand (info->path); -}} - - -/* Some file types have more than one suffix. */ - -static void -add_suffixes PVAR1C(const_string **, list, ap) -{ - const_string s; - unsigned count = 0; - - while ((s = va_arg (ap, string)) != NULL) { - count++; - XRETALLOC (*list, count + 1, const_string); - (*list)[count - 1] = s; - } - va_end (ap); - (*list)[count] = NULL; -}} - - -/* The path spec we are defining, one element of the global array. */ -#define FMT_INFO kpse_format_info[format] -/* Call add_suffixes. */ -#define SUFFIXES(args) add_suffixes(&FMT_INFO.suffix, args, NULL) -#define ALT_SUFFIXES(args) add_suffixes (&FMT_INFO.alt_suffix, args, NULL) - -/* Call `init_path', including appending the trailing NULL to the envvar - list. Also initialize the fields not needed in setting the path. */ -#define INIT_FORMAT(text, default_path, envs) \ - FMT_INFO.type = text; \ - init_path (&FMT_INFO, default_path, envs, NULL) - - -/* A few file types allow for runtime generation by an external program. - kpse_init_prog may have already initialized it (the `program' - member). Here we allow people to turn it off or on in the config - file, by setting the variable whose name is the uppercasified program - name to 0 or 1. */ - -static void -init_maketex P3C(kpse_file_format_type, fmt, const_string, dflt_prog, - const_string, args) -{ - kpse_format_info_type *f = &kpse_format_info[fmt]; - const_string prog = f->program ? f->program : dflt_prog; /* mktexpk */ - string PROG = uppercasify (prog); /* MKTEXPK */ - string progval = kpse_var_value (PROG); /* ENV/cnf{"MKTEXPK"} */ - - /* Doesn't hurt to always set this info. */ - f->program = prog; - f->program_args = args; - - if (progval && *progval) { - /* This might actually be from an environment variable value, but in - that case, we'll have previously set it from kpse_init_prog. */ - kpse_set_program_enabled (fmt, *progval == '1', kpse_src_client_cnf); - } - - free (PROG); -} - -/* We need this twice, so ... */ -#define MKTEXPK_ARGS \ - "--mfmode $MAKETEX_MODE --bdpi $MAKETEX_BASE_DPI --mag $MAKETEX_MAG --dpi $KPATHSEA_DPI" - -static string -remove_dbonly P1C(const_string, path) -{ - string ret = XTALLOC(strlen (path) + 1, char), q=ret; - const_string p=path; - boolean new_elt=true; - - while (*p) { - if (new_elt && *p && *p == '!' && *(p+1) == '!') - p += 2; - else { - new_elt = (*p == ENV_SEP); - *q++ = *p++; - } - } - *q = '\0'; - return(ret); -} - -/* Initialize everything for FORMAT. */ - -const_string -kpse_init_format P1C(kpse_file_format_type, format) -{ - /* If we get called twice, don't redo all the work. */ - if (FMT_INFO.path) - return FMT_INFO.path; - - switch (format) - { /* We might be able to avoid repeating `gf' or whatever so many - times with token pasting, but it doesn't seem worth it. */ - case kpse_gf_format: - INIT_FORMAT ("gf", DEFAULT_GFFONTS, GF_ENVS); - SUFFIXES ("gf"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_pk_format: - init_maketex (format, "mktexpk", MKTEXPK_ARGS); - INIT_FORMAT ("pk", DEFAULT_PKFONTS, PK_ENVS); - SUFFIXES ("pk"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_any_glyph_format: - init_maketex (format, "mktexpk", MKTEXPK_ARGS); - INIT_FORMAT ("bitmap font", DEFAULT_GLYPHFONTS, GLYPH_ENVS); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_tfm_format: - /* Must come before kpse_ofm_format. */ - init_maketex (format, "mktextfm", NULL); - INIT_FORMAT ("tfm", DEFAULT_TFMFONTS, TFM_ENVS); - SUFFIXES (".tfm"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_afm_format: - INIT_FORMAT ("afm", DEFAULT_AFMFONTS, AFM_ENVS); - SUFFIXES (".afm"); - break; - case kpse_base_format: - INIT_FORMAT ("base", DEFAULT_MFBASES, BASE_ENVS); - SUFFIXES (".base"); - FMT_INFO.binmode = true; - break; - case kpse_bib_format: - INIT_FORMAT ("bib", DEFAULT_BIBINPUTS, BIB_ENVS); - SUFFIXES (".bib"); - break; - case kpse_bst_format: - INIT_FORMAT ("bst", DEFAULT_BSTINPUTS, BST_ENVS); - SUFFIXES (".bst"); - break; - case kpse_cnf_format: - INIT_FORMAT ("cnf", DEFAULT_TEXMFCNF, CNF_ENVS); - SUFFIXES (".cnf"); - break; - case kpse_db_format: - INIT_FORMAT ("ls-R", DEFAULT_TEXMFDBS, DB_ENVS); - SUFFIXES ("ls-R"); - FMT_INFO.path = remove_dbonly (FMT_INFO.path); - break; - case kpse_fmt_format: - INIT_FORMAT ("fmt", DEFAULT_TEXFORMATS, FMT_ENVS); - SUFFIXES (".fmt"); -#define FMT_SUFFIXES ".efmt", ".efm" - ALT_SUFFIXES (FMT_SUFFIXES); - FMT_INFO.binmode = true; - break; - case kpse_fontmap_format: - INIT_FORMAT ("map", DEFAULT_TEXFONTMAPS, FONTMAP_ENVS); - SUFFIXES (".map"); - break; - case kpse_mem_format: - INIT_FORMAT ("mem", DEFAULT_MPMEMS, MEM_ENVS); - SUFFIXES (".mem"); - FMT_INFO.binmode = true; - break; - case kpse_mf_format: - init_maketex (format, "mktexmf", NULL); - INIT_FORMAT ("mf", DEFAULT_MFINPUTS, MF_ENVS); - SUFFIXES (".mf"); - break; - case kpse_mft_format: - INIT_FORMAT ("mft", DEFAULT_MFTINPUTS, MFT_ENVS); - SUFFIXES (".mft"); - break; - case kpse_mfpool_format: - INIT_FORMAT ("mfpool", DEFAULT_MFPOOL, MFPOOL_ENVS); - SUFFIXES (".pool"); - break; - case kpse_mp_format: - INIT_FORMAT ("mp", DEFAULT_MPINPUTS, MP_ENVS); - SUFFIXES (".mp"); - break; - case kpse_mppool_format: - INIT_FORMAT ("mppool", DEFAULT_MPPOOL, MPPOOL_ENVS); - SUFFIXES (".pool"); - break; - case kpse_mpsupport_format: - INIT_FORMAT ("MetaPost support", DEFAULT_MPSUPPORT, MPSUPPORT_ENVS); - break; - case kpse_ocp_format: - init_maketex (format, "mkocp", NULL); - INIT_FORMAT ("ocp", DEFAULT_OCPINPUTS, OCP_ENVS); - SUFFIXES (".ocp"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_ofm_format: - init_maketex (format, "mkofm", NULL); - INIT_FORMAT ("ofm", DEFAULT_OFMFONTS, OFM_ENVS); -#define OFM_SUFFIXES ".ofm", ".tfm" - SUFFIXES (OFM_SUFFIXES); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_opl_format: - INIT_FORMAT ("opl", DEFAULT_OPLFONTS, OPL_ENVS); - SUFFIXES (".opl"); - FMT_INFO.suffix_search_only = true; - break; - case kpse_otp_format: - INIT_FORMAT ("otp", DEFAULT_OTPINPUTS, OTP_ENVS); - SUFFIXES (".otp"); - FMT_INFO.suffix_search_only = true; - break; - case kpse_ovf_format: - INIT_FORMAT ("ovf", DEFAULT_OVFFONTS, OVF_ENVS); - SUFFIXES (".ovf"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_ovp_format: - INIT_FORMAT ("ovp", DEFAULT_OVPFONTS, OVP_ENVS); - SUFFIXES (".ovp"); - FMT_INFO.suffix_search_only = true; - break; - case kpse_pict_format: - INIT_FORMAT ("graphic/figure", DEFAULT_TEXINPUTS, PICT_ENVS); -#define PICT_SUFFIXES ".eps", ".epsi" - ALT_SUFFIXES (PICT_SUFFIXES); - FMT_INFO.binmode = true; - break; - case kpse_tex_format: - init_maketex (format, "mktextex", NULL); - INIT_FORMAT ("tex", DEFAULT_TEXINPUTS, TEX_ENVS); - SUFFIXES (".tex"); - /* We don't maintain a list of alternate TeX suffixes. Such a list - could never be complete. */ - break; - case kpse_tex_ps_header_format: - INIT_FORMAT ("PostScript header", DEFAULT_TEXPSHEADERS, - TEX_PS_HEADER_ENVS); -/* Unfortunately, dvipsk uses this format for type1 fonts. */ -#define TEXPSHEADER_SUFFIXES ".pro", ".enc" - ALT_SUFFIXES (TEXPSHEADER_SUFFIXES); - FMT_INFO.binmode = true; - break; - case kpse_texdoc_format: - INIT_FORMAT ("TeX system documentation", DEFAULT_TEXDOCS, TEXDOC_ENVS); - break; - case kpse_texpool_format: - INIT_FORMAT ("texpool", DEFAULT_TEXPOOL, TEXPOOL_ENVS); - SUFFIXES (".pool"); - break; - case kpse_texsource_format: - INIT_FORMAT ("TeX system sources", DEFAULT_TEXSOURCES, TEXSOURCE_ENVS); - break; - case kpse_troff_font_format: - INIT_FORMAT ("Troff fonts", DEFAULT_TRFONTS, TROFF_FONT_ENVS); - FMT_INFO.binmode = true; - break; - case kpse_type1_format: - INIT_FORMAT ("type1 fonts", DEFAULT_T1FONTS, TYPE1_ENVS); -#define TYPE1_SUFFIXES ".pfa", ".pfb" - SUFFIXES (TYPE1_SUFFIXES); - FMT_INFO.binmode = true; - break; - case kpse_vf_format: - INIT_FORMAT ("vf", DEFAULT_VFFONTS, VF_ENVS); - SUFFIXES (".vf"); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_dvips_config_format: - INIT_FORMAT ("dvips config", DEFAULT_TEXCONFIG, DVIPS_CONFIG_ENVS); - break; - case kpse_ist_format: - INIT_FORMAT ("ist", DEFAULT_INDEXSTYLE, IST_ENVS); - SUFFIXES (".ist"); - break; - case kpse_truetype_format: - INIT_FORMAT ("truetype fonts", DEFAULT_TTFONTS, TRUETYPE_ENVS); -#define TRUETYPE_SUFFIXES ".ttf", ".ttc" - SUFFIXES (TRUETYPE_SUFFIXES); - FMT_INFO.suffix_search_only = true; - FMT_INFO.binmode = true; - break; - case kpse_type42_format: - INIT_FORMAT ("type42 fonts", DEFAULT_T42FONTS, TYPE42_ENVS); - FMT_INFO.binmode = true; - break; - case kpse_web2c_format: - INIT_FORMAT ("web2c files", DEFAULT_WEB2C, WEB2C_ENVS); - break; - case kpse_program_text_format: - INIT_FORMAT ("other text files", - concatn (".:", DEFAULT_TEXMF, "/", kpse_program_name, "//", - NULL), - concat (uppercasify (kpse_program_name), "INPUTS")); - break; - case kpse_program_binary_format: - INIT_FORMAT ("other binary files", - concatn (".:", DEFAULT_TEXMF, "/", kpse_program_name, "//", - NULL), - concat (uppercasify (kpse_program_name), "INPUTS")); - FMT_INFO.binmode = true; - break; - default: - FATAL1 ("kpse_init_format: Unknown format %d", format); - } - -#ifdef KPSE_DEBUG -#define MAYBE(member) (FMT_INFO.member ? FMT_INFO.member : "(none)") - - /* Describe the monster we've created. */ - if (KPSE_DEBUG_P (KPSE_DEBUG_PATHS)) - { - DEBUGF2 ("Search path for %s files (from %s)\n", - FMT_INFO.type, FMT_INFO.path_source); - DEBUGF1 (" = %s\n", FMT_INFO.path); - DEBUGF1 (" before expansion = %s\n", FMT_INFO.raw_path); - DEBUGF1 (" application override path = %s\n", MAYBE (override_path)); - DEBUGF1 (" application config file path = %s\n", MAYBE (client_path)); - DEBUGF1 (" texmf.cnf path = %s\n", MAYBE (cnf_path)); - DEBUGF1 (" compile-time path = %s\n", MAYBE (default_path)); - DEBUGF (" default suffixes ="); - if (FMT_INFO.suffix) { - const_string *ext; - for (ext = FMT_INFO.suffix; ext && *ext; ext++) { - fprintf (stderr, " %s", *ext); - } - putc ('\n', stderr); - } else { - fputs (" (none)\n", stderr); - } - DEBUGF (" other suffixes ="); - if (FMT_INFO.alt_suffix) { - const_string *alt; - for (alt = FMT_INFO.alt_suffix; alt && *alt; alt++) { - fprintf (stderr, " %s", *alt); - } - putc ('\n', stderr); - } else { - fputs (" (none)\n", stderr); - } - DEBUGF1 (" search only with suffix = %d\n",FMT_INFO.suffix_search_only); - DEBUGF1 (" numeric format value = %d\n", format); - DEBUGF1 (" runtime generation program = %s\n", MAYBE (program)); - DEBUGF1 (" extra program args = %s\n", MAYBE (program_args)); - DEBUGF1 (" program enabled = %d\n", FMT_INFO.program_enabled_p); - DEBUGF1 (" program enable level = %d\n", FMT_INFO.program_enable_level); - } -#endif /* KPSE_DEBUG */ - - return FMT_INFO.path; -} - -/* Look up a file NAME of type FORMAT, and the given MUST_EXIST. This - initializes the path spec for FORMAT if it's the first lookup of that - type. Return the filename found, or NULL. This is the most likely - thing for clients to call. */ - -string -kpse_find_file P3C(const_string, name, kpse_file_format_type, format, - boolean, must_exist) -{ - const_string *ext; - unsigned name_len = 0; - boolean name_has_suffix_already = false; - string mapped_name; - string *mapped_names; - boolean use_fontmaps = (format == kpse_tfm_format - || format == kpse_gf_format - || format == kpse_pk_format - || format == kpse_ofm_format); - string ret = NULL; - - /* NAME being NULL is a programming bug somewhere. NAME can be empty, - though; this happens with constructs like `\input\relax'. */ - assert (name); - - if (FMT_INFO.path == NULL) - kpse_init_format (format); - - /* Does NAME already end in a possible suffix? */ - name_len = strlen (name); - if (FMT_INFO.suffix) { - for (ext = FMT_INFO.suffix; !name_has_suffix_already && *ext; ext++) { - unsigned suffix_len = strlen (*ext); - name_has_suffix_already = (name_len > suffix_len - && FILESTRCASEEQ (*ext, name + name_len - suffix_len)); - } - } - if (!name_has_suffix_already && FMT_INFO.alt_suffix) { - for (ext = FMT_INFO.alt_suffix; !name_has_suffix_already && *ext; ext++) { - unsigned suffix_len = strlen (*ext); - name_has_suffix_already = (name_len > suffix_len - && FILESTRCASEEQ (*ext, name + name_len - suffix_len)); - } - } - - /* Search #1: NAME doesn't have a suffix which is equal to a "standard" - suffix. For example, foo.bar, but not foo.tex. We look for the - name with the standard suffixes appended. */ - if (!name_has_suffix_already && FMT_INFO.suffix) { - /* Append a suffix and search for it. Don't pound the disk yet. */ - for (ext = FMT_INFO.suffix; !ret && *ext; ext++) { - string name_with_suffix = concat (name, *ext); - ret = kpse_path_search (FMT_INFO.path, name_with_suffix, false); - if (!ret && use_fontmaps) { - mapped_names = kpse_fontmap_lookup (name_with_suffix); - while (mapped_names && (mapped_name = *mapped_names++) && !ret) - ret = kpse_path_search (FMT_INFO.path, mapped_name, false); - } - free (name_with_suffix); - } - /* If we only do suffix searches, and are instructed to pound the disk, - do so now. We don't pound the disk for aliases...perhaps we should? */ - if (!ret && FMT_INFO.suffix_search_only && must_exist) { - for (ext = FMT_INFO.suffix; !ret && *ext; ext++) { - string name_with_suffix = concat (name, *ext); - ret = kpse_path_search (FMT_INFO.path, name_with_suffix, true); - free (name_with_suffix); - } - } - } - - /* Search #2: Just look for the name we've been given, provided non-suffix - searches are allowed or the name already includes a suffix. */ - if (!ret && (name_has_suffix_already || !FMT_INFO.suffix_search_only)) { - ret = kpse_path_search (FMT_INFO.path, name, false); - if (!ret && use_fontmaps) { - mapped_names = kpse_fontmap_lookup (name); - while (mapped_names && (mapped_name = *mapped_names++) && !ret) - ret = kpse_path_search (FMT_INFO.path, mapped_name, false); - } - /* We don't pound the disk for aliases...perhaps we should? */ - if (!ret && must_exist) { - ret = kpse_path_search (FMT_INFO.path, name, true); - } - } - - /* Search #3 (sort of): Call mktextfm or whatever to create a - missing file. */ - if (!ret && must_exist) { - ret = kpse_make_tex (format, name); - } - - return ret; -} - -/* Open NAME along the search path for TYPE for reading and return the - resulting file, or exit with an error message. */ - -FILE * -kpse_open_file P2C(const_string, name, kpse_file_format_type, type) -{ - string fullname = kpse_find_file (name, type, true); - const_string mode = kpse_format_info[type].binmode - ? FOPEN_RBIN_MODE - : FOPEN_R_MODE; - FILE *f = fullname ? fopen (fullname, mode) : NULL; - if (!f) { - if (fullname) { - perror (fullname); - exit (1); - } else { - FATAL2 ("%s file `%s' not found", kpse_format_info[type].type, name); - } - } - - return f; -} - -/* When using the %&<format> construct, we'd like to use the paths for - that format, rather than those for the name we were called with. - Of course this happens after various initializations have been - performed, so we have this function to force the issue. Note that - the paths for kpse_cnf_format and kpse_db_format are not cleared. - - This function is defined here, and not in progname.c, because it - need kpse_format_info, and would cause all of tex-file to be pulled - in by programs that do not need it. */ -void -kpse_reset_program_name P1C(const_string, progname) -{ - int i; - - /* It is a fatal error for either of these to be NULL. */ - assert (progname && kpse_program_name); - /* Do nothing if the name is unchanged. */ - if (STREQ(kpse_program_name, progname)) - return; - - free (kpse_program_name); - kpse_program_name = xstrdup (progname); - - /* Clear paths -- do we want the db path to be cleared? */ - for (i = 0; i != kpse_last_format; ++i) { - /* Do not erase the cnf of db paths. This means that the filename - database is not rebuilt, nor are different configuration files - searched. The alternative is to tolerate a memory leak of up - to 100k if this function is called. */ - if (i == kpse_cnf_format || i == kpse_db_format) - continue; - if (kpse_format_info[i].path != NULL) { - free ((string)kpse_format_info[i].path); - kpse_format_info[i].path = NULL; - } - } -}
deleted file mode 100644 --- a/kpathsea/tex-file.h +++ /dev/null @@ -1,182 +0,0 @@ -/* tex-file.h: find files in a particular format. - -Copyright (C) 1993, 94, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TEX_FILE_H -#define KPATHSEA_TEX_FILE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* If non-NULL, try looking for this if can't find the real font. */ -extern const_string kpse_fallback_font; - - -/* If non-NULL, default list of fallback resolutions comes from this - instead of the compile-time value. Set by dvipsk for the R config - cmd. *SIZES environment variables override/use as default. */ -extern DllImport const_string kpse_fallback_resolutions_string; - -/* If non-NULL, check these if can't find (within a few percent of) the - given resolution. List must end with a zero element. */ -extern unsigned *kpse_fallback_resolutions; - -/* This initializes the fallback resolution list. If ENVVAR - is set, it is used; otherwise, the envvar `TEXSIZES' is looked at; if - that's not set either, a compile-time default is used. */ -extern void kpse_init_fallback_resolutions P1H(string envvar); - -/* We put the glyphs first so we don't waste space in an array in - tex-glyph.c. Accompany a new format here with appropriate changes in - tex-file.c and kpsewhich.c (the suffix variable). */ -typedef enum -{ - kpse_gf_format, - kpse_pk_format, - kpse_any_glyph_format, /* ``any'' meaning anything above */ - kpse_tfm_format, - kpse_afm_format, - kpse_base_format, - kpse_bib_format, - kpse_bst_format, - kpse_cnf_format, - kpse_db_format, - kpse_fmt_format, - kpse_fontmap_format, - kpse_mem_format, - kpse_mf_format, - kpse_mfpool_format, - kpse_mft_format, - kpse_mp_format, - kpse_mppool_format, - kpse_mpsupport_format, - kpse_ocp_format, - kpse_ofm_format, - kpse_opl_format, - kpse_otp_format, - kpse_ovf_format, - kpse_ovp_format, - kpse_pict_format, - kpse_tex_format, - kpse_texdoc_format, - kpse_texpool_format, - kpse_texsource_format, - kpse_tex_ps_header_format, - kpse_troff_font_format, - kpse_type1_format, - kpse_vf_format, - kpse_dvips_config_format, - kpse_ist_format, - kpse_truetype_format, - kpse_type42_format, - kpse_web2c_format, - kpse_program_text_format, - kpse_program_binary_format, - kpse_last_format /* one past last index */ -} kpse_file_format_type; - - -/* Perhaps we could use this for path values themselves; for now, we use - it only for the program_enabled_p value. */ -typedef enum -{ - kpse_src_implicit, /* C initialization to zero */ - kpse_src_compile, /* configure/compile-time default */ - kpse_src_texmf_cnf, /* texmf.cnf, the kpathsea config file */ - kpse_src_client_cnf, /* application config file, e.g., config.ps */ - kpse_src_env, /* environment variable */ - kpse_src_x, /* X Window System resource */ - kpse_src_cmdline /* command-line option */ -} kpse_src_type; - - -/* For each file format, we record the following information. The main - thing that is not part of this structure is the environment variable - lists. They are used directly in tex-file.c. We could incorporate - them here, but it would complicate the code a bit. We could also do - it via variable expansion, but not now, maybe not ever: - ${PKFONTS-${TEXFONTS-/usr/local/lib/texmf/fonts//}}. */ - -typedef struct -{ - const_string type; /* Human-readable description. */ - const_string path; /* The search path to use. */ - const_string raw_path; /* Pre-$~ (but post-default) expansion. */ - const_string path_source; /* Where the path started from. */ - const_string override_path; /* From client environment variable. */ - const_string client_path; /* E.g., from dvips's config.ps. */ - const_string cnf_path; /* From texmf.cnf. */ - const_string default_path; /* If all else fails. */ - const_string *suffix; /* For kpse_find_file to check for/append. */ - const_string *alt_suffix; /* More suffixes to check for. */ - boolean suffix_search_only; /* Only search with a suffix? */ - const_string program; /* ``mktexpk'', etc. */ - const_string program_args; /* Args to `program'. */ - boolean program_enabled_p; /* Invoke `program'? */ - kpse_src_type program_enable_level; /* Who said to invoke `program'. */ - boolean binmode; /* The files must be opened in binary mode. */ -} kpse_format_info_type; - -/* The sole variable of that type, indexed by `kpse_file_format_type'. - Initialized by calls to `kpse_find_file' for `kpse_init_format'. */ -extern DllImport kpse_format_info_type kpse_format_info[]; - - -/* If LEVEL is higher than `program_enabled_level' for FMT, set - `program_enabled_p' to VALUE. */ -extern void kpse_set_program_enabled P3H(kpse_file_format_type fmt, - boolean value, kpse_src_type level); -/* Call kpse_set_program_enabled with VALUE and the format corresponding - to FMTNAME. */ -extern void kpse_maketex_option P2H(const_string fmtname, boolean value); - -/* 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 const_string kpse_init_format P1H(kpse_file_format_type); - -/* If FORMAT has a non-null `suffix' member, append it to NAME "." - and call `kpse_path_search' with the result and the other arguments. - If that fails, try just NAME. */ -extern string kpse_find_file P3H(const_string name, - kpse_file_format_type format, boolean must_exist); - -/* Here are some abbreviations. */ -#define kpse_find_mf(name) kpse_find_file (name, kpse_mf_format, true) -#define kpse_find_mft(name) kpse_find_file (name, kpse_mft_format, true) -#define kpse_find_pict(name) kpse_find_file (name, kpse_pict_format, true) -#define kpse_find_tex(name) kpse_find_file (name, kpse_tex_format, true) -#define kpse_find_tfm(name) kpse_find_file (name, kpse_tfm_format, true) -#define kpse_find_ofm(name) kpse_find_file (name, kpse_ofm_format, true) - -/* The `false' is correct for DVI translators, which should clearly not - require vf files for every font (e.g., cmr10.vf). But it's wrong for - VF translators, such as vftovp. */ -#define kpse_find_vf(name) kpse_find_file (name, kpse_vf_format, false) -#define kpse_find_ovf(name) kpse_find_file (name, kpse_ovf_format, false) - -/* Don't just look up the name, actually open the file. */ -extern FILE *kpse_open_file P2H(const_string, kpse_file_format_type); - -/* 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 void kpse_reset_program_name P1H(const_string progname); - -#endif /* not KPATHSEA_TEX_FILE_H */
deleted file mode 100644 --- a/kpathsea/tex-glyph.c +++ /dev/null @@ -1,384 +0,0 @@ -/* tex-glyph.c: Search for GF/PK files. - -Copyright (C) 1993, 94, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/absolute.h> -#include <kpathsea/expand.h> -#include <kpathsea/fontmap.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/tex-glyph.h> -#include <kpathsea/tex-make.h> -#include <kpathsea/variable.h> - -/* Routines are in bottom-up order. */ - -/* Support both cmr10.300pk and dpi300/cmr10.pk. (Use the latter - instead of dpi300\cmr10.pk since DOS supports /'s, but Unix doesn't - support \'s. */ -#define UNIX_BITMAP_SPEC "$KPATHSEA_NAME.$KPATHSEA_DPI$KPATHSEA_FORMAT" -#define DPI_BITMAP_SPEC "dpi$KPATHSEA_DPI/$KPATHSEA_NAME.$KPATHSEA_FORMAT" - -/* Look up FONTNAME at resolution DPI in PATH, with filename suffix - EXTENSION. Return file found or NULL. */ - -static string -try_format P3C(const_string, fontname, unsigned, dpi, - kpse_file_format_type, format) -{ - static const_string bitmap_specs[] - = { UNIX_BITMAP_SPEC, DPI_BITMAP_SPEC, NULL }; - const_string *spec; - boolean must_exist; - string ret = NULL; - const_string path = kpse_format_info[format].path; - const_string *sfx; - if (!path) - path = kpse_init_format (format); - - /* Set the suffix on the name we'll be searching for. */ - sfx = kpse_format_info[format].suffix; - if (sfx && *sfx) - xputenv ("KPATHSEA_FORMAT", *sfx); - - /* OK, the limits on this for loop are a little hokey, but it saves - having to repeat the body. We want to do it once with `must_exist' - false to avoid looking on the disk for cmr10.600pk if - dpi600/cmr10.pk is in ls-R. (The time spent in the extra variable - expansions and db searches is negligible.) */ - for (must_exist = false; !ret && must_exist <= true; must_exist++) - { - for (spec = bitmap_specs; !ret && *spec; spec++) - { - string name = kpse_var_expand (*spec); - ret = kpse_path_search (path, name, must_exist); - if (name != ret) - free (name); - } - } - - return ret; -} - -/* Look for FONTNAME at resolution DPI in format FORMAT. Search the - (entire) PK path first, then the GF path, if we're looking for both. - Return any filename found, and (if we succeeded) fill in GLYPH_FILE. */ - -static string -try_size P4C(const_string, fontname, unsigned, dpi, - kpse_file_format_type, format, - kpse_glyph_file_type *, glyph_file) -{ - kpse_file_format_type format_found; - string ret; - boolean try_gf = format == kpse_gf_format || format == kpse_any_glyph_format; - boolean try_pk = format == kpse_pk_format || format == kpse_any_glyph_format; - - xputenv_int ("KPATHSEA_DPI", dpi); - - /* Look for PK first (since it's more likely to be found), then GF. */ - ret = try_pk ? try_format (fontname, dpi, kpse_pk_format) : NULL; - - if (ret != NULL) - format_found = kpse_pk_format; - else - { - if (try_gf) - { - ret = try_format (fontname, dpi, kpse_gf_format); - format_found = kpse_gf_format; - } - } - - if (ret != NULL && glyph_file) - { /* Success. Fill in the return info. Discard const. */ - glyph_file->name = (string) fontname; - glyph_file->dpi = dpi; - glyph_file->format = format_found; - } - - return ret; -} - -/* Look for FONTNAME at resolution DPI, then at the resolutions within - KPSE_BITMAP_TOLERANCE of DPI. */ - -static string -try_resolution P4C(const_string, fontname, unsigned, dpi, - kpse_file_format_type, format, - kpse_glyph_file_type *, glyph_file) -{ - string ret = try_size (fontname, dpi, format, glyph_file); - - if (!ret) - { - unsigned r; - unsigned tolerance = KPSE_BITMAP_TOLERANCE (dpi); - unsigned lower_bound = (int) (dpi - tolerance) < 0 ? 0 : dpi - tolerance; - unsigned upper_bound = dpi + tolerance; - - /* Prefer scaling up to scaling down, since scaling down can omit - character features (Tom did this in dvips). */ - for (r = lower_bound; !ret && r <= upper_bound; r++) - if (r != dpi) - ret = try_size (fontname, r, format, glyph_file); - } - - return ret; -} - -/* Look up *FONTNAME_PTR in format FORMAT at DPI in the texfonts.map files - that we can find, returning the filename found and GLYPH_FILE. Also - set *FONTNAME_PTR to the real name corresponding to the alias found - or the first alias, if that is not an alias itself. (This allows - mktexpk to only deal with real names.) */ - -static string -try_fontmap P4C(string *, fontname_ptr, unsigned, dpi, - kpse_file_format_type, format, - kpse_glyph_file_type *, glyph_file) -{ - string *mapped_names; - string fontname = *fontname_ptr; - string ret = NULL; - - mapped_names = kpse_fontmap_lookup (fontname); - if (mapped_names) { - string mapped_name; - string first_name = *mapped_names; - while ((mapped_name = *mapped_names++) && !ret) { - xputenv ("KPATHSEA_NAME", mapped_name); - ret = try_resolution (mapped_name, dpi, format, glyph_file); - } - if (ret) { - /* If some alias succeeeded, return that alias. */ - *fontname_ptr = xstrdup (mapped_name); - /* Return first alias name, unless that itself is an alias, - in which case do nothing. */ - } else if (!kpse_fontmap_lookup (first_name)) { - *fontname_ptr = xstrdup (first_name); - } - } - - return ret; -} - -/* Look for FONTNAME in `kpse_fallback_resolutions', omitting DPI if we - happen across it. Return NULL if nothing found. Pass GLYPH_FILE - along as usual. Assume `kpse_fallback_resolutions' is sorted. */ - -static string -try_fallback_resolutions P4C(const_string, fontname, unsigned, dpi, - kpse_file_format_type, format, - kpse_glyph_file_type *, glyph_file) -{ - unsigned s; - int loc, max_loc; - int lower_loc, upper_loc; - unsigned lower_diff, upper_diff; - unsigned closest_diff = UINT_MAX; - string ret = NULL; /* In case the only fallback resolution is DPI. */ - - /* First find the fallback size closest to DPI, even including DPI. */ - for (s = 0; kpse_fallback_resolutions[s] != 0; s++) - { - unsigned this_diff = abs (kpse_fallback_resolutions[s] - dpi); - if (this_diff < closest_diff) - { - closest_diff = this_diff; - loc = s; - } - } - if (s == 0) - return ret; /* If nothing in list, quit now. */ - - max_loc = s; - lower_loc = loc - 1; - upper_loc = loc + 1; - - for (;;) - { - unsigned fallback = kpse_fallback_resolutions[loc]; - /* Don't bother to try DPI itself again. */ - if (fallback != dpi) - { - ret = try_resolution (fontname, fallback, format, glyph_file); - if (ret) - break; - } - - /* That didn't work. How far away are the locs above or below? */ - lower_diff = lower_loc > -1 - ? dpi - kpse_fallback_resolutions[lower_loc] : INT_MAX; - upper_diff = upper_loc < max_loc - ? kpse_fallback_resolutions[upper_loc] - dpi : INT_MAX; - - /* But if we're at the end in both directions, quit. */ - if (lower_diff == INT_MAX && upper_diff == INT_MAX) - break; - - /* Go in whichever direction is closest. */ - if (lower_diff < upper_diff) - { - loc = lower_loc; - lower_loc--; - } - else - { - loc = upper_loc; - upper_loc++; - } - } - - return ret; -} - -/* See the .h file for description. This is the entry point. */ - -string -kpse_find_glyph P4C(const_string, passed_fontname, unsigned, dpi, - kpse_file_format_type, format, - kpse_glyph_file_type *, glyph_file) -{ - string ret; - kpse_glyph_source_type source; - string fontname = (string) passed_fontname; /* discard const */ - - /* Start the search: try the name we're given. */ - source = kpse_glyph_source_normal; - xputenv ("KPATHSEA_NAME", fontname); - ret = try_resolution (fontname, dpi, format, glyph_file); - - /* Try all the various possibilities in order of preference. */ - if (!ret) { - /* Maybe FONTNAME was an alias. */ - source = kpse_glyph_source_alias; - ret = try_fontmap (&fontname, dpi, format, glyph_file); - - /* If not an alias, try creating it on the fly with mktexpk, - unless FONTNAME is absolute or explicitly relative. */ - if (!ret && !kpse_absolute_p (fontname, true)) { - source = kpse_glyph_source_maketex; - /* `try_resolution' leaves the envvar set randomly. */ - xputenv_int ("KPATHSEA_DPI", dpi); - ret = kpse_make_tex (format, fontname); - } - - /* If mktex... succeeded, set return struct. Doesn't make sense for - `kpse_make_tex' to set it, since it can only succeed or fail, - unlike the other routines. */ - if (ret) { - KPSE_GLYPH_FILE_DPI (*glyph_file) = dpi; - KPSE_GLYPH_FILE_NAME (*glyph_file) = fontname; - } - - /* If mktex... failed, try any fallback resolutions. */ - else { - if (kpse_fallback_resolutions) - ret = try_fallback_resolutions (fontname, dpi, format, glyph_file); - - /* We're down to the font of last resort. */ - if (!ret && kpse_fallback_font) { - const_string name = kpse_fallback_font; - source = kpse_glyph_source_fallback; - xputenv ("KPATHSEA_NAME", name); - - /* As before, first try it at the given size. */ - ret = try_resolution (name, dpi, format, glyph_file); - - /* The fallback font at the fallback resolutions. */ - if (!ret && kpse_fallback_resolutions) - ret = try_fallback_resolutions (name, dpi, format, glyph_file); - } - } - } - - /* If RET is null, then the caller is not supposed to look at GLYPH_FILE, - so it doesn't matter if we assign something incorrect. */ - KPSE_GLYPH_FILE_SOURCE (*glyph_file) = source; - - if (fontname != passed_fontname) - free (fontname); - - return ret; -} - -/* The tolerances change whether we base things on DPI1 or DPI2. */ - -boolean -kpse_bitmap_tolerance P2C(double, dpi1, double, dpi2) -{ - unsigned tolerance = KPSE_BITMAP_TOLERANCE (dpi2); - unsigned lower_bound = (int) (dpi2 - tolerance) < 0 ? 0 : dpi2 - tolerance; - unsigned upper_bound = dpi2 + tolerance; - - return lower_bound <= dpi1 && dpi1 <= upper_bound; -} - -#ifdef TEST - -void -test_find_glyph (const_string fontname, unsigned dpi) -{ - string answer; - kpse_glyph_file_type ret; - - printf ("\nSearch for %s@%u:\n\t", fontname, dpi); - - answer = kpse_find_glyph_format (fontname, dpi, - kpse_any_glyph_format, &ret); - if (answer) - { - string format = ret.format == kpse_pk_format ? "pk" : "gf"; - if (!ret.name) - ret.name = "(nil)"; - printf ("%s\n\t(%s@%u, %s)\n", answer, ret.name, ret.dpi, format); - } - else - puts ("(nil)"); -} - - -int -main () -{ - test_find_glyph ("/usr/local/lib/tex/fonts/cm/cmr10", 300); /* absolute */ - test_find_glyph ("cmr10", 300); /* normal */ - test_find_glyph ("logo10", 300); /* find gf */ - test_find_glyph ("cmr10", 299); /* find 300 */ - test_find_glyph ("circle10", 300); /* in fontmap */ - test_find_glyph ("none", 300); /* do not find */ - kpse_fallback_font = "cmr10"; - test_find_glyph ("fallback", 300); /* find fallback font cmr10 */ - kpse_init_fallback_resolutions ("KPATHSEA_TEST_SIZES"); - test_find_glyph ("fallbackdpi", 759); /* find fallback font cmr10@300 */ - - xputenv ("GFFONTS", "."); - test_find_glyph ("cmr10", 300); /* different GFFONTS/TEXFONTS */ - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -test-compile-command: "gcc -g -I. -I.. -DTEST tex-glyph.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/tex-glyph.h +++ /dev/null @@ -1,78 +0,0 @@ -/* tex-glyph.h: look for a TeX glyph font (GF or PK). - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TEX_GLYPH_H -#define KPATHSEA_TEX_GLYPH_H - -#include <kpathsea/tex-file.h> - - -/* This type describes the origination of a glyph font. */ - -typedef enum -{ - kpse_glyph_source_normal, /* the searched-for font: already existed */ - kpse_glyph_source_alias, /* : was an alias for an existing file */ - kpse_glyph_source_maketex, /* : was created on the fly */ - kpse_glyph_source_fallback /* : wasn't found, but the fallback font was */ -} kpse_glyph_source_type; - - -typedef struct -{ - string name; /* font name found */ - unsigned dpi; /* size found, for glyphs */ - kpse_file_format_type format; /* glyph format found */ - kpse_glyph_source_type source; /* where we found it */ -} kpse_glyph_file_type; - -#define KPSE_GLYPH_FILE_NAME(f) ((f).name) -#define KPSE_GLYPH_FILE_DPI(f) ((f).dpi) -#define KPSE_GLYPH_FILE_FORMAT(f) ((f).format) -#define KPSE_GLYPH_FILE_SOURCE(f) ((f).source) - - -/* Search first for the font named FONT_NAME at resolution DPI in the - glyph format FORMAT (see `try_size' for details of format searching). - Then try resolutions within KPSE_BITMAP_TOLERANCE of DPI. Then try - the resolutions in `kpse_fallback_sizes', then within the tolerance - of each of those. Then if FONT_NAME is an alias defined in a - texfonts.map do all the above for its real name. Then try the above - for kpse_fallback_name. Then fail. Return either the filename - found, or NULL. Also return information about the file found in - *GLYPH_FILE. */ -extern string kpse_find_glyph P4H(const_string font_name, unsigned dpi, - kpse_file_format_type format, - kpse_glyph_file_type *glyph_file); - -/* Look for a specific format only. */ -#define kpse_find_pk(font_name, dpi, glyph_file) \ - kpse_find_glyph (font_name, dpi, kpse_pk_format, glyph_file) -#define kpse_find_gf(font_name, dpi, glyph_file) \ - kpse_find_glyph (font_name, dpi, kpse_gf_format, glyph_file) - - -/* Defines how far away a pixel file can be found from its stated size. - The DVI standard says any resolution within 0.2% of the stated size - is ok, but we are more forgiving. */ -#define KPSE_BITMAP_TOLERANCE(r) ((r) / 500.0 + 1) - -/* Check whether DPI1 is within KPSE_BITMAP_TOLERANCE of DPI2. */ -extern boolean kpse_bitmap_tolerance P2H(double dpi1, double dpi2); - -#endif /* not KPATHSEA_TEX_GLYPH_H */
deleted file mode 100644 --- a/kpathsea/tex-hush.c +++ /dev/null @@ -1,39 +0,0 @@ -/* tex-hush.c: are we suppressing warnings? - -Copyright (C) 1996 Karl Berry. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/pathsearch.h> -#include <kpathsea/tex-hush.h> -#include <kpathsea/variable.h> - -boolean -kpse_tex_hush P1C(const_string, what) -{ - string h; - string hush = kpse_var_value ("TEX_HUSH"); - if (hush) { - for (h = kpse_path_element (hush); h; h = kpse_path_element (NULL)) { - /* Don't do anything special with empty elements. */ - if (STREQ (h, what) || STREQ (h, "all")) - return true; - } - } - - return false; -}
deleted file mode 100644 --- a/kpathsea/tex-hush.h +++ /dev/null @@ -1,29 +0,0 @@ -/* tex-hush.h: suppressing warnings? - -Copyright (C) 1996 Karl Berry. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TEX_HUSH_H -#define KPATHSEA_TEX_HUSH_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Return true if WHAT is included in the TEX_HUSH environment - variable/config value. */ -extern boolean kpse_tex_hush P1H(const_string what); - -#endif /* not KPATHSEA_TEX_HUSH_H */
deleted file mode 100644 --- a/kpathsea/tex-make.c +++ /dev/null @@ -1,351 +0,0 @@ -/* tex-make.c: Run external programs to make TeX-related files. - -Copyright (C) 1993, 94, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-fopen.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/concatn.h> -#include <kpathsea/db.h> -#include <kpathsea/fn.h> -#include <kpathsea/magstep.h> -#include <kpathsea/readable.h> -#include <kpathsea/tex-make.h> -#include <kpathsea/variable.h> - - -/* We never throw away stdout, since that is supposed to be the filename - found, if all is successful. This variable controls whether stderr - is thrown away. */ -boolean kpse_make_tex_discard_errors = false; - -/* We set the envvar MAKETEX_MAG, which is part of the default spec for - MakeTeXPK above, based on KPATHSEA_DPI and MAKETEX_BASE_DPI. */ - -static void -set_maketex_mag P1H(void) -{ - char q[MAX_INT_LENGTH * 3 + 3]; - int m; - string dpi_str = getenv ("KPATHSEA_DPI"); - string bdpi_str = getenv ("MAKETEX_BASE_DPI"); - unsigned dpi = dpi_str ? atoi (dpi_str) : 0; - unsigned bdpi = bdpi_str ? atoi (bdpi_str) : 0; - - /* If the environment variables aren't set, it's a bug. */ - assert (dpi != 0 && bdpi != 0); - - /* Fix up for roundoff error. Hopefully the driver has already fixed - up DPI, but may as well be safe, and also get the magstep number. */ - (void) kpse_magstep_fix (dpi, bdpi, &m); - - if (m == 0) - sprintf (q, "%d+%d/%d", dpi / bdpi, dpi % bdpi, bdpi); - else - { /* m is encoded with LSB being a ``half'' bit (see magstep.h). Are - we making an assumption here about two's complement? Probably. - In any case, if m is negative, we have to put in the sign - explicitly, since m/2==0 if m==-1. */ - const_string sign = ""; - if (m < 0) - { - m *= -1; - sign = "-"; - } - sprintf (q, "magstep\\(%s%d.%d\\)", sign, m / 2, (m & 1) * 5); - } - xputenv ("MAKETEX_MAG", q); -} - -/* This mktex... program was disabled, or the script failed. If this - was a font creation (according to FORMAT), append CMD - to a file missfont.log in the current directory. */ - -static void -misstex P2C(kpse_file_format_type, format, const_string, cmd) -{ - static FILE *missfont = NULL; - - /* If we weren't trying to make a font, do nothing. Maybe should - allow people to specify what they want recorded? */ - if (format > kpse_any_glyph_format && format != kpse_tfm_format - && format != kpse_vf_format) - return; - - /* If this is the first time, have to open the log file. But don't - bother logging anything if they were discarding errors. */ - if (!missfont && !kpse_make_tex_discard_errors) { - const_string missfont_name = kpse_var_value ("MISSFONT_LOG"); - if (!missfont_name || *missfont_name == '1') { - missfont_name = "missfont.log"; /* take default name */ - } else if (missfont_name - && (*missfont_name == 0 || *missfont_name == '0')) { - missfont_name = NULL; /* user requested no missfont.log */ - } /* else use user's name */ - - missfont = missfont_name ? fopen (missfont_name, FOPEN_A_MODE) : NULL; - if (!missfont && kpse_var_value ("TEXMFOUTPUT")) { - missfont_name = concat3 (kpse_var_value ("TEXMFOUTPUT"), DIR_SEP_STRING, - missfont_name); - missfont = fopen (missfont_name, FOPEN_A_MODE); - } - - if (missfont) - fprintf (stderr, "kpathsea: Appending font creation commands to %s.\n", - missfont_name); - } - - /* Write the command if we have a log file. */ - if (missfont) { - fputs (cmd, missfont); - putc ('\n', missfont); - } -} - - -/* Assume the script outputs the filename it creates (and nothing - else) on standard output; hence, we run the script with `popen'. */ - -static string -maketex P2C(kpse_file_format_type, format, const_string, passed_cmd) -{ - string ret; - unsigned i; - FILE *f; - string cmd = xstrdup (passed_cmd); - -#if defined (MSDOS) || defined (WIN32) - /* For discarding stderr. This is so we don't require an MSDOS user - to istall a unixy shell (see kpse_make_tex below): they might - devise their own ingenious ways of running mktex... even though - they don't have such a shell. */ - int temp_stderr = -1; - int save_stderr = -1; -#endif - - /* If the user snuck `backquotes` or $(command) substitutions into the - name, foil them. */ - for (i = 0; i < strlen (cmd); i++) { - if (cmd[i] == '`' || (cmd[i] == '$' && cmd[i+1] == '(')) { - cmd[i] = '#'; - } - } - - /* Tell the user we are running the script, so they have a clue as to - what's going on if something messes up. But if they asked to - discard output, they probably don't want to see this, either. */ - if (!kpse_make_tex_discard_errors) { - fprintf (stderr, "kpathsea: Running %s\n", cmd); - } -#if defined (MSDOS) || defined (WIN32) - else { - temp_stderr = open ("NUL", O_WRONLY); - if (temp_stderr >= 0) { - save_stderr = dup (2); - if (save_stderr >= 0) - dup2 (temp_stderr, 2); - } - /* Else they lose: the errors WILL be shown. However, open/dup - aren't supposed to fail in this case, it's just my paranoia. */ - } -#endif - - /* Run the script. The Amiga has a different interface. */ -#ifdef AMIGA - ret = system (cmd) == 0 ? getenv ("LAST_FONT_CREATED") : NULL; -#else /* not AMIGA */ - f = popen (cmd, FOPEN_R_MODE); - -#if defined (MSDOS) || defined (WIN32) - if (kpse_make_tex_discard_errors) { - /* Close /dev/null and revert stderr. */ - if (save_stderr >= 0) { - dup2 (save_stderr, 2); - close (save_stderr); - } - if (temp_stderr >= 0) - close (temp_stderr); - } -#endif - - if (f) { - int c; - string fn; /* The final filename. */ - unsigned len; /* And its length. */ - fn_type output; - output = fn_init (); /* Collect the script output. */ - - /* Read all the output and terminate with a null. */ - while ((c = getc (f)) != EOF) - fn_1grow (&output, c); - fn_1grow (&output, 0); - - /* Maybe should check for `EXIT_SUCCESS' status before even - looking at the output? In some versions of Linux, pclose fails - with ECHILD (No child processes), maybe only if we're being run - by lpd. So don't make this a fatal error. */ - if (pclose (f) == -1) { - perror ("pclose(mktexpk)"); - WARNING ("kpathsea: This is probably the Linux pclose bug; continuing"); - } - - len = FN_LENGTH (output); - fn = FN_STRING (output); - - /* Remove trailing newlines and returns. */ - while (len > 1 && (fn[len - 2] == '\n' || fn[len - 2] == '\r')) { - fn[len - 2] = 0; - len--; - } - - /* If no output from script, return NULL. Otherwise check - what it output. */ - ret = len == 1 ? NULL : kpse_readable_file (fn); - if (!ret && len > 1) { - WARNING1 ("kpathsea: mktexpk output `%s' instead of a filename", fn); - } - - /* Free the name if we're not returning it. */ - if (fn != ret) - free (fn); - } else { - /* popen failed. */ - perror ("kpathsea"); - ret = NULL; - } -#endif /* not AMIGA */ - - if (ret == NULL) - misstex (format, cmd); - else - kpse_db_insert (ret); - - return ret; -} - - -/* Create BASE in FORMAT and return the generated filename, or - return NULL. */ - -string -kpse_make_tex P2C(kpse_file_format_type, format, const_string, base) -{ - kpse_format_info_type spec; /* some compilers lack struct initialization */ - string ret = NULL; - - spec = kpse_format_info[format]; - if (!spec.type) { /* Not initialized yet? */ - kpse_init_format (format); - spec = kpse_format_info[format]; - } - - if (spec.program && spec.program_enabled_p) { - /* See the documentation for the envvars we're dealing with here. */ - string args, cmd; - const_string prog = spec.program; - const_string arg_spec = spec.program_args; - - if (format <= kpse_any_glyph_format) - set_maketex_mag (); - - /* Here's an awful kludge: if the mode is `/', mktexpk recognizes - it as a special case. `kpse_prog_init' sets it to this in the - first place when no mode is otherwise specified; this is so - when the user defines a resolution, they don't also have to - specify a mode; instead, mktexpk's guesses will take over. - They use / for the value because then when it is expanded as - part of the PKFONTS et al. path values, we'll wind up searching - all the pk directories. We put $MAKETEX_MODE in the path - values in the first place so that sites with two different - devices with the same resolution can find the right fonts; but - such sites are uncommon, so they shouldn't make things harder - for everyone else. */ - args = arg_spec ? kpse_var_expand (arg_spec) : (string) ""; - - /* The command is the program name plus the arguments. */ - cmd = concatn (prog, " ", args, " ", base, NULL); - - /* Only way to discard errors is redirect stderr inside another - shell; otherwise, if the mktex... script doesn't exist, we - will see the `sh: mktex...: not found' error. No point in - doing this if we're not actually going to run anything. */ -#if !defined(MSDOS) && !defined(WIN32) && !defined(AMIGA) - /* We don't want to require that a Unix-like shell be installed - on MS-DOS or WIN32 systems, so we will redirect stderr by hand - (in maketex). */ - if (kpse_make_tex_discard_errors) { - string old_cmd = cmd; -#ifdef OS2 - cmd = concat3 ("cmd /c \"", cmd, "\" 2>/dev/nul"); -#else - cmd = concat3 ("sh -c \"", cmd, "\" 2>/dev/null"); -#endif - free (old_cmd); - } -#endif - - ret = maketex (format, cmd); - - free (cmd); - if (*args) - free (args); - } - - return ret; -} - -#ifdef TEST - -void -test_make_tex (kpse_file_format_type fmt, const_string base) -{ - string answer; - - printf ("\nAttempting %s in format %d:\n", base, fmt); - - answer = kpse_make_tex (fmt, base); - puts (answer ? answer : "(nil)"); -} - - -int -main () -{ - xputenv ("KPATHSEA_DPI", "781"); /* call mktexpk */ - xputenv ("MAKETEX_BASE_DPI", "300"); /* call mktexpk */ - KPSE_MAKE_SPEC_ENABLED (kpse_make_specs[kpse_pk_format]) = true; - test_make_tex (kpse_pk_format, "cmr10"); - - /* Fail with mktextfm. */ - KPSE_MAKE_SPEC_ENABLED (kpse_make_specs[kpse_tfm_format]) = true; - test_make_tex (kpse_tfm_format, "foozler99"); - - /* Call something disabled. */ - test_make_tex (kpse_bst_format, "no-way"); - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -test-compile-command: "gcc -g -I. -I.. -DTEST tex-make.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/tex-make.h +++ /dev/null @@ -1,39 +0,0 @@ -/* tex-make.h: declarations for executing external scripts. - -Copyright (C) 1993, 94 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TEX_MAKE_H -#define KPATHSEA_TEX_MAKE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/tex-file.h> -#include <kpathsea/types.h> - - -/* If true, throw away standard error from the mktex... scripts. - (Standard output is the filename, so we never throw that away.) */ -extern DllImport boolean kpse_make_tex_discard_errors; - - -/* Run a program to create a file named by BASE_FILE in format FORMAT. - Return the full filename to it, or NULL. Any other information about - the file is passed through environment variables. See the mktexpk - stuff in `tex-make.c' for an example. */ -extern string kpse_make_tex P2H(kpse_file_format_type format, - const_string base_file); - -#endif /* not KPATHSEA_TEX_MAKE_H */
deleted file mode 100644 --- a/kpathsea/texmf.in +++ /dev/null @@ -1,412 +0,0 @@ -% original texmf.cnf -- runtime path configuration file for kpathsea. -% (If you change or delete `original' on the previous line, the -% distribution won't install its version over yours.) -% Public domain. -% -% What follows is a super-summary of what this .cnf file can -% contain. Please read the Kpathsea manual for more information. -% -% texmf.cnf is generated from texmf.in, by replacing @var@ with the -% value of the Make variable `var', via a sed file texmf.sed, generated -% (once) by kpathsea/Makefile (itself generated from kpathsea/Makefile.in -% by configure). -% -% Any identifier (sticking to A-Za-z_ for names is safest) can be assigned. -% The `=' (and surrounding spaces) is optional. -% No % or @ in texmf.in, for the sake of autogeneration. -% (However, %'s and @'s can be edited into texmf.cnf or put in envvar values.) -% $foo (or ${foo}) in a value expands to the envvar or cnf value of foo. -% -% Earlier entries (in the same or another file) override later ones, and -% an environment variable foo overrides any texmf.cnf definition of foo. -% -% All definitions are read before anything is expanded, so you can use -% variables before they are defined. -% -% If a variable assignment is qualified with `.PROGRAM', it is ignored -% unless the current executable (last filename component of argv[0]) is -% named PROGRAM. This foo.PROGRAM construct is not recognized on the -% right-hand side. For environment variables, use FOO_PROGRAM. -% -% Which file formats use which paths for searches is described in the -% various programs' and the kpathsea documentation. -% -% // means to search subdirectories (recursively). -% A leading !! means to look only in the ls-R db, never on the disk. -% A leading/trailing/doubled : in the paths will be expanded into the -% compile-time default. Probably not what you want. -% -% You can use brace notation, for example: /usr/local/{mytex:othertex} -% expands to /usr/local/mytex:/usr/local/othertex. Instead of the path -% separator you can use a comma: /usr/local/{mytex,othertex} also expands -% to /usr/local/mytex:/usr/local/othertex. However, the use of the comma -% instead of the path separator is deprecated. -% -% The text above assumes thet path separator is a colon (:). Non-UNIX -% systems use different path separators, for example MicroSoft operating -% systems use the semicolon (;). - -% Part 1: Search paths and directories. - -% You can set an environment variable to override TEXMF if you're testing -% a new TeX tree, without changing anything else. -% -% You may wish to use one of the $SELFAUTO... variables here so TeX will -% find where to look dynamically. See the manual and the definition -% below of TEXMFCNF. - -% The main tree, which must be mentioned in $TEXMF, below: -TEXMFMAIN = @texmf@ - -% A place for local additions to a "standard" texmf tree. For example: -% TEXMFLOCAL = @texmf@.local - -% User texmf trees can be catered for like this... -% HOMETEXMF = $HOME/texmf - -% Now, list all the texmf trees. If you have multiple trees, -% use shell brace notation, like this: -% TEXMF = {$HOMETEXMF:!!$TEXMFLOCAL:!!$TEXMFMAIN} -% The braces are necessary. -TEXMF = $TEXMFMAIN - -% The system trees. These are the trees that are shared by all the users. -SYSTEXMF = $TEXMF - -% Where generated fonts may be written. This tree is used when the sources -% were found in a system tree and either that tree wasn't writable, or the -% varfonts feature was enabled in MT_FEATURES in mktex.cnf. -VARTEXFONTS = @vartexfonts@ - -% Where to look for ls-R files. There need not be an ls-R in the -% directories in this path, but if there is one, Kpathsea will use it. -TEXMFDBS = $TEXMF:$VARTEXFONTS - -% It may be convenient to define TEXMF like this: -% TEXMF = {$HOMETEXMF:!!$TEXMFLOCAL:!!$TEXMFMAIN:$HOME} -% which allows users to set up entire texmf trees, and tells TeX to -% look in places like ~/tex and ~/bibtex. If you do this, define TEXMFDBS -% like this: -% TEXMFDBS = $HOMETEXMF:$TEXMFLOCAL:$TEXMFMAIN:$VARTEXFONTS -% or mktexlsr will generate an ls-R file for $HOME when called, which is -% rarely desirable. If you do this you'll want to define SYSTEXMF like -% this: -% SYSTEXMF = $TEXMFLOCAL:$TEXMFMAIN -% so that fonts from a user's tree won't escape into the global trees. -% -% On some systems, there will be a system tree which contains all the font -% files that may be created as well as the formats. For example -% VARTEXMF = /var/lib/texmf -% is used on many Linux systems. In this case, set VARTEXFONTS like this -% VARTEXFONTS = $VARTEXMF/fonts -% and do not mention it in TEXMFDBS (but _do_ mention VARTEXMF). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Usually you will not need to edit any of the other variables in part 1. % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% WEB2C is for Web2C specific files. The current directory may not be -% a good place to look for them. -WEB2C = $TEXMF/web2c - -% TEXINPUTS is for TeX input files -- i.e., anything to be found by \input -% or \openin, including .sty, .eps, etc. - -% LaTeX 2e specific macros are stored in latex/, macros that can only be -% used with 2.09 in latex209/. In addition, we look in the directory -% latex209, useful for macros that were written for 2.09 and do not -% mention 2e at all, but can be used with 2e. -TEXINPUTS.latex209 = .:$TEXMF/tex/{latex209:generic:latex:}// -TEXINPUTS.latex2e = .:$TEXMF/tex/{latex:generic:latex209:}// -TEXINPUTS.latex = .:$TEXMF/tex/{latex:generic:latex209:}// - -% Fontinst needs to read afm files. -TEXINPUTS.fontinst = .:$TEXMF/tex//:$TEXMF/fonts//afm// - -% Plain TeX. Have the command tex check all directories as a last -% resort, we may have plain-compatible stuff anywhere. -TEXINPUTS.tex = .:$TEXMF/tex/{plain:generic:}// -% other plain-based formats -TEXINPUTS.amstex = .:$TEXMF/tex/{amstex:plain:generic:}// -TEXINPUTS.ftex = .:$TEXMF/tex/{formate:plain:generic:}// -TEXINPUTS.texinfo = .:$TEXMF/tex/{texinfo:plain:generic:}// -TEXINPUTS.eplain = .:$TEXMF/tex/{eplain:plain:generic:}// -TEXINPUTS.jadetex = .:$TEXMF/tex/{jadetex:plain:generic:}// - -% MLTeX. -TEXINPUTS.frtex = .:$TEXMF/{mltex:tex}/{french:plain:generic:}// -TEXINPUTS.frlatex = .:$TEXMF/{mltex:tex}/{french:latex:generic:latex209:}// -TEXINPUTS.mltex = .:$TEXMF/{mltex:tex}/{plain:generic:}// -TEXINPUTS.mllatex = .:$TEXMF/{mltex:tex}/{latex:generic:latex209:}// - -% e-TeX. This form of the input paths is borrowed from teTeX. A certain -% variant of TDS is assumed here, unaffected by the build variables. -TEXINPUTS.elatex = .:$TEXMF/{etex:tex}/{latex:generic:latex209:plain:}// -TEXINPUTS.etex = .:$TEXMF/{etex:tex}/{plain:generic:}// - -% PDFTeX. This form of the input paths is borrowed from teTeX. A certain -% variant of TDS is assumed here, unaffected by the build variables. -TEXINPUTS.pdftexinfo = .:$TEXMF/{pdftex:tex}/{texinfo:generic:plain:}// -TEXINPUTS.pdflatex = .:$TEXMF/{pdftex:tex}/{latex:generic:latex209:plain:}// -TEXINPUTS.pdftex = .:$TEXMF/{pdftex:tex}/{plain:generic:}// - -% Omega. -TEXINPUTS.lambda = .:$TEXMF/{omega:tex}/{lambda:latex:generic:latex209:plain:}// -TEXINPUTS.omega = .:$TEXMF/{omega:tex}/{plain:generic:}// - -% Earlier entries override later ones, so put this last. -TEXINPUTS = .:$TEXMF/tex/{generic:}// - -% Metafont, MetaPost inputs. -MFINPUTS = .:$TEXMF/metafont//:{$TEXMF/fonts:$VARTEXFONTS}//source// -MPINPUTS = .:$TEXMF/metapost// - -% Dump files (fmt/base/mem) for vir{tex,mf,mp} to read (see web2c/INSTALL), -% and string pools (.pool) for ini{tex,mf,mp}. It is silly that we have six -% paths and directories here (they all resolve to a single place by default), -% but historically ... -TEXFORMATS = .:$TEXMF/web2c -MFBASES = .:$TEXMF/web2c -MPMEMS = .:$TEXMF/web2c -TEXPOOL = .:$TEXMF/web2c -MFPOOL = .:$TEXMF/web2c -MPPOOL = .:$TEXMF/web2c - -% Device-independent font metric files. -VFFONTS = .:$TEXMF/fonts//vf// -TFMFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//tfm// - -% The $MAKETEX_MODE below means the drivers will not use a cx font when -% the mode is ricoh. If no mode is explicitly specified, kpse_prog_init -% sets MAKETEX_MODE to /, so all subdirectories are searched. See the manual. -% The modeless part guarantees that bitmaps for PostScript fonts are found. -PKFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//pk/{$MAKETEX_MODE:modeless}// - -% Similarly for the GF format, which only remains in existence because -% Metafont outputs it (and MF isn't going to change). -GFFONTS = .:$TEXMF/fonts//gf/$MAKETEX_MODE// - -% A backup for PKFONTS and GFFONTS. Not used for anything. -GLYPHFONTS = .:$TEXMF/fonts - -% For texfonts.map and included map files used by mktexpk. -% See ftp://ftp.tug.org/tex/fontname.tar.gz. -TEXFONTMAPS = .:$TEXMF/fontname - -% BibTeX bibliographies and style files. -BIBINPUTS = .:$TEXMF/bibtex/{bib:}// -BSTINPUTS = .:$TEXMF/bibtex/{bst:}// - -% MFT style files. -MFTINPUTS = .:$TEXMF/mft// - -% PostScript headers, prologues (.pro), encodings (.enc) and fonts. -TEXPSHEADERS = .:$TEXMF/dvips//:$TEXMF/pdftex//:$TEXMF/fonts//type1// - -% PostScript Type 1 outline fonts. -T1FONTS = .:$TEXMF/fonts//type1// - -% PostScript AFM metric files. -AFMFONTS = .:$TEXMF/fonts//afm// - -% TrueType outline fonts. -TTFONTS = .:$TEXMF/fonts//truetype// - -% Type 42 outline fonts. -T42FONTS = .:$TEXMF/fonts//type42// - -% Dvips' config.* files (this name should not start with `TEX'!). -TEXCONFIG = .:$TEXMF/dvips// - -% Makeindex style (.ist) files. -INDEXSTYLE = .:$TEXMF/makeindex// - -% Used by DMP (ditroff-to-mpx), called by makempx -troff. -TRFONTS = /usr/lib/font/devpost -MPSUPPORT = .:$TEXMF/metapost/support - -% For xdvi to find mime.types and .mailcap, if they do not exist in -% $HOME. These are single directories, not paths. -% (But the default mime.types, at least, may well suffice.) -MIMELIBDIR = @prefix@/etc -MAILCAPLIBDIR = @prefix@/etc - -% TeX documentation and source files, for use with kpsewhich. -TEXDOCS = .:$TEXMF/doc// -TEXSOURCES = .:$TEXMF/source// - -% Omega-related fonts and other files. The odd construction for OFMFONTS -% makes it behave in the face of a definition of TFMFONTS. Unfortunately -% no default substitution would take place for TFMFONTS, so an explicit -% path is retained. -OFMFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//{ofm:tfm}//:$TFMFONTS -OPLFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//opl// -OVFFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//ovf// -OVPFONTS = .:{$TEXMF/fonts:$VARTEXFONTS}//ovp// -OTPINPUTS = .:$TEXMF/omega/otp// -OCPINPUTS = .:$TEXMF/omega/ocp// - -% Some additional input variables for several programs. If you add -% a program that uses the 'other text files' or 'other binary files' -% search formats, you'll want to add their variables here as well. -XDVIINPUTS = .:$TEXMF/xdvi -TEX4HTINPUTS = .:$TEXMF/tex4ht// - -%% The mktex* scripts rely on KPSE_DOT. Do not set it in the environment. -KPSE_DOT = . - -% This definition isn't used from this .cnf file itself (that would be -% paradoxical), but the compile-time default in paths.h is built from it. -% The SELFAUTO* variables are set automatically from the location of -% argv[0], in kpse_set_progname. -% -% About the /. construction: -% 1) if the variable is undefined, we'd otherwise have an empty path -% element in the compile-time path. This is not meaningful. -% 2) if we used /$VARIABLE, we'd end up with // if VARIABLE is defined, -% which would search the entire world. -% -% The TETEXDIR stuff isn't likely to relevant unless you're using teTeX, -% but it doesn't hurt. -% -TEXMFCNF = .:{$SELFAUTOLOC:$SELFAUTODIR:$SELFAUTOPARENT}{:{/share:}/texmf{.local:}/web2c}:/.$TETEXDIR:/.$TEXMF/web2c:@web2c@ - - - -% Part 2: Non-path options. - -% Write .log/.dvi/etc. files here, if the current directory is unwritable. -% TEXMFOUTPUT = /tmp - -% If a dynamic file creation fails, log the command to this file, in -% either the current directory or TEXMFOUTPUT. Set to the -% empty string or 0 to avoid logging. -MISSFONT_LOG = missfont.log - -% Set to a colon-separated list of words specifying warnings to suppress. -% To suppress everything, use TEX_HUSH = all; this is equivalent to -% TEX_HUSH = checksum:lostchar:readable:special -TEX_HUSH = none - -% Enable system commands via \write18{...}? -shell_escape = f - -% Allow TeX \openout on filenames starting with `.' (e.g., .rhosts)? -% a (any) : any file can be opened. -% r (restricted) : disallow opening "dotfiles". -% p (paranoid) : as 'r' and disallow going to parent directories, and -% restrict absolute paths to be under $TEXMFOUTPUT. -openout_any = p - -% Enable the mktex... scripts by default? These must be set to 0 or 1. -% Particular programs can and do override these settings, for example -% dvips's -M option. Your first chance to specify whether the scripts -% are invoked by default is at configure time. -% -% These values are ignored if the script names are changed; e.g., if you -% set DVIPSMAKEPK to `foo', what counts is the value of the environment -% variable/config value `FOO', not the `MKTEXPK' value. -% -% MKTEXTEX = 0 -% MKTEXPK = 0 -% MKTEXMF = 0 -% MKTEXTFM = 0 -% MKOCP = 0 -% MKOFM = 0 - -% What MetaPost runs to make MPX files. This is passed an option -troff -% if MP is in troff mode. Set to `0' to disable this feature. -MPXCOMMAND = makempx - - -% Part 3: Array and other sizes for TeX (and Metafont and MetaPost). -% -% If you want to change some of these sizes only for a certain TeX -% variant, the usual dot notation works, e.g., -% main_memory.hugetex = 20000000 -% -% If a change here appears to be ignored, try redumping the format file. - -% Memory. Must be less than 8,000,000 total. -% -% main_memory is relevant only to initex, extra_mem_* only to non-ini. -% Thus, have to redump the .fmt file after changing main_memory; to add -% to existing fmt files, increase extra_mem_*. (To get an idea of how -% much, try \tracingstats=2 in your TeX source file; -% web2c/tests/memtest.tex might also be interesting.) -% -% To increase space for boxes (as might be needed by, e.g., PiCTeX), -% increase extra_mem_bot. -% -% For some xy-pic samples, you may need as much as 700000 words of memory. -% For the vast majority of documents, 60000 or less will do. -% -main_memory = 263000 % words of inimemory available; also applies to inimf&mp -extra_mem_top = 0 % extra high memory for chars, tokens, etc. -extra_mem_bot = 0 % extra low memory for boxes, glue, breakpoints, etc. - -% Words of font info for TeX (total size of all TFM files, approximately). -font_mem_size = 200000 - -% Total number of fonts. Must be >= 50 and <= 2000 (without tex.ch changes). -font_max = 1000 - -% Extra space for the hash table of control sequences (which allows 10K -% names as distributed). -hash_extra = 0 - -% Max number of characters in all strings, including all error messages, -% help texts, font names, control sequences. These values apply to TeX and MP. -pool_size = 125000 -% Minimum pool space after TeX/MP's own strings; must be at least -% 25000 less than pool_size, but doesn't need to be nearly that large. -string_vacancies = 25000 -max_strings = 15000 % max number of strings -pool_free = 5000 % min pool space left after loading .fmt - -% Hyphenation trie. As distributed, the maximum is 65535; this should -% work unless `unsigned short' is not supported or is smaller than 16 -% bits. This value should suffice for UK English, US English, French, -% and German (for example). To increase, you must change -% `ssup_trie_opcode' and `ssup_trie_size' in tex.ch (and rebuild TeX); -% the trie will then consume four bytes per entry, instead of two. -% -% US English, German, and Portuguese: 30000. -% German: 14000. -% US English: 10000. -% -trie_size = 64000 - -% Buffer size. TeX uses the buffer to contain input lines, but macro -% expansion works by writing material into the buffer and reparsing the -% line. As a consequence, certain constructs require the buffer to be -% very large. As distributed, the size is 50000; most documents can be -% handled within a tenth of this size. -buf_size = 50000 - -hyph_size = 1000 % number of hyphenation exceptions, >610 and <32767. -nest_size = 100 % simultaneous semantic levels (e.g., groups) -max_in_open = 15 % simultaneous input files and error insertions -param_size = 500 % simultaneous macro parameters -save_size = 4000 % for saving values outside current group -stack_size = 300 % simultaneous input sources - -% These are Omega-specific. -ocp_buf_size = 20000 % character buffers for ocp filters. -ocp_stack_size = 10000 % stacks for ocp computations. -ocp_list_size = 1000 % control for multiple ocps. - -% These work best if they are the same as the I/O buffer size, but it -% doesn't matter much. Must be a multiple of 8. -dvi_buf_size = 16384 % TeX -gf_buf_size = 16384 % MF - -% It's probably inadvisable to change these. At any rate, we must have: -% 45 < error_line < 255; -% 30 < half_error_line < error_line - 15; -% 60 <= max_print_line; -% These apply to Metafont and MetaPost as well. -error_line = 79 -half_error_line = 50 -max_print_line = 79
deleted file mode 100644 --- a/kpathsea/tilde.c +++ /dev/null @@ -1,141 +0,0 @@ -/* tilde.c: Expand user's home directories. - -Copyright (C) 1993, 95, 96, 97 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-pathch.h> -#include <kpathsea/tilde.h> - -#ifdef HAVE_PWD_H -#include <pwd.h> -#endif - - -/* If NAME has a leading ~ or ~user, Unix-style, expand it to the user's - home directory, and return a new malloced string. If no ~, or no - <pwd.h>, just return NAME. */ - -string -kpse_tilde_expand P1C(const_string, name) -{ - const_string expansion; - const_string home; - - assert (name); - - /* If no leading tilde, do nothing. */ - if (*name != '~') { - expansion = name; - - /* If a bare tilde, return the home directory or `.'. (Very unlikely - that the directory name will do anyone any good, but ... */ - } else if (name[1] == 0) { - expansion = xstrdup (getenv ("HOME")); - if (!expansion) { - expansion = xstrdup ("."); - } - - /* If `~/', remove any trailing / or replace leading // in $HOME. - Should really check for doubled intermediate slashes, too. */ - } else if (IS_DIR_SEP (name[1])) { - unsigned c = 1; - home = getenv ("HOME"); - if (!home) { - home = "."; - } - if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */ - home++; - } - if (IS_DIR_SEP (home[strlen (home) - 1])) { /* omit / after ~ */ - c++; - } - expansion = concat (home, name + c); - - /* If `~user' or `~user/', look up user in the passwd database (but - OS/2 doesn't have this concept. */ - } else -#ifdef HAVE_PWD_H - { - struct passwd *p; - string user; - unsigned c = 2; - while (!IS_DIR_SEP (name[c]) && name[c] != 0) /* find user name */ - c++; - - user = (string) xmalloc (c); - strncpy (user, name + 1, c - 1); - user[c - 1] = 0; - - /* We only need the cast here for (deficient) systems - which do not declare `getpwnam' in <pwd.h>. */ - p = (struct passwd *) getpwnam (user); - free (user); - - /* If no such user, just use `.'. */ - home = p ? p->pw_dir : "."; - if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */ - home++; - } - if (IS_DIR_SEP (home[strlen (home) - 1]) && name[c] != 0) - c++; /* If HOME ends in /, omit the / after ~user. */ - - expansion = name[c] == 0 ? xstrdup (home) : concat (home, name + c); - } -#else /* not HAVE_PWD_H */ - expansion = name; -#endif /* not HAVE_PWD_H */ - - /* We may return the same thing as the original, and then we might not - be returning a malloc-ed string. Callers beware. Sorry. */ - return (string) expansion; -} - -#ifdef TEST - -void -test_expand_tilde (const_string filename) -{ - string answer; - - printf ("Tilde expansion of `%s':\t", filename ? filename : "(nil)"); - answer = kpse_tilde_expand (filename); - puts (answer); -} - -int -main () -{ - string tilde_path = "tilde"; - - test_expand_tilde (""); - test_expand_tilde ("none"); - test_expand_tilde ("~root"); - test_expand_tilde ("~"); - test_expand_tilde ("foo~bar"); - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -standalone-compile-command: "gcc -g -I. -I.. -DTEST tilde.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/tilde.h +++ /dev/null @@ -1,31 +0,0 @@ -/* tilde.h: Declare tilde expander. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TILDE_H -#define KPATHSEA_TILDE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* Replace a leading ~ or ~name in FILENAME with getenv ("HOME") or - name's home directory, respectively. FILENAME may not be null. */ - -extern string kpse_tilde_expand P1H(const_string filename); - -#endif /* not KPATHSEA_TILDE_H */
deleted file mode 100644 --- a/kpathsea/truncate.c +++ /dev/null @@ -1,57 +0,0 @@ -/* truncate.c: truncate too-long components in a filename. - -Copyright (C) 1993, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-namemx.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-pathmx.h> -#include <kpathsea/truncate.h> - - -/* Truncate any too-long components in NAME, returning the result. It's - too bad this is necessary. See comments in readable.c for why. */ - -string -kpse_truncate_filename P1C(const_string, name) -{ - unsigned c_len = 0; /* Length of current component. */ - unsigned ret_len = 0; /* Length of constructed result. */ - - /* Allocate enough space. */ - string ret = (string) xmalloc (strlen (name) + 1); - - for (; *name; name++) - { - if (IS_DIR_SEP (*name) || IS_DEVICE_SEP (*name)) - { /* At a directory delimiter, reset component length. */ - c_len = 0; - } - else if (c_len > NAME_MAX) - { /* If past the max for a component, ignore this character. */ - continue; - } - - /* Copy this character. */ - ret[ret_len++] = *name; - c_len++; - } - ret[ret_len] = 0; - - return ret; -}
deleted file mode 100644 --- a/kpathsea/truncate.h +++ /dev/null @@ -1,30 +0,0 @@ -/* truncate.h: truncate too-long components in a filename. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TRUNCATE_H -#define KPATHSEA_TRUNCATE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Truncate any component in NAME longer than the system NAME_MAX, and - return the result as a malloced string. If none, return a copy of - NAME. */ -extern string kpse_truncate_filename P1H(const_string name); - -#endif /* not KPATHSEA_TRUNCATE_H */
deleted file mode 100644 --- a/kpathsea/types.h +++ /dev/null @@ -1,53 +0,0 @@ -/* types.h: general types. - -Copyright (C) 1993, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_TYPES_H -#define KPATHSEA_TYPES_H - -/* Booleans. */ -#ifdef __cplusplus -/* `true' and `false' are reserved words in C++. Sigh. Although sizeof - (bool) may not equal sizeof (boolean), so this isn't completely - correct, we never rely on the size of the type. */ -#define boolean bool -#else -/* NeXT wants to define their own boolean type. */ -#ifndef HAVE_BOOLEAN -#define HAVE_BOOLEAN -typedef enum { false = 0, true = 1 } boolean; -#endif /* not HAVE_BOOLEAN */ -#endif /* not C++ */ - -/* The X library (among other things) defines `FALSE' and `TRUE', and so - we only want to define them if necessary, for use by application code. */ -#ifndef FALSE -#define FALSE false -#define TRUE true -#endif /* FALSE */ - -/* The usual null-terminated string. */ -typedef char *string; - -/* A pointer to constant data. (ANSI says `const string' is - `char * const', which is a constant pointer to non-constant data.) */ -typedef const char *const_string; - -/* A generic pointer. */ -typedef void *address; - -#endif /* not KPATHSEA_TYPES_H */
deleted file mode 100644 --- a/kpathsea/unixtex.texi +++ /dev/null @@ -1,298 +0,0 @@ -@ifclear version -@defcodeindex fl -@defcodeindex op -@end ifclear - -@node unixtex.ftp -@section @file{unixtex.ftp}: Obtaining @TeX{} - -@cindex obtaining @TeX{} -@cindex retrieving @TeX{} - -@flindex unixtex.ftp -@flindex tug.org -@flindex www.tug.org -@flindex ftp.tug.org -This -@iftex -chapter -@end iftex -is @url{ftp://ftp.tug.org/tex/unixtex.ftp}, last updated 18 March 1998. -Also available as @url{http://www.tug.org/unixtex.ftp}. The IP address -is currently @code{[158.121.106.10]}, and the canonical host name is -currently @samp{tug.org}. It is also in Kpathsea source distributions -as @file{etc/unixtex.ftp} (although the network version is usually -newer). Mail @email{kb@@mail.tug.org} with comments or questions. - -Following are general instructions for Unix or other sites who wish to -acquire the Web2c distribution, (plain) @TeX{}, La@TeX{} (2e), -Bib@TeX{}, Metafont, MetaPost, DVI processors for the X window system, -PostScript, the PCL language in the HP LaserJet, and related programs. -They are oriented towards building from the original sources, though -some information on alternative packages is included in the last -section. See also @url{http://www.tug.org/web2c}, the Web2c and -Kpathsea home page. - -Please consider joining the @TeX{} Users Group (TUG) to help support the -maintenance and development of the programs you retrieve. Email -@email{tug@@tug.org} or see @url{http://www.tug.org} for information and -a membership form. - -For actual installation instructions after obtaining the necessary -sources, see @ref{Installation}. A copy is in the distribution file -@file{kpathsea/INSTALL}. - -@menu -* Electronic distribution:: CTAN and so forth. -* CD-ROM distribution:: -* Tape distribution:: -* Other TeX packages:: -@end menu - - -@node Electronic distribution -@subsection Electronic distribution - -@cindex ftp retrieval -@cindex obtaining Web2c by ftp -@cindex distributions, via ftp - -@cindex CTAN, defined -@cindex backbone of CTAN -In many places we refer to @var{CTAN:}. This is @emph{both} a host name -and a directory name. Here are some primary locations: - -@example -@url{ftp://ctan.tug.org/tex-archive} @r{(California, USA)} -@url{ftp://ftp.dante.de/tex-archive} @r{(Germany)} -@url{ftp://ftp.tex.ac.uk/tex-archive} @r{(England)} -@end example - -@noindent -@flindex README.mirrors -@flindex CTAN.sites -@cindex mirrors, FTP -CTAN has many mirrors worldwide; see the top-level file -@file{README.mirrors} from one of the sites above, or finger -@email{ctan@@ftp.tug.org}, or see @url{http://www.tug.org/CTAN.sites}. -A list current as of the time of distribution is in the top-level file -@file{./MIRROR}. - -@cindex World Wide Web CTAN access -@cindex Gopher CTAN access -@cindex email CTAN access -@cindex NFS CTAN access -You can also access CTAN via the World Wide Web, Gopher, electronic -mail, or NFS. The same @file{README.mirrors} file explains how. - -@cindex binary mode, for file transfers -You will need to retrieve some or all of the following archives, -depending on your needs (don't forget to set binary mode for file -transfers): - -@table @asis -@item @file{@var{CTAN:}/systems/web2c/texmflib.tar.gz} -A basic collection of fonts (TFM files only) and macro packages -(including Texinfo and La@TeX{} 2e). It unpacks into @file{texmf/}; if -you change the structure of this hierarchy, you will also have to change -the default search paths (@pxref{Changing search paths}). It is -required unless you already have these files, in which case you should -change the default paths as necessary to find them. There are other -packages of library files, @file{etexlib.tar.gz}, -@file{omegalib.tar.gz}, and @file{pdftexlib.tar.gz}, that are required -as well if you install e-@TeX{}, Omega, or pdf@TeX{} respectively. - -@item @file{@var{CTAN:}/systems/web2c/web.tar.gz} -@cindex Knuth, Donald E., original author -The original WEB source files, written mostly by Don Knuth. Required -unless you already have this @file{web} version. (The WEB sources -change irregularly with respect to Web2c itself.) Unpacks into -@file{web2c-@var{version}}. - -@item @file{@var{CTAN:}/systems/web2c/web2c.tar.gz} -The Web2c system. Required. Also unpacks into -@file{web2c-@var{version}}. - -@item @file{@var{CTAN:}/systems/web2c/web2c-etex.tar.gz} -Additions to the Web2c system for building e-@TeX{}. Optional. Also -unpacks into @file{web2c-@var{version}}. - -@item @file{@var{CTAN:}/systems/web2c/web2c-omega.tar.gz} -Additions to the Web2c system for building Omega. Optional. Also -unpacks into @file{web2c-@var{version}}. - -@item @file{@var{CTAN:}/systems/web2c/web2c-pdftex.tar.gz} -Additions to the Web2c system for building pdf@TeX{}. Optional. Also -unpacks into @file{web2c-@var{version}}. - -@item @file{@var{CTAN:}/systems/web2c/texk.tar.gz} -The web and web2c sources, plus the additions for web2c, plus the dvi -drivers mentioned below, plus extra dvi drivers and tools not packaged -separately. Recommended if you want to build a complete system. -Unpacks into @file{texk-@var{version}}. - -@c @item @file{@var{CTAN:}/systems/web2c/psfonts.tar.gz} -@c Metrics, outlines, and bitmaps (for previewing) for the 35 de facto -@c standard fonts donated by URW and the additional high-quality freely -@c available PostScript fonts donated by Adobe, Bitstream, and URW, -@c including geometrically-created variants such as oblique and small -@c caps. Unpacks into @file{texmf}. Necessary for PostScript printing or -@c previewing support. - -@item @file{@var{CTAN:}/dviware/dvipsk/dvipsk.tar.gz} -DVI-to-PostScript translator. Unpacks into @file{dvipsk-@var{version}}. -Optional. - -@item @file{@var{CTAN:}/dviware/xdvik/xdvik.tar.gz} -X window system DVI previewer. Unpacks into @file{xdvik-@var{version}}. -Optional. - -@item @file{@var{CTAN:}/dviware/dviljk/dviljk.tar.gz} -DVI-to-PCL (HP LaserJet) translator. Unpacks into -@file{dviljk-@var{version}}. Optional. -@end table - -All that said, the originating host for the software above is -@file{ftp.tug.org}. You can retrieve these distributions (but not much -else) from the @file{tex/} directory on that host. - - -@node CD-ROM distribution -@subsection CD-ROM distribution - -@cindex CD-ROM distributions -@cindex obtaining Web2c on CD-ROM -@cindex distributions, on CD-ROM - -Numerous organizations distribute various @TeX{} CD-ROM's: - -@itemize @bullet -@item -@cindex @TeX{} Live CD-ROM -@cindex TUG -@cindex UKTUG -@cindex GUTenberg -TUG, UK TUG, and GUTenberg (French-speaking @TeX{} user group) -collaborated to produce the @cite{@TeX{} Live} CD-ROM, based on -te@TeX{}, which in turn is based on Web2c; email -@email{tex-live@@mail.tug.org} or see -@url{http://www.tug.org/tex-live.html}. - -@item -@cindex Dante @TeX{} CD-ROM -@cindex German @TeX{} CD info -Dante (the German-speaking @TeX{} user group) has produced a CD-ROM. -See @url{http://www.dante.de/dante/DANTE-CTAN-CD-ROM.html}, and -@url{http://www.dante.de/tex-informationen/CD-ROMs.html} for -information about @TeX{} CD's in general. Both are in German. - -@item -@cindex Free Software Foundation -@cindex FSF Source Code CD-ROM -The Free Software Foundation's @cite{Source Code CD-ROM} contains the -minimal @TeX{} source distribution described in the previous section -(i.e., enough to print GNU documentation); email -@email{gnu@@gnu.org}. - -@item -The Gateway@! CD-ROM set contains a runnable NetBSD/Amiga distribution -and sources; see @url{http://www.netbsd.org/Sites/cdroms.html}. - -@item -The InfoMagic CD-ROM is a copy of CTAN (see previous section); see -@url{http://www.infomagic.com}. - -@item -@cindex 4all@TeX{} Live CD-ROM -@cindex NTG -NTG (Dutch-speaking @TeX{} user group) produced the 4all@TeX{} CD-ROM; -email @email{ntg@@nic.surfnet.nl}, or see -@url{http://www.ntg.nl/4allcd/}. This is a runnable system. - -@item -@cindex Prime Time @TeX{}cetera CD-ROM -The Prime Time @TeX{}cetera CD-ROM is also a copy of CTAN; email -@email{ptf@@ctcl.com} or see @url{http://www.ptf.com/ptf/}. - -@item -@cindex Walnut Creek @TeX{} CD-ROM -Walnut Creek's @TeX{} CD-ROM is also a copy of CTAN; email -@email{info@@cdrom.com} or see -@url{http://www.cdrom.com:/titles/tex.html}. - -@item -@cindex Linux, using Web2c -Most Linux distributions include some @TeX{} package based on -Web2c; see the Linux documentation file @samp{Distribution-HOWTO} for a -comparison of Linux distributions, available (for example) via -@url{http://www.linux.org}. -@end itemize - -If you know of additional @TeX{} CD-ROM distributions to add to this -list, please inform @email{kb@@mail.tug.org}. - - -@node Tape distribution -@subsection Tape distribution - -@cindex tape distribution -@cindex obtaining @TeX{} on tape -@cindex distributions, on tape - -@cindex Northwest Computing Support Center -@flindex unixtex@@u.washington.edu -@cindex support organization -You can obtain a complete @TeX{} distribution, including Web2c, on tape. -Contact: -@display -Pierre MacKay / Denny Hall, Mail Stop DH-10 / Department of Classics -University of Washington / Seattle, WA 98195 / USA -phone: 206-543-2268; email: @email{unixtex@@u.washington.edu} -@end display - -At this writing, the distribution is available in @code{tar} format on -1/4 inch 4-track QIC-24 cartridges and 4@dmn{mm} DAT cartridges, and the -cost is US$210. Make checks payable to the University of Washington, -drawn on a U.S. bank. Purchase orders are acceptable, but they carry an -extra charge of $10 to pay for invoice processing. Overseas sites, -please add $20 for shipment via air parcel post, or $30 for shipment via -courier. - - -@node Other TeX packages -@subsection Other @TeX{} packages - -@cindex other @TeX{} distributions -@cindex @TeX{} distributions besides Web2c - -@cindex Amiga @TeX{} implementations -@cindex Acorn @TeX{} implementations -@cindex VMS @TeX{} implementations -@cindex Macintosh @TeX{} implementations -@cindex DOS @TeX{} implementations -@cindex Windows @TeX{} implementations -Many other @TeX{} implementations are available in -@file{@var{CTAN:}/systems}, including ready-to-run distributions for -Unix, Amiga, Acorn, VMS, Macintosh, DOS, and Windows (in various forms). -Although Web2c has support in the source code for many operating -systems, and in fact some of the other distributions are based on it, -it's unlikely to work as distributed on anything but Unix. (Please -contribute improvements!) - -@cindex te@TeX{} -@cindex precompiled Unix binaries -The Unix distribution alluded to above is the te@TeX{} distribution. -This includes both complete sources and precompiled binaries for many -popular Unix variants, including Linux. It is based on Web2c, and -contains many other @TeX{}-related programs as well. - -@flindex labrea.stanford.edu -@cindex Knuth, Donald E., archive of programs by -The host @t{labrea.stanford.edu} is the original source for the files -for which Donald Knuth is directly responsible: @file{tex.web}, -@file{plain.tex}, etc. However, unless you want to build your @TeX{} -library tree ab initio, it is more reliable and less work to retrieve -these files as part of the above packages. In any case, @t{labrea} is -not the canonical source for anything except what was created by -Stanford @TeX{} project, so do not rely on all the files available at -that ftp site being up-to-date.
deleted file mode 100644 --- a/kpathsea/uppercasify.c +++ /dev/null @@ -1,36 +0,0 @@ -/* uppercasify.c: change all lowercase letters to uppercase. - -Copyright (C) 1993 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-ctype.h> - - -string -uppercasify P1C(const_string, s) -{ - string target; - string ret = xstrdup (s); - - for (target = ret; *target; target++) - { - *target = TOUPPER (*target); - } - - return ret; -}
deleted file mode 100644 --- a/kpathsea/variable.c +++ /dev/null @@ -1,248 +0,0 @@ -/* variable.c: variable expansion. - -Copyright (C) 1993, 94, 95, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/c-ctype.h> -#include <kpathsea/cnf.h> -#include <kpathsea/fn.h> -#include <kpathsea/variable.h> - - -/* Here's the simple one, when a program just wants a value. */ - -string -kpse_var_value P1C(const_string, var) -{ - string ret = getenv (var); - - if (!ret) - ret = kpse_cnf_get (var); - - if (ret) - ret = kpse_var_expand (ret); - -#ifdef KPSE_DEBUG - if (KPSE_DEBUG_P (KPSE_DEBUG_VARS)) - DEBUGF2("variable: %s = %s\n", var, ret ? ret : "(nil)"); -#endif - - return ret; -} - -/* We have to keep track of variables being expanded, otherwise - constructs like TEXINPUTS = $TEXINPUTS result in an infinite loop. - (Or indirectly recursive variables, etc.) Our simple solution is to - add to a list each time an expansion is started, and check the list - before expanding. */ - -typedef struct { - const_string var; - boolean expanding; -} expansion_type; -static expansion_type *expansions; /* The sole variable of this type. */ -static unsigned expansion_len = 0; - -static void -expanding P2C(const_string, var, boolean, xp) -{ - unsigned e; - for (e = 0; e < expansion_len; e++) { - if (STREQ (expansions[e].var, var)) { - expansions[e].expanding = xp; - return; - } - } - - /* New variable, add it to the list. */ - expansion_len++; - XRETALLOC (expansions, expansion_len, expansion_type); - expansions[expansion_len - 1].var = xstrdup (var); - expansions[expansion_len - 1].expanding = xp; -} - - -/* Return whether VAR is currently being expanding. */ - -static boolean -expanding_p P1C(const_string, var) -{ - unsigned e; - for (e = 0; e < expansion_len; e++) { - if (STREQ (expansions[e].var, var)) - return expansions[e].expanding; - } - - return false; -} - -/* Append the result of value of `var' to EXPANSION, where `var' begins - at START and ends at END. If `var' is not set, do not complain. - This is a subroutine for the more complicated expansion function. */ - -static void -expand P3C(fn_type *, expansion, const_string, start, const_string, end) -{ - string value; - unsigned len = end - start + 1; - string var = xmalloc (len + 1); - strncpy (var, start, len); - var[len] = 0; - - if (expanding_p (var)) { - WARNING1 ("kpathsea: variable `%s' references itself (eventually)", var); - } else { - /* Check for an environment variable. */ - value = getenv (var); - - /* If no envvar, check the config files. */ - if (!value) - value = kpse_cnf_get (var); - - if (value) { - expanding (var, true); - value = kpse_var_expand (value); - expanding (var, false); - fn_grow (expansion, value, strlen (value)); - free (value); - } - - free (var); - } -} - -/* Can't think of when it would be useful to change these (and the - diagnostic messages assume them), but ... */ -#ifndef IS_VAR_START /* starts all variable references */ -#define IS_VAR_START(c) ((c) == '$') -#endif -#ifndef IS_VAR_CHAR /* variable name constituent */ -#define IS_VAR_CHAR(c) (ISALNUM (c) || (c) == '_') -#endif -#ifndef IS_VAR_BEGIN_DELIMITER /* start delimited variable name (after $) */ -#define IS_VAR_BEGIN_DELIMITER(c) ((c) == '{') -#endif -#ifndef IS_VAR_END_DELIMITER -#define IS_VAR_END_DELIMITER(c) ((c) == '}') -#endif - - -/* Maybe we should support some or all of the various shell ${...} - constructs, especially ${var-value}. */ - -string -kpse_var_expand P1C(const_string, src) -{ - const_string s; - string ret; - fn_type expansion; - expansion = fn_init (); - - /* Copy everything but variable constructs. */ - for (s = src; *s; s++) { - if (IS_VAR_START (*s)) { - s++; - - /* Three cases: `$VAR', `${VAR}', `$<anything-else>'. */ - if (IS_VAR_CHAR (*s)) { - /* $V: collect name constituents, then expand. */ - const_string var_end = s; - - do { - var_end++; - } while (IS_VAR_CHAR (*var_end)); - - var_end--; /* had to go one past */ - expand (&expansion, s, var_end); - s = var_end; - - } else if (IS_VAR_BEGIN_DELIMITER (*s)) { - /* ${: scan ahead for matching delimiter, then expand. */ - const_string var_end = ++s; - - while (*var_end && !IS_VAR_END_DELIMITER (*var_end)) - var_end++; - - if (! *var_end) { - WARNING1 ("%s: No matching } for ${", src); - s = var_end - 1; /* will incr to null at top of loop */ - } else { - expand (&expansion, s, var_end - 1); - s = var_end; /* will incr past } at top of loop*/ - } - - } else { - /* $<something-else>: error. */ - WARNING2 ("%s: Unrecognized variable construct `$%c'", src, *s); - /* Just ignore those chars and keep going. */ - } - } else - fn_1grow (&expansion, *s); - } - fn_1grow (&expansion, 0); - - ret = FN_STRING (expansion); - return ret; -} - -#ifdef TEST - -static void -test_var (string test, string right_answer) -{ - string result = kpse_var_expand (test); - - printf ("expansion of `%s'\t=> %s", test, result); - if (!STREQ (result, right_answer)) - printf (" [should be `%s']", right_answer); - putchar ('\n'); -} - - -int -main () -{ - test_var ("a", "a"); - test_var ("$foo", ""); - test_var ("a$foo", "a"); - test_var ("$foo a", " a"); - test_var ("a$foo b", "a b"); - - xputenv ("FOO", "foo value"); - test_var ("a$FOO", "afoo value"); - - xputenv ("Dollar", "$"); - test_var ("$Dollar a", "$ a"); - - test_var ("a${FOO}b", "afoo valueb"); - test_var ("a${}b", "ab"); - - test_var ("$$", ""); /* and error */ - test_var ("a${oops", "a"); /* and error */ - - return 0; -} - -#endif /* TEST */ - - -/* -Local variables: -standalone-compile-command: "gcc -g -I. -I.. -DTEST variable.c kpathsea.a" -End: -*/
deleted file mode 100644 --- a/kpathsea/variable.h +++ /dev/null @@ -1,42 +0,0 @@ -/* variable.h: Declare variable expander. - -Copyright (C) 1993, 95 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_VARIABLE_H -#define KPATHSEA_VARIABLE_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - - -/* Return the (variable-expanded) environment variable value or config - file value, or NULL. */ -extern string kpse_var_value P1H(const_string var); - -/* Expand $VAR and ${VAR} references in SRC, returning the (always newly - dynamically-allocated) result. An unterminated ${ or any other - character following $ produce error messages, and that part of SRC is - ignored. In the $VAR form, the variable name consists of consecutive - letters, digits, and underscores. In the ${VAR} form, the variable - name consists of whatever is between the braces. - - In any case, ``expansion'' means calling `getenv'; if the variable is not - set, look in texmf.cnf files for a definition. If not set there, either, - the expansion is the empty string (no error). */ -extern string kpse_var_expand P1H(const_string src); - -#endif /* not KPATHSEA_VARIABLE_H */
deleted file mode 100644 --- a/kpathsea/version.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "c-auto.h" - -char *kpathsea_version_string = (char *) KPSEVERSION; - -/* If you are redistributing a modified version of my original - distribution, please change this address. - - Also change the address in makempx.in, mpto.c, and newer.c in - web2c/mpware/, and in dvilj/dvihp. - - Thanks. --kb@cs.umb.edu */ - -char *kpse_bug_address = (char *) - "Email bug reports to tex-k@mail.tug.org.\n";
deleted file mode 100644 --- a/kpathsea/win32lib.c +++ /dev/null @@ -1,326 +0,0 @@ -/* libc replacement functions for win32. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* - This does make sense only under WIN32. - Functions: - - popen() rewritten - - pclose() rewritten - - stat() wrapper for _stat(), removing trailing slashes - */ - -#ifdef WIN32 - -#include <fcntl.h> -#include <kpathsea/config.h> -#include <kpathsea/c-pathch.h> -#include <kpathsea/c-pathmx.h> -#include <kpathsea/concatn.h> - -struct _popen_elt { - FILE *f; /* File stream returned */ - HANDLE hp; /* Handle of associated process */ - struct _popen_elt *next; /* Next list element */ -}; - -static struct _popen_elt _z = { NULL, 0, &_z }; -static struct _popen_elt *_popen_list = &_z; - -FILE *popen P2C(const_string, cmd, const_string, mode) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; - FILE *f = NULL; - int fno, i; - HANDLE child_in, child_out; - HANDLE father_in, father_out; - HANDLE father_in_dup, father_out_dup; - HANDLE current_in, current_out; - HANDLE current_pid; - int binary_mode; - char *new_cmd, *app_name = NULL; - char *p, *q; - struct _popen_elt *new_process; - char pname[PATH_MAX], *fp; - char *suffixes[] = { ".bat", ".cmd", ".com", ".exe", NULL }; - char **s; - boolean go_on; - - /* We should look for the application name along the PATH, - and decide to prepend "%COMSPEC% /c " or not to the command line. - Do nothing for the moment. */ - - /* Another way to do that would be to try CreateProcess first without - invoking cmd, and look at the error code. If it fails because of - command not found, try to prepend "cmd /c" to the cmd line. - */ - - /* Look for the application name */ - for (p = cmd; *p && isspace(*p); p++); - if (*p == '"') { - q = ++p; - while(*p && *p != '"') p++; - if (*p != '\0') { - fprintf(stderr, "popen: malformed command (\" not terminated)\n"); - return NULL; - } - } - else - for (q = p; *p && !isspace(*p); p++); - /* q points to the beginning of appname, p to the last + 1 char */ - if ((app_name = malloc(p - q + 1)) == NULL) { - fprintf(stderr, "xpopen: malloc(app_name) failed.\n"); - return NULL; - } - strncpy(app_name, q, p - q ); - app_name[p - q] = '\0'; - pname[0] = '\0'; -#ifdef TRACE - fprintf(stderr, "popen: app_name = %s\n", app_name); -#endif - - /* Looking for appname on the path */ - for (s = suffixes, go_on = true; go_on; *s++) { - if (SearchPath(NULL, /* Address of search path */ - app_name, /* Address of filename */ - *s, /* Address of extension */ - PATH_MAX, /* Size of destination buffer */ - pname, /* Address of destination buffer */ - &fp) /* File part of app_name */ - != 0) { -#ifdef TRACE - fprintf(stderr, "%s found with suffix %s\n", app_name, *s); -#endif - new_cmd = xstrdup(cmd); - free(app_name); - app_name = xstrdup(pname); - break; - } - go_on = (*s != NULL); - } - if (go_on == false) { - /* the app_name was not found */ -#ifdef TRACE - fprintf(stderr, "%s not found, concatenating comspec\n", app_name); -#endif - new_cmd = concatn(getenv("COMSPEC"), " /c ", cmd, NULL); - free(app_name); - app_name = NULL; - } - else { - } -#ifdef TRACE - fprintf(stderr, "popen: app_name = %s\n", app_name); - fprintf(stderr, "popen: cmd_line = %s\n", new_cmd); -#endif - - current_in = GetStdHandle(STD_INPUT_HANDLE); - current_out = GetStdHandle(STD_OUTPUT_HANDLE); - current_pid = GetCurrentProcess(); - ZeroMemory( &si, sizeof(STARTUPINFO) ); - si.cb = sizeof(STARTUPINFO); - si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; - si.wShowWindow = SW_HIDE; - - if (strchr(mode, 'b')) - binary_mode = _O_BINARY; - else - binary_mode = _O_TEXT; - - /* Opening the pipe for writing */ - if (strchr(mode, 'w')) { - binary_mode |= _O_WRONLY; - if (CreatePipe(&child_in, &father_out, &sa, 0) == FALSE) { - fprintf(stderr, "popen: error CreatePipe\n"); - return NULL; - } -#if 0 - if (SetStdHandle(STD_INPUT_HANDLE, child_in) == FALSE) { - fprintf(stderr, "popen: error SetStdHandle child_in\n"); - return NULL; - } -#endif - si.hStdInput = child_in; - si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - si.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - if (DuplicateHandle(current_pid, father_out, - current_pid, &father_out_dup, - 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) { - fprintf(stderr, "popen: error DuplicateHandle father_out\n"); - return NULL; - } - CloseHandle(father_out); - fno = _open_osfhandle((long)father_out_dup, binary_mode); - f = _fdopen(fno, mode); - i = setvbuf( f, NULL, _IONBF, 0 ); - } - /* Opening the pipe for reading */ - else if (strchr(mode, 'r')) { - binary_mode |= _O_RDONLY; - if (CreatePipe(&father_in, &child_out, &sa, 0) == FALSE) { - fprintf(stderr, "popen: error CreatePipe\n"); - return NULL; - } -#if 0 - if (SetStdHandle(STD_OUTPUT_HANDLE, child_out) == FALSE) { - fprintf(stderr, "popen: error SetStdHandle child_out\n"); - return NULL; - } -#endif - si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - si.hStdOutput = child_out; - si.hStdError = GetStdHandle(STD_ERROR_HANDLE); - if (DuplicateHandle(current_pid, father_in, - current_pid, &father_in_dup, - 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) { - fprintf(stderr, "popen: error DuplicateHandle father_in\n"); - return NULL; - } - CloseHandle(father_in); - fno = _open_osfhandle((long)father_in_dup, binary_mode); - f = _fdopen(fno, mode); - i = setvbuf( f, NULL, _IONBF, 0 ); - } - else { - fprintf(stderr, "popen: invalid mode %s\n", mode); - return NULL; - } - - /* creating child process */ - if (CreateProcess(app_name, /* pointer to name of executable module */ - new_cmd, /* pointer to command line string */ - NULL, /* pointer to process security attributes */ - NULL, /* pointer to thread security attributes */ - TRUE, /* handle inheritance flag */ - CREATE_NEW_CONSOLE, /* creation flags */ - NULL, /* pointer to environment */ - NULL, /* pointer to current directory */ - &si, /* pointer to STARTUPINFO */ - &pi /* pointer to PROCESS_INFORMATION */ - ) == FALSE) { - fprintf(stderr, "popen: CreateProcess %x\n", GetLastError()); - return NULL; - } - -#if 0 - /* Restoring saved values for stdin/stdout */ - if (SetStdHandle(STD_INPUT_HANDLE, current_in) == FALSE) - fprintf(stderr, "popen: error re-redirecting Stdin\n"); - if (SetStdHandle(STD_OUTPUT_HANDLE, current_out) == FALSE) - fprintf(stderr, "popen: error re-redirecting Stdout\n"); -#endif - /* Only the process handle is needed */ - if (CloseHandle(pi.hThread) == FALSE) { - fprintf(stderr, "popen: error closing thread handle\n"); - return NULL; - } - - if (new_cmd) free(new_cmd); - if (app_name) free(app_name); - -#if 0 - /* This does not seem to make sense for console apps */ - while (1) { - i = WaitForInputIdle(pi.hProcess, 5); /* Wait 5ms */ - if (i == 0xFFFFFFFF) { - fprintf(stderr, "popen: process can't initialize\n"); - return NULL; - } - else if (i == WAIT_TIMEOUT) - fprintf(stderr, "popen: warning, process still not initialized\n"); - else - break; - } -#endif - - /* Add the pair (f, pi.hProcess) to the list */ - if ((new_process = malloc(sizeof(struct _popen_elt))) == NULL) { - fprintf (stderr, "popen: malloc(new_process) error\n"); - return NULL; - } - /* Saving the FILE * pointer, access key for retrieving the process - handle later on */ - new_process->f = f; - /* Closing the unnecessary part of the pipe */ - if (strchr(mode, 'r')) { - CloseHandle(child_out); - } - else if (strchr(mode, 'w')) { - CloseHandle(child_in); - } - /* Saving the process handle */ - new_process->hp = pi.hProcess; - /* Linking it to the list of popen() processes */ - new_process->next = _popen_list; - _popen_list = new_process; - - return f; - -} - -int pclose P1C(FILE *, f) -{ - struct _popen_elt *p, *q; - int exit_code; - - /* Look for f is the access key in the linked list */ - for (q = NULL, p = _popen_list; - p != &_z && p->f != f; - q = p, p = p->next); - - if (p == &_z) { - fprintf(stderr, "pclose: error, file not found."); - return -1; - } - - /* Closing the FILE pointer */ - fclose(f); - - /* Waiting for the process to terminate */ - if (WaitForSingleObject(p->hp, INFINITE) != WAIT_OBJECT_0) { - fprintf(stderr, "pclose: error, process still active\n"); - return -1; - } - - /* retrieving the exit code */ - if (GetExitCodeProcess(p->hp, &exit_code) == 0) { - fprintf(stderr, "pclose: can't get process exit code\n"); - return -1; - } - - /* Closing the process handle, this will cause the system to - remove the process from memory */ - if (CloseHandle(p->hp) == FALSE) { - fprintf(stderr, "pclose: error closing process handle\n"); - return -1; - } - - /* remove the elt from the list */ - if (q != NULL) - q->next = p->next; - else - _popen_list = p->next; - free(p); - - return exit_code; -} - - -#endif
deleted file mode 100644 --- a/kpathsea/win32lib.h +++ /dev/null @@ -1,142 +0,0 @@ -/* System description file for Windows NT. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. - -This file is part of Web2C. - -Web2C is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Web2C is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Web2C; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA -02111 USA. */ - -#ifndef KPATHSEA_WIN32LIB_H -#define KPATHSEA_WIN32LIB_H - -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ - -#ifndef DOSISH -#define DOSISH -#endif - -#ifndef MAXPATHLEN -#define MAXPATHLEN _MAX_PATH -#endif - -#define HAVE_DUP2 1 -#define HAVE_RENAME 1 -#define HAVE_RMDIR 1 -#define HAVE_MKDIR 1 -#define HAVE_GETHOSTNAME 1 -#define HAVE_RANDOM 1 -#define USE_UTIME 1 -#define HAVE_MOUSE 1 -#define HAVE_TZNAME 1 - -/* These have to be defined because our compilers treat __STDC__ as being - defined (most of them anyway). */ - -#define access _access -#define alloca _alloca -#define chdir _chdir -#define chmod _chmod -#define close _close -#define creat _creat -#define dup _dup -#define dup2 _dup2 -#define execlp _execlp -#define execvp _execvp -#define fdopen _fdopen -#define fileno _fileno -#define getpid _getpid -#define getwd(dir) GetCurrentDirectory(MAXPATHLEN, dir) -#define index strchr -#define isatty _isatty -#define itoa _itoa -#define link _link -#define lseek _lseek -#define mkdir _mkdir -#define mktemp _mktemp -#define open _open -#define pipe _pipe -#if 0 -#define popen _popen -#define pclose _pclose -#endif -#define putenv _putenv -#define read _read -#define rmdir _rmdir -#define setmode _setmode -#define spawnlp _spawnlp -#define stat _stat -#define strcasecmp _stricmp -#define strdup _strdup -#define strncasecmp _strnicmp -#define unlink _unlink -#define umask _umask -#define utime _utime -#define write _write - -#define S_IFMT _S_IFMT -#define S_IFDIR _S_IFDIR -#define S_IFCHR _S_IFCHR -#define S_IFIFO _S_IFIFO -#define S_IFREG _S_IFREG -#define S_IREAD _S_IREAD -#define S_IWRITE _S_IWRITE -#define S_IEXEC _S_IEXEC -#define S_IXUSR _S_IEXEC -#define S_IXGRP _S_IEXEC -#define S_IXOTH _S_IEXEC -#define S_IRUSR _S_IREAD -#define S_IWUSR _S_IWRITE -#define O_RDWR _O_RDWR -#define O_CREAT _O_CREAT -#define O_TRUNC _O_TRUNC -#define O_RDONLY _O_RDONLY -#define O_WRONLY _O_WRONLY -#define O_APPEND _O_APPEND -#define O_TEXT _O_TEXT -#define O_BINARY _O_BINARY - -/* Define this so that winsock.h definitions don't get included when - windows.h is... For this to have proper effect, config.h must - always be included before windows.h. */ -#define _WINSOCKAPI_ 1 - -#include <windows.h> - -/* Defines size_t and alloca (). */ -#include <malloc.h> - -/* For proper declaration of environ. */ -#include <stdlib.h> -#include <io.h> -#include <fcntl.h> -#include <stdio.h> -#include <process.h> - -/* Web2C takes care of ensuring that these are defined. */ -#ifdef max -#undef max -#undef min -#endif - -/* Functions from win32lib.c */ -extern FILE *popen(const char *, const char *); -extern int pclose(FILE *); - -/* ============================================================ */ - -#endif /* not KPATHSEA_WIN32LIB_H */
deleted file mode 100644 --- a/kpathsea/withenable.ac +++ /dev/null @@ -1,83 +0,0 @@ -dnl withenable.ac: --with and --enable options. - -AC_ARG_WITH(mktexmf-default, -[ --without-mktexmf-default do not run mktexmf if MF source missing], - , withval=yes) -if test "x$withval" = xyes; then - AC_DEFINE(MAKE_TEX_MF_BY_DEFAULT) -fi -AC_ARG_WITH(mktexpk-default, -[ --without-mktexpk-default do not run mktexpk if PK font missing], - , withval=yes) -if test "x$withval" = xyes; then - AC_DEFINE(MAKE_TEX_PK_BY_DEFAULT) -fi -AC_ARG_WITH(mktextfm-default, -[ --without-mktextfm-default do not run mktextfm if TFM file missing], - , withval=yes) -if test "x$withval" = xyes; then - AC_DEFINE(MAKE_TEX_TFM_BY_DEFAULT) -fi -AC_ARG_WITH(mkocp-default, -[ --without-mkocp-default do not run mkocp if OCP file missing], - , withval=yes) -if test "x$withval" = xyes; then - AC_DEFINE(MAKE_OMEGA_OCP_BY_DEFAULT) -fi -AC_ARG_WITH(mkofm-default, -[ --without-mkofm-default do not run mkofm if OFM file missing], - , withval=yes) -if test "x$withval" = xyes; then - AC_DEFINE(MAKE_OMEGA_OFM_BY_DEFAULT) -fi - -dnl The --enable-multiplatform option. -AC_CANONICAL_HOST -AC_ARG_ENABLE(multiplatform, -[ --enable-multiplatform put executables in bin/PLATFORM], -if test "x$enable_multiplatform" = xyes && - test "x$bindir" = 'x${exec_prefix}/bin' -then - bindir="$bindir/$host" -fi) - -dnl Check whether we can find a texmf tree. Look at the most common spots. -dnl Not a switch, but something that must be included everywhere, even at -dnl at the top level, so putting it in common.ac is not enough. -AC_MSG_CHECKING(where the main texmf tree is located) -texmfmain= -if test "x$datadir" != 'x${prefix}/share'; then - # First case, datadir is defined... - eval p=\"$datadir\" - if test -d "$p/texmf"; then - texmfmain="$p/texmf" - fi -else - # Second case, datadir is default... - if test "x$prefix" = "xNONE"; then - p="$ac_default_prefix" - else - eval p=\"$prefix\" - fi - for e in share/texmf lib/texmf texmf; do - if test -d "$p/$e"; then - texmfmain="$p/$e" - break - fi - done -fi -texmfmain=`echo "$texmfmain" | sed 's,//*,/,g'` -if test -n "$texmfmain"; then - AC_MSG_RESULT("$texmfmain") -else - AC_MSG_RESULT([not found]) -dnl Octave doesn't need this, so don't worry users if it can't be found. -dnl -dnl AC_MSG_WARN([The main texmf tree was not found. -dnl Specify the location of its parent directory with the --datadir option. -dnl If you do not have the files, you can retrieve a minimal set from -dnl ftp://ftp.tug.org/tex/texmflib.tar.gz, which is mirrored on CTAN hosts -dnl in systems/web2c. Winging it by using the default location.]) -dnl texmfmain="$datadir/texmf" -fi -AC_SUBST(texmfmain)
deleted file mode 100644 --- a/kpathsea/xcalloc.c +++ /dev/null @@ -1,35 +0,0 @@ -/* xcalloc.c: calloc with error checking. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -address -xcalloc P2C(unsigned, nelem, unsigned, elsize) -{ - address new_mem = (address) calloc (nelem, elsize); - - if (new_mem == NULL) - { - fprintf (stderr, "xcalloc: request for %u elements of size %u failed.\n", - nelem, elsize); - abort (); - } - - return new_mem; -}
deleted file mode 100644 --- a/kpathsea/xfopen.c +++ /dev/null @@ -1,47 +0,0 @@ -/* xfopen.c: fopen and fclose with error checking. - -Copyright (C) 1992, 93, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -/* These routines just check the return status from standard library - routines and abort if an error happens. */ - -FILE * -xfopen P2C(const_string, filename, const_string, mode) -{ - FILE *f; - - assert (filename && mode); - - f = fopen (filename, mode); - if (f == NULL) - FATAL_PERROR (filename); - - return f; -} - - -void -xfclose P2C(FILE *, f, const_string, filename) -{ - assert (f); - - if (fclose (f) == EOF) - FATAL_PERROR (filename); -}
deleted file mode 100644 --- a/kpathsea/xfseek.c +++ /dev/null @@ -1,27 +0,0 @@ -/* xfseek.c: fseek with error checking. - -Copyright (C) 1992, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -void -xfseek P4C(FILE *, f, long, offset, int, wherefrom, string, filename) -{ - if (fseek (f, offset, wherefrom) < 0) - FATAL_PERROR (filename); -}
deleted file mode 100644 --- a/kpathsea/xftell.c +++ /dev/null @@ -1,31 +0,0 @@ -/* xftell.c: ftell with error checking. - -Copyright (C) 1992, 93, 95 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -unsigned long -xftell P2C(FILE *, f, string, filename) -{ - long where = ftell (f); - - if (where < 0) - FATAL_PERROR (filename); - - return where; -}
deleted file mode 100644 --- a/kpathsea/xgetcwd.c +++ /dev/null @@ -1,153 +0,0 @@ -/* xgetcwd.c: a from-scratch version of getwd. Ideas from the tcsh 5.20 - source, apparently uncopyrighted. - -Copyright (C) 1992, 94, 96 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#if defined (HAVE_GETCWD) || defined (HAVE_GETWD) -#include <kpathsea/c-pathmx.h> -#else /* not HAVE_GETCWD && not HAVE_GETWD*/ -#include <kpathsea/c-dir.h> -#include <kpathsea/xopendir.h> -#include <kpathsea/xstat.h> - - -static void -xchdir P1C(string, dirname) -{ - if (chdir (dirname) != 0) - FATAL_PERROR (dirname); -} - -#endif /* not HAVE_GETCWD && not HAVE_GETWD */ - - -/* Return the pathname of the current directory, or give a fatal error. */ - -string -xgetcwd P1H(void) -{ - /* If the system provides getcwd, use it. If not, use getwd if - available. But provide a way not to use getcwd: on some systems - getcwd forks, which is expensive and may in fact be impossible for - large programs like tex. If your system needs this define and it - is not detected by configure, let me know. - -- Olaf Weber <infovore@xs4all.nl */ -#if defined (HAVE_GETCWD) && !defined (GETCWD_FORKS) - string path = xmalloc (PATH_MAX + 1); - - if (getcwd (path, PATH_MAX + 1) == 0) - { - fprintf (stderr, "getcwd: %s", path); - exit (1); - } - - return path; -#elif defined (HAVE_GETWD) - string path = xmalloc (PATH_MAX + 1); - - if (getwd (path) == 0) - { - fprintf (stderr, "getwd: %s", path); - exit (1); - } - - return path; -#else /* not HAVE_GETCWD && not HAVE_GETWD */ - struct stat root_stat, cwd_stat; - string cwd_path = xmalloc (2); /* In case we assign "/" below. */ - - *cwd_path = 0; - - /* Find the inodes of the root and current directories. */ - root_stat = xstat ("/"); - cwd_stat = xstat ("."); - - /* Go up the directory hierarchy until we get to root, prepending each - directory we pass through to `cwd_path'. */ - while (!SAME_FILE_P (root_stat, cwd_stat)) - { - struct dirent *e; - DIR *parent_dir; - boolean found = false; - - xchdir (".."); - parent_dir = xopendir ("."); - - /* Look through the parent directory for the entry with the same - inode, so we can get its name. */ - while ((e = readdir (parent_dir)) != NULL && !found) - { - struct stat test_stat; - test_stat = xlstat (e->d_name); - - if (SAME_FILE_P (test_stat, cwd_stat)) - { - /* We've found it. Prepend the pathname. */ - string temp = cwd_path; - cwd_path = concat3 ("/", e->d_name, cwd_path); - free (temp); - - /* Set up to test the next parent. */ - cwd_stat = xstat ("."); - - /* Stop reading this directory. */ - found = true; - } - } - if (!found) - FATAL2 ("No inode %d/device %d in parent directory", - cwd_stat.st_ino, cwd_stat.st_dev); - - xclosedir (parent_dir); - } - - /* If the current directory is the root, cwd_path will be the empty - string, and we will have not gone through the loop. */ - if (*cwd_path == 0) - strcpy (cwd_path, "/"); - else - /* Go back to where we were. */ - xchdir (cwd_path); - -#ifdef DOSISH - /* Prepend the drive letter to CWD_PATH, since this technique - never tells us what the drive is. - - Note that on MS-DOS/MS-Windows, the branch that works around - missing `getwd' will probably only work for DJGPP (which does - have `getwd'), because only DJGPP reports meaningful - st_ino numbers. But someday, somebody might need this... */ - { - char drive[3]; - string temp = cwd_path; - - /* Make the drive letter lower-case, unless it is beyond Z: (yes, - there ARE such drives, in case of Novell Netware on MS-DOS). */ - drive[0] = root_stat.st_dev + (root_stat.st_dev < 26 ? 'a' : 'A'); - drive[1] = ':'; - drive[2] = '\0'; - - cwd_path = concat (drive, cwd_path); - free (temp); - } -#endif - - return cwd_path; -#endif /* not HAVE_GETCWD && not HAVE_GETWD */ -}
deleted file mode 100644 --- a/kpathsea/xmalloc.c +++ /dev/null @@ -1,37 +0,0 @@ -/* xmalloc.c: malloc with error checking. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include <kpathsea/config.h> - - -void * -xmalloc P1C(unsigned, size) -{ - void *new_mem = (void *) malloc (size); - - if (new_mem == NULL) - { - fprintf (stderr, "fatal: memory exhausted (xmalloc of %u bytes).\n", - size); - /* 1 means success on VMS, so pick a random number (ASCII `K'). */ - exit (75); - } - - return new_mem; -}
deleted file mode 100644 --- a/kpathsea/xopendir.c +++ /dev/null @@ -1,48 +0,0 @@ -/* xopendir.c: opendir and closedir with error checking. - -Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/xopendir.h> - - -#ifndef WIN32 -DIR * -xopendir P1C(string, dirname) -{ - DIR *d = opendir (dirname); - - if (d == NULL) - FATAL_PERROR (dirname); - - return d; -} -#endif /* not WIN32 */ - -void -xclosedir P1C(DIR *, d) -{ -#ifdef CLOSEDIR_VOID - closedir (d); -#else - int ret = closedir (d); - - if (ret != 0) - FATAL ("closedir failed"); -#endif -}
deleted file mode 100644 --- a/kpathsea/xopendir.h +++ /dev/null @@ -1,30 +0,0 @@ -/* xopendir.h: Checked directory operations. - -Copyright (C) 1994, 96 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if !defined (KPATHSEA_XOPENDIR_H) && !defined (WIN32) -#define KPATHSEA_XOPENDIR_H - -#include <kpathsea/c-dir.h> -#include <kpathsea/c-proto.h> -#include <kpathsea/types.h> - -/* Like opendir and closedir, but abort on error. */ -extern DIR *xopendir P1H(string dirname); -extern void xclosedir P1H(DIR *); - -#endif /* not (KPATHSEA_XOPENDIR_H or WIN32) */
deleted file mode 100644 --- a/kpathsea/xputenv.c +++ /dev/null @@ -1,142 +0,0 @@ -/* xputenv.c: set an environment variable without return. - -Copyright (C) 1993, 94, 95, 96, 97, 98 Karl Berry. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#ifdef WIN32 -#include <stdlib.h> -#else -/* Avoid implicit declaration warning. But since some systems do - declare it, don't use a prototype, for fear of conflicts. */ -extern int putenv (); -#endif /* not WIN32 */ - -/* This `x' function is different from the others in that it takes - different parameters than the standard function; but I find it much - more convenient to pass the variable and the value separately. Also, - this way we can guarantee that the environment value won't become - garbage. Also, putenv just overwrites old entries with - the new, and we want to reclaim that space -- this may be called - hundreds of times on a run. - - But naturally, some systems do it differently. In this case, it's - net2 that is smart and does its own saving/freeing. configure tries - to determine this. */ - -void -xputenv P2C(const_string, var_name, const_string, value) -{ - string old_item = NULL; - string new_item = concat3 (var_name, "=", value); - unsigned name_len = strlen (var_name); - -#ifndef SMART_PUTENV - - static const_string *saved_env_items = NULL; - static unsigned saved_len; - boolean found = false; - - /* Check if we have saved anything yet. */ - if (!saved_env_items) - { - saved_env_items = XTALLOC1 (const_string); - saved_env_items[0] = var_name; - saved_len = 1; - } - else - { - /* Check if we've assigned VAR_NAME before. */ - unsigned i; - for (i = 0; i < saved_len && !found; i++) - { - if (STREQ (saved_env_items[i], var_name)) - { - found = true; - old_item = getenv (var_name); -#ifdef WIN32 - /* win32 putenv() removes the variable if called with - "VAR=". So we have to cope with this case. Distinction - is not made between the value being "" or the variable - not set. */ - if (old_item) - old_item -= (name_len + 1); -#else - assert (old_item); - /* Back up to the `NAME=' in the environment before the - value that getenv returns. */ - old_item -= (name_len + 1); -#endif - } - } - - if (!found) - { - /* If we haven't seen VAR_NAME before, save it. Assume it is - in safe storage. */ - saved_len++; - XRETALLOC (saved_env_items, saved_len, const_string); - saved_env_items[saved_len - 1] = var_name; - } - } -#endif /* not SMART_PUTENV */ - - /* If the old and the new values are identical, don't do anything. - This is both more memory-efficient and safer as far as our - assumptions (about how putenv is implemented in libc) go. */ - if (!old_item || !STREQ (old_item, new_item)) - { - char *new_val; - /* As far as I can see there's no way to distinguish between the - various errors; putenv doesn't have errno values. */ - if (putenv (new_item) < 0) - FATAL1 ("putenv (%s) failed", new_item); - - /* If their putenv copied `new_item', we can free it. */ - new_val = getenv (var_name); - if (new_val && new_val - name_len - 1 != new_item) - free (new_item); - -#ifndef SMART_PUTENV - /* Can't free `new_item' because its contained value is now in - `environ', but we can free `old_item', since it's been replaced. */ -#ifdef WIN32 - /* ... except on Win32, where old_item points to garbage if we set the - variable to "". So we recognize this special case. */ - if (old_item && value && *value) -#else - if (old_item) -#endif - free (old_item); -#endif /* not SMART_PUTENV */ - } -} - - -/* A special case for setting a variable to a numeric value - (specifically, KPATHSEA_DPI). We don't need to dynamically allocate - and free the string for the number, since it's saved as part of the - environment value. */ - -void -xputenv_int P2C(const_string, var_name, int, num) -{ - char str[MAX_INT_LENGTH]; - sprintf (str, "%d", num); - - xputenv (var_name, str); -}
deleted file mode 100644 --- a/kpathsea/xrealloc.c +++ /dev/null @@ -1,48 +0,0 @@ -/* xrealloc.c: realloc with error checking. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include <kpathsea/config.h> - -extern void *xmalloc P1H(unsigned); - -void * -xrealloc P2C(void *, old_ptr, unsigned, size) -{ - void *new_mem; - - if (old_ptr == NULL) - new_mem = xmalloc (size); - else - { - new_mem = (void *) realloc (old_ptr, size); - if (new_mem == NULL) - { - /* We used to print OLD_PTR here using %x, and casting its - value to unsigned, but that lost on the Alpha, where - pointers and unsigned had different sizes. Since the info - is of little or no value anyway, just don't print it. */ - fprintf (stderr, "fatal: memory exhausted (realloc of %u bytes).\n", - size); - /* 1 means success on VMS, so pick a random number (ASCII `B'). */ - exit (66); - } - } - - return new_mem; -}
deleted file mode 100644 --- a/kpathsea/xstat.c +++ /dev/null @@ -1,50 +0,0 @@ -/* xstat.c: stat and (maybe) lstat with error checking. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - -#include <kpathsea/xstat.h> - - -struct stat -xstat P1C(const_string, path) -{ - struct stat s; - - if (stat (path, &s) != 0) - FATAL_PERROR (path); - - return s; -} - - -/* If we don't have symbolic links, lstat is the same as stat, and - a #define is made in the include file. */ - -#ifdef S_ISLNK -struct stat -xlstat P1C(const_string, path) -{ - struct stat s; - - if (lstat (path, &s) != 0) - FATAL_PERROR (path); - - return s; -} -#endif
deleted file mode 100644 --- a/kpathsea/xstat.h +++ /dev/null @@ -1,42 +0,0 @@ -/* xstat.h: stat with error checking. - -Copyright (C) 1992, 93, 94 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef KPATHSEA_XSTAT_H -#define KPATHSEA_XSTAT_H - -#include <kpathsea/c-proto.h> -#include <kpathsea/c-stat.h> -#include <kpathsea/types.h> - -/* Two files are indistinguishable if they are on the same device - and have the same inode. This checks two stat buffers for that. Cf. - the `same_file_p' routine in file-p.c, declared in kpathlib.h. */ -#define SAME_FILE_P(s1, s2) \ - ((s1).st_ino == (s2).st_ino && (s1).st_dev == (s2).st_dev) - -/* Does stat(2) on PATH, and aborts if the stat fails. */ -extern struct stat xstat P1H(const_string path); - -/* Ditto, for lstat(2) (except that lstat might not exist). */ -#ifdef S_ISLNK -extern struct stat xlstat P1H(const_string path); -#else -#define xlstat xstat -#endif - -#endif /* not KPATHSEA_XSTAT_H */
deleted file mode 100644 --- a/kpathsea/xstrdup.c +++ /dev/null @@ -1,29 +0,0 @@ -/* xstrdup.c: strdup with error checking. - -Copyright (C) 1992, 93 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <kpathsea/config.h> - - -/* Return a copy of S in new storage. */ - -string -xstrdup P1C(const_string, s) -{ - string new_string = (string) xmalloc (strlen (s) + 1); - return strcpy (new_string, s); -}
deleted file mode 100644 --- a/kpathsea/xt.ac +++ /dev/null @@ -1,20 +0,0 @@ -dnl Included by web2c and xdvik to handle --with-x-toolkit. - -# This defines --with-x implicitly (which is why we use that package -# name below), so put it here, so it comes first in the --help output. -# This reads best. -AC_PATH_XTRA -AC_ARG_WITH(x-toolkit, - [ --with-x-toolkit=KIT use a toolkit (KIT=no/yes/xt/athena)], -[ case "${withval}" in - y | ye | yes ) val=yes ;; - x | xt ) val=xt ;; - n | no ) val=no ;; - a | at | ath | athe | athena ) val=athena ;; - * ) -AC_MSG_WARN([unknown --with-x-toolkit argument \`$withval'; using yes.]) - val=yes;; - esac - with_x_toolkit=$val -]) -
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,28 @@ +2003-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * getopt.c, getopt1.c, getopt.h: Move here from kpathsea. + * Makefile.in: Add them to the appropriates lists. + + * oct-getopt.c: Include "getopt.h", not <kpathsea/getopt.h>. + + * Makefile.in (liboctave.$(LIBEXT), liboctave.$(SHLEXT)): Adjust + for new locations of kpathsea objects. + Delete kpathsea targets. + + * pathsearch.cc (dir_path::set_program_name): Delete. + + * kpse.cc: New file. + * Makefile.in (LIBOCT_PATHSEARCH_CXX_SOURCES): Add it to the list. + + * kpse.c: New file. + * Makefile.in (LIBOCT_PATHSEARCH_C_SOURCES): Add it to the list. + + * kpse.h, kpse-config.h, kpse-xfns.h: New files. + * Makefile.in (INCLUDES): Add them to the list. + + * oct-kpse.h: Delete. + * Makefile.in (INCLUDES): Delete it from the list. + 2003-04-07 John W. Eaton <jwe@bevo.che.wisc.edu> * dbleSVD.h (SVD::SVD, SVD::operator =): Also copy type_computed.
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -20,7 +20,7 @@ ifeq ($(INCLUDE_LINK_DEPS), true) LINK_DEPS = \ - -L../libcruft -L../kpathsea -L../glob -L. $(RLD_FLAG) \ + -L../libcruft -L../glob -L. $(RLD_FLAG) \ $(LIBCRUFT) $(BLAS_LIBS) $(FFTW_LIBS) $(LIBREADLINE) \ -lglob $(LIBS) $(FLIBS) endif @@ -57,14 +57,15 @@ NLFunc.h NLP.h ODE.h ODEFunc.h ODES.h ODESFunc.h \ ODESSA.h Objective.h QP.h Quad.h Range.h base-dae.h \ base-de.h base-min.h byte-swap.h cmd-edit.h cmd-hist.h \ - data-conv.h dir-ops.h file-ops.h file-stat.h \ - glob-match.h idx-vector.h lo-ieee.h lo-mappers.h \ - lo-specfun.h lo-sstream.h lo-sysdep.h lo-utils.h \ - mach-info.h oct-alloc.h oct-cmplx.h oct-env.h oct-fftw.h \ - oct-getopt.h oct-group.h oct-kpse.h oct-passwd.h oct-rand.h \ - oct-rl-edit.h oct-rl-hist.h oct-shlib.h oct-syscalls.h \ - oct-time.h pathlen.h pathsearch.h prog-args.h statdefs.h \ - str-vec.h sun-utils.h sysdir.h systime.h syswait.h \ + data-conv.h dir-ops.h file-ops.h file-stat.h getopt.h \ + glob-match.h idx-vector.h kpse.h kpse-config.h kpse-xfns.h \ + lo-ieee.h lo-mappers.h lo-specfun.h lo-sstream.h \ + lo-sysdep.h lo-utils.h mach-info.h oct-alloc.h oct-cmplx.h \ + oct-env.h oct-fftw.h oct-getopt.h oct-group.h oct-passwd.h \ + oct-rand.h oct-rl-edit.h oct-rl-hist.h oct-shlib.h \ + oct-syscalls.h oct-time.h pathlen.h pathsearch.h \ + prog-args.h statdefs.h str-vec.h sun-utils.h sysdir.h \ + systime.h syswait.h \ $(OPTS_INC) \ $(MATRIX_INC) \ $(MX_OP_INC) \ @@ -110,7 +111,7 @@ $(MX_OP_SRC) \ $(VX_OP_SRC) -LIBOCTAVE_C_SOURCES := f2c-main.c filemode.c \ +LIBOCTAVE_C_SOURCES := f2c-main.c filemode.c getopt.c getopt1.c \ lo-cieee.c lo-cutils.c mkdir.c oct-getopt.c rename.c \ rmdir.c strftime.c strptime.c tempname.c tempnam.c @@ -122,9 +123,9 @@ LIBOCT_READLINE_SOURCES := $(LIBOCT_READLINE_CXX_SOURCES) $(LIBOCT_READLINE_C_SOURCES) -LIBOCT_PATHSEARCH_CXX_SOURCES := pathsearch.cc +LIBOCT_PATHSEARCH_CXX_SOURCES := pathsearch.cc kpse.cc -LIBOCT_PATHSEARCH_C_SOURCES := oct-kpse.c +LIBOCT_PATHSEARCH_C_SOURCES := kpse-xfns.c LIBOCT_PATHSEARCH_SOURCES := \ $(LIBOCT_PATHSEARCH_C_SOURCES) $(LIBOCT_PATHSEARCH_CXX_SOURCES) @@ -210,24 +211,19 @@ endif .PHONY: libraries -libkpathsea-target: - $(MAKE) -C ../kpathsea -.PHONY: libkpathsea-target - -liboctave.$(LIBEXT): $(LIBOCTAVE_OBJECTS) libkpathsea-target +liboctave.$(LIBEXT): $(LIBOCTAVE_OBJECTS) rm -f $@ - $(TEMPLATE_AR) $(TEMPLATE_ARFLAGS) $@ $(LIBOCTAVE_OBJECTS) \ - ../kpathsea/STATIC/*.o + $(TEMPLATE_AR) $(TEMPLATE_ARFLAGS) $@ $(LIBOCTAVE_OBJECTS) $(RANLIB) $@ liboctave.$(SHLEXT_VER): liboctave.$(SHLEXT) rm -f $@ $(LN_S) $< $@ -liboctave.$(SHLEXT): $(LIBOCTAVE_PICOBJ) libkpathsea-target +liboctave.$(SHLEXT): $(LIBOCTAVE_PICOBJ) rm -f $@ $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ \ - $(LIBOCTAVE_PICOBJ) ../kpathsea/SHARED/*.o $(LINK_DEPS) + $(LIBOCTAVE_PICOBJ) $(LINK_DEPS) $(LIBOCTAVE_PICOBJ): stmp-pic
new file mode 100644 --- /dev/null +++ b/liboctave/getopt.c @@ -0,0 +1,1001 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.org + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. + Ditto for AIX 3.2 and <stdlib.h>. */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#if !defined (__STDC__) || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include <stdio.h> + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 +#include <gnu-versions.h> +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include <stdlib.h> +#include <unistd.h> +#endif /* GNU C library. */ + +#ifdef VMS +#include <unixlib.h> +#if HAVE_STRING_H - 0 +#include <string.h> +#endif +#endif + +#if defined (WIN32) && !defined (__CYGWIN32__) +/* It's not Unix, really. See? Capital letters. */ +#include <stdlib.h> +#include <windows.h> +#define getpid() GetCurrentProcessId() +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +#ifdef HAVE_LIBINTL_H +# include <libintl.h> +# define _(msgid) gettext (msgid) +#else +# define _(msgid) (msgid) +#endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = NULL; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#if defined(__GNU_LIBRARY__) || defined(WIN32) +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include <string.h> +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +#if !defined (__STDC__) || !__STDC__ +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +#endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +static const char *nonoption_flags; +static int nonoption_flags_len; + +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void store_args (int argc, char *const *argv) __attribute__ ((unused)); +static void +store_args (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +text_set_element (__libc_subinit, store_args); +#endif + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined (__STDC__) && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined (__STDC__) && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) + { + /* Bash 2.0 puts a special variable in the environment for each + command it runs, specifying which ARGV elements are the results of + file name wildcard expansion and therefore should not be + considered as options. */ + char var[100]; + sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); + nonoption_flags = getenv (var); + if (nonoption_flags == NULL) + nonoption_flags_len = 0; + else + nonoption_flags_len = strlen (nonoption_flags); + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (!__getopt_initialized || optind == 0) + { + optstring = _getopt_initialize (argc, argv, optstring); + optind = 1; /* Don't scan ARGV[0], the program name. */ + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && nonoption_flags[optind] == '1')) +#else +#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */
--- a/liboctave/getopt.h +++ b/liboctave/getopt.h @@ -105,7 +105,14 @@ #define optional_argument 2 #if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv,
new file mode 100644 --- /dev/null +++ b/liboctave/getopt1.c @@ -0,0 +1,189 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "getopt.h" + +#if !defined (__STDC__) || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include <stdio.h> + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 +#include <gnu-versions.h> +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include <stdlib.h> +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include <stdio.h> + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */
new file mode 100644 --- /dev/null +++ b/liboctave/kpse-config.h @@ -0,0 +1,100 @@ +/* config.h: master configuration file, included first by all compilable + source files (not headers). + +Copyright (C) 1993, 95, 96, 97 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef KPATHSEA_CONFIG_H +#define KPATHSEA_CONFIG_H + +#if defined (__cplusplus) +extern "C" { +#endif + +/* System defines are for non-Unix systems only. (Testing for all Unix + variations should be done in configure.) Presently the defines used + are: DOS OS2 WIN32. I do not use any of these systems + myself; if you do, I'd be grateful for any changes. --kb@mail.tug.org */ + +/* If we have either DOS or OS2, we are DOSISH. */ +#if defined (DOS) || defined (OS2) || defined (WIN32) || defined(__MSDOS__) +#define DOSISH +#endif + +#if defined (DOSISH) +#define MONOCASE_FILENAMES /* case-insensitive filename comparisons */ +#endif + +#if defined(__MINGW32__) +#include <windows.h> +#include <fcntl.h> +#include <dirent.h> +#elif defined(WIN32) +#define __STDC__ 1 +#include "win32lib.h" +#endif /* not WIN32 */ + +#ifdef __DJGPP__ +#include <fcntl.h> /* for long filenames' stuff */ +#include <dir.h> /* for `getdisk' */ +#include <io.h> /* for `setmode' */ +#endif + +/* Some drivers have partially integrated kpathsea changes. */ +#ifndef KPATHSEA +#define KPATHSEA 32 +#endif + +/* System dependencies that are figured out by `configure'. If we are + compiling standalone, we get our c-auto.h. Otherwise, the package + containing us must provide this (unless it can somehow generate ours + from c-auto.in). We use <...> instead of "..." so that the current + cpp directory (i.e., kpathsea/) won't be searched. */ + +#include "kpse-lib.h" /* STREQ, etc. */ + +extern DIR *xopendir (char *dirname); + +extern void xclosedir (DIR *d); + +/* If you want to find subdirectories in a directory with non-Unix + semantics (specifically, if a directory with no subdirectories does + not have exactly two links), define this. */ +#if !defined (DOSISH) || defined(__DJGPP__) +/* Surprise! DJGPP returns st_nlink exactly like on Unix. */ +#define ST_NLINK_TRICK +#endif /* either not DOSISH or __DJGPP__ */ + +#ifdef OS2 +#define access ln_access +#define chmod ln_chmod +#define creat ln_creat +#define fopen ln_fopen +#define freopen ln_freopen +#define lstat ln_lstat +#define open ln_open +#define remove ln_remove +#define rename ln_rename +#define sopen ln_sopen +#define stat ln_stat +#define unlink ln_unlink +#endif /* OS2 */ + +#if defined (__cplusplus) +} +#endif + +#endif /* not KPATHSEA_CONFIG_H */
new file mode 100644 --- /dev/null +++ b/liboctave/kpse-lib.h @@ -0,0 +1,881 @@ +/* lib.h: declarations for common, low-level routines in kpathsea. + +Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +Copyright (C) 1993, 94, 95, 96 Karl Berry. +Copyright (C) 1997, 1998 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef KPATHSEA_LIB_H +#define KPATHSEA_LIB_H + +#if defined (__cplusplus) +extern "C" { +#endif + +/* c-std.h: the first header files. */ + +/* Header files that essentially all of our sources need, and + that all implementations have. We include these first, to help with + NULL being defined multiple times. */ +#include <math.h> +#include <stdio.h> +#include <stdarg.h> + +#include <sys/types.h> + +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <stdlib.h> + +#ifdef WIN32 +#include <malloc.h> +#endif /* not WIN32 */ + +#include <string.h> +#include <errno.h> +#include <assert.h> + +/* c-dir.h: directory headers. */ + +#ifdef WIN32 + +#include <direct.h> + +#else /* not WIN32 */ + +/* Use struct dirent instead of struct direct. */ +#ifdef HAVE_DIRENT_H +#include <dirent.h> +#define NAMLEN(dirent) strlen ((dirent)->d_name) +#else /* not DIRENT */ +#define dirent direct +#define NAMLEN(dirent) ((dirent)->d_namlen) + +#ifdef HAVE_SYS_NDIR_H +#include <sys/ndir.h> +#endif + +#ifdef HAVE_SYS_DIR_H +#include <sys/dir.h> +#endif + +#ifdef HAVE_NDIR_H +#include <ndir.h> +#endif + +#endif /* not DIRENT */ + +#endif /* not WIN32 */ + +/* c-fopen.h: how to open files with fopen. */ + +/* How to open a text file: */ +#ifndef FOPEN_A_MODE +#define FOPEN_A_MODE "a" +#endif + +#ifndef FOPEN_R_MODE +#define FOPEN_R_MODE "r" +#endif + +#ifndef FOPEN_W_MODE +#define FOPEN_W_MODE "w" +#endif + +/* How to open a binary file for reading: */ +#ifndef FOPEN_RBIN_MODE +#if defined(DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) +#define FOPEN_RBIN_MODE "rb" +#else +#define FOPEN_RBIN_MODE "r" +#endif /* not (DOS or OS2 or WIN32 or __DJGPP__ or __CYGWIN32__) */ +#endif /* not FOPEN_RBIN_MODE */ + +/* How to open a binary file for writing: */ +#ifndef FOPEN_WBIN_MODE +#if defined (DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) +#define FOPEN_WBIN_MODE "wb" +#else +#define FOPEN_WBIN_MODE "w" +#endif /* not (DOS or OS2 or WIN32 or DJGPP or CYGWIN32) */ +#endif /* not FOPEN_WBIN_MODE */ + +/* How to open a binary file for appending: */ +#ifndef FOPEN_ABIN_MODE +#if defined (DOS) || defined (OS2) || defined (WIN32) || defined (__DJGPP__) || defined (__CYGWIN32__) +#define FOPEN_ABIN_MODE "ab" +#else +#define FOPEN_ABIN_MODE "a" +#endif /* not (DOS or OS2 or WIN32 or DJGPP or CYGWIN32) */ +#endif /* not FOPEN_ABIN_MODE */ + +/* How to switch an already open file handle to binary mode. + Used on DOSISH systems when we need to switch a standard + stream, such as stdin or stdout, to binary mode. */ +#include <fcntl.h> +#ifdef DOSISH +#include <io.h> +#ifndef O_BINARY +#ifdef _O_BINARY +#define O_BINARY _O_BINARY +#endif +#endif +#if defined (__DJGPP__) || defined (WIN32) || defined (__CYGWIN32__) +#define SET_BINARY(f) setmode((f), O_BINARY) +#endif +#else /* not DOSISH */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif +#define SET_BINARY(f) 0 +#endif /* not DOSISH */ + +/* c-namemx.h: define NAME_MAX, the maximum length of a single + component in a filename. No such limit may exist, or may vary + depending on the filesystem. */ + +#include <limits.h> + +/* Most likely the system will truncate filenames if it is not POSIX, + and so we can use the BSD value here. */ +#ifndef _POSIX_NAME_MAX +#define _POSIX_NAME_MAX 255 +#endif + +#ifndef NAME_MAX +#define NAME_MAX _POSIX_NAME_MAX +#endif + +/* c-ctype.h: ASCII-safe versions of the <ctype.h> macros. */ + +#include <ctype.h> + +/* Be sure we have `isascii'. */ +#ifndef isascii +#define isascii(c) 1 +#endif + +#define ISALNUM(c) (isascii (c) && isalnum(c)) +#define ISALPHA(c) (isascii (c) && isalpha(c)) +#define ISASCII isascii +#define ISCNTRL(c) (isascii (c) && iscntrl(c)) +#define ISDIGIT(c) (isascii (c) && isdigit (c)) +#define ISGRAPH(c) (isascii (c) && isgraph(c)) +#define ISLOWER(c) (isascii (c) && islower(c)) +#define ISPRINT(c) (isascii (c) && isprint(c)) +#define ISPUNCT(c) (isascii (c) && ispunct(c)) +#define ISSPACE(c) (isascii (c) && isspace(c)) +#define ISUPPER(c) (isascii (c) && isupper(c)) +#define ISXDIGIT(c) (isascii (c) && isxdigit(c)) +#define TOASCII toascii +#define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c)) +#define TOUPPER(c) (ISLOWER (c) ? toupper (c) : (c)) + +/* This isn't part of the usual <ctype.h>, but it's useful sometimes. */ +#ifndef isblank +#define isblank(c) ((c) == ' ' || (c) == '\t') +#endif + +/* Here's why this mess is necessary: + +From: meyering@cs.utexas.edu (Jim Meyering) +Date: Wed, 25 Nov 1992 09:52:33 -0600 +Subject: ss-921123: using isascii with <ctype.h> macros + + Yesterday some cursory regression testing found that GNU od + (in an upcoming release of textutils) generated incorrect output + when run on an SGI indigo because isprint ('\377') returned true. + Of course, '\377' is not a printing character; the problem lay + in using isprint without first making sure its integer argument + corresponded to an ascii code. + + MORAL: always guard uses of ctype macros with isascii if it's available. + An obvious alternative is to avoid <ctype.h> and define and use your + own versions of the ctype macros. + + A pretty clean approach to using <ctype.h> and isascii was + suggested by David MacKenzie: + + #ifndef isascii + #define isascii(c) 1 + #endif + + #define ISDIGIT(c) (isascii (c) && isdigit (c)) + #define ISPRINT(c) (isascii (c) && isprint (c)) + ... + + then, use ISDIGIT, etc. instead of isdigit, etc. */ + +/* c-pathch.h: define the characters which separate components of + filenames and environment variable paths. */ + +/* What separates filename components? */ +#ifndef DIR_SEP +#ifdef DOSISH +/* Either \'s or 's work. Wayne Sullivan's web2pc prefers /, so we'll + go with that. */ +#define DIR_SEP '/' +#define DIR_SEP_STRING "/" +#define IS_DEVICE_SEP(ch) ((ch) == ':') +#define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1])) +/* On DOS, it's good to allow both \ and / between directories. */ +#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') +#else +#define DIR_SEP '/' +#define DIR_SEP_STRING "/" +#endif /* not DOSISH */ +#endif /* not DIR_SEP */ + +#ifndef IS_DIR_SEP +#define IS_DIR_SEP(ch) ((ch) == DIR_SEP) +#endif +#ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix. */ +#define IS_DEVICE_SEP(ch) 0 +#endif +#ifndef NAME_BEGINS_WITH_DEVICE +#define NAME_BEGINS_WITH_DEVICE(name) 0 +#endif + +/* What separates elements in environment variable path lists? */ +#ifndef ENV_SEP +#ifdef DOSISH +#define ENV_SEP ';' +#define ENV_SEP_STRING ";" +#else +#define ENV_SEP ':' +#define ENV_SEP_STRING ":" +#endif /* not DOS */ +#endif /* not ENV_SEP */ + +#ifndef IS_ENV_SEP +#define IS_ENV_SEP(ch) ((ch) == ENV_SEP) +#endif + +/* c-pathmx.h: define PATH_MAX, the maximum length of a filename. + Since no such limit may exist, it's preferable to dynamically grow + filenames as needed. */ + +#include <limits.h> + +/* Cheat and define this as a manifest constant no matter what, instead + of using pathconf. I forget why we want to do this. */ + +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX 255 +#endif + +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX _POSIX_PATH_MAX +#endif +#endif /* not PATH_MAX */ + +/* c-proto.h: macros to include or discard prototypes. */ + +#if !defined(WIN32) +#define DllImport +#define __cdecl +#elif (defined(_DLL) && !defined(_IMPORT)) || !defined(_DLL) +#define DllImport +#else +#define DllImport __declspec(dllimport) +#endif + +/* debug.h: Runtime tracing. */ + +/* If NO_DEBUG is defined (not recommended), skip all this. */ +#ifndef NO_DEBUG + +#if defined(WIN32) +#if defined(_DEBUG) +/* This was needed at some time for catching errors in pdftex. */ +#include <crtdbg.h> +#define SET_CRT_DEBUG_FIELD(a) \ + _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +#define CLEAR_CRT_DEBUG_FIELD(a) \ + _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +#define SETUP_CRTDBG \ + { _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); \ + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); \ + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); \ + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); \ + _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); \ + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );\ + } +#else /* ! _DEBUG */ +#define SET_CRT_DEBUG_FIELD(a) +#define CLEAR_CRT_DEBUG_FIELD(a) +#define SETUP_CRTDBG +#endif /* _DEBUG */ +#endif /* WIN32 */ + +/* OK, we'll have tracing support. */ +#define KPSE_DEBUG + +/* Bit vector defining what we should trace. */ +extern DllImport unsigned kpathsea_debug; + +/* Set a bit. */ +#define KPSE_DEBUG_SET(bit) kpathsea_debug |= 1 << (bit) + +/* Test if a bit is on. */ +#define KPSE_DEBUG_P(bit) (kpathsea_debug & (1 << (bit))) + +#define KPSE_DEBUG_STAT 0 /* stat calls */ +#define KPSE_DEBUG_HASH 1 /* hash lookups */ +#define KPSE_DEBUG_FOPEN 2 /* fopen/fclose calls */ +#define KPSE_DEBUG_PATHS 3 /* search path initializations */ +#define KPSE_DEBUG_EXPAND 4 /* path element expansion */ +#define KPSE_DEBUG_SEARCH 5 /* searches */ +#define KPSE_DEBUG_VARS 6 /* variable values */ +#define KPSE_LAST_DEBUG KPSE_DEBUG_VARS + +/* A printf for the debugging. */ +#define DEBUGF_START() do { fputs ("kdebug:", stderr) +#define DEBUGF_END() fflush (stderr); } while (0) + +#define DEBUGF(str) \ + DEBUGF_START (); fputs (str, stderr); DEBUGF_END () +#define DEBUGF1(str, e1) \ + DEBUGF_START (); fprintf (stderr, str, e1); DEBUGF_END () +#define DEBUGF2(str, e1, e2) \ + DEBUGF_START (); fprintf (stderr, str, e1, e2); DEBUGF_END () +#define DEBUGF3(str, e1, e2, e3) \ + DEBUGF_START (); fprintf (stderr, str, e1, e2, e3); DEBUGF_END () +#define DEBUGF4(str, e1, e2, e3, e4) \ + DEBUGF_START (); fprintf (stderr, str, e1, e2, e3, e4); DEBUGF_END () + +#undef fopen +#define fopen kpse_fopen_trace +extern FILE *fopen (const char *filename, const char *mode); +#undef fclose +#define fclose kpse_fclose_trace +extern int fclose (FILE *); + +#endif /* not NO_DEBUG */ + +/* c-stat.h: declarations for using stat(2). */ + +#include <sys/types.h> + +/* This is the symbol that X uses to determine if <sys/types.h> has been + read, so we define it. */ +#define __TYPES__ + +#include <sys/stat.h> + +#if defined (WIN32) && !defined (__MINGW32__) + +/* System description file for Windows NT. */ + +/* + * Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. + */ + +#ifndef DOSISH +#define DOSISH +#endif + +#ifndef MAXPATHLEN +#define MAXPATHLEN _MAX_PATH +#endif + +#define HAVE_DUP2 1 +#define HAVE_RENAME 1 +#define HAVE_RMDIR 1 +#define HAVE_MKDIR 1 +#define HAVE_GETHOSTNAME 1 +#define HAVE_RANDOM 1 +#define USE_UTIME 1 +#define HAVE_MOUSE 1 +#define HAVE_TZNAME 1 + +/* These have to be defined because our compilers treat __STDC__ as being + defined (most of them anyway). */ + +#define access _access +#define alloca _alloca +#define chdir _chdir +#define chmod _chmod +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define execlp _execlp +#define execvp _execvp +#define fdopen _fdopen +#define fileno _fileno +#define getpid _getpid +#define getwd(dir) GetCurrentDirectory(MAXPATHLEN, dir) +#define index strchr +#define isatty _isatty +#define itoa _itoa +#define link _link +#define lseek _lseek +#define mkdir _mkdir +#define mktemp _mktemp +#define open _open +#define pipe _pipe +#if 0 +#define popen _popen +#define pclose _pclose +#endif +#define read _read +#define rmdir _rmdir +#define setmode _setmode +#define spawnlp _spawnlp +#define stat _stat +#define strcasecmp _stricmp +#define strdup _strdup +#define strncasecmp _strnicmp +#define unlink _unlink +#define umask _umask +#define utime _utime +#define write _write + +#define S_IFMT _S_IFMT +#define S_IFDIR _S_IFDIR +#define S_IFCHR _S_IFCHR +#define S_IFIFO _S_IFIFO +#define S_IFREG _S_IFREG +#define S_IREAD _S_IREAD +#define S_IWRITE _S_IWRITE +#define S_IEXEC _S_IEXEC +#define S_IXUSR _S_IEXEC +#define S_IXGRP _S_IEXEC +#define S_IXOTH _S_IEXEC +#define S_IRUSR _S_IREAD +#define S_IWUSR _S_IWRITE +#define O_RDWR _O_RDWR +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_APPEND _O_APPEND +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY + +/* Define this so that winsock.h definitions don't get included when + windows.h is... For this to have proper effect, config.h must + always be included before windows.h. */ +#define _WINSOCKAPI_ 1 + +#include <windows.h> + +/* Defines size_t and alloca (). */ +#include <malloc.h> + +/* For proper declaration of environ. */ +#include <stdlib.h> +#include <io.h> +#include <fcntl.h> +#include <stdio.h> +#include <process.h> + +/* Web2C takes care of ensuring that these are defined. */ +#ifdef max +#undef max +#undef min +#endif + +/* Functions from win32lib.c */ +extern FILE *popen(const char *, const char *); +extern int pclose(FILE *); + +/* ============================================================ */ + +#endif /* WIN32 */ + +/* POSIX predicates for testing file attributes. */ + +#if !defined (S_ISBLK) && defined (S_IFBLK) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#endif +#if !defined (S_ISCHR) && defined (S_IFCHR) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#endif +#if !defined (S_ISDIR) && defined (S_IFDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif +#if !defined (S_ISREG) && defined (S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif +#if !defined (S_ISFIFO) && defined (S_IFIFO) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#endif +#if !defined (S_ISLNK) && defined (S_IFLNK) +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#if !defined (S_ISSOCK) && defined (S_IFSOCK) +#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +#endif +#if !defined (S_ISMPB) && defined (S_IFMPB) /* V7 */ +#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +#endif +#if !defined (S_ISNWK) && defined (S_IFNWK) /* HP/UX */ +#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +#endif + +/* readable.h: Is a file readable? */ + +/* If NAME is readable and is a regular file, return it. If the error is + ENAMETOOLONG, truncate any too-long path components, and if the + result is a readable file, return that. Otherwise return NULL. */ + +extern char *kpse_readable_file (const char *name); + +/* absolute.h: Declare absolute filename predicate. */ + +extern int kpse_absolute_p (const char *filename, int relative_ok); + +/* hash.h: declarations for a hash table. */ + +/* A single (key,value) pair. */ +typedef struct hash_element_struct +{ + const char *key; + const char *value; + struct hash_element_struct *next; +} hash_element_type; + +/* The usual arrangement of buckets initialized to null. */ +typedef struct +{ + hash_element_type **buckets; + unsigned size; +} hash_table_type; + +#ifdef KPSE_DEBUG +/* How to print the hash results when debugging. */ +extern int kpse_debug_hash_lookup_int; +#endif + +/* Create a hash table of size SIZE. */ +extern hash_table_type hash_create (unsigned size); + +/* Insert the (KEY,VALUE) association into TABLE. KEY may have more + than one VALUE. Neither KEY nor VALUE is copied. */ +extern void hash_insert (hash_table_type *table, const char *key, + const char *value); + +/* Remove the (KEY,VALUE) association from TABLE. */ +extern void hash_remove (hash_table_type *table, const char *key, + const char *value); + +/* Look up KEY in MAP, and return NULL-terminated list of all matching + values (not copies), in insertion order. If none, return NULL. */ +extern char **hash_lookup (hash_table_type table, const char *key); + +/* Print TABLE to stderr. */ +extern void hash_print (hash_table_type table, int summary_only); + +/* str-list.h: Declarations for string lists. */ + +/* Lists of strings; used for, e.g., directory lists. */ + +typedef struct +{ + unsigned length; + char **list; +} str_list_type; + +#define STR_LIST_LENGTH(l) ((l).length) +#define STR_LIST(l) ((l).list) +#define STR_LIST_ELT(l, n) STR_LIST (l)[n] +#define STR_LIST_LAST_ELT(l) STR_LIST_ELT (l, STR_LIST_LENGTH (l) - 1) + +/* Return a new, empty, list. */ +extern str_list_type str_list_init (void); + +/* Append the string S to the list L. It's up to the caller to not + deallocate S; we don't copy it. Also up to the caller to terminate + the list with a null entry. */ +extern void str_list_add (str_list_type *l, char *s); + +/* Append all the elements from MORE to TARGET. */ +extern void str_list_concat (str_list_type * target, str_list_type more); + +/* Free the space for the list elements (but not the list elements + themselves). */ +extern void str_list_free (str_list_type *l); + +/* str-llist.h: A linked list of strings, + +It's pretty disgusting that both this and str-list exist; the reason is +that C cannot express iterators very well, and I don't want to change +all the for loops right now. */ + +/* It's a little bizarre to be using the same type for the list and the + elements of the list, but no reason not to in this case, I think -- + we never need a NULL string in the middle of the list, and an extra + NULL/NULL element always at the end is inconsequential. */ + +struct str_llist_elt +{ + char *str; + int moved; + struct str_llist_elt *next; +}; +typedef struct str_llist_elt str_llist_elt_type; +typedef struct str_llist_elt *str_llist_type; + +#define STR_LLIST(sl) ((sl).str) +#define STR_LLIST_MOVED(sl) ((sl).moved) +#define STR_LLIST_NEXT(sl) ((sl).next) + + +/* Add the new string E to the end of the list L. */ +extern void str_llist_add (str_llist_type *l, char *e); + +/* Reorganize L so that E is below only other elements that have already + been moved. Set `moved' member for E. */ +extern void str_llist_float (str_llist_type *l, str_llist_elt_type *e); + +/* xstat.h: stat with error checking. */ + +/* Two files are indistinguishable if they are on the same device + and have the same inode. This checks two stat buffers for that. Cf. + the `same_file_p' routine in file-p.c, declared in kpathlib.h. */ +#define SAME_FILE_P(s1, s2) \ + ((s1).st_ino == (s2).st_ino && (s1).st_dev == (s2).st_dev) + +/* Does stat(2) on PATH, and aborts if the stat fails. */ +extern struct stat xstat (const char *path); + +/* Ditto, for lstat(2) (except that lstat might not exist). */ +#ifdef S_ISLNK +extern struct stat xlstat (const char *path); +#else +#define xlstat xstat +#endif + +/* fn.h: arbitrarily long filenames (or just strings). */ + +/* Arbitrarily long filenames; it's inconvenient to use obstacks here, + because we want to maintain a null terminator. Also used for + dynamically growing strings even when the null byte isn't necessary, + e.g., in `variable.c', since I don't want to pass obstacks around + everywhere, and one can't free parts of an obstack arbitrarily. */ + +typedef struct +{ + char *str; + unsigned allocated; + unsigned length; /* includes the terminating null byte, if any */ +} fn_type; + +#define FN_STRING(fn) ((fn).str) +#define FN_ALLOCATED(fn) ((fn).allocated) +#define FN_LENGTH(fn) ((fn).length) + + +/* Create a new empty fn. */ +extern fn_type fn_init (void); + +/* Create a new fn from the first LEN characters from S and a null. */ +extern fn_type fn_copy0 (const char *s, unsigned len); + +/* Free what's been allocated. Can also just free the string if it's + been extracted out. Fatal error if nothing allocated in F. */ +extern void fn_free (fn_type *f); + +/* Append the character C to the fn F. Don't append trailing null. */ +extern void fn_1grow (fn_type *f, char c); + +/* Append LENGTH bytes from SOURCE to F. */ +extern void fn_grow (fn_type *f, void *source, unsigned length); + +/* Concatenate the component S to the fn F. Assumes string currently in + F is null terminated. */ +extern void fn_str_grow (fn_type *f, const char *s); + +/* Add a null to F's string at position LOC, and update its length. + Fatal error if LOC is past the end of the string. */ +extern void fn_shrink_to (fn_type *f, unsigned loc); + +/* variable.h: Declare variable expander. */ + +/* Return the (variable-expanded) environment variable value or config + file value, or NULL. */ +extern char *kpse_var_value (const char *var); + +/* Expand $VAR and ${VAR} references in SRC, returning the (always newly + dynamically-allocated) result. An unterminated ${ or any other + character following $ produce error messages, and that part of SRC is + ignored. In the $VAR form, the variable name consists of consecutive + letters, digits, and underscores. In the ${VAR} form, the variable + name consists of whatever is between the braces. + + In any case, ``expansion'' means calling `getenv'; if the variable is not + set, look in texmf.cnf files for a definition. If not set there, either, + the expansion is the empty string (no error). */ +extern char *kpse_var_expand (const char *src); + +/* lib.h: other stuff. */ + +#ifndef WIN32 +/* `popen' and `pclose' are part of POSIX.2, not POSIX.1. So + STDC_HEADERS isn't enough. */ +extern FILE *popen (); +extern int pclose (); +#endif /* not WIN32 */ + +/* Define common sorts of messages. */ + +/* This should be called only after a system call fails. Don't exit + with status `errno', because that might be 256, which would mean + success (exit statuses are truncated to eight bits). */ +#define FATAL_PERROR(str) do { \ + fputs ("pathsearch: ", stderr); \ + perror (str); exit (EXIT_FAILURE); } while (0) + +#define START_FATAL() do { \ + fputs ("pathsearch: fatal: ", stderr); +#define END_FATAL() fputs (".\n", stderr); exit (1); } while (0) + +#define FATAL(str) \ + START_FATAL (); fputs (str, stderr); END_FATAL () +#define FATAL1(str, e1) \ + START_FATAL (); fprintf (stderr, str, e1); END_FATAL () +#define FATAL2(str, e1, e2) \ + START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL () +#define FATAL3(str, e1, e2, e3) \ + START_FATAL (); fprintf (stderr, str, e1, e2, e3); END_FATAL () +#define FATAL4(str, e1, e2, e3, e4) \ + START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4); END_FATAL () +#define FATAL5(str, e1, e2, e3, e4, e5) \ + START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5); END_FATAL () +#define FATAL6(str, e1, e2, e3, e4, e5, e6) \ + START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5, e6); END_FATAL () + + +#define START_WARNING() do { fputs ("warning: ", stderr) +#define END_WARNING() fputs (".\n", stderr); fflush (stderr); } while (0) + +#define WARNING(str) \ + START_WARNING (); fputs (str, stderr); END_WARNING () +#define WARNING1(str, e1) \ + START_WARNING (); fprintf (stderr, str, e1); END_WARNING () +#define WARNING2(str, e1, e2) \ + START_WARNING (); fprintf (stderr, str, e1, e2); END_WARNING () +#define WARNING3(str, e1, e2, e3) \ + START_WARNING (); fprintf (stderr, str, e1, e2, e3); END_WARNING () +#define WARNING4(str, e1, e2, e3, e4) \ + START_WARNING (); fprintf (stderr, str, e1, e2, e3, e4); END_WARNING () + + +/* I find this easier to read. */ +#define STREQ(s1, s2) (strcmp (s1, s2) == 0) +#define STRNEQ(s1, s2, n) (strncmp (s1, s2, n) == 0) + +/* Support for FAT/ISO-9660 filesystems. Theoretically this should be + done at runtime, per filesystem, but that's painful to program. */ +#ifdef MONOCASE_FILENAMES +#define FILESTRCASEEQ(s1, s2) (strcasecmp (s1, s2) == 0) +#define FILESTRNCASEEQ(s1, s2, l) (strncasecmp (s1, s2, l) == 0) +#define FILECHARCASEEQ(c1, c2) (toupper (c1) == toupper (c2)) +#else +#define FILESTRCASEEQ STREQ +#define FILESTRNCASEEQ STRNEQ +#define FILECHARCASEEQ(c1, c2) ((c1) == (c2)) +#endif + +/* This is the maximum number of numerals that result when a 64-bit + integer is converted to a string, plus one for a trailing null byte, + plus one for a sign. */ +#define MAX_INT_LENGTH 21 + +/* If the environment variable TEST is set, return it; otherwise, + DEFAULT. This is useful for paths that use more than one envvar. */ +#define ENVVAR(test, default) (getenv (test) ? (test) : (default)) + +/* Return a fresh copy of S1 followed by S2, et al. */ +extern DllImport char *concat (const char *s1, const char *s2); +extern DllImport char *concat3 (const char *, const char *, const char *); +extern DllImport char *concatn (const char *str1, ...); + +/* A fresh copy of just S. */ +extern DllImport char *xstrdup (const char *s); + +/* True if FILENAME1 and FILENAME2 are the same file. If stat fails on + either name, return false, no error message. + Cf. `SAME_FILE_P' in xstat.h. */ +extern DllImport int same_file_p (const char *filename1, + const char *filename2); + +#ifndef HAVE_BASENAME +/* Return NAME with any leading path stripped off. This returns a + pointer into NAME. */ +extern DllImport const char *basename (const char *name); +#endif /* not HAVE_BASENAME */ + +/* If NAME has a suffix, return a pointer to its first character (i.e., + the one after the `.'); otherwise, return NULL. */ +extern DllImport char *find_suffix (const char *name); + +/* Return NAME with any suffix removed. */ +extern DllImport char *remove_suffix (const char *name); + +/* Return S with the suffix SUFFIX, removing any suffix already present. + For example, `make_suffix ("/foo/bar.baz", "quux")' returns + `/foo/bar.quux'. Returns a string allocated with malloc. */ +extern DllImport char *make_suffix (const char *s, const char *suffix); + +/* Return NAME with STEM_PREFIX prepended to the stem. For example, + `make_prefix ("/foo/bar.baz", "x")' returns `/foo/xbar.baz'. + Returns a string allocated with malloc. */ +extern DllImport char *make_prefix (char *stem_prefix, char *name); + + +/* Return the current working directory. */ +extern DllImport char *xgetcwd (void); + +/* Returns true if FN is a directory or a symlink to a directory. */ +extern DllImport int dir_p (const char *fn); + +/* If FN is a readable directory, return the number of links it has. + Otherwise, return -1. */ +extern DllImport int dir_links (const char *fn); + +/* Like their stdio counterparts, but abort on error, after calling + perror(3) with FILENAME as its argument. */ +extern DllImport FILE *xfopen (const char *filename, const char *mode); +extern DllImport void xfclose (FILE *, const char *filename); + +/* These call the corresponding function in the standard library, and + abort if those routines fail. Also, `xrealloc' calls `xmalloc' if + OLD_ADDRESS is null. */ +extern DllImport void *xmalloc (unsigned size); +extern DllImport void *xrealloc (void *old_address, unsigned new_size); + +extern DllImport char *xbasename (const char *name); + +/* (Re)Allocate N items of type T using xmalloc/xrealloc. */ +#define XTALLOC(n, t) ((t *) xmalloc ((n) * sizeof (t))) +#define XTALLOC1(t) XTALLOC (1, t) +#define XRETALLOC(addr, n, t) ((addr) = (t *) xrealloc (addr, (n) * sizeof(t))) + +#if defined (__cplusplus) +} +#endif + +#endif /* not KPATHSEA_LIB_H */
new file mode 100644 --- /dev/null +++ b/liboctave/kpse-xfns.c @@ -0,0 +1,1623 @@ +/* xfns.c: All the x* functions from kpathsearch in one file. + +Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +Copyright (C) 1993, 94, 95, 96, 97, 98 Karl Berry. +Copyright (C) 1994, 95, 96, 97 Karl Berry & Olaf Weber. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if defined (HAVE_CONFIG_H) +#include <config.h> +#endif + +#ifdef HAVE_UNISTD_H +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#include <unistd.h> +#endif + +#include <stdio.h> +#include <stdlib.h> + +#include "kpse-lib.h" + +/* xfopen.c: fopen and fclose with error checking. */ + +/* These routines just check the return status from standard library + routines and abort if an error happens. */ + +FILE * +xfopen (const char *filename, const char *mode) +{ + FILE *f; + + assert (filename && mode); + + f = fopen (filename, mode); + if (f == NULL) + FATAL_PERROR (filename); + + return f; +} + +void +xfclose (FILE *f, const char *filename) +{ + assert (f); + + if (fclose (f) == EOF) + FATAL_PERROR (filename); +} + +/* xfseek.c: fseek with error checking. */ + +void +xfseek (FILE *f, long offset, int wherefrom, char *filename) +{ + if (fseek (f, offset, wherefrom) < 0) + FATAL_PERROR (filename); +} + +/* xftell.c: ftell with error checking. */ + +unsigned long +xftell (FILE *f, char *filename) +{ + long where = ftell (f); + + if (where < 0) + FATAL_PERROR (filename); + + return where; +} + +/* xopendir.c: opendir and closedir with error checking. */ + +#ifndef WIN32 +DIR * +xopendir (char *dirname) +{ + DIR *d = opendir (dirname); + + if (d == NULL) + FATAL_PERROR (dirname); + + return d; +} +#endif /* not WIN32 */ + +void +xclosedir (DIR *d) +{ +#ifdef CLOSEDIR_VOID + closedir (d); +#else + int ret = closedir (d); + + if (ret != 0) + FATAL ("closedir failed"); +#endif +} + +/* xstat.c: stat and (maybe) lstat with error checking. */ + +struct stat +xstat (const char *path) +{ + struct stat s; + + if (stat (path, &s) != 0) + FATAL_PERROR (path); + + return s; +} + +/* If we don't have symbolic links, lstat is the same as stat, and + a #define is made in the include file. */ + +#ifdef S_ISLNK +struct stat +xlstat (const char *path) +{ + struct stat s; + + if (lstat (path, &s) != 0) + FATAL_PERROR (path); + + return s; +} +#endif + +/* xgetcwd.c: a from-scratch version of getwd. Ideas from the tcsh 5.20 + source, apparently uncopyrighted. */ + +#if ! (defined (HAVE_GETCWD) || defined (HAVE_GETWD)) + +static void +xchdir (char *dirname) +{ + if (chdir (dirname) != 0) + FATAL_PERROR (dirname); +} + +#endif /* not HAVE_GETCWD && not HAVE_GETWD */ + +/* Return the pathname of the current directory, or give a fatal error. */ + +char * +xgetcwd (void) +{ + /* If the system provides getcwd, use it. If not, use getwd if + available. But provide a way not to use getcwd: on some systems + getcwd forks, which is expensive and may in fact be impossible for + large programs like tex. If your system needs this define and it + is not detected by configure, let me know. + -- Olaf Weber <infovore@xs4all.nl */ +#if defined (HAVE_GETCWD) && !defined (GETCWD_FORKS) + char *path = (char *) xmalloc (PATH_MAX + 1); + + if (getcwd (path, PATH_MAX + 1) == 0) + { + fprintf (stderr, "getcwd: %s", path); + exit (1); + } + + return path; +#elif defined (HAVE_GETWD) + char *path = (char *) xmalloc (PATH_MAX + 1); + + if (getwd (path) == 0) + { + fprintf (stderr, "getwd: %s", path); + exit (1); + } + + return path; +#else /* not HAVE_GETCWD && not HAVE_GETWD */ + struct stat root_stat, cwd_stat; + char *cwd_path = (char *) xmalloc (2); /* In case we assign "/" below. */ + + *cwd_path = 0; + + /* Find the inodes of the root and current directories. */ + root_stat = xstat ("/"); + cwd_stat = xstat ("."); + + /* Go up the directory hierarchy until we get to root, prepending each + directory we pass through to `cwd_path'. */ + while (!SAME_FILE_P (root_stat, cwd_stat)) + { + struct dirent *e; + DIR *parent_dir; + int found = 0; + + xchdir (".."); + parent_dir = xopendir ("."); + + /* Look through the parent directory for the entry with the same + inode, so we can get its name. */ + while ((e = readdir (parent_dir)) != NULL && !found) + { + struct stat test_stat; + test_stat = xlstat (e->d_name); + + if (SAME_FILE_P (test_stat, cwd_stat)) + { + /* We've found it. Prepend the pathname. */ + char *temp = cwd_path; + cwd_path = concat3 ("/", e->d_name, cwd_path); + free (temp); + + /* Set up to test the next parent. */ + cwd_stat = xstat ("."); + + /* Stop reading this directory. */ + found = 1; + } + } + if (!found) + FATAL2 ("No inode %d/device %d in parent directory", + cwd_stat.st_ino, cwd_stat.st_dev); + + xclosedir (parent_dir); + } + + /* If the current directory is the root, cwd_path will be the empty + string, and we will have not gone through the loop. */ + if (*cwd_path == 0) + strcpy (cwd_path, "/"); + else + /* Go back to where we were. */ + xchdir (cwd_path); + +#ifdef DOSISH + /* Prepend the drive letter to CWD_PATH, since this technique + never tells us what the drive is. + + Note that on MS-DOS/MS-Windows, the branch that works around + missing `getwd' will probably only work for DJGPP (which does + have `getwd'), because only DJGPP reports meaningful + st_ino numbers. But someday, somebody might need this... */ + { + char drive[3]; + char *temp = cwd_path; + + /* Make the drive letter lower-case, unless it is beyond Z: (yes, + there ARE such drives, in case of Novell Netware on MS-DOS). */ + drive[0] = root_stat.st_dev + (root_stat.st_dev < 26 ? 'a' : 'A'); + drive[1] = ':'; + drive[2] = '\0'; + + cwd_path = concat (drive, cwd_path); + free (temp); + } +#endif + + return cwd_path; +#endif /* not HAVE_GETCWD && not HAVE_GETWD */ +} + +/* xmalloc.c: malloc with error checking. */ + +void * +xmalloc (unsigned size) +{ + void *new_mem = (void *) malloc (size); + + if (new_mem == NULL) + { + fprintf (stderr, "fatal: memory exhausted (xmalloc of %u bytes).\n", + size); + /* 1 means success on VMS, so pick a random number (ASCII `K'). */ + exit (75); + } + + return new_mem; +} + +/* xrealloc.c: realloc with error checking. */ + +extern void *xmalloc (unsigned); + +void * +xrealloc (void *old_ptr, unsigned size) +{ + void *new_mem; + + if (old_ptr == NULL) + new_mem = xmalloc (size); + else + { + new_mem = (void *) realloc (old_ptr, size); + if (new_mem == NULL) + { + /* We used to print OLD_PTR here using %x, and casting its + value to unsigned, but that lost on the Alpha, where + pointers and unsigned had different sizes. Since the info + is of little or no value anyway, just don't print it. */ + fprintf (stderr, "fatal: memory exhausted (realloc of %u bytes).\n", + size); + /* 1 means success on VMS, so pick a random number (ASCII `B'). */ + exit (66); + } + } + + return new_mem; +} + +/* xstrdup.c: strdup with error checking. */ + +/* Return a copy of S in new storage. */ + +char * +xstrdup (const char *s) +{ + char *new_string = (char *) xmalloc (strlen (s) + 1); + return strcpy (new_string, s); +} + +/* basename.c: return the last element in a path. */ + +#ifndef HAVE_BASENAME + +/* Return NAME with any leading path stripped off. This returns a + pointer into NAME. For example, `basename ("/foo/bar.baz")' + returns "bar.baz". */ + +const char * +basename (const char *name) +{ + const char *base = NULL; + unsigned len = strlen (name); + + for (len = strlen (name); len > 0; len--) { + if (IS_DIR_SEP (name[len - 1]) || IS_DEVICE_SEP (name[len - 1])) { + base = name + len; + break; + } + } + + if (!base) + base = name; + + return base; +} + +#endif + +char * +xbasename (const char *name) +{ + return (char *) basename (name); +} + +/* file-p.c: file predicates. */ + +/* Test whether FILENAME1 and FILENAME2 are actually the same file. If + stat fails on either of the names, we return false, without error. */ + +int +same_file_p (const char *filename1, const char *filename2) +{ + struct stat sb1, sb2; + /* These are put in variables only so the results can be inspected + under gdb. */ + int r1 = stat (filename1, &sb1); + int r2 = stat (filename2, &sb2); + + return r1 == 0 && r2 == 0 ? SAME_FILE_P (sb1, sb2) : 0; +} + +/* dir.c: directory operations. */ + +/* Return true if FN is a directory or a symlink to a directory, + false if not. */ + +int +dir_p (const char *fn) +{ +#ifdef WIN32 + int fa = GetFileAttributes(fn); + return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY)); +#else + struct stat stats; + return stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode); +#endif +} + +#ifndef WIN32 + +/* Return -1 if FN isn't a directory, else its number of links. + Duplicate the call to stat; no need to incur overhead of a function + call for that little bit of cleanliness. */ + +int +dir_links (const char *fn) +{ + static hash_table_type link_table; + char **hash_ret; + long ret; + + if (link_table.size == 0) + link_table = hash_create (457); + +#ifdef KPSE_DEBUG + /* This is annoying, but since we're storing integers as pointers, we + can't print them as strings. */ + if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) + kpse_debug_hash_lookup_int = 1; +#endif + + hash_ret = hash_lookup (link_table, fn); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) + kpse_debug_hash_lookup_int = 0; +#endif + + /* Have to cast the int we need to/from the const_string that the hash + table stores for values. Let's hope an int fits in a pointer. */ + if (hash_ret) + ret = (long) *hash_ret; + else + { + struct stat stats; + ret = stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode) + ? stats.st_nlink : (unsigned) -1; + + /* It's up to us to copy the value. */ + hash_insert (&link_table, xstrdup (fn), (const char *) ret); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_STAT)) + DEBUGF2 ("dir_links(%s) => %ld\n", fn, ret); +#endif + } + + return ret; +} + +#endif /* !WIN32 */ + +/* hash.c: hash table operations. */ + +/* The hash function. We go for simplicity here. */ + +/* All our hash tables are related to filenames. */ +#ifdef MONOCASE_FILENAMES +#define TRANSFORM(x) toupper (x) +#else +#define TRANSFORM(x) (x) +#endif + +static unsigned +hash (hash_table_type table, const char *key) +{ + unsigned n = 0; + + /* Our keys aren't often anagrams of each other, so no point in + weighting the characters. */ + while (*key != 0) + n = (n + n + TRANSFORM (*key++)) % table.size; + + return n; +} + +hash_table_type +hash_create (unsigned size) +{ + /* hash_table_type ret; changed into "static ..." to work around gcc + optimizer bug for Alpha. */ + static hash_table_type ret; + unsigned b; + ret.buckets = XTALLOC (size, hash_element_type *); + ret.size = size; + + /* calloc's zeroes aren't necessarily NULL, so be safe. */ + for (b = 0; b <ret.size; b++) + ret.buckets[b] = NULL; + + return ret; +} + +/* Whether or not KEY is already in MAP, insert it and VALUE. Do not + duplicate the strings, in case they're being purposefully shared. */ + +void +hash_insert (hash_table_type *table, const char *key, const char *value) +{ + unsigned n = hash (*table, key); + hash_element_type *new_elt = XTALLOC1 (hash_element_type); + + new_elt->key = key; + new_elt->value = value; + new_elt->next = NULL; + + /* Insert the new element at the end of the list. */ + if (!table->buckets[n]) + /* first element in bucket is a special case. */ + table->buckets[n] = new_elt; + else + { + hash_element_type *loc = table->buckets[n]; + while (loc->next) /* Find the last element. */ + loc = loc->next; + loc->next = new_elt; /* Insert the new one after. */ + } +} + +/* Remove a (KEY, VALUE) pair. */ + +void +hash_remove (hash_table_type *table, const char *key, const char *value) +{ + hash_element_type *p; + hash_element_type *q; + unsigned n = hash (*table, key); + + /* Find pair. */ + for (q = NULL, p = table->buckets[n]; p != NULL; q = p, p = p->next) + if (FILESTRCASEEQ (key, p->key) && STREQ (value, p->value)) + break; + if (p) { + /* We found something, remove it from the chain. */ + if (q) q->next = p->next; else table->buckets[n] = p->next; + /* We cannot dispose of the contents. */ + free (p); + } +} + +/* Look up STR in MAP. Return a (dynamically-allocated) list of the + corresponding strings or NULL if no match. */ + +#ifdef KPSE_DEBUG +/* Print the hash values as integers if this is nonzero. */ +int kpse_debug_hash_lookup_int = 0; +#endif + +char ** +hash_lookup (hash_table_type table, const char *key) +{ + hash_element_type *p; + str_list_type ret; + unsigned n = hash (table, key); + ret = str_list_init (); + + /* Look at everything in this bucket. */ + for (p = table.buckets[n]; p != NULL; p = p->next) + if (FILESTRCASEEQ (key, p->key)) + /* Cast because the general str_list_type shouldn't force const data. */ + str_list_add (&ret, (char *) p->value); + + /* If we found anything, mark end of list with null. */ + if (STR_LIST (ret)) + str_list_add (&ret, NULL); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) + { + DEBUGF1 ("hash_lookup(%s) =>", key); + if (!STR_LIST (ret)) + fputs (" (nil)\n", stderr); + else + { + char **r; + for (r = STR_LIST (ret); *r; r++) + { + putc (' ', stderr); + if (kpse_debug_hash_lookup_int) + fprintf (stderr, "%ld", (long) *r); + else + fputs (*r, stderr); + } + putc ('\n', stderr); + } + fflush (stderr); + } +#endif + + return STR_LIST (ret); +} + +/* We only print nonempty buckets, to decrease output volume. */ + +void +hash_print (hash_table_type table, int summary_only) +{ + unsigned b; + unsigned total_elements = 0, total_buckets = 0; + + for (b = 0; b < table.size; b++) { + hash_element_type *bucket = table.buckets[b]; + + if (bucket) { + unsigned len = 1; + hash_element_type *tb; + + total_buckets++; + if (!summary_only) fprintf (stderr, "%4d ", b); + + for (tb = bucket->next; tb != NULL; tb = tb->next) + len++; + if (!summary_only) fprintf (stderr, ":%-5d", len); + total_elements += len; + + if (!summary_only) { + for (tb = bucket; tb != NULL; tb = tb->next) + fprintf (stderr, " %s=>%s", tb->key, tb->value); + putc ('\n', stderr); + } + } + } + + fprintf (stderr, + "%u buckets, %u nonempty (%u%%); %u entries, average chain %.1f.\n", + table.size, + total_buckets, + 100 * total_buckets / table.size, + total_elements, + total_buckets ? total_elements / (double) total_buckets : 0.0); +} + +/* concat.c: dynamic string concatenation. */ + +/* Return the concatenation of S1 and S2. See `concatn.c' for a + `concatn', which takes a variable number of arguments. */ + +char * +concat (const char *s1, const char *s2) +{ + char *answer = (char *) xmalloc (strlen (s1) + strlen (s2) + 1); + strcpy (answer, s1); + strcat (answer, s2); + + return answer; +} + +/* concat3.c: concatenate three strings. */ + +char * +concat3 (const char *s1, const char *s2, const char *s3) +{ + char *answer + = (char *) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1); + strcpy (answer, s1); + strcat (answer, s2); + strcat (answer, s3); + + return answer; +} + +/* concatn.c: Concatenate an arbitrary number of strings. */ + +/* OK, it would be epsilon more efficient to compute the total length + and then do the copying ourselves, but I doubt it matters in reality. */ + +char * +concatn (const char *str1, ...) +{ + char *arg; + char *ret; + va_list ap; + + va_start (ap, str1); + + if (!str1) + return NULL; + + ret = xstrdup (str1); + + while ((arg = va_arg (ap, char *)) != NULL) + { + char *temp = concat (ret, arg); + free (ret); + ret = temp; + } + va_end (ap); + + return ret; +} + +/* debug.c: Help the user discover what's going on. */ + +#ifdef KPSE_DEBUG + +unsigned kpathsea_debug = 0; + +/* If the real definitions of fopen or fclose are macros, we lose -- the + #undef won't restore them. */ + +FILE * +fopen (const char *filename, const char *mode) +{ +#undef fopen + FILE *ret = fopen (filename, mode); + + if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN)) + DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret); + + return ret; +} + +int +fclose (FILE *f) +{ +#undef fclose + int ret = fclose (f); + + if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN)) + DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret); + + return ret; +} + +#endif + +/* libc replacement functions for win32. */ + +/* + This does make sense only under WIN32. + Functions: + - popen() rewritten + - pclose() rewritten + - stat() wrapper for _stat(), removing trailing slashes + */ + +#ifdef WIN32 + +#include <fcntl.h> + +/* The X library (among other things) defines `FALSE' and `TRUE', and so + we only want to define them if necessary, for use by application code. */ +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif /* FALSE */ + +struct _popen_elt { + FILE *f; /* File stream returned */ + HANDLE hp; /* Handle of associated process */ + struct _popen_elt *next; /* Next list element */ +}; + +static struct _popen_elt _z = { NULL, 0, &_z }; +static struct _popen_elt *_popen_list = &_z; + +FILE *popen (const char *cmd, const char *mode) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + FILE *f = NULL; + int fno, i; + HANDLE child_in, child_out; + HANDLE father_in, father_out; + HANDLE father_in_dup, father_out_dup; + HANDLE current_in, current_out; + HANDLE current_pid; + int binary_mode; + char *new_cmd, *app_name = NULL; + char *p, *q; + struct _popen_elt *new_process; + char pname[PATH_MAX], *fp; + char *suffixes[] = { ".bat", ".cmd", ".com", ".exe", NULL }; + char **s; + int go_on; + + /* We should look for the application name along the PATH, + and decide to prepend "%COMSPEC% /c " or not to the command line. + Do nothing for the moment. */ + + /* Another way to do that would be to try CreateProcess first without + invoking cmd, and look at the error code. If it fails because of + command not found, try to prepend "cmd /c" to the cmd line. + */ + + /* Look for the application name */ + for (p = cmd; *p && isspace(*p); p++); + if (*p == '"') { + q = ++p; + while(*p && *p != '"') p++; + if (*p != '\0') { + fprintf(stderr, "popen: malformed command (\" not terminated)\n"); + return NULL; + } + } + else + for (q = p; *p && !isspace(*p); p++); + /* q points to the beginning of appname, p to the last + 1 char */ + if ((app_name = malloc(p - q + 1)) == NULL) { + fprintf(stderr, "xpopen: malloc(app_name) failed.\n"); + return NULL; + } + strncpy(app_name, q, p - q ); + app_name[p - q] = '\0'; + pname[0] = '\0'; +#ifdef TRACE + fprintf(stderr, "popen: app_name = %s\n", app_name); +#endif + + /* Looking for appname on the path */ + for (s = suffixes, go_on = 1; go_on; *s++) { + if (SearchPath(NULL, /* Address of search path */ + app_name, /* Address of filename */ + *s, /* Address of extension */ + PATH_MAX, /* Size of destination buffer */ + pname, /* Address of destination buffer */ + &fp) /* File part of app_name */ + != 0) { +#ifdef TRACE + fprintf(stderr, "%s found with suffix %s\n", app_name, *s); +#endif + new_cmd = xstrdup(cmd); + free(app_name); + app_name = xstrdup(pname); + break; + } + go_on = (*s != NULL); + } + if (go_on == 0) { + /* the app_name was not found */ +#ifdef TRACE + fprintf(stderr, "%s not found, concatenating comspec\n", app_name); +#endif + new_cmd = concatn(getenv("COMSPEC"), " /c ", cmd, NULL); + free(app_name); + app_name = NULL; + } + else { + } +#ifdef TRACE + fprintf(stderr, "popen: app_name = %s\n", app_name); + fprintf(stderr, "popen: cmd_line = %s\n", new_cmd); +#endif + + current_in = GetStdHandle(STD_INPUT_HANDLE); + current_out = GetStdHandle(STD_OUTPUT_HANDLE); + current_pid = GetCurrentProcess(); + ZeroMemory( &si, sizeof(STARTUPINFO) ); + si.cb = sizeof(STARTUPINFO); + si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; + + if (strchr(mode, 'b')) + binary_mode = _O_BINARY; + else + binary_mode = _O_TEXT; + + /* Opening the pipe for writing */ + if (strchr(mode, 'w')) { + binary_mode |= _O_WRONLY; + if (CreatePipe(&child_in, &father_out, &sa, 0) == FALSE) { + fprintf(stderr, "popen: error CreatePipe\n"); + return NULL; + } +#if 0 + if (SetStdHandle(STD_INPUT_HANDLE, child_in) == FALSE) { + fprintf(stderr, "popen: error SetStdHandle child_in\n"); + return NULL; + } +#endif + si.hStdInput = child_in; + si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + si.hStdError = GetStdHandle(STD_ERROR_HANDLE); + + if (DuplicateHandle(current_pid, father_out, + current_pid, &father_out_dup, + 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) { + fprintf(stderr, "popen: error DuplicateHandle father_out\n"); + return NULL; + } + CloseHandle(father_out); + fno = _open_osfhandle((long)father_out_dup, binary_mode); + f = _fdopen(fno, mode); + i = setvbuf( f, NULL, _IONBF, 0 ); + } + /* Opening the pipe for reading */ + else if (strchr(mode, 'r')) { + binary_mode |= _O_RDONLY; + if (CreatePipe(&father_in, &child_out, &sa, 0) == FALSE) { + fprintf(stderr, "popen: error CreatePipe\n"); + return NULL; + } +#if 0 + if (SetStdHandle(STD_OUTPUT_HANDLE, child_out) == FALSE) { + fprintf(stderr, "popen: error SetStdHandle child_out\n"); + return NULL; + } +#endif + si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + si.hStdOutput = child_out; + si.hStdError = GetStdHandle(STD_ERROR_HANDLE); + if (DuplicateHandle(current_pid, father_in, + current_pid, &father_in_dup, + 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) { + fprintf(stderr, "popen: error DuplicateHandle father_in\n"); + return NULL; + } + CloseHandle(father_in); + fno = _open_osfhandle((long)father_in_dup, binary_mode); + f = _fdopen(fno, mode); + i = setvbuf( f, NULL, _IONBF, 0 ); + } + else { + fprintf(stderr, "popen: invalid mode %s\n", mode); + return NULL; + } + + /* creating child process */ + if (CreateProcess(app_name, /* pointer to name of executable module */ + new_cmd, /* pointer to command line string */ + NULL, /* pointer to process security attributes */ + NULL, /* pointer to thread security attributes */ + TRUE, /* handle inheritance flag */ + CREATE_NEW_CONSOLE, /* creation flags */ + NULL, /* pointer to environment */ + NULL, /* pointer to current directory */ + &si, /* pointer to STARTUPINFO */ + &pi /* pointer to PROCESS_INFORMATION */ + ) == FALSE) { + fprintf(stderr, "popen: CreateProcess %x\n", GetLastError()); + return NULL; + } + +#if 0 + /* Restoring saved values for stdin/stdout */ + if (SetStdHandle(STD_INPUT_HANDLE, current_in) == FALSE) + fprintf(stderr, "popen: error re-redirecting Stdin\n"); + if (SetStdHandle(STD_OUTPUT_HANDLE, current_out) == FALSE) + fprintf(stderr, "popen: error re-redirecting Stdout\n"); +#endif + /* Only the process handle is needed */ + if (CloseHandle(pi.hThread) == FALSE) { + fprintf(stderr, "popen: error closing thread handle\n"); + return NULL; + } + + if (new_cmd) free(new_cmd); + if (app_name) free(app_name); + +#if 0 + /* This does not seem to make sense for console apps */ + while (1) { + i = WaitForInputIdle(pi.hProcess, 5); /* Wait 5ms */ + if (i == 0xFFFFFFFF) { + fprintf(stderr, "popen: process can't initialize\n"); + return NULL; + } + else if (i == WAIT_TIMEOUT) + fprintf(stderr, "popen: warning, process still not initialized\n"); + else + break; + } +#endif + + /* Add the pair (f, pi.hProcess) to the list */ + if ((new_process = malloc(sizeof(struct _popen_elt))) == NULL) { + fprintf (stderr, "popen: malloc(new_process) error\n"); + return NULL; + } + /* Saving the FILE * pointer, access key for retrieving the process + handle later on */ + new_process->f = f; + /* Closing the unnecessary part of the pipe */ + if (strchr(mode, 'r')) { + CloseHandle(child_out); + } + else if (strchr(mode, 'w')) { + CloseHandle(child_in); + } + /* Saving the process handle */ + new_process->hp = pi.hProcess; + /* Linking it to the list of popen() processes */ + new_process->next = _popen_list; + _popen_list = new_process; + + return f; + +} + +int pclose (FILE *f) +{ + struct _popen_elt *p, *q; + int exit_code; + + /* Look for f is the access key in the linked list */ + for (q = NULL, p = _popen_list; + p != &_z && p->f != f; + q = p, p = p->next); + + if (p == &_z) { + fprintf(stderr, "pclose: error, file not found."); + return -1; + } + + /* Closing the FILE pointer */ + fclose(f); + + /* Waiting for the process to terminate */ + if (WaitForSingleObject(p->hp, INFINITE) != WAIT_OBJECT_0) { + fprintf(stderr, "pclose: error, process still active\n"); + return -1; + } + + /* retrieving the exit code */ + if (GetExitCodeProcess(p->hp, &exit_code) == 0) { + fprintf(stderr, "pclose: can't get process exit code\n"); + return -1; + } + + /* Closing the process handle, this will cause the system to + remove the process from memory */ + if (CloseHandle(p->hp) == FALSE) { + fprintf(stderr, "pclose: error closing process handle\n"); + return -1; + } + + /* remove the elt from the list */ + if (q != NULL) + q->next = p->next; + else + _popen_list = p->next; + free(p); + + return exit_code; +} + +#endif + +/* find-suffix.c: return the stuff after a dot. */ + +/* Return pointer to first character after `.' in last directory element + of NAME. If the name is `foo' or `/foo.bar/baz', we have no extension. */ + +char * +find_suffix (const char *name) +{ + const char *slash_pos; + char *dot_pos = strrchr (name, '.'); + + if (dot_pos == NULL) + return NULL; + + for (slash_pos = name + strlen (name); + slash_pos > dot_pos && !IS_DIR_SEP (*slash_pos); + slash_pos--) + ; + + return slash_pos > dot_pos ? NULL : dot_pos + 1; +} + +/* rm-suffix.c: remove any suffix. */ + +/* Generic const warning -- see extend-fname.c. */ + +char * +remove_suffix (const char *s) +{ + char *ret; + const char *suffix = find_suffix (s); + + if (suffix) + { + /* Back up to before the dot. */ + suffix--; + ret = (char *) xmalloc (suffix - s + 1); + strncpy (ret, s, suffix - s); + ret[suffix - s] = 0; + } + else + ret = (char *) s; + + return ret; +} + +/* make-suffix.c: unconditionally add a filename suffix. */ + +/* Return a new string: S suffixed with SUFFIX, regardless of what it + was before. This returns a newly allocated string. */ + +char * +make_suffix (const char *s, const char *suffix) +{ + char *new_s; + const char *dot_pos = strrchr (s, '.'); + const char *slash_pos; + + for (slash_pos = s + strlen (s) - 1; slash_pos > dot_pos && slash_pos > s; + slash_pos--) { + if (IS_DIR_SEP (*slash_pos)) + break; + } + + if (dot_pos == NULL || slash_pos > dot_pos ) + new_s = concat3 (s, ".", suffix); + else + { + unsigned past_dot_index = dot_pos + 1 - s; + + new_s = (char *) xmalloc (past_dot_index + strlen (suffix) + 1); + strncpy (new_s, s, dot_pos + 1 - s); + strcpy (new_s + past_dot_index, suffix); + } + + return new_s; +} + +/* readable.c: check if a filename is a readable non-directory file. */ + +/* Truncate any too-long components in NAME, returning the result. It's + too bad this is necessary. See comments in readable.c for why. */ + +static char * +kpse_truncate_filename (const char *name) +{ + unsigned c_len = 0; /* Length of current component. */ + unsigned ret_len = 0; /* Length of constructed result. */ + + /* Allocate enough space. */ + char *ret = (char *) xmalloc (strlen (name) + 1); + + for (; *name; name++) + { + if (IS_DIR_SEP (*name) || IS_DEVICE_SEP (*name)) + { /* At a directory delimiter, reset component length. */ + c_len = 0; + } + else if (c_len > NAME_MAX) + { /* If past the max for a component, ignore this character. */ + continue; + } + + /* Copy this character. */ + ret[ret_len++] = *name; + c_len++; + } + ret[ret_len] = 0; + + return ret; +} + +/* If access can read FN, run stat (assigning to stat buffer ST) and + check that fn is not a directory. Don't check for just being a + regular file, as it is potentially useful to read fifo's or some + kinds of devices. */ + +#ifdef __DJGPP__ +/* `stat' is way too expensive for such a simple job. */ +#define READABLE(fn, st) \ + (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) +#elif WIN32 +#define READABLE(fn, st) \ + (GetFileAttributes(fn) != 0xFFFFFFFF && \ + !(GetFileAttributes(fn) & FILE_ATTRIBUTE_DIRECTORY)) +#else +#define READABLE(fn, st) \ + (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) +#endif + +/* POSIX invented the brain-damage of not necessarily truncating + filename components; the system's behavior is defined by the value of + the symbol _POSIX_NO_TRUNC, but you can't change it dynamically! + + Generic const return warning. See extend-fname.c. */ + +char * +kpse_readable_file (const char *name) +{ + struct stat st; + char *ret; + + if (READABLE (name, st)) { + ret = (char *) name; + +#ifdef ENAMETOOLONG + } else if (errno == ENAMETOOLONG) { + ret = kpse_truncate_filename (name); + + /* Perhaps some other error will occur with the truncated name, so + let's call access again. */ + if (!READABLE (ret, st)) + { /* Failed. */ + if (ret != name) free (ret); + ret = NULL; + } +#endif /* ENAMETOOLONG */ + + } else { /* Some other error. */ + if (errno == EACCES) { /* Maybe warn them if permissions are bad. */ + perror (name); + } + ret = NULL; + } + + return ret; +} + +/* absolute.c: Test if a filename is absolute or explicitly relative. */ + +/* Sorry this is such a system-dependent mess, but I can't see any way + to usefully generalize. */ + +int +kpse_absolute_p (const char *filename, int relative_ok) +{ + int 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] == '\\') +#endif + ; + int explicit_relative + = relative_ok + && (*filename == '.' && (IS_DIR_SEP (filename[1]) + || (filename[1] == '.' && IS_DIR_SEP (filename[2])))); + + return absolute || explicit_relative; +} + +/* str-list.c: define routines for string lists. */ + +/* See the lib.h file for comments. */ + +str_list_type +str_list_init (void) +{ + str_list_type ret; + + STR_LIST_LENGTH (ret) = 0; + STR_LIST (ret) = NULL; + + return ret; +} + +void +str_list_add (str_list_type *l, char *s) +{ + STR_LIST_LENGTH (*l)++; + XRETALLOC (STR_LIST (*l), STR_LIST_LENGTH (*l), char *); + STR_LIST_LAST_ELT (*l) = s; +} + +/* May as well save some reallocations and do everything in a chunk + instead of calling str_list_add on each element. */ + +void +str_list_concat (str_list_type *target, str_list_type more) +{ + unsigned e; + unsigned prev_len = STR_LIST_LENGTH (*target); + + STR_LIST_LENGTH (*target) += STR_LIST_LENGTH (more); + XRETALLOC (STR_LIST (*target), STR_LIST_LENGTH (*target), char *); + + for (e = 0; e < STR_LIST_LENGTH (more); e++) + STR_LIST_ELT (*target, prev_len + e) = STR_LIST_ELT (more, e); +} + +/* Free the list (but not the elements within it). */ + +void +str_list_free (str_list_type *l) +{ + if (STR_LIST (*l)) + { + free (STR_LIST (*l)); + STR_LIST (*l) = NULL; + } +} + +/* str-llist.c: Implementation of a linked list of strings. */ + +/* Add the new string STR to the end of the list L. */ + +void +str_llist_add (str_llist_type *l, char *str) +{ + str_llist_elt_type *e; + str_llist_elt_type *new_elt = XTALLOC1 (str_llist_elt_type); + + /* The new element will be at the end of the list. */ + STR_LLIST (*new_elt) = str; + STR_LLIST_MOVED (*new_elt) = 0; + STR_LLIST_NEXT (*new_elt) = NULL; + + /* Find the current end of the list. */ + for (e = *l; e && STR_LLIST_NEXT (*e); e = STR_LLIST_NEXT (*e)) + ; + + if (!e) + *l = new_elt; + else + STR_LLIST_NEXT (*e) = new_elt; +} + +/* Move an element towards the top. The idea is that when a file is + found in a given directory, later files will likely be in that same + directory, and looking for the file in all the directories in between + is thus a waste. */ + +void +str_llist_float (str_llist_type *l, str_llist_elt_type *mover) +{ + str_llist_elt_type *last_moved, *unmoved; + + /* If we've already moved this element, never mind. */ + if (STR_LLIST_MOVED (*mover)) + return; + + /* Find the first unmoved element (to insert before). We're + guaranteed this will terminate, since MOVER itself is currently + unmoved, and it must be in L (by hypothesis). */ + for (last_moved = NULL, unmoved = *l; STR_LLIST_MOVED (*unmoved); + last_moved = unmoved, unmoved = STR_LLIST_NEXT (*unmoved)) + ; + + /* If we are the first unmoved element, nothing to relink. */ + if (unmoved != mover) + { /* Remember `mover's current successor, so we can relink `mover's + predecessor to it. */ + str_llist_elt_type *before_mover; + str_llist_elt_type *after_mover = STR_LLIST_NEXT (*mover); + + /* Find `mover's predecessor. */ + for (before_mover = unmoved; STR_LLIST_NEXT (*before_mover) != mover; + before_mover = STR_LLIST_NEXT (*before_mover)) + ; + + /* `before_mover' now links to `after_mover'. */ + STR_LLIST_NEXT (*before_mover) = after_mover; + + /* Insert `mover' before `unmoved' and after `last_moved' (or at + the head of the list). */ + STR_LLIST_NEXT (*mover) = unmoved; + if (!last_moved) + *l = mover; + else + STR_LLIST_NEXT (*last_moved) = mover; + } + + /* We've moved it. */ + STR_LLIST_MOVED (*mover) = 1; +} + +/* fn.c: arbitrarily long filenames (or just strings). */ + +/* /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmr10.300pk is 58 + chars, so ASCII `K' seems a good choice. */ +#define CHUNK_SIZE 75 + +fn_type +fn_init (void) +{ + fn_type ret; + + FN_ALLOCATED (ret) = FN_LENGTH (ret) = 0; + FN_STRING (ret) = NULL; + + return ret; +} + +fn_type +fn_copy0 (const char *s, unsigned len) +{ + fn_type ret; + + FN_ALLOCATED (ret) = CHUNK_SIZE > len ? CHUNK_SIZE : len + 1; + FN_STRING (ret) = (char *) xmalloc (FN_ALLOCATED (ret)); + + strncpy (FN_STRING (ret), s, len); + FN_STRING (ret)[len] = 0; + FN_LENGTH (ret) = len + 1; + + return ret; +} + +/* Don't think we ever try to free something that might usefully be + empty, so give fatal error if nothing allocated. */ + +void +fn_free (fn_type *f) +{ + assert (FN_STRING (*f) != NULL); + free (FN_STRING (*f)); + FN_STRING (*f) = NULL; + FN_ALLOCATED (*f) = 0; + FN_LENGTH (*f) = 0; +} + +/* An arithmetic increase seems more reasonable than geometric. We + don't increase the length member since it may be more convenient for + the caller to add than subtract when appending the stuff that will + presumably follow. */ + +static void +grow (fn_type *f, unsigned len) +{ + while (FN_LENGTH (*f) + len > FN_ALLOCATED (*f)) + { + FN_ALLOCATED (*f) += CHUNK_SIZE; + XRETALLOC (FN_STRING (*f), FN_ALLOCATED (*f), char); + } +} + +void +fn_1grow (fn_type *f, char c) +{ + grow (f, 1); + FN_STRING (*f)[FN_LENGTH (*f)] = c; + FN_LENGTH (*f)++; +} + +void +fn_grow (fn_type *f, void *source, unsigned len) +{ + grow (f, len); + strncpy (FN_STRING (*f) + FN_LENGTH (*f), (char *) source, len); + FN_LENGTH (*f) += len; +} + +void +fn_str_grow (fn_type *f, const char *s) +{ + unsigned more_len = strlen (s); + grow (f, more_len); + strcat (FN_STRING (*f), s); + FN_LENGTH (*f) += more_len; +} + +void +fn_shrink_to (fn_type *f, unsigned loc) +{ + assert (FN_LENGTH (*f) > loc); + FN_STRING (*f)[loc] = 0; + FN_LENGTH (*f) = loc + 1; +} + +/* variable.c: variable expansion. */ + +/* Here's the simple one, when a program just wants a value. */ + +char * +kpse_var_value (const char *var) +{ + char *ret = getenv (var); + + if (ret) + ret = kpse_var_expand (ret); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_VARS)) + DEBUGF2("variable: %s = %s\n", var, ret ? ret : "(nil)"); +#endif + + return ret; +} + +/* We have to keep track of variables being expanded, otherwise + constructs like TEXINPUTS = $TEXINPUTS result in an infinite loop. + (Or indirectly recursive variables, etc.) Our simple solution is to + add to a list each time an expansion is started, and check the list + before expanding. */ + +typedef struct { + const char *var; + int expanding; +} expansion_type; +static expansion_type *expansions; /* The sole variable of this type. */ +static unsigned expansion_len = 0; + +static void +expanding (const char *var, int xp) +{ + unsigned e; + for (e = 0; e < expansion_len; e++) { + if (STREQ (expansions[e].var, var)) { + expansions[e].expanding = xp; + return; + } + } + + /* New variable, add it to the list. */ + expansion_len++; + XRETALLOC (expansions, expansion_len, expansion_type); + expansions[expansion_len - 1].var = xstrdup (var); + expansions[expansion_len - 1].expanding = xp; +} + + +/* Return whether VAR is currently being expanding. */ + +static int +expanding_p (const char *var) +{ + unsigned e; + for (e = 0; e < expansion_len; e++) { + if (STREQ (expansions[e].var, var)) + return expansions[e].expanding; + } + + return 0; +} + +/* Append the result of value of `var' to EXPANSION, where `var' begins + at START and ends at END. If `var' is not set, do not complain. + This is a subroutine for the more complicated expansion function. */ + +static void +expand (fn_type *expansion, const char *start, const char *end) +{ + char *value; + unsigned len = end - start + 1; + char *var = (char *) xmalloc (len + 1); + strncpy (var, start, len); + var[len] = 0; + + if (expanding_p (var)) { + WARNING1 ("kpathsea: variable `%s' references itself (eventually)", var); + } else { + /* Check for an environment variable. */ + value = getenv (var); + + if (value) { + expanding (var, 1); + value = kpse_var_expand (value); + expanding (var, 0); + fn_grow (expansion, value, strlen (value)); + free (value); + } + + free (var); + } +} + +/* Can't think of when it would be useful to change these (and the + diagnostic messages assume them), but ... */ +#ifndef IS_VAR_START /* starts all variable references */ +#define IS_VAR_START(c) ((c) == '$') +#endif +#ifndef IS_VAR_CHAR /* variable name constituent */ +#define IS_VAR_CHAR(c) (ISALNUM (c) || (c) == '_') +#endif +#ifndef IS_VAR_BEGIN_DELIMITER /* start delimited variable name (after $) */ +#define IS_VAR_BEGIN_DELIMITER(c) ((c) == '{') +#endif +#ifndef IS_VAR_END_DELIMITER +#define IS_VAR_END_DELIMITER(c) ((c) == '}') +#endif + + +/* Maybe we should support some or all of the various shell ${...} + constructs, especially ${var-value}. */ + +char * +kpse_var_expand (const char *src) +{ + const char *s; + char *ret; + fn_type expansion; + expansion = fn_init (); + + /* Copy everything but variable constructs. */ + for (s = src; *s; s++) { + if (IS_VAR_START (*s)) { + s++; + + /* Three cases: `$VAR', `${VAR}', `$<anything-else>'. */ + if (IS_VAR_CHAR (*s)) { + /* $V: collect name constituents, then expand. */ + const char *var_end = s; + + do { + var_end++; + } while (IS_VAR_CHAR (*var_end)); + + var_end--; /* had to go one past */ + expand (&expansion, s, var_end); + s = var_end; + + } else if (IS_VAR_BEGIN_DELIMITER (*s)) { + /* ${: scan ahead for matching delimiter, then expand. */ + const char *var_end = ++s; + + while (*var_end && !IS_VAR_END_DELIMITER (*var_end)) + var_end++; + + if (! *var_end) { + WARNING1 ("%s: No matching } for ${", src); + s = var_end - 1; /* will incr to null at top of loop */ + } else { + expand (&expansion, s, var_end - 1); + s = var_end; /* will incr past } at top of loop*/ + } + + } else { + /* $<something-else>: error. */ + WARNING2 ("%s: Unrecognized variable construct `$%c'", src, *s); + /* Just ignore those chars and keep going. */ + } + } else + fn_1grow (&expansion, *s); + } + fn_1grow (&expansion, 0); + + ret = FN_STRING (expansion); + return ret; +}
new file mode 100644 --- /dev/null +++ b/liboctave/kpse.cc @@ -0,0 +1,2430 @@ +/* pathsearch.c: look up a filename in a path. + +Copyright (C) 1993, 94, 95, 96, 97 Karl Berry. +Copyright (C) 1993, 94, 95, 96, 97 Karl Berry & O. Weber. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if defined (HAVE_CONFIG_H) +#include <config.h> +#endif + +#include "kpse-config.h" +#include "kpse-lib.h" +#include "kpse.h" + +#include <time.h> /* for `time' */ + +#ifdef __DJGPP__ +#include <sys/stat.h> /* for stat bits */ +#endif + +/* The very first search is for texmf.cnf, called when someone tries to + initialize the TFM path or whatever. init_path calls kpse_cnf_get + which calls kpse_all_path_search to find all the texmf.cnf's. We + need to do various special things in this case, since we obviously + don't yet have the configuration files when we're searching for the + configuration files. */ +static bool first_search = true; + + + +/* This function is called after every search (except the first, since + we definitely want to allow enabling the logging in texmf.cnf) to + record the filename(s) found in $TEXMFLOG. */ + +static void +log_search (str_list_type filenames) +{ + static FILE *log_file = NULL; + static bool first_time = true; /* Need to open the log file? */ + + if (first_time) { + /* Get name from either envvar or config file. */ + char *log_name = kpse_var_value ("TEXMFLOG"); + first_time = false; + if (log_name) { + log_file = fopen (log_name, FOPEN_A_MODE); + if (!log_file) + perror (log_name); + free (log_name); + } + } + + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH) || log_file) { + unsigned e; + + /* FILENAMES should never be null, but safety doesn't hurt. */ + for (e = 0; e < STR_LIST_LENGTH (filenames) && STR_LIST_ELT (filenames, e); + e++) { + char *filename = STR_LIST_ELT (filenames, e); + + /* Only record absolute filenames, for privacy. */ + if (log_file && kpse_absolute_p (filename, false)) + fprintf (log_file, "%lu %s\n", (long unsigned) time (NULL), + filename); + + /* And show them online, if debugging. We've already started + the debugging line in `search', where this is called, so + just print the filename here, don't use DEBUGF. */ + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + fputs (filename, stderr); + } + } +} + +/* Concatenate each element in DIRS with NAME (assume each ends with a + /, to save time). If SEARCH_ALL is false, return the first readable + regular file. Else continue to search for more. In any case, if + none, return a list containing just NULL. + + We keep a single buffer for the potential filenames and reallocate + only when necessary. I'm not sure it's noticeably faster, but it + does seem cleaner. (We do waste a bit of space in the return + value, though, since we don't shrink it to the final size returned.) */ + +#define INIT_ALLOC 75 /* Doesn't much matter what this number is. */ + +static str_list_type +dir_list_search (str_llist_type *dirs, const char *name, bool search_all) +{ + str_llist_elt_type *elt; + str_list_type ret; + unsigned name_len = strlen (name); + unsigned allocated = INIT_ALLOC; + char *potential = (char *) xmalloc (allocated); + + ret = str_list_init (); + + for (elt = *dirs; elt; elt = STR_LLIST_NEXT (*elt)) + { + const char *dir = STR_LLIST (*elt); + unsigned dir_len = strlen (dir); + + while (dir_len + name_len + 1 > allocated) + { + allocated += allocated; + XRETALLOC (potential, allocated, char); + } + + strcpy (potential, dir); + strcat (potential, name); + + if (kpse_readable_file (potential)) + { + str_list_add (&ret, potential); + + /* Move this element towards the top of the list. */ + str_llist_float (dirs, elt); + + /* If caller only wanted one file returned, no need to + terminate the list with NULL; the caller knows to only look + at the first element. */ + if (!search_all) + return ret; + + /* Start new filename. */ + allocated = INIT_ALLOC; + potential = (char *) xmalloc (allocated); + } + } + + /* If we get here, either we didn't find any files, or we were finding + all the files. But we're done with the last filename, anyway. */ + free (potential); + + return ret; +} + +/* This is called when NAME is absolute or explicitly relative; if it's + readable, return (a list containing) it; otherwise, return NULL. */ + +static str_list_type +absolute_search (char *name) +{ + str_list_type ret_list; + char *found = kpse_readable_file (name); + + /* Some old compilers can't initialize structs. */ + ret_list = str_list_init (); + + /* If NAME wasn't found, free the expansion. */ + if (name != found) + free (name); + + /* Add `found' to the return list even if it's null; that tells + the caller we didn't find anything. */ + str_list_add (&ret_list, found); + + return ret_list; +} + +/* This is the hard case -- look for NAME in PATH. If ALL is false, + return the first file found. Otherwise, search all elements of PATH. */ + +static str_list_type +path_search (const char *path, char *name, bool must_exist, bool all) +{ + char *elt; + str_list_type ret_list; + bool done = false; + ret_list = str_list_init (); /* some compilers lack struct initialization */ + + for (elt = kpse_path_element (path); !done && elt; + elt = kpse_path_element (NULL)) { + str_list_type *found; + bool allow_disk_search = true; + + if (*elt == '!' && *(elt + 1) == '!') { + /* Those magic leading chars in a path element means don't search the + disk for this elt. And move past the magic to get to the name. */ + allow_disk_search = false; + elt += 2; + } + + /* Do not touch the device if present */ + if (NAME_BEGINS_WITH_DEVICE (elt)) { + while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) { + *(elt + 2) = *(elt + 1); + *(elt + 1) = *elt; + elt++; + } + } else { + /* We never want to search the whole disk. */ + while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) + elt++; + } + + /* Try ls-R, unless we're searching for texmf.cnf. Our caller + (search), also tests first_search, and does the resetting. */ + found = first_search ? NULL : kpse_db_search (name, elt, all); + + /* Search the filesystem if (1) the path spec allows it, and either + (2a) we are searching for texmf.cnf ; or + (2b) no db exists; or + (2c) no db's are relevant to this elt; or + (3) MUST_EXIST && NAME was not in the db. + In (2*), `found' will be NULL. + In (3), `found' will be an empty list. */ + if (allow_disk_search && (!found || (must_exist && !STR_LIST (*found)))) { + str_llist_type *dirs = kpse_element_dirs (elt); + if (dirs && *dirs) { + if (!found) + found = XTALLOC1 (str_list_type); + *found = dir_list_search (dirs, name, all); + } + } + + /* Did we find anything anywhere? */ + if (found && STR_LIST (*found)) + if (all) + str_list_concat (&ret_list, *found); + else { + str_list_add (&ret_list, STR_LIST_ELT (*found, 0)); + done = true; + } + + /* Free the list space, if any (but not the elements). */ + if (found) { + str_list_free (found); + free (found); + } + } + + /* Free the expanded name we were passed. It can't be in the return + list, since the path directories got unconditionally prepended. */ + free (name); + + return ret_list; +} + +/* Search PATH for ORIGINAL_NAME. If ALL is false, or ORIGINAL_NAME is + absolute_p, check ORIGINAL_NAME itself. Otherwise, look at each + element of PATH for the first readable ORIGINAL_NAME. + + Always return a list; if no files are found, the list will + contain just NULL. If ALL is true, the list will be + terminated with NULL. */ + +static char ** +search (const char *path, const char *original_name, + bool must_exist, bool all) +{ + str_list_type ret_list; + char *name; + bool absolute_p; + +#ifdef __DJGPP__ + /* We will use `stat' heavily, so let's request for + the fastest possible version of `stat', by telling + it what members of struct stat do we really need. + + We need to set this on each call because this is a + library function; the caller might need other options + from `stat'. Thus save the flags and restore them + before exit. + + This call tells `stat' that we do NOT need to recognize + executable files (neither by an extension nor by a magic + signature); that we do NOT need time stamp of root directories; + and that we do NOT need the write access bit in st_mode. + + Note that `kpse_set_progname' needs the EXEC bits, + but it was already called by the time we get here. */ + unsigned short save_djgpp_flags = _djstat_flags; + + _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT + | _STAT_ROOT_TIME | _STAT_WRITEBIT; +#endif + + /* Make a leading ~ count as an absolute filename, and expand $FOO's. */ + name = kpse_expand (original_name); + + /* If the first name is absolute or explicitly relative, no need to + consider PATH at all. */ + absolute_p = kpse_absolute_p (name, true); + + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF4 ("start search(file=%s, must_exist=%d, find_all=%d, path=%s).\n", + name, must_exist, all, path); + + /* Find the file(s). */ + ret_list = absolute_p ? absolute_search (name) + : path_search (path, name, must_exist, all); + + /* Append NULL terminator if we didn't find anything at all, or we're + supposed to find ALL and the list doesn't end in NULL now. */ + if (STR_LIST_LENGTH (ret_list) == 0 + || (all && STR_LIST_LAST_ELT (ret_list) != NULL)) + str_list_add (&ret_list, NULL); + + /* The very first search is for texmf.cnf. We can't log that, since + we want to allow setting TEXMFLOG in texmf.cnf. */ + if (first_search) { + first_search = false; + } else { + /* Record the filenames we found, if desired. And wrap them in a + debugging line if we're doing that. */ + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF1 ("search(%s) =>", original_name); + log_search (ret_list); + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + putc ('\n', stderr); + } + +#ifdef __DJGPP__ + /* Undo any side effects. */ + _djstat_flags = save_djgpp_flags; +#endif + + return STR_LIST (ret_list); +} + +/* Search PATH for the first NAME. */ + +char * +kpse_path_search (const char *path, const char *name, bool must_exist) +{ + static char **ret_list = 0; + + if (ret_list) + { + free (ret_list); + ret_list = 0; /* Don't let an interrupt in search() cause trouble */ + } + + ret_list = search (path, name, must_exist, false); + + return *ret_list; /* Freeing this is caller's responsibility */ +} + + +/* Search all elements of PATH for files named NAME. Not sure if it's + right to assert `must_exist' here, but it suffices now. */ + +char ** +kpse_all_path_search (const char *path, const char *name) +{ + char **ret = search (path, name, true, true); + return ret; +} + +/* This is the hard case -- look in each element of PATH for each + element of NAMES. If ALL is false, return the first file found. + Otherwise, search all elements of PATH. */ + +static str_list_type +path_find_first_of (const char *path, const char **names, + bool must_exist, bool all) +{ + const char **p; + char *elt; + const char *name; + str_list_type ret_list; + bool done = false; + ret_list = str_list_init (); /* some compilers lack struct initialization */ + + for (elt = kpse_path_element (path); !done && elt; + elt = kpse_path_element (NULL)) + { + str_llist_type *dirs; + str_llist_elt_type *dirs_elt; + str_list_type *found; + bool allow_disk_search = true; + + if (*elt == '!' && *(elt + 1) == '!') + { + /* Those magic leading chars in a path element means don't + search the disk for this elt. And move past the magic to + get to the name. */ + + allow_disk_search = false; + elt += 2; + } + + /* Do not touch the device if present */ + + if (NAME_BEGINS_WITH_DEVICE (elt)) + { + while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) + { + *(elt + 2) = *(elt + 1); + *(elt + 1) = *elt; + elt++; + } + } + else + { + /* We never want to search the whole disk. */ + while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) + elt++; + } + + /* We have to search one directory at a time. */ + dirs = kpse_element_dirs (elt); + for (dirs_elt = *dirs; dirs_elt; dirs_elt = STR_LLIST_NEXT (*dirs_elt)) + { + char *dir = STR_LLIST (*dirs_elt); + + for (p = names; !done && *p; p++) + { + name = *p; + + /* Try ls-R, unless we're searching for texmf.cnf. Our caller + (find_first_of), also tests first_search, and does the + resetting. */ + found = first_search ? NULL : kpse_db_search (name, dir, all); + + /* Search the filesystem if (1) the path spec allows it, + and either + + (2a) we are searching for texmf.cnf ; or + (2b) no db exists; or + (2c) no db's are relevant to this elt; or + (3) MUST_EXIST && NAME was not in the db. + + In (2*), `found' will be NULL. + In (3), `found' will be an empty list. */ + + if (allow_disk_search + && (!found || (must_exist && !STR_LIST (*found)))) + { + static str_llist_type *tmp = 0; + + if (! tmp) + { + tmp = XTALLOC1 (str_llist_type); + *tmp = NULL; + str_llist_add (tmp, ""); + } + + STR_LLIST (*(*tmp)) = dir; + + if (!found) + found = XTALLOC1 (str_list_type); + + *found = dir_list_search (tmp, name, all); + } + + /* Did we find anything anywhere? */ + if (found && STR_LIST (*found)) + { + if (all) + str_list_concat (&ret_list, *found); + else + { + str_list_add (&ret_list, STR_LIST_ELT (*found, 0)); + done = true; + } + } + + /* Free the list space, if any (but not the elements). */ + if (found) + { + str_list_free (found); + free (found); + } + } + } + } + + return ret_list; +} + +static char ** +find_first_of (const char *path, const char **names, + bool must_exist, bool all) +{ + str_list_type ret_list; + +#ifdef __DJGPP__ + /* We will use `stat' heavily, so let's request for + the fastest possible version of `stat', by telling + it what members of struct stat do we really need. + + We need to set this on each call because this is a + library function; the caller might need other options + from `stat'. Thus save the flags and restore them + before exit. + + This call tells `stat' that we do NOT need to recognize + executable files (neither by an extension nor by a magic + signature); that we do NOT need time stamp of root directories; + and that we do NOT need the write access bit in st_mode. + + Note that `kpse_set_progname' needs the EXEC bits, + but it was already called by the time we get here. */ + unsigned short save_djgpp_flags = _djstat_flags; + + _djstat_flags = _STAT_EXEC_MAGIC | _STAT_EXEC_EXT + | _STAT_ROOT_TIME | _STAT_WRITEBIT; +#endif + + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + { + const char **p; + fputs ("start find_first_of((", stderr); + for (p = names; *p; p++) + { + if (p == names) + fputs (*p, stderr); + else + fprintf (stderr, ", %s", *p); + } + fprintf (stderr, "), path=%s, must_exist=%d).\n", path, must_exist); + } + + /* Find the file. */ + ret_list = path_find_first_of (path, names, must_exist, all); + + /* Append NULL terminator if we didn't find anything at all, or we're + supposed to find ALL and the list doesn't end in NULL now. */ + if (STR_LIST_LENGTH (ret_list) == 0 + || (all && STR_LIST_LAST_ELT (ret_list) != NULL)) + str_list_add (&ret_list, NULL); + + /* The very first search is for texmf.cnf. We can't log that, since + we want to allow setting TEXMFLOG in texmf.cnf. */ + if (first_search) { + first_search = false; + } else { + /* Record the filenames we found, if desired. And wrap them in a + debugging line if we're doing that. */ + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + { + const char **p; + fputs ("find_first_of(", stderr); + for (p = names; *p; p++) + { + if (p == names) + fputs (*p, stderr); + else + fprintf (stderr, ", %s", *p); + } + fputs (") =>", stderr); + } + log_search (ret_list); + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + putc ('\n', stderr); + } + +#ifdef __DJGPP__ + /* Undo any side effects. */ + _djstat_flags = save_djgpp_flags; +#endif + + return STR_LIST (ret_list); +} + +/* Search each element of PATH for each element of NAMES. Return the + first one found. */ + +char * +kpse_path_find_first_of (const char *path, const char **names, + bool must_exist) +{ + static char **ret_list = 0; + + if (ret_list) + { + free (ret_list); + ret_list = 0; /* Don't let an interrupt in search() cause trouble */ + } + + ret_list = find_first_of (path, names, must_exist, false); + + return *ret_list; /* Freeing this is caller's responsibility */ +} + +/* Search each element of PATH for each element of NAMES and return a + list containing everything found, in the order found. */ + +char ** +kpse_all_path_find_first_of (const char *path, const char **names) +{ + char **ret = find_first_of (path, names, true, true); + return ret; +} + +/* expand.c: general expansion. Some of this file (the brace-expansion + code from bash) is covered by the GPL; this is the only GPL-covered + code in kpathsea. The part of the file that I wrote (the first + couple of functions) is covered by the LGPL. */ + +#ifdef HAVE_PWD_H +#include <pwd.h> +#endif + +/* If NAME has a leading ~ or ~user, Unix-style, expand it to the user's + home directory, and return a new malloced string. If no ~, or no + <pwd.h>, just return NAME. */ + +static char * +kpse_tilde_expand (const char *name) +{ + const char *expansion; + const char *home; + + assert (name); + + /* If no leading tilde, do nothing. */ + if (*name != '~') { + expansion = name; + + /* If a bare tilde, return the home directory or `.'. (Very unlikely + that the directory name will do anyone any good, but ... */ + } else if (name[1] == 0) { + expansion = xstrdup (getenv ("HOME")); + if (!expansion) { + expansion = xstrdup ("."); + } + + /* If `~/', remove any trailing / or replace leading // in $HOME. + Should really check for doubled intermediate slashes, too. */ + } else if (IS_DIR_SEP (name[1])) { + unsigned c = 1; + home = getenv ("HOME"); + if (!home) { + home = "."; + } + if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */ + home++; + } + if (IS_DIR_SEP (home[strlen (home) - 1])) { /* omit / after ~ */ + c++; + } + expansion = concat (home, name + c); + + /* If `~user' or `~user/', look up user in the passwd database (but + OS/2 doesn't have this concept. */ + } else +#ifdef HAVE_PWD_H + { + struct passwd *p; + char *user; + unsigned c = 2; + while (!IS_DIR_SEP (name[c]) && name[c] != 0) /* find user name */ + c++; + + user = (char *) xmalloc (c); + strncpy (user, name + 1, c - 1); + user[c - 1] = 0; + + /* We only need the cast here for (deficient) systems + which do not declare `getpwnam' in <pwd.h>. */ + p = (struct passwd *) getpwnam (user); + free (user); + + /* If no such user, just use `.'. */ + home = p ? p->pw_dir : "."; + if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) { /* handle leading // */ + home++; + } + if (IS_DIR_SEP (home[strlen (home) - 1]) && name[c] != 0) + c++; /* If HOME ends in /, omit the / after ~user. */ + + expansion = name[c] == 0 ? xstrdup (home) : concat (home, name + c); + } +#else /* not HAVE_PWD_H */ + expansion = name; +#endif /* not HAVE_PWD_H */ + + /* We may return the same thing as the original, and then we might not + be returning a malloc-ed string. Callers beware. Sorry. */ + return (char *) expansion; +} + +/* Do variable expansion first so ~${USER} works. (Besides, it's what the + shells do.) */ + +char * +kpse_expand (const char *s) +{ + char *var_expansion = kpse_var_expand (s); + char *tilde_expansion = kpse_tilde_expand (var_expansion); + + /* `kpse_var_expand' always gives us new memory; `kpse_tilde_expand' + doesn't, necessarily. So be careful that we don't free what we are + about to return. */ + if (tilde_expansion != var_expansion) + free (var_expansion); + + return tilde_expansion; +} + + +/* Forward declarations of functions from the original expand.c */ +static char **brace_expand (const char *); +static void free_array (char **); + +/* If $KPSE_DOT is defined in the environment, prepend it to any relative + path components. */ + +static char * +kpse_expand_kpse_dot (char *path) +{ + char *ret, *elt; + char *kpse_dot = getenv("KPSE_DOT"); +#ifdef MSDOS + bool malloced_kpse_dot = false; +#endif + + if (kpse_dot == NULL) + return path; + ret = (char *) xmalloc(1); + *ret = 0; + +#ifdef MSDOS + /* Some setups of ported Bash force $KPSE_DOT to have the //d/foo/bar + form (when `pwd' is used), which is not understood by libc and the OS. + Convert them back to the usual d:/foo/bar form. */ + if (kpse_dot[0] == '/' && kpse_dot[1] == '/' + && kpse_dot[2] >= 'A' && kpse_dot[2] <= 'z' && kpse_dot[3] == '/') { + kpse_dot++; + kpse_dot = xstrdup (kpse_dot); + kpse_dot[0] = kpse_dot[1]; /* drive letter */ + kpse_dot[1] = ':'; + malloced_kpse_dot = true; + } +#endif + + for (elt = kpse_path_element (path); elt; elt = kpse_path_element (NULL)) { + char *save_ret = ret; + /* We assume that the !! magic is only used on absolute components. + Single "." get special treatment, as does "./" or its equivalent. */ + if (kpse_absolute_p (elt, false) || (elt[0] == '!' && elt[1] == '!')) { + ret = concat3(ret, elt, ENV_SEP_STRING); + } else if (elt[0] == '.' && elt[1] == 0) { + ret = concat3 (ret, kpse_dot, ENV_SEP_STRING); + } else if (elt[0] == '.' && IS_DIR_SEP(elt[1])) { + ret = concatn (ret, kpse_dot, elt + 1, ENV_SEP_STRING, NULL); + } else { + ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL); + } + free (save_ret); + } + +#ifdef MSDOS + if (malloced_kpse_dot) free (kpse_dot); +#endif + + ret[strlen (ret) - 1] = 0; + return ret; +} + +/* Do brace expansion on ELT; then do variable and ~ expansion on each + element of the result; then do brace expansion again, in case a + variable definition contained braces (e.g., $TEXMF). Return a + string comprising all of the results separated by ENV_SEP_STRING. */ + +static char * +kpse_brace_expand_element (const char *elt) +{ + unsigned i; + char **expansions = brace_expand (elt); + char *ret = (char *) xmalloc (1); + *ret = 0; + + for (i = 0; expansions[i]; i++) { + /* Do $ and ~ expansion on each element. */ + char *x = kpse_expand (expansions[i]); + char *save_ret = ret; + if (!STREQ (x, expansions[i])) { + /* If we did any expansions, do brace expansion again. Since + recursive variable definitions are not allowed, this recursion + must terminate. (In practice, it's unlikely there will ever be + more than one level of recursion.) */ + char *save_x = x; + x = kpse_brace_expand_element (x); + free (save_x); + } + ret = concat3 (ret, x, ENV_SEP_STRING); + free (save_ret); + free (x); + } + + free_array (expansions); + ret[strlen (ret) - 1] = 0; /* waste the trailing null */ + return ret; +} + +/* Be careful to not waste all the memory we allocate for each element. */ + +char * +kpse_brace_expand (const char *path) +{ + char *kpse_dot_expansion; + char *elt; + unsigned len; + /* Must do variable expansion first because if we have + foo = .:~ + TEXINPUTS = $foo + we want to end up with TEXINPUTS = .:/home/karl. + Since kpse_path_element is not reentrant, we must get all + the path elements before we start the loop. */ + char *xpath = kpse_var_expand (path); + char *ret = (char *) xmalloc (1); + *ret = 0; + + for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) { + char *save_ret = ret; + /* Do brace expansion first, so tilde expansion happens in {~ka,~kb}. */ + char *expansion = kpse_brace_expand_element (elt); + ret = concat3 (ret, expansion, ENV_SEP_STRING); + free (expansion); + free (save_ret); + } + + /* Waste the last byte by overwriting the trailing env_sep with a null. */ + len = strlen (ret); + if (len != 0) + ret[len - 1] = 0; + free (xpath); + + kpse_dot_expansion = kpse_expand_kpse_dot (ret); + if (kpse_dot_expansion != ret) + free (ret); + + return kpse_dot_expansion; +} + +/* Expand all special constructs in a path, and include only the actually + existing directories in the result. */ +char * +kpse_path_expand (const char *path) +{ + char *ret; + char *xpath; + char *elt; + unsigned len; + + /* Initialise ret to the empty string. */ + ret = (char *) xmalloc (1); + *ret = 0; + len = 0; + + /* Expand variables and braces first. */ + xpath = kpse_brace_expand (path); + + /* Now expand each of the path elements, printing the results */ + for (elt = kpse_path_element (xpath); elt; elt = kpse_path_element (NULL)) { + str_llist_type *dirs; + + /* Skip and ignore magic leading chars. */ + if (*elt == '!' && *(elt + 1) == '!') + elt += 2; + + /* Do not touch the device if present */ + if (NAME_BEGINS_WITH_DEVICE (elt)) { + while (IS_DIR_SEP (*(elt + 2)) && IS_DIR_SEP (*(elt + 3))) { + *(elt + 2) = *(elt + 1); + *(elt + 1) = *elt; + elt++; + } + } else { + /* We never want to search the whole disk. */ + while (IS_DIR_SEP (*elt) && IS_DIR_SEP (*(elt + 1))) + elt++; + } + + /* Search the disk for all dirs in the component specified. + Be faster to check the database, but this is more reliable. */ + dirs = kpse_element_dirs (elt); + if (dirs && *dirs) { + str_llist_elt_type *dir; + + for (dir = *dirs; dir; dir = STR_LLIST_NEXT (*dir)) { + char *thedir = STR_LLIST (*dir); + unsigned dirlen = strlen (thedir); + char *save_ret = ret; + /* Retain trailing slash if that's the root directory. */ + if (dirlen == 1 || (dirlen == 3 && NAME_BEGINS_WITH_DEVICE (thedir) + && IS_DIR_SEP (thedir[2]))) { + ret = concat3 (ret, thedir, ENV_SEP_STRING); + len += dirlen + 1; + ret[len - 1] = ENV_SEP; + } else { + ret = concat (ret, thedir); + len += dirlen; + ret [len - 1] = ENV_SEP; + } + free (save_ret); + } + } + } + /* Get rid of trailing ':', if any. */ + if (len != 0) + ret[len - 1] = 0; + return ret; +} + +/* braces.c -- code for doing word expansion in curly braces. Taken from + bash 1.14.5. [Ans subsequently modified for kpatshea.] + + Copyright (C) 1987,1991 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + + +#define brace_whitespace(c) (!(c) || (c) == ' ' || (c) == '\t' || (c) == '\n') +#define savestring xstrdup + +/* Basic idea: + + Segregate the text into 3 sections: preamble (stuff before an open brace), + postamble (stuff after the matching close brace) and amble (stuff after + preamble, and before postamble). Expand amble, and then tack on the + expansions to preamble. Expand postamble, and tack on the expansions to + the result so far. + */ + +/* The character which is used to separate arguments. */ +static int brace_arg_separator = ','; + +static int brace_gobbler (const char *, int *, int); +static char **expand_amble (const char *), + **array_concat (char **, char **); + +/* Return the length of ARRAY, a NULL terminated array of char *. */ +static int +array_len (char **array) +{ + register int i; + for (i = 0; array[i]; i++); + return (i); +} + +/* Free the contents of ARRAY, a NULL terminated array of char *. */ +static void +free_array (char **array) +{ + register int i = 0; + + if (!array) return; + + while (array[i]) + free (array[i++]); + free (array); +} + +/* Allocate and return a new copy of ARRAY and its contents. */ +static char ** +copy_array (char **array) +{ + register int i; + int len; + char **new_array; + + len = array_len (array); + + new_array = (char **)xmalloc ((len + 1) * sizeof (char *)); + for (i = 0; array[i]; i++) + new_array[i] = savestring (array[i]); + new_array[i] = (char *)NULL; + + return (new_array); +} + + +/* Return an array of strings; the brace expansion of TEXT. */ +static char ** +brace_expand (const char *text) +{ + register int start; + char *preamble, *amble; + const char *postamble; + char **tack, **result; + int i, c; + + /* Find the text of the preamble. */ + i = 0; + c = brace_gobbler (text, &i, '{'); + + preamble = (char *) xmalloc (i + 1); + strncpy (preamble, text, i); + preamble[i] = 0; + + result = (char **) xmalloc (2 * sizeof (char *)); + result[0] = preamble; + result[1] = NULL; + + /* Special case. If we never found an exciting character, then + the preamble is all of the text, so just return that. */ + if (c != '{') + return (result); + + /* Find the amble. This is the stuff inside this set of braces. */ + start = ++i; + c = brace_gobbler (text, &i, '}'); + + /* What if there isn't a matching close brace? */ + if (!c) + { + WARNING1 ("%s: Unmatched {", text); + free (preamble); /* Same as result[0]; see initialization. */ + result[0] = savestring (text); + return (result); + } + + amble = (char *) xmalloc (1 + (i - start)); + strncpy (amble, &text[start], (i - start)); + amble[i - start] = 0; + + postamble = &text[i + 1]; + + tack = expand_amble (amble); + result = array_concat (result, tack); + free (amble); + free_array (tack); + + tack = brace_expand (postamble); + result = array_concat (result, tack); + free_array (tack); + + return (result); +} + + +/* Expand the text found inside of braces. We simply try to split the + text at BRACE_ARG_SEPARATORs into separate strings. We then brace + expand each slot which needs it, until there are no more slots which + need it. */ +static char ** +expand_amble (const char *text) +{ + char **result, **partial; + char *tem; + int start, i, c; + + result = NULL; + + for (start = 0, i = 0, c = 1; c; start = ++i) + { + int c0, c1; + int i0, i1; + i0 = i; + c0 = brace_gobbler (text, &i0, brace_arg_separator); + i1 = i; + c1 = brace_gobbler (text, &i1, ENV_SEP); + c = c0 | c1; + i = (i0 < i1 ? i0 : i1); + + tem = (char *) xmalloc (1 + (i - start)); + strncpy (tem, &text[start], (i - start)); + tem[i- start] = 0; + + partial = brace_expand (tem); + + if (!result) + result = partial; + else + { + register int lr = array_len (result); + register int lp = array_len (partial); + register int j; + + result = (char **) xrealloc (result, (1 + lp + lr) * sizeof (char *)); + + for (j = 0; j < lp; j++) + result[lr + j] = partial[j]; + + result[lr + j] = NULL; + free (partial); + } + free (tem); + } + return (result); +} + +/* Return a new array of strings which is the result of appending each + string in ARR2 to each string in ARR1. The resultant array is + len (arr1) * len (arr2) long. For convenience, ARR1 (and its contents) + are free ()'ed. ARR1 can be NULL, in that case, a new version of ARR2 + is returned. */ +static char ** +array_concat (char **arr1, char **arr2) +{ + register int i, j, len, len1, len2; + register char **result; + + if (!arr1) + return (copy_array (arr2)); + + if (!arr2) + return (copy_array (arr1)); + + len1 = array_len (arr1); + len2 = array_len (arr2); + + result = (char **) xmalloc ((1 + (len1 * len2)) * sizeof (char *)); + + len = 0; + for (i = 0; i < len2; i++) + { + int strlen_2 = strlen (arr2[i]); + + for (j = 0; j < len1; j++) + { + int strlen_1 = strlen (arr1[j]); + + result[len] = (char *) xmalloc (1 + strlen_1 + strlen_2); + strcpy (result[len], arr1[j]); + strcpy (result[len] + strlen_1, arr2[i]); + len++; + } + } + free_array (arr1); + + result[len] = NULL; + return (result); +} + +/* Start at INDEX, and skip characters in TEXT. Set INDEX to the + index of the character matching SATISFY. This understands about + quoting. Return the character that caused us to stop searching; + this is either the same as SATISFY, or 0. */ +static int +brace_gobbler (const char *text, int *indx, int satisfy) +{ + register int i, c, quoted, level, pass_next; + + level = quoted = pass_next = 0; + + for (i = *indx; (c = text[i]); i++) + { + if (pass_next) + { + pass_next = 0; + continue; + } + + /* A backslash escapes the next character. This allows backslash to + escape the quote character in a double-quoted string. */ + if (c == '\\' && (quoted == 0 || quoted == '"' || quoted == '`')) + { + pass_next = 1; + continue; + } + + if (quoted) + { + if (c == quoted) + quoted = 0; + continue; + } + + if (c == '"' || c == '\'' || c == '`') + { + quoted = c; + continue; + } + + if (c == satisfy && !level && !quoted) + { + /* We ignore an open brace surrounded by whitespace, and also + an open brace followed immediately by a close brace, that + was preceded with whitespace. */ + if (c == '{' && + ((!i || brace_whitespace (text[i - 1])) && + (brace_whitespace (text[i + 1]) || text[i + 1] == '}'))) + continue; + /* If this is being compiled as part of bash, ignore the `{' + in a `${}' construct */ + if ((c != '{') || !i || (text[i - 1] != '$')) + break; + } + + if (c == '{') + level++; + else if (c == '}' && level) + level--; + } + + *indx = i; + return (c); +} + +/* db.c: an external database to avoid filesystem lookups. */ + +#ifndef DEFAULT_TEXMFDBS +#define DEFAULT_TEXMFDBS "/usr/local/share/texmf:/var/tmp/texfonts" +#endif + +/* Perhaps we could use this for path values themselves; for now, we use + it only for the program_enabled_p value. */ +typedef enum +{ + kpse_src_implicit, /* C initialization to zero */ + kpse_src_compile, /* configure/compile-time default */ + kpse_src_texmf_cnf, /* texmf.cnf, the kpathsea config file */ + kpse_src_client_cnf, /* application config file, e.g., config.ps */ + kpse_src_env, /* environment variable */ + kpse_src_x, /* X Window System resource */ + kpse_src_cmdline /* command-line option */ +} kpse_src_type; + + +/* For each file format, we record the following information. The main + thing that is not part of this structure is the environment variable + lists. They are used directly in tex-file.c. We could incorporate + them here, but it would complicate the code a bit. We could also do + it via variable expansion, but not now, maybe not ever: + ${PKFONTS-${TEXFONTS-/usr/local/lib/texmf/fonts//}}. */ + +typedef struct +{ + const char *type; /* Human-readable description. */ + const char *path; /* The search path to use. */ + const char *raw_path; /* Pre-$~ (but post-default) expansion. */ + const char *path_source; /* Where the path started from. */ + const char *override_path; /* From client environment variable. */ + const char *client_path; /* E.g., from dvips's config.ps. */ + const char *cnf_path; /* From texmf.cnf. */ + const char *default_path; /* If all else fails. */ + const char **suffix; /* For kpse_find_file to check for/append. */ + const char **alt_suffix; /* More suffixes to check for. */ + bool suffix_search_only; /* Only search with a suffix? */ + const char *program; /* ``mktexpk'', etc. */ + const char *program_args; /* Args to `program'. */ + bool program_enabled_p; /* Invoke `program'? */ + kpse_src_type program_enable_level; /* Who said to invoke `program'. */ + bool binmode; /* The files must be opened in binary mode. */ +} kpse_format_info_type; + +/* The sole variable of that type, indexed by `kpse_file_format_type'. + Initialized by calls to `kpse_find_file' for `kpse_init_format'. */ +static kpse_format_info_type kpse_format_info; + +#define DB_ENVS "TEXMFDBS" + +/* And EXPAND_DEFAULT calls kpse_expand_default on try_path and the + present info->path. */ +#define EXPAND_DEFAULT(try_path, source_string) \ + if (try_path) { \ + info->raw_path = try_path; \ + info->path = kpse_expand_default (try_path, info->path); \ + info->path_source = source_string; \ + } + +/* Find the final search path to use for the format entry INFO, given + the compile-time default (DEFAULT_PATH), and the environment + variables to check (the remaining arguments, terminated with NULL). + We set the `path' and `path_source' members of INFO. The + `client_path' member must already be set upon entry. */ + +static void +init_path (kpse_format_info_type *info, const char *default_path, ...) +{ + char *env_name; + char *var = NULL; + va_list ap; + + va_start (ap, default_path); + + info->default_path = default_path; + + /* First envvar that's set to a nonempty value will exit the loop. If + none are set, we want the first cnf entry that matches. Find the + cnf entries simultaneously, to avoid having to go through envvar + list twice -- because of the PVAR?C macro, that would mean having + to create a str_list and then use it twice. Yuck. */ + while ((env_name = va_arg (ap, char *)) != NULL) { + /* Since sh doesn't like envvar names with `.', check PATH_prog + rather than PATH.prog. */ + if (!var) { + /* Try simply PATH. */ + char *env_value = getenv (env_name); + if (env_value && *env_value) { + var = env_name; + } + } + + if (var && info->cnf_path) + break; + } + va_end (ap); + + /* Expand any extra :'s. For each level, we replace an extra : with + the path at the next lower level. For example, an extra : in a + user-set envvar should be replaced with the path from the cnf file. + things are complicated because none of the levels above the very + bottom are guaranteed to exist. */ + + /* Assume we can reliably start with the compile-time default. */ + info->path = info->raw_path = info->default_path; + info->path_source = "compile-time paths.h"; + + EXPAND_DEFAULT (info->cnf_path, "texmf.cnf"); + EXPAND_DEFAULT (info->client_path, "program config file"); + if (var) + EXPAND_DEFAULT (getenv (var), concat (var, " environment variable")); + EXPAND_DEFAULT (info->override_path, "application override variable"); + info->path = kpse_brace_expand (info->path); +} + + +/* Some file types have more than one suffix. */ + +static void +add_suffixes (const char ***list, ...) +{ + const char *s; + unsigned count = 0; + va_list ap; + + va_start (ap, list); + + while ((s = va_arg (ap, char *)) != NULL) { + count++; + XRETALLOC (*list, count + 1, const char *); + (*list)[count - 1] = s; + } + va_end (ap); + (*list)[count] = NULL; +} + + +static char * +remove_dbonly (const char *path) +{ + char *ret = XTALLOC(strlen (path) + 1, char), *q=ret; + const char *p=path; + bool new_elt=true; + + while (*p) { + if (new_elt && *p && *p == '!' && *(p+1) == '!') + p += 2; + else { + new_elt = (*p == ENV_SEP); + *q++ = *p++; + } + } + *q = '\0'; + return(ret); +} + +/* Initialize everything for FORMAT. */ + +static const char * +kpse_init_format (void) +{ + /* If we get called twice, don't redo all the work. */ + if (kpse_format_info.path) + return kpse_format_info.path; + + kpse_format_info.type = "ls-R"; + init_path (&kpse_format_info, DEFAULT_TEXMFDBS, DB_ENVS, NULL); + add_suffixes(&kpse_format_info.suffix, "ls-R", NULL); + kpse_format_info.path = remove_dbonly (kpse_format_info.path); + +#ifdef KPSE_DEBUG +#define MAYBE(member) (kpse_format_info.member ? kpse_format_info.member : "(none)") + + /* Describe the monster we've created. */ + if (KPSE_DEBUG_P (KPSE_DEBUG_PATHS)) + { + DEBUGF2 ("Search path for %s files (from %s)\n", + kpse_format_info.type, kpse_format_info.path_source); + DEBUGF1 (" = %s\n", kpse_format_info.path); + DEBUGF1 (" before expansion = %s\n", kpse_format_info.raw_path); + DEBUGF1 (" application override path = %s\n", MAYBE (override_path)); + DEBUGF1 (" application config file path = %s\n", MAYBE (client_path)); + DEBUGF1 (" texmf.cnf path = %s\n", MAYBE (cnf_path)); + DEBUGF1 (" compile-time path = %s\n", MAYBE (default_path)); + DEBUGF (" default suffixes ="); + if (kpse_format_info.suffix) { + const char **ext; + for (ext = kpse_format_info.suffix; ext && *ext; ext++) { + fprintf (stderr, " %s", *ext); + } + putc ('\n', stderr); + } else { + fputs (" (none)\n", stderr); + } + DEBUGF (" other suffixes ="); + if (kpse_format_info.alt_suffix) { + const char **alt; + for (alt = kpse_format_info.alt_suffix; alt && *alt; alt++) { + fprintf (stderr, " %s", *alt); + } + putc ('\n', stderr); + } else { + fputs (" (none)\n", stderr); + } + DEBUGF1 (" search only with suffix = %d\n",kpse_format_info.suffix_search_only); + DEBUGF1 (" runtime generation program = %s\n", MAYBE (program)); + DEBUGF1 (" extra program args = %s\n", MAYBE (program_args)); + DEBUGF1 (" program enabled = %d\n", kpse_format_info.program_enabled_p); + DEBUGF1 (" program enable level = %d\n", kpse_format_info.program_enable_level); + } +#endif /* KPSE_DEBUG */ + + return kpse_format_info.path; +} + +static hash_table_type db; /* The hash table for all the ls-R's. */ +/* SMALL: The old size of the hash table was 7603, with the assumption + that a minimal ls-R bas about 3500 entries. But a typical ls-R will + be more like double that size. */ +#ifndef DB_HASH_SIZE +#define DB_HASH_SIZE 15991 +#endif +#ifndef DB_NAME +#define DB_NAME "ls-R" +#endif + +static hash_table_type alias_db; +#ifndef ALIAS_NAME +#define ALIAS_NAME "aliases" +#endif +#ifndef ALIAS_HASH_SIZE +#define ALIAS_HASH_SIZE 1009 +#endif + +static str_list_type db_dir_list; + +/* If DIRNAME contains any element beginning with a `.' (that is more + than just `./'), return true. This is to allow ``hidden'' + directories -- ones that don't get searched. */ + +static bool +ignore_dir_p (const char *dirname) +{ + const char *dot_pos = dirname; + + while ((dot_pos = strchr (dot_pos + 1, '.'))) { + /* If / before and no / after, skip it. */ + if (IS_DIR_SEP (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP (dot_pos[1])) + return true; + } + + return false; +} + +/* Allocate in increments of this size. */ +#define BLOCK_SIZE 75 + +static char * +read_line (FILE *f) +{ + int c; + unsigned limit = BLOCK_SIZE; + unsigned loc = 0; + char *line = (char *) xmalloc (limit); + + while ((c = getc (f)) != EOF && c != '\n' && c != '\r') + { + line[loc] = c; + loc++; + + /* By testing after the assignment, we guarantee that we'll always + have space for the null we append below. We know we always + have room for the first char, since we start with BLOCK_SIZE. */ + if (loc == limit) + { + limit += BLOCK_SIZE; + line = (char *) xrealloc (line, limit); + } + } + + /* If we read anything, return it. This can't represent a last + ``line'' which doesn't end in a newline, but so what. */ + if (c != EOF) + { + /* Terminate the string. We can't represent nulls in the file, + either. Again, it doesn't matter. */ + line[loc] = 0; + /* Absorb LF of a CRLF pair. */ + if (c == '\r') { + c = getc (f); + if (c != '\n') + ungetc (c, f); + } + } + else /* At end of file. */ + { + free (line); + line = NULL; + } + + return line; +} + +/* If no DB_FILENAME, return false (maybe they aren't using this feature). + Otherwise, add entries from DB_FILENAME to TABLE, and return true. */ + +static bool +db_build (hash_table_type *table, const char *db_filename) +{ + char *line; + unsigned dir_count = 0, file_count = 0, ignore_dir_count = 0; + unsigned len = strlen (db_filename) - sizeof (DB_NAME) + 1; /* Keep the /. */ + char *top_dir = (char *) xmalloc (len + 1); + char *cur_dir = NULL; /* First thing in ls-R might be a filename. */ + FILE *db_file = fopen (db_filename, FOPEN_R_MODE); + + strncpy (top_dir, db_filename, len); + top_dir[len] = 0; + + if (db_file) { + while ((line = read_line (db_file)) != NULL) { + len = strlen (line); + + /* A line like `/foo:' = new dir foo. Allow both absolute (/...) + and explicitly relative (./...) names here. It's a kludge to + pass in the directory name with the trailing : still attached, + but it doesn't actually hurt. */ + if (len > 0 && line[len - 1] == ':' && kpse_absolute_p (line, true)) { + /* New directory line. */ + if (!ignore_dir_p (line)) { + /* If they gave a relative name, prepend full directory name now. */ + line[len - 1] = DIR_SEP; + /* Skip over leading `./', it confuses `match' and is just a + waste of space, anyway. This will lose on `../', but `match' + won't work there, either, so it doesn't matter. */ + cur_dir = *line == '.' ? concat (top_dir, line + 2) : xstrdup (line); + dir_count++; + } else { + cur_dir = NULL; + ignore_dir_count++; + } + + /* Ignore blank, `.' and `..' lines. */ + } else if (*line != 0 && cur_dir /* a file line? */ + && !(*line == '.' + && (line[1] == '0' || (line[1] == '.' && line[2] == 0)))) + {/* Make a new hash table entry with a key of `line' and a data + of `cur_dir'. An already-existing identical key is ok, since + a file named `foo' can be in more than one directory. Share + `cur_dir' among all its files (and hence never free it). */ + hash_insert (table, xstrdup (line), cur_dir); + file_count++; + + } /* else ignore blank lines or top-level files + or files in ignored directories*/ + + free (line); + } + + xfclose (db_file, db_filename); + + if (file_count == 0) { + WARNING1 ("kpathsea: No usable entries in %s", db_filename); + WARNING ("kpathsea: See the manual for how to generate ls-R"); + db_file = NULL; + } else { + str_list_add (&db_dir_list, xstrdup (top_dir)); + } + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) { + /* Don't make this a debugging bit, since the output is so + voluminous, and being able to specify -1 is too useful. + Instead, let people who want it run the program under + a debugger and change the variable that way. */ + bool hash_summary_only = true; + + DEBUGF4 ("%s: %u entries in %d directories (%d hidden).\n", + db_filename, file_count, dir_count, ignore_dir_count); + DEBUGF ("ls-R hash table:"); + hash_print (*table, hash_summary_only); + fflush (stderr); + } +#endif /* KPSE_DEBUG */ + } + + free (top_dir); + + return db_file != NULL; +} + + +/* Insert FNAME into the hash table. This is for files that get built + during a run. We wouldn't want to reread all of ls-R, even if it got + rebuilt. */ + +void +kpse_db_insert (const char *passed_fname) +{ + /* We might not have found ls-R, or even had occasion to look for it + yet, so do nothing if we have no hash table. */ + if (db.buckets) { + const char *dir_part; + char *fname = xstrdup (passed_fname); + char *baseptr = xbasename (fname); + const char *file_part = xstrdup (baseptr); + + *baseptr = '\0'; /* Chop off the filename. */ + dir_part = fname; /* That leaves the dir, with the trailing /. */ + + hash_insert (&db, file_part, dir_part); + } +} + +/* Return true if FILENAME could be in PATH_ELT, i.e., if the directory + part of FILENAME matches PATH_ELT. Have to consider // wildcards, but + $ and ~ expansion have already been done. */ + +static bool +match (const char *filename, const char *path_elt) +{ + const char *original_filename = filename; + bool matched = false; + + for (; *filename && *path_elt; filename++, path_elt++) { + if (FILECHARCASEEQ (*filename, *path_elt)) /* normal character match */ + ; + + else if (IS_DIR_SEP (*path_elt) /* at // */ + && original_filename < filename && IS_DIR_SEP (path_elt[-1])) { + while (IS_DIR_SEP (*path_elt)) + path_elt++; /* get past second and any subsequent /'s */ + if (*path_elt == 0) { + /* Trailing //, matches anything. We could make this part of the + other case, but it seems pointless to do the extra work. */ + matched = true; + break; + } else { + /* Intermediate //, have to match rest of PATH_ELT. */ + for (; !matched && *filename; filename++) { + /* Try matching at each possible character. */ + if (IS_DIR_SEP (filename[-1]) + && FILECHARCASEEQ (*filename, *path_elt)) + matched = match (filename, path_elt); + } + /* Prevent filename++ when *filename='\0'. */ + break; + } + } + + else /* normal character nonmatch, quit */ + break; + } + + /* If we've reached the end of PATH_ELT, check that we're at the last + component of FILENAME, we've matched. */ + if (!matched && *path_elt == 0) { + /* Probably PATH_ELT ended with `vf' or some such, and FILENAME ends + with `vf/ptmr.vf'. In that case, we'll be at a directory + separator. On the other hand, if PATH_ELT ended with a / (as in + `vf/'), FILENAME being the same `vf/ptmr.vf', we'll be at the + `p'. Upshot: if we're at a dir separator in FILENAME, skip it. + But if not, that's ok, as long as there are no more dir separators. */ + if (IS_DIR_SEP (*filename)) + filename++; + + while (*filename && !IS_DIR_SEP (*filename)) + filename++; + matched = *filename == 0; + } + + return matched; +} + + +/* If DB_DIR is a prefix of PATH_ELT, return true; otherwise false. + That is, the question is whether to try the db for a file looked up + in PATH_ELT. If PATH_ELT == ".", for example, the answer is no. If + PATH_ELT == "/usr/local/lib/texmf/fonts//tfm", the answer is yes. + + In practice, ls-R is only needed for lengthy subdirectory + comparisons, but there's no gain to checking PATH_ELT to see if it is + a subdir match, since the only way to do that is to do a string + search in it, which is all we do anyway. */ + +static bool +elt_in_db (const char *db_dir, const char *path_elt) +{ + bool found = false; + + while (!found && FILECHARCASEEQ (*db_dir++, *path_elt++)) { + /* If we've matched the entire db directory, it's good. */ + if (*db_dir == 0) + found = true; + + /* If we've reached the end of PATH_ELT, but not the end of the db + directory, it's no good. */ + else if (*path_elt == 0) + break; + } + + return found; +} + +/* If ALIAS_FILENAME exists, read it into TABLE. */ + +static bool +alias_build (hash_table_type *table, const char *alias_filename) +{ + char *line, *real, *alias; + unsigned count = 0; + FILE *alias_file = fopen (alias_filename, FOPEN_R_MODE); + + if (alias_file) { + while ((line = read_line (alias_file)) != NULL) { + /* comments or empty */ + if (*line == 0 || *line == '%' || *line == '#') { + ; + } else { + /* Each line should have two fields: realname aliasname. */ + real = line; + while (*real && ISSPACE (*real)) + real++; + alias = real; + while (*alias && !ISSPACE (*alias)) + alias++; + *alias++ = 0; + while (*alias && ISSPACE (*alias)) + alias++; + /* Is the check for errors strong enough? Should we warn the user + for potential errors? */ + if (strlen (real) != 0 && strlen (alias) != 0) { + hash_insert (table, xstrdup (alias), xstrdup (real)); + count++; + } + } + free (line); + } + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_HASH)) { + /* As with ls-R above ... */ + bool hash_summary_only = true; + DEBUGF2 ("%s: %u aliases.\n", alias_filename, count); + DEBUGF ("alias hash table:"); + hash_print (*table, hash_summary_only); + fflush (stderr); + } +#endif /* KPSE_DEBUG */ + + xfclose (alias_file, alias_filename); + } + + return alias_file != NULL; +} + +/* Initialize the path for ls-R files, and read them all into the hash + table `db'. If no usable ls-R's are found, set db.buckets to NULL. */ + +void +kpse_init_db (void) +{ + bool ok = false; + const char *db_path = kpse_init_format (); + char **db_files = kpse_all_path_search (db_path, DB_NAME); + char **orig_db_files = db_files; + + /* Must do this after the path searching (which ends up calling + kpse_db_search recursively), so db.buckets stays NULL. */ + db = hash_create (DB_HASH_SIZE); + + while (db_files && *db_files) { + if (db_build (&db, *db_files)) + ok = true; + free (*db_files); + db_files++; + } + + if (!ok) { + /* If db can't be built, leave `size' nonzero (so we don't + rebuild it), but clear `buckets' (so we don't look in it). */ + free (db.buckets); + db.buckets = NULL; + } + + free (orig_db_files); + + /* Add the content of any alias databases. There may exist more than + one alias file along DB_NAME files. This duplicates the above code + -- should be a function. */ + ok = false; + db_files = kpse_all_path_search (db_path, ALIAS_NAME); + orig_db_files = db_files; + + alias_db = hash_create (ALIAS_HASH_SIZE); + + while (db_files && *db_files) { + if (alias_build (&alias_db, *db_files)) + ok = true; + free (*db_files); + db_files++; + } + + if (!ok) { + free (alias_db.buckets); + alias_db.buckets = NULL; + } + + free (orig_db_files); +} + +/* Avoid doing anything if this PATH_ELT is irrelevant to the databases. */ + +str_list_type * +kpse_db_search (const char *name, const char *orig_path_elt, bool all) +{ + char **db_dirs, **orig_dirs, **r; + const char *last_slash; + char *path_elt; + bool done; + str_list_type *ret = 0; + unsigned e; + char **aliases = NULL; + bool relevant = false; + + /* If we failed to build the database (or if this is the recursive + call to build the db path), quit. */ + if (db.buckets == NULL) + return NULL; + + /* When tex-glyph.c calls us looking for, e.g., dpi600/cmr10.pk, we + won't find it unless we change NAME to just `cmr10.pk' and append + `/dpi600' to PATH_ELT. We are justified in using a literal `/' + here, since that's what tex-glyph.c unconditionally uses in + DPI_BITMAP_SPEC. But don't do anything if the / begins NAME; that + should never happen. */ + last_slash = strrchr (name, '/'); + if (last_slash && last_slash != name) { + unsigned len = last_slash - name + 1; + char *dir_part = (char *) xmalloc (len); + strncpy (dir_part, name, len - 1); + dir_part[len - 1] = 0; + path_elt = concat3 (orig_path_elt, "/", dir_part); + name = last_slash + 1; + } else + path_elt = (char *) orig_path_elt; + + /* Don't bother doing any lookups if this `path_elt' isn't covered by + any of database directories. We do this not so much because the + extra couple of hash lookups matter -- they don't -- but rather + because we want to return NULL in this case, so path_search can + know to do a disk search. */ + for (e = 0; !relevant && e < STR_LIST_LENGTH (db_dir_list); e++) { + relevant = elt_in_db (STR_LIST_ELT (db_dir_list, e), path_elt); + } + if (!relevant) + return NULL; + + /* If we have aliases for this name, use them. */ + if (alias_db.buckets) + aliases = hash_lookup (alias_db, name); + + if (!aliases) { + aliases = XTALLOC1 (char *); + aliases[0] = NULL; + } + { /* Push aliases up by one and insert the original name at the front. */ + unsigned i; + unsigned len = 1; /* Have NULL element already allocated. */ + for (r = aliases; *r; r++) + len++; + XRETALLOC (aliases, len + 1, char *); + for (i = len; i > 0; i--) { + aliases[i] = aliases[i - 1]; + } + aliases[0] = (char *) name; + } + + done = false; + for (r = aliases; !done && *r; r++) { + char *atry = *r; + + /* We have an ls-R db. Look up `atry'. */ + orig_dirs = db_dirs = hash_lookup (db, atry); + + ret = XTALLOC1 (str_list_type); + *ret = str_list_init (); + + /* For each filename found, see if it matches the path element. For + example, if we have .../cx/cmr10.300pk and .../ricoh/cmr10.300pk, + and the path looks like .../cx, we don't want the ricoh file. */ + while (!done && db_dirs && *db_dirs) { + char *db_file = concat (*db_dirs, atry); + bool matched = match (db_file, path_elt); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF3 ("db:match(%s,%s) = %d\n", db_file, path_elt, matched); +#endif + + /* We got a hit in the database. Now see if the file actually + exists, possibly under an alias. */ + if (matched) { + char *found = NULL; + if (kpse_readable_file (db_file)) { + found = db_file; + + } else { + char **a; + + free (db_file); /* `db_file' wasn't on disk. */ + + /* The hit in the DB doesn't exist in disk. Now try all its + aliases. For example, suppose we have a hierarchy on CD, + thus `mf.bas', but ls-R contains `mf.base'. Find it anyway. + Could probably work around this with aliases, but + this is pretty easy and shouldn't hurt. The upshot is that + if one of the aliases actually exists, we use that. */ + for (a = aliases + 1; *a && !found; a++) { + char *atry = concat (*db_dirs, *a); + if (kpse_readable_file (atry)) + found = atry; + else + free (atry); + } + } + + /* If we have a real file, add it to the list, maybe done. */ + if (found) { + str_list_add (ret, found); + if (!all && found) + done = true; + } + } else { /* no match in the db */ + free (db_file); + } + + + /* On to the next directory, if any. */ + db_dirs++; + } + + /* This is just the space for the pointers, not the strings. */ + if (orig_dirs && *orig_dirs) + free (orig_dirs); + } + + free (aliases); + + /* If we had to break up NAME, free the temporary PATH_ELT. */ + if (path_elt != orig_path_elt) + free (path_elt); + + return ret; +} + +/* kdefault.c: Expand extra colons. */ + +/* Check for leading colon first, then trailing, then doubled, since + that is fastest. Usually it will be leading or trailing. */ + +char * +kpse_expand_default (const char *path, const char *fallback) +{ + unsigned path_length; + char *expansion; + + /* The default path better not be null. */ + assert (fallback); + + if (path == NULL) + expansion = xstrdup (fallback); + + /* Solitary or leading :? */ + else if (IS_ENV_SEP (*path)) + { + expansion = path[1] == 0 ? xstrdup (fallback) : concat (fallback, path); + } + + /* Sorry about the assignment in the middle of the expression, but + conventions were made to be flouted and all that. I don't see the + point of calling strlen twice or complicating the logic just to + avoid the assignment (especially now that I've pointed it out at + such great length). */ + else if (path[(path_length = strlen (path)) - 1] == ENV_SEP) + expansion = concat (path, fallback); + + /* OK, not leading or trailing. Check for doubled. */ + else + { + const char *loc; + + /* What we'll return if we find none. */ + expansion = xstrdup (path); + + for (loc = path; *loc; loc++) + { + if (IS_ENV_SEP (loc[0]) && IS_ENV_SEP (loc[1])) + { /* We have a doubled colon. */ + expansion = (char *) xmalloc (path_length + strlen (fallback) + 1); + + /* Copy stuff up to and including the first colon. */ + strncpy (expansion, path, loc - path + 1); + expansion[loc - path + 1] = 0; + + /* Copy in FALLBACK, and then the rest of PATH. */ + strcat (expansion, fallback); + strcat (expansion, loc + 1); + + break; + } + } + } + + return expansion; +} + +/* elt-dirs.c: Translate a path element to its corresponding + director{y,ies}. */ + +/* To avoid giving prototypes for all the routines and then their real + definitions, we give all the subroutines first. The entry point is + the last routine in the file. */ + +/* Make a copy of DIR (unless it's null) and save it in L. Ensure that + DIR ends with a DIR_SEP for the benefit of later searches. */ + +static void +dir_list_add (str_llist_type *l, const char *dir) +{ + char last_char = dir[strlen (dir) - 1]; + char *saved_dir + = IS_DIR_SEP (last_char) || IS_DEVICE_SEP (last_char) + ? xstrdup (dir) + : concat (dir, DIR_SEP_STRING); + + str_llist_add (l, saved_dir); +} + + +/* If DIR is a directory, add it to the list L. */ + +static void +checked_dir_list_add (str_llist_type *l, const char *dir) +{ + if (dir_p (dir)) + dir_list_add (l, dir); +} + +/* The cache. Typically, several paths have the same element; for + example, /usr/local/lib/texmf/fonts//. We don't want to compute the + expansion of such a thing more than once. Even though we also cache + the dir_links call, that's not enough -- without this path element + caching as well, the execution time doubles. */ + +typedef struct +{ + const char *key; + str_llist_type *value; +} cache_entry; + +static cache_entry *the_cache = NULL; +static unsigned cache_length = 0; + +/* Associate KEY with VALUE. We implement the cache as a simple linear + list, since it's unlikely to ever be more than a dozen or so elements + long. We don't bother to check here if PATH has already been saved; + we always add it to our list. We copy KEY but not VALUE; not sure + that's right, but it seems to be all that's needed. */ + +static void +cache (const char *key, str_llist_type *value) +{ + cache_length++; + XRETALLOC (the_cache, cache_length, cache_entry); + the_cache[cache_length - 1].key = xstrdup (key); + the_cache[cache_length - 1].value = value; +} + + +/* To retrieve, just check the list in order. */ + +static str_llist_type * +cached (const char *key) +{ + unsigned p; + + for (p = 0; p < cache_length; p++) + { + if (FILESTRCASEEQ (the_cache[p].key, key)) + return the_cache[p].value; + } + + return NULL; +} + +/* Handle the magic path constructs. */ + +/* Declare recursively called routine. */ +static void expand_elt (str_llist_type *, const char *, unsigned); + + +/* POST is a pointer into the original element (which may no longer be + ELT) to just after the doubled DIR_SEP, perhaps to the null. Append + subdirectories of ELT (up to ELT_LENGTH, which must be a /) to + STR_LIST_PTR. */ + +#ifdef WIN32 +/* Shared across recursive calls, it acts like a stack. */ +static char dirname[MAX_PATH]; +#endif + +static void +do_subdir (str_llist_type *str_list_ptr, const char *elt, + unsigned elt_length, const char *post) +{ +#ifdef WIN32 + WIN32_FIND_DATA find_file_data; + HANDLE hnd; + int proceed; +#else + DIR *dir; + struct dirent *e; +#endif /* not WIN32 */ + fn_type name; + + /* Some old compilers don't allow aggregate initialization. */ + name = fn_copy0 (elt, elt_length); + + assert (IS_DIR_SEP (elt[elt_length - 1]) + || IS_DEVICE_SEP (elt[elt_length - 1])); + +#if defined (WIN32) + strcpy(dirname, FN_STRING(name)); + strcat(dirname, "/*.*"); /* "*.*" or "*" -- seems equivalent. */ + hnd = FindFirstFile(dirname, &find_file_data); + + if (hnd == INVALID_HANDLE_VALUE) { + fn_free(&name); + return; + } + + /* Include top level before subdirectories, if nothing to match. */ + if (*post == 0) + dir_list_add (str_list_ptr, FN_STRING (name)); + else { + /* If we do have something to match, see if it exists. For + example, POST might be `pk/ljfour', and they might have a + directory `$TEXMF/fonts/pk/ljfour' that we should find. */ + fn_str_grow (&name, post); + expand_elt (str_list_ptr, FN_STRING (name), elt_length); + fn_shrink_to (&name, elt_length); + } + proceed = 1; + while (proceed) { + if (find_file_data.cFileName[0] != '.') { + /* Construct the potential subdirectory name. */ + fn_str_grow (&name, find_file_data.cFileName); + if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + unsigned potential_len = FN_LENGTH (name); + + /* It's a directory, so append the separator. */ + fn_str_grow (&name, DIR_SEP_STRING); + + do_subdir (str_list_ptr, FN_STRING (name), + potential_len, post); + } + fn_shrink_to (&name, elt_length); + } + proceed = FindNextFile (hnd, &find_file_data); + } + fn_free (&name); + FindClose(hnd); + +#else /* not WIN32 */ + + /* If we can't open it, quit. */ + dir = opendir (FN_STRING (name)); + if (dir == NULL) + { + fn_free (&name); + return; + } + + /* Include top level before subdirectories, if nothing to match. */ + if (*post == 0) + dir_list_add (str_list_ptr, FN_STRING (name)); + else + { /* If we do have something to match, see if it exists. For + example, POST might be `pk/ljfour', and they might have a + directory `$TEXMF/fonts/pk/ljfour' that we should find. */ + fn_str_grow (&name, post); + expand_elt (str_list_ptr, FN_STRING (name), elt_length); + fn_shrink_to (&name, elt_length); + } + + while ((e = readdir (dir)) != NULL) + { /* If it begins with a `.', never mind. (This allows ``hidden'' + directories that the algorithm won't find.) */ + if (e->d_name[0] != '.') + { + int links; + + /* Construct the potential subdirectory name. */ + fn_str_grow (&name, e->d_name); + + /* If we can't stat it, or if it isn't a directory, continue. */ + links = dir_links (FN_STRING (name)); + + if (links >= 0) + { + unsigned potential_len = FN_LENGTH (name); + + /* It's a directory, so append the separator. */ + fn_str_grow (&name, DIR_SEP_STRING); + + /* Should we recurse? To see if the subdirectory is a + leaf, check if it has two links (one for . and one for + ..). This means that symbolic links to directories do + 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. + + The #ifdef here makes all this configurable at + compile-time, so that if we're using VMS directories or + some such, we can still find subdirectories, even if it + is much slower. */ +#ifdef ST_NLINK_TRICK +#ifdef AMIGA + /* With SAS/C++ 6.55 on the Amiga, `stat' sets the `st_nlink' + field to -1 for a file, or to 1 for a directory. */ + if (links == 1) +#else + if (links > 2) +#endif /* not AMIGA */ +#endif /* not ST_NLINK_TRICK */ + /* All criteria are met; find subdirectories. */ + do_subdir (str_list_ptr, FN_STRING (name), + potential_len, post); +#ifdef ST_NLINK_TRICK + else if (*post == 0) + /* Nothing to match, no recursive subdirectories to + look for: we're done with this branch. Add it. */ + dir_list_add (str_list_ptr, FN_STRING (name)); +#endif + } + + /* Remove the directory entry we just checked from `name'. */ + fn_shrink_to (&name, elt_length); + } + } + + fn_free (&name); + xclosedir (dir); +#endif /* not WIN32 */ +} + + +/* Assume ELT is non-empty and non-NULL. Return list of corresponding + directories (with no terminating NULL entry) in STR_LIST_PTR. Start + looking for magic constructs at START. */ + +static void +expand_elt (str_llist_type *str_list_ptr, const char *elt, unsigned start) +{ + const char *dir = elt + start; + const char *post; + + while (*dir != 0) + { + if (IS_DIR_SEP (*dir)) + { + /* If two or more consecutive /'s, find subdirectories. */ + if (IS_DIR_SEP (dir[1])) + { + for (post = dir + 1; IS_DIR_SEP (*post); post++) ; + do_subdir (str_list_ptr, elt, dir - elt + 1, post); + return; + } + + /* No special stuff at this slash. Keep going. */ + } + + dir++; + } + + /* When we reach the end of ELT, it will be a normal filename. */ + checked_dir_list_add (str_list_ptr, elt); +} + +/* Here is the entry point. Returns directory list for ELT. */ + +str_llist_type * +kpse_element_dirs (const char *elt) +{ + str_llist_type *ret; + + /* If given nothing, return nothing. */ + if (!elt || !*elt) + return NULL; + + /* If we've already cached the answer for ELT, return it. */ + ret = cached (elt); + if (ret) + return ret; + + /* We're going to have a real directory list to return. */ + ret = XTALLOC1 (str_llist_type); + *ret = NULL; + + /* We handle the hard case in a subroutine. */ + expand_elt (ret, elt, 0); + + /* Remember the directory list we just found, in case future calls are + made with the same ELT. */ + cache (elt, ret); + +#ifdef KPSE_DEBUG + if (KPSE_DEBUG_P (KPSE_DEBUG_EXPAND)) + { + DEBUGF1 ("path element %s =>", elt); + if (ret) + { + str_llist_elt_type *e; + for (e = *ret; e; e = STR_LLIST_NEXT (*e)) + fprintf (stderr, " %s", STR_LLIST (*e)); + } + putc ('\n', stderr); + fflush (stderr); + } +#endif /* KPSE_DEBUG */ + + return ret; +} + +/* path-elt.c: Return the stuff between colons. */ + +/* The static (but dynamically allocated) area we return the answer in, + and how much we've currently allocated for it. */ +static char *elt = NULL; +static unsigned elt_alloc = 0; + +/* The path we're currently working on. */ +static const char *path = NULL; + +/* Upon entry, the static `path' is at the first (and perhaps last) + character of the return value, or else NULL if we're at the end (or + haven't been called). I make no provision for caching the results; + thus, we parse the same path over and over, on every lookup. If that + turns out to be a significant lose, it can be fixed, but I'm guessing + disk accesses overwhelm everything else. If ENV_P is true, use + IS_ENV_SEP; else use IS_DIR_SEP. */ + +static char * +element (const char *passed_path, bool env_p) +{ + const char *p; + char *ret; + int brace_level; + unsigned len; + + if (passed_path) + path = passed_path; + /* Check if called with NULL, and no previous path (perhaps we reached + the end). */ + else if (!path) + return NULL; + + /* OK, we have a non-null `path' if we get here. */ + assert (path); + p = path; + + /* Find the next colon not enclosed by braces (or the end of the path). */ + brace_level = 0; + while (*p != 0 && !(brace_level == 0 + && (env_p ? IS_ENV_SEP (*p) : IS_DIR_SEP (*p)))) { + if (*p == '{') ++brace_level; + else if (*p == '}') --brace_level; + ++p; + } + + /* Return the substring starting at `path'. */ + len = p - path; + + /* Make sure we have enough space (including the null byte). */ + if (len + 1 > elt_alloc) + { + elt_alloc = len + 1; + elt = (char *) xrealloc (elt, elt_alloc); + } + + strncpy (elt, path, len); + elt[len] = 0; + ret = elt; + + /* If we are at the end, return NULL next time. */ + if (path[len] == 0) + path = NULL; + else + path += len + 1; + + return ret; +} + +char * +kpse_path_element (const char *p) +{ + return element (p, true); +} + +char * +kpse_filename_component (const char *p) +{ + return element (p, false); +} +
new file mode 100644 --- /dev/null +++ b/liboctave/kpse.h @@ -0,0 +1,130 @@ +/* pathsearch.h: mostly-generic path searching. + +Copyright (C) 1993, 94, 96, 97 Karl Berry. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef KPATHSEA_PATHSEARCH_H +#define KPATHSEA_PATHSEARCH_H + +#include "kpse-lib.h" + +/* If PATH is non-null, return its first element (as defined by + IS_ENV_SEP). If it's NULL, return the next element in the previous + path, a la strtok. Leading, trailing, or doubled colons result in + the empty string. When at the end of PATH, return NULL. In any + case, return a pointer to an area that may be overwritten on + subsequent calls. */ +extern char *kpse_path_element (const char *path); + +/* Like `kpse_path_element', but for filename components (using + IS_DIR_SEP). Uses same area as `kpse_path_element'. */ +extern char *kpse_filename_component (const char *path); + + +/* Given a path element ELT, return a pointer to a NULL-terminated list + of the corresponding (existing) directory or directories, with + trailing slashes, or NULL. If ELT is the empty string, check the + current working directory. + + It's up to the caller to expand ELT. This is because this routine is + most likely only useful to be called from `kpse_path_search', which + has already assumed expansion has been done. */ +extern str_llist_type *kpse_element_dirs (const char *elt); + + +/* Call `kpse_expand' on NAME. If the result is an absolute or + explicitly relative filename, check whether it is a readable + (regular) file. + + Otherwise, look in each of the directories specified in PATH (also do + tilde and variable expansion on elements in PATH), using a prebuilt + db (see db.h) if it's relevant for a given path element. + + If the prebuilt db doesn't exist, or if MUST_EXIST is true and NAME + isn't found in the prebuilt db, look on the filesystem. (I.e., if + MUST_EXIST is false, and NAME isn't found in the db, do *not* look on + the filesystem.) + + The caller must expand PATH. This is because it makes more sense to + do this once, in advance, instead of for every search using it. + + In any case, return the complete filename if found, otherwise NULL. */ +extern char *kpse_path_search (const char *path, const char *name, + bool must_exist); + + +/* Like `kpse_path_search' with MUST_EXIST true, but return a list of + all the filenames (or NULL if none), instead of taking the first. */ +extern char **kpse_all_path_search (const char *path, const char *name); + +/* Search each element of PATH for each element in the list of NAMES. + Return the first one found. */ +extern char *kpse_path_find_first_of (const char *path, const char **names, + bool must_exist); + +/* Like `kpse_path_find_first_of' with MUST_EXIST true, but return a + list of all the filenames (or NULL if none), instead of taking the + first. */ +extern char **kpse_all_path_find_first_of (const char *path, + const char **names); + +/* expand.h: general expansion. */ + +/* Call kpse_var_expand and kpse_tilde_expand (in that order). Result + is always in fresh memory, even if no expansions were done. */ +extern char *kpse_expand (const char *s); + +/* Do brace expansion and call `kpse_expand' on each element of the + result; return the final expansion (always in fresh memory, even if + no expansions were done). We don't call `kpse_expand_default' + because there is a whole sequence of defaults to run through; see + `kpse_init_format'. */ +extern char *kpse_brace_expand (const char *path); + +/* Do brace expansion and call `kpse_expand' on each argument of the + result, then expand any `//' constructs. The final expansion (always + in fresh memory) is a path of all the existing directories that match + the pattern. */ +extern char *kpse_path_expand (const char *path); + +/* default.h: Declare default path expander. */ + +/* Replace a leading or trailing or doubled : in PATH with DFLT. If + no extra colons, return PATH. Only one extra colon is replaced. + DFLT may not be NULL. */ + +extern char *kpse_expand_default (const char *path, const char *dflt); + +/* db.h: lookups in an externally built db file. */ + +/* Initialize the database. Until this is called, no ls-R matches will + be found. */ +extern void kpse_init_db (void); + +/* Return list of matches for NAME in the ls-R file matching PATH_ELT. If + ALL is set, return (null-terminated list) of all matches, else just + the first. If no matches, return a pointer to an empty list. If no + databases can be read, or PATH_ELT is not in any of the databases, + return NULL. */ +extern str_list_type *kpse_db_search (const char *name, + const char *path_elt, bool all); + +/* Insert the filename FNAME into the database. + Called by mktexpk et al. */ +extern void kpse_db_insert (const char *fname); + +#endif /* not KPATHSEA_PATHSEARCH_H */ +
--- a/liboctave/oct-getopt.c +++ b/liboctave/oct-getopt.c @@ -24,7 +24,7 @@ #include <config.h> #endif -#include <kpathsea/getopt.h> +#include "getopt.h" int octave_getopt (int argc, char *const *argv, const char *optstring)
deleted file mode 100644 --- a/liboctave/oct-kpse.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - -Copyright (C) 2000 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <kpathsea/default.h> -#include <kpathsea/expand.h> -#include <kpathsea/pathsearch.h> -#include <kpathsea/progname.h> - -#define OCTAVE_KPSE_SKIP_STRUCT_DECLS -#include "oct-kpse.h" -#undef OCTAVE_KPSE_SKIP_STRUCT_DECLS - -str_llist_type * -octave_kpse_element_dirs (const char *elt) -{ - return kpse_element_dirs (elt); -} - -char * -octave_kpse_path_search (const char *path, const char *name, int must_exist) -{ - return kpse_path_search (path, name, must_exist); -} - -char ** -octave_kpse_all_path_search (const char *path, const char *name) -{ - return kpse_all_path_search (path, name); -} - -char * -octave_kpse_path_find_first_of (const char *path, const char **names, - int must_exist) -{ - return kpse_path_find_first_of (path, names, must_exist); -} - -char ** -octave_kpse_all_path_find_first_of (const char *path, const char **names) -{ - return kpse_all_path_find_first_of (path, names); -} - -void -octave_kpse_set_progname (const char *name) -{ - kpse_set_progname (name); -} - -char * -octave_kpse_expand_default (const char *path, const char *dflt) -{ - return kpse_expand_default (path, dflt); -} - -char * -octave_kpse_path_expand (const char *path) -{ - return kpse_path_expand (path); -} - -char * -octave_kpse_path_element (const char *path) -{ - return kpse_path_element (path); -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/
deleted file mode 100644 --- a/liboctave/oct-kpse.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - -Copyright (C) 2000 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#if !defined (octave_kpse_h) -#define octave_kpse_h 1 - -#if !defined (OCTAVE_KPSE_SKIP_STRUCT_DECLS) -struct str_llist_elt -{ - char *str; - int moved; - struct str_llist_elt *next; -}; -typedef struct str_llist_elt str_llist_elt_type; -typedef struct str_llist_elt *str_llist_type; - -#define STR_LLIST(sl) ((sl).str) -#define STR_LLIST_MOVED(sl) ((sl).moved) -#define STR_LLIST_NEXT(sl) ((sl).next) -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern unsigned int kpathsea_debug; - -extern str_llist_type *octave_kpse_element_dirs (const char *); - -extern char *octave_kpse_path_search (const char *, const char *, int); - -extern char **octave_kpse_all_path_search (const char *, const char *); - -extern char *octave_kpse_path_find_first_of (const char *, const char **, int); - -extern char **octave_kpse_all_path_find_first_of (const char *, const char **); - -extern void octave_kpse_set_progname (const char *); - -extern char *octave_kpse_expand_default (const char *, const char *); - -extern char *octave_kpse_path_expand (const char *); - -extern char *octave_kpse_path_element (const char *); - -#ifdef __cplusplus -} -#endif - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/
--- a/liboctave/pathsearch.cc +++ b/liboctave/pathsearch.cc @@ -30,11 +30,12 @@ #include "lo-utils.h" #include "oct-env.h" -#include "oct-kpse.h" #include "pathsearch.h" #include "str-vec.h" #include "str-vec.h" +#include "kpse.h" + static bool octave_kpathsea_initialized = false; string_vector @@ -60,7 +61,7 @@ for (int i = 0; i < len; i++) { str_llist_type *elt_dirs - = ::octave_kpse_element_dirs (pv[i].c_str ()); + = kpse_element_dirs (pv[i].c_str ()); if (elt_dirs) { @@ -96,7 +97,7 @@ if (initialized) { - char *tmp = ::octave_kpse_path_search (p.c_str (), nm.c_str (), true); + char *tmp = kpse_path_search (p.c_str (), nm.c_str (), true); if (tmp) { @@ -151,7 +152,7 @@ if (initialized) { - char **tmp = ::octave_kpse_all_path_search (p.c_str (), nm.c_str ()); + char **tmp = kpse_all_path_search (p.c_str (), nm.c_str ()); retval = make_retval (tmp); @@ -196,7 +197,7 @@ { const char **c_names = make_c_names (names); - char *tmp = ::octave_kpse_path_find_first_of (p.c_str (), c_names, true); + char *tmp = kpse_path_find_first_of (p.c_str (), c_names, true); delete_c_names (c_names); @@ -219,7 +220,7 @@ { const char **c_names = make_c_names (names); - char **tmp = ::octave_kpse_all_path_find_first_of (p.c_str (), c_names); + char **tmp = kpse_all_path_find_first_of (p.c_str (), c_names); delete_c_names (c_names); @@ -232,34 +233,6 @@ } void -dir_path::set_program_name (const std::string& nm) -{ - std::string selfautodir = octave_env::getenv ("SELFAUTODIR"); - std::string selfautoloc = octave_env::getenv ("SELFAUTOLOC"); - std::string selfautoparent = octave_env::getenv ("SELFAUTOPARENT"); - - ::octave_kpse_set_progname (nm.c_str ()); - - // Calling kpse_set_progname has the unfortunate side-effect of - // exporting the following variables. If they were empty when we - // started, we make them empty again so that they will not interfere - // with TeX if it is run as a subprocess of Octave (if they were set - // before, we want to preserve their values). - // - // XXX FIXME XXX -- is there a reasonable way to actually remove - // them from the environment? - - if (selfautodir.empty ()) - octave_env::putenv ("SELFAUTODIR", ""); - - if (selfautoloc.empty ()) - octave_env::putenv ("SELFAUTOLOC", ""); - - if (selfautoparent.empty ()) - octave_env::putenv ("SELFAUTOPARENT", ""); -} - -void dir_path::init (void) { if (! octave_kpathsea_initialized) @@ -275,13 +248,13 @@ char *t1 = 0; if (p_default.empty ()) - t1 = ::octave_kpse_path_expand (p_orig.c_str ()); + t1 = kpse_path_expand (p_orig.c_str ()); else { char *t2 - = ::octave_kpse_expand_default (p_orig.c_str (), p_default.c_str ()); + = kpse_expand_default (p_orig.c_str (), p_default.c_str ()); - t1 = ::octave_kpse_path_expand (t2); + t1 = kpse_path_expand (t2); if (t2) free (t2); @@ -296,21 +269,21 @@ p = std::string (); int count = 0; - char *path_elt = ::octave_kpse_path_element (p.c_str ()); + char *path_elt = kpse_path_element (p.c_str ()); while (path_elt) { - path_elt = ::octave_kpse_path_element (0); + path_elt = kpse_path_element (0); count++; } pv.resize (count); - path_elt = ::octave_kpse_path_element (p.c_str ()); + path_elt = kpse_path_element (p.c_str ()); for (int i = 0; i < count; i++) { pv[i] = path_elt; - path_elt = ::octave_kpse_path_element (0); + path_elt = kpse_path_element (0); } initialized = true;
--- a/liboctave/pathsearch.h +++ b/liboctave/pathsearch.h @@ -75,8 +75,6 @@ std::string find_first_of (const string_vector& names); string_vector find_all_first_of (const string_vector& names); - static void set_program_name (const std::string&); - void rehash (void) { initialized = false;
--- a/octMakefile.in +++ b/octMakefile.in @@ -24,18 +24,19 @@ acx_blas.m4 acx_lapack.m4 config.h.in install-sh autogen.sh DISTFILES = $(CONF_DISTFILES) \ - BUGS COPYING FLEX.patch INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] \ - PROJECTS README README.Linux README.Windows README.MachTen ROADMAP \ - SENDING-PATCHES THANKS move-if-change octave-sh octave-bug.in \ + BUGS COPYING FLEX.patch INSTALL INSTALL.OCTAVE NEWS \ + NEWS.[0-9] PROJECTS README README.Linux README.Windows \ + README.MachTen README.kpathsea ROADMAP SENDING-PATCHES \ + THANKS move-if-change octave-sh octave-bug.in \ octave-config.in install-octave.in mk-opts.pl mkinstalldirs \ mkoctfile.in texi2dvi ChangeLog ChangeLog.[0-9] # Complete directory trees to distribute. -DISTDIRS = glob kpathsea # plplot +DISTDIRS = glob # plplot # Subdirectories in which to run `make all'. SUBDIRS = @PLPLOT_DIR@ @DLFCN_DIR@ @GLOB_DIR@ \ - kpathsea libcruft liboctave scripts doc examples + libcruft liboctave scripts doc examples ALL_SUBDIRS = $(SUBDIRS) src @@ -61,7 +62,7 @@ BINDISTSUBDIRS = libcruft liboctave src scripts doc emacs examples # Subdirectories in which to run clean targets. -CLEANSUBDIRS = $(DISTSUBDIRS) @GLOB_DIR@ kpathsea +CLEANSUBDIRS = $(DISTSUBDIRS) @GLOB_DIR@ DIRS_TO_MAKE = $(bindir) $(libdir) $(octincludedir)/octave $(fcnfiledir) \ $(octfiledir) $(archlibdir) $(localarchlibdir) \ @@ -95,10 +96,6 @@ $(MAKE) -C test check .PHONY: check -kpathsea.info: - $(MAKE) -C kpathsea kpathsea.info -.PHONY: kpathsea.info - octave.info: $(MAKE) -C doc/interpreter octave.info .PHONY: octave.info @@ -171,8 +168,7 @@ -o -name config.status -o -name config.cache -o -name stamp-h \ -o -name klibtool.config -o -name stamp-auto \ -o -name c-auto.h \) -print | xargs rm -rf - find `cat .fname`/kpathsea `cat .fname`/glob \ - -name Makefile | xargs rm -f + find `cat .fname`/glob -name Makefile | xargs rm -f find `cat .fname`/glob -name config.h | xargs rm -f rm -f `cat .fname`/test/octave.test/*.m chmod -R a+rwX `cat .fname`
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * toplev.cc (octave_config_info): Delete LIBKPATHSEA from struct. + * oct-conf.h.in: Don't substitute LIBKPATHSEA. + + * octave.cc (octave_main): Don't call dir_path::set_program_name. + 2003-04-17 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-file.h (octave_file::empty_clone): Create an octave_scalar
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -192,10 +192,6 @@ #define OCTAVE_CONF_LIBGLOB %OCTAVE_CONF_LIBGLOB% #endif -#ifndef OCTAVE_CONF_LIBKPATHSEA -#define OCTAVE_CONF_LIBKPATHSEA %OCTAVE_CONF_LIBKPATHSEA% -#endif - #ifndef OCTAVE_CONF_LIBOCTAVE #define OCTAVE_CONF_LIBOCTAVE %OCTAVE_CONF_LIBOCTAVE% #endif
--- a/src/octave.cc +++ b/src/octave.cc @@ -375,8 +375,6 @@ { octave_env::set_program_name (argv[0]); - dir_path::set_program_name (argv[0]); - // The order of these calls is important. The call to // install_defaults must come before install_builtins because // default variable values must be available for the variables to be
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -740,7 +740,6 @@ "LIBEXT", OCTAVE_CONF_LIBEXT, "LIBFLAGS", OCTAVE_CONF_LIBFLAGS, "LIBGLOB", OCTAVE_CONF_LIBGLOB, - "LIBKPATHSEA", OCTAVE_CONF_LIBKPATHSEA, "LIBOCTAVE", OCTAVE_CONF_LIBOCTAVE, "LIBOCTINTERP", OCTAVE_CONF_LIBOCTINTERP, "LIBPLPLOT", OCTAVE_CONF_LIBPLPLOT,