diff --git a/COPYING b/COPYING index 1384f46..1a88dcf 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (C) 1998-2019 Ivo Timmermans, Guus Sliepen and others. +Copyright (C) 1998-2018 Ivo Timmermans, Guus Sliepen and others. See the AUTHORS file for a complete list. This program is free software; you can redistribute it and/or modify it under diff --git a/ChangeLog b/ChangeLog index 041bf3f..a13df1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,49 +1,3 @@ -Version 1.0.36 August 26 2019 ------------------------------------------------------------------------- - -Guus Sliepen (8): - Remove the call to RAND_load_file(). - Update THANKS. - Backport tinc 1.1's str2net() function. - Update THANKS. - Fix spelling errors found by codespell. - Reformat all code using astyle. - Add a missing check for a pathname being too long. - Releasing 1.0.36. - -Rosen Penev (2): - Fix compilation when OpenSSL has no ENGINE support - Fix compilation without deprecated OpenSSL APIs - -Quentin Rameau (1): - Double-quote nodes in graphviz network file - -Werner Schreiber (1): - Fix segfault when dest->mtu is 0. - -Version 1.0.35 October 05 2018 ------------------------------------------------------------------------- - -Guus Sliepen (12): - Prevent oracle attacks (CVE-2018-16737, CVE-2018-16738) - Prevent a MITM from forcing a NULL cipher for UDP (CVE-2018-16758) - Check the return value from snprintf(). - Check the return values from BN_hex2bn() and RAND_load_file(). - Fix all warnings when compiling with -Wall -W -pedantic. - Fix two small memory leaks. - Don't check for NULL-pointers before calling free(). - Update THANKS. - Fix checks for Cygwin-related macros. - Fix spelling errors. - Update README and links to required libraries. - Releasing 1.0.35. - -AMRI Amine (1): - Fixing typo - -Rafael Sadowski (1): - OpenBSD has a proper tap device. - Version 1.0.34 June 12 2018 ------------------------------------------------------------------------ diff --git a/Makefile.in b/Makefile.in index 2940df5..46319ea 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,9 +141,9 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ - config.h.in + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -335,8 +335,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -469,10 +469,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) +distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ @@ -558,10 +555,6 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) -dist-zstd: distdir - tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst - $(am__post_remove_distdir) - dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -604,8 +597,6 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ - *.tar.zst*) \ - zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -782,7 +773,7 @@ uninstall-am: am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - dist-zstd distcheck distclean distclean-generic distclean-hdr \ + distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ diff --git a/NEWS b/NEWS index c587e87..aefcd40 100644 --- a/NEWS +++ b/NEWS @@ -1,22 +1,3 @@ -Version 1.0.36 August 26 2019 - - * Fix compiling tinc with certain versions of the OpenSSL library. - * Fix parsing some IPv6 addresses with :: in them. - * Fix GraphDumpFile output to handle node names starting with a digit. - * Fix a potential segmentation fault when fragmenting packets. - -Thanks to Rosen Penev, Quentin Rameau and Werner Schreiber for their -contributions to this version of tinc. - -Version 1.0.35 October 5 2018 - - * Prevent oracle attacks (CVE-2018-16737, CVE-2018-16738). - * Prevent a MITM from forcing a NULL cipher for UDP (CVE-2018-16758). - * Minor fixes in the documentation. - -Thanks to Amine Amri and Rafael Sadowski for their contributions to this -version of tinc. - Version 1.0.34 June 12 2018 * Fix a potential segmentation fault when connecting to an IPv6 peer via a diff --git a/README b/README index 127cde2..e2355dc 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ -This is the README file for tinc version 1.0.36. Installation +This is the README file for tinc version 1.0.34. Installation instructions may be found in the INSTALL file. -tinc is Copyright (C) 1998-2019 by: +tinc is Copyright (C) 1998-2018 by: Ivo Timmermans, Guus Sliepen , @@ -41,25 +41,24 @@ issues are being addressed in the tinc 1.1 branch. The Sweet32 attack affects versions of tinc prior to 1.0.30. -On September 6th, 2018, Michael Yonly contacted us and provided -proof-of-concept code that allowed a remote attacker to create an -authenticated, one-way connection with a node, and also that there was a -possibility for a man-in-the-middle to force UDP packets from a node to be sent -in plaintext. The first issue was trivial to exploit on tinc versions prior to -1.0.30, but the changes in 1.0.30 to mitigate the Sweet32 attack made this -weakness much harder to exploit. These issues have been fixed in tinc 1.0.35. -The new protocol in the tinc 1.1 branch is not susceptible to these issues. - Cryptography is a hard thing to get right. We cannot make any guarantees. Time, review and feedback are the only things that can prove the security of any cryptographic product. If you wish to review tinc or give us feedback, you are strongly encouraged to do so. +Changes to configuration file format since 1.0pre5 +-------------------------------------------------- + +Some configuration variables have different names now. Most notably "TapDevice" +should be changed into "Device", and "Device" should be changed into +"BindToDevice". + + Compatibility ------------- -Version 1.0.35 is compatible with 1.0pre8, 1.0 and later, but not with older +Version 1.0.31 is compatible with 1.0pre8, 1.0 and later, but not with older versions of tinc. Note that since version 1.0.30, tinc requires all nodes in the VPN to be compiled with a version of LibreSSL or OpenSSL that supports the AES256 and SHA256 algorithms. @@ -68,21 +67,21 @@ AES256 and SHA256 algorithms. Requirements ------------ -The OpenSSL library is used for all cryptographic functions. You can find it at -https://www.openssl.org/. You will need version 1.0.1 or later with support for -AES256 and SHA256 enabled. If this library is not installed on your system, the -configure script will fail. The manual in doc/tinc.texi contains more detailed -information on how to install this library. Alternatively, you may also use the -LibreSSL library. +Since 1.0pre3, we use OpenSSL for all cryptographic functions. So you need to +install this library first; grab it from http://www.openssl.org/. You will +need version 1.0.1 or later with support for AES256 and SHA256 enabled. If +this library is not installed on you system, configure will fail. The manual +in doc/tinc.texi contains more detailed information on how to install this +library. Alternatively, you may also use LibreSSL. -The zlib library is used for optional compression. You can -find it at https://zlib.net/. Because of a possible exploit in +Since 1.0pre6, the zlib library is used for optional compression. You can +find it at http://www.gzip.org/zlib/. Because of a possible exploit in earlier versions we recommend that you download version 1.1.4 or later. -The LZO library is also used for optional compression. You can -find it at https://www.oberhumer.com/opensource/lzo/. +Since 1.0, the lzo library is also used for optional compression. You can +find it at http://www.oberhumer.com/opensource/lzo/. -In order to compile tinc, you will need a C99 compliant compiler. +In order to compile tinc, you will need a GNU C compiler environment. Features diff --git a/THANKS b/THANKS index a0f7966..ddf4d89 100644 --- a/THANKS +++ b/THANKS @@ -5,7 +5,6 @@ We would like to thank the following people for their contributions to tinc: * Alexis Hildebrandt * Allesandro Gatti * Andreas van Cranenburgh -* Andrew Hahn * Anthony G. Basile * Armijn Hemel * Armin Fisslthaler @@ -22,7 +21,6 @@ We would like to thank the following people for their contributions to tinc: * Delf Eldkraft * Dennis Joachimsthaler * dnk -* Егор Палкин * Élie Bouttier * Enrique Zanardi * Erik Tews @@ -43,10 +41,8 @@ We would like to thank the following people for their contributions to tinc: * James Cook * James MacLean * Jamie Briggs -* Jan Štembera * Jason Harper * Jason Livesay -* Jasper Krijgsman * Jelle de Jong * Jeroen Domburg * Jeroen Ubbink @@ -73,9 +69,7 @@ We would like to thank the following people for their contributions to tinc: * Max Rijevski * Menno Smits * Mesar Hameed -* Michael Taylor * Michael Tokarev -* Michael Yonli * Miles Nordin * Nathan Stratton Treadway * Murat Donmez @@ -85,12 +79,10 @@ We would like to thank the following people for their contributions to tinc: * Philipp Babel * Pierre Emeriaud * Pierre-Olivier Mercier -* Rafael Wolf * Rafael Sadowski * Rafał Leśniak * Rhosyn Celyn * Robert van der Meulen -* Robert Waniek * Rumko * Ryan Miller * Sam Bryan @@ -109,7 +101,6 @@ We would like to thank the following people for their contributions to tinc: * Tonnerre Lombard * Ulrich Seifert * Vil Brekin -* Vincent Laurent * Vittorio Gambaletta * Wendy Willard * Wessel Dankers diff --git a/aclocal.m4 b/aclocal.m4 index a50e7c2..d14b497 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.2 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.2], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.2])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,12 +332,13 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. + # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -345,43 +346,49 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf + for mf do # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE="gmake" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -390,17 +397,18 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -487,8 +495,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -555,7 +563,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -597,7 +605,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -618,7 +626,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -639,7 +647,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -647,42 +655,49 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. +# Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' +[am_make=${MAKE-make} +cat > confinc << 'END' am__doit: - @echo this is the am__doit target >confinc.out + @echo this is the am__doit target .PHONY: am__doit END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -721,7 +736,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -750,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -797,7 +812,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -816,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -897,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,7 +972,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -985,7 +1000,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1004,7 +1019,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/compile b/compile index 23fcba0..a85b723 100755 --- a/compile +++ b/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2018-03-07.03; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2018-03-07.03; # UTC # 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, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN* | MSYS*) + CYGWIN*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/* | msys/*) + cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,8 +255,7 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -340,9 +339,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" +# time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: diff --git a/configure b/configure index 2f7cd24..721a2f7 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tinc 1.0.36. +# Generated by GNU Autoconf 2.69 for tinc 1.0.34. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tinc' PACKAGE_TARNAME='tinc' -PACKAGE_VERSION='1.0.36' -PACKAGE_STRING='tinc 1.0.36' +PACKAGE_VERSION='1.0.34' +PACKAGE_STRING='tinc 1.0.34' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -662,6 +662,7 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE +am__quote am__include DEPDIR OBJEXT @@ -736,8 +737,7 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL -am__quote' +SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tinc 1.0.36 to adapt to many kinds of systems. +\`configure' configures tinc 1.0.34 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1392,7 +1392,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tinc 1.0.36:";; + short | recursive ) echo "Configuration of tinc 1.0.34:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tinc configure 1.0.36 +tinc configure 1.0.34 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1974,7 +1974,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tinc $as_me 1.0.36, which was +It was created by tinc $as_me 1.0.34, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2323,7 +2323,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.16' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2838,7 +2838,7 @@ fi # Define the identity of the package. PACKAGE='tinc' - VERSION='1.0.36' + VERSION='1.0.34' cat >>confdefs.h <<_ACEOF @@ -2868,8 +2868,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -2920,7 +2920,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -2981,45 +2981,45 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' + +am_make=${MAKE-make} +cat > confinc << 'END' am__doit: - @echo this is the am__doit target >confinc.out + @echo this is the am__doit target .PHONY: am__doit END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -7333,7 +7333,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tinc $as_me 1.0.36, which was +This file was extended by tinc $as_me 1.0.34, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7399,7 +7399,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tinc config.status 1.0.36 +tinc config.status 1.0.34 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -7518,7 +7518,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF @@ -8133,35 +8133,29 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf + for mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8179,50 +8173,53 @@ $as_echo X"$am_mf" | q } s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } - /^X\/\(\/\/\)$/{ + /^X\(\/\/\)[^/].*/{ s//\1/ q } - /^X\/\(\/\).*/{ + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE=\"gmake\" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk } ;; diff --git a/configure.ac b/configure.ac index ca2948a..2564bf3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([tinc], [1.0.36]) +AC_INIT([tinc], [1.0.34]) AC_CONFIG_SRCDIR([src/tincd.c]) AM_INIT_AUTOMAKE([1.11 check-news std-options subdir-objects nostdinc silent-rules -Wall]) AC_CONFIG_HEADERS([config.h]) @@ -237,7 +237,7 @@ AC_ARG_ENABLE(jumbograms, ] ) -dnl Ensure runstatedir is set if we are using a version of autoconf that does not support it +dnl Ensure runstatedir is set if we are using a version of autoconf that does not suppport it if test "x$runstatedir" = "x"; then AC_SUBST([runstatedir], ['${localstatedir}/run']) fi diff --git a/debian/NEWS b/debian/NEWS deleted file mode 100644 index b3eb367..0000000 --- a/debian/NEWS +++ /dev/null @@ -1,14 +0,0 @@ -tinc (1.0.27-1) unstable; urgency=medium - - This package now provides native systemd service files, allowing multiple - instances of tinc to be managed. Existing networks listed in - /etc/tinc/nets.boot will be converted to service instances once during this - upgrade. Afterwards, you can enable and disable networks using: - - systemctl enable tinc@ - systemctl disable tinc@ - - If you do not have systemd installed, the SysV init script will continue to - work as usual. For more information, see README.Debian. - - -- Guus Sliepen Sun, 10 Apr 2016 01:33:55 +0200 diff --git a/debian/README.Debian b/debian/README.Debian deleted file mode 100644 index d911295..0000000 --- a/debian/README.Debian +++ /dev/null @@ -1,80 +0,0 @@ -tinc for Debian ---------------- - -The manual for tinc is also available as info pages, type `info tinc' -to read it. - -There are several ways in which tinc may be automatically started at boot: - -Systemd -------- - -Since 1.0.27-1, the tinc package comes with native systemd service files. -To enable and start a net, call: - -systemctl enable tinc@ -systemctl start tinc@ - -This will cause a tincd to be started which uses the configuration from -/etc/tinc/, and also makes sure that it will be started next time your -system boots. - -Apart from controlling individual instances, you can also start/stop/reload all -enabled instances simultaneously by omitting @, for example: - -systemctl reload tinc - -Note that when you have systemd installed on your system, the file -/etc/tinc/nets.boot will not be used anymore to automatically start tinc -daemons. If the variable EXTRA is defined in /etc/default/tinc, it will be -passed on to tinc. The variable LIMITS is however not used. - -The service files that come with this package start tinc unconditionally. -However, tinc does support socket activation. If you wish to write a socket -unit for tinc, use the ListenStream option to specify on which port(s) and -address(es) tinc should listen. - -SysVinit --------- - -The system startup script for tinc, /etc/init.d/tinc, uses the file -/etc/tinc/nets.boot to find out which networks have to be started. Use one -netname per line. Lines starting with a # are ignored. - -/etc/network/interfaces ------------------------ - -You can create a stanza in /etc/network/interfaces, and add a line with -"tinc-net ". This will cause a tincd to be started which uses the -configuration from /etc/tinc/. You can use an inet static (with -address and netmask options) or inet dhcp stanza, in which case the ifup will -configure the VPN interface and you do not need to have a tinc-up script. - -The following options are also recognized and map directly to the corresponding -command line options for tincd: - -tinc-config -tinc-debug -tinc-mlock yes -tinc-logfile -tinc-pidfile -tinc-chroot yes -tinc-user - -An example stanza: - -iface vpn inet static - address 192.168.2.42 - netmask 255.255.0.0 - tinc-net myvpn - tinc-debug 1 - tinc-mlock yes - tinc-user nobody - tinc-pidfile /tmp/tinc.pid - -This will start a tinc daemon that reads its configuration from -/etc/tinc/myvpn, logs at debug level 1, locks itself in RAM, runs as user -nobody, and creates a network interface called "vpn". Ifup then sets the -address and netmask on that interface. - - -- Guus Sliepen , Sun, 10 April 2016, 01:38:08 +0200 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 04508d0..0000000 --- a/debian/changelog +++ /dev/null @@ -1,685 +0,0 @@ -tinc (1.0.36-2) unstable; urgency=medium - - * Disable support for libvdeplug. Closes: #973233 - - -- Guus Sliepen Sun, 22 Nov 2020 10:40:27 +0100 - -tinc (1.0.36-1) unstable; urgency=medium - - * New upstream version 1.0.36 - * Add Vcs tags to debian/control. - * Bump Standards-Version. - - -- Guus Sliepen Mon, 26 Aug 2019 14:17:21 +0200 - -tinc (1.0.35-2) unstable; urgency=medium - - * Bump Standards-Version and Build-Depend on debhelper-compat (= 12). - * Remove calls to dh_installinit and dh_systemd_start from debian/rules, - compat level 12 does the right thing by default. - * Ensure we clean up doc/tinc.info. - - -- Guus Sliepen Mon, 28 Jan 2019 21:54:45 +0100 - -tinc (1.0.35-1) unstable; urgency=medium - - * New upstream release. - - Includes fixes for CVE-2018-16737, CVE-2018-16738, CVE-2018-16758. - - -- Guus Sliepen Mon, 08 Oct 2018 16:09:06 +0200 - -tinc (1.0.34-1) unstable; urgency=medium - - [ Guus Sliepen ] - * New upstream release. - - Fixes a potential segmentation fault when connecting to an IPv6 - peer via a proxy. Closes: #887401 - * Add support for the $EXTRA variable in /etc/default/tinc when using - systemd. Closes: #887116 - - [ Benda Xu ] - * Prevent possible incorrect IPv6 checksums due to function inlining. - Closes: #891400 - - -- Guus Sliepen Tue, 12 Jun 2018 23:00:49 +0200 - -tinc (1.0.33-1) unstable; urgency=medium - - * New upstream release. - * Test for /etc/default/tinc before trying to source it. Closes: #777262 - * Use --runstatedir=/run. - - -- Guus Sliepen Sat, 04 Nov 2017 16:22:06 +0100 - -tinc (1.0.32-1) unstable; urgency=medium - - * New upstream release. - * Add a note to new nets.boot files that it is not used with systemd. - Closes: #841052 - * In the post-down script, read the pid file only once. Closes: #832784 - * Explicitly use /bin/sleep from coreutils. Closes: #772379 - * Bump Standards-Version. - - -- Guus Sliepen Tue, 05 Sep 2017 20:23:36 +0200 - -tinc (1.0.31-1) unstable; urgency=medium - - * New upstream release. - * Bump Standards-Version. - * Bump debian/compat. - * Add missing Depends: lsb-base. - - -- Guus Sliepen Sun, 15 Jan 2017 16:20:40 +0100 - -tinc (1.0.29-2) unstable; urgency=medium - - * Rebuild with libssl-dev from unstable. - - -- Guus Sliepen Thu, 27 Oct 2016 13:09:46 +0200 - -tinc (1.0.29-1) unstable; urgency=medium - - * New upstream release. - * Bump debian/compat. - - -- Guus Sliepen Mon, 10 Oct 2016 22:30:25 +0200 - -tinc (1.0.28-1) unstable; urgency=medium - - * New upstream release. - - Fixes FTBFS on kfreebsd. - * Systemd service files are now provided by upstream. - - -- Guus Sliepen Sun, 10 Apr 2016 15:44:28 +0200 - -tinc (1.0.27-2) unstable; urgency=medium - - * Fix tinc@.service. - - -- Guus Sliepen Sun, 10 Apr 2016 12:45:33 +0200 - -tinc (1.0.27-1) unstable; urgency=medium - - * New upstream release. - * Bump Standards-Version. - * Add native systemd unit files. - * Automatically convert networks listed in nets.boot to systemd service - instances on upgrade. - - -- Guus Sliepen Sun, 10 Apr 2016 01:39:16 +0200 - -tinc (1.0.26-1) unstable; urgency=medium - - * New upstream release. - * Use the contents, not the presence, of the pidfile to check that tincd is - shut down properly. Closes: #774682 - * Bump Standards-Version. - - -- Guus Sliepen Sun, 05 Jul 2015 17:23:08 +0200 - -tinc (1.0.24-2) unstable; urgency=medium - - * Improve the init script: stopping tinc now waits for the process to - terminate. If that doesn't happen in 5 seconds, it will send the TERM - signal again (which helps if tinc is waiting for a script to finish - executing). It now also detects whether the process mentioned in the PID - file is actually running, and if not it will exit early and without - warnings. Closes: #748107 - - -- Guus Sliepen Wed, 14 May 2014 21:44:16 +0200 - -tinc (1.0.24-1) unstable; urgency=medium - - [ Guus Sliepen ] - * New upstream release - * Add a debian/watch file. - * Bump Standards-Version. - - [ Gian Piero Carrubba ] - * Allow resource limits to be set in /etc/default/tinc. - Closes: #690685, #704702 - - -- Guus Sliepen Sun, 11 May 2014 21:17:13 +0200 - -tinc (1.0.23-2) unstable; urgency=low - - * Use if-statements instead of && in shell scripts. Closes: #731279 - The && operator does not clear the error status, and if the next statement - in a shell script does not change the error status it would cause the - script to prematurely exit. Thanks to Peter Reinholdtsen for spotting it. - * Use absolute path to tincd in the if-post-down script. - - -- Guus Sliepen Thu, 05 Dec 2013 09:41:13 +0000 - -tinc (1.0.23-1) unstable; urgency=low - - * New upstream release. - - -- Guus Sliepen Sat, 19 Oct 2013 21:06:05 +0200 - -tinc (1.0.22-1) unstable; urgency=low - - * New upstream release. - - Handles whitespace between command line flags and optional arguments. - Closes: #710267 - * Bump Standards-Version. - * Source /lib/lsb/init-functions in the init.d script. - * Don't use texi2html anymore, use automake's install-html target which uses - makeinfo. - - -- Guus Sliepen Wed, 14 Aug 2013 15:34:29 +0200 - -tinc (1.0.21-1) unstable; urgency=low - - * New upstream release. - - Includes fix for CVE-2013-1428. - - -- Guus Sliepen Sun, 05 May 2013 10:42:33 +0200 - -tinc (1.0.19-3) unstable; urgency=high - - * Drop packets forwarded via TCP if they are too big (CVE-2013-1428). - - -- Guus Sliepen Fri, 12 Apr 2013 22:52:10 +0200 - -tinc (1.0.19-2) unstable; urgency=low - - * Fix behaviour of tinc-pidfile. Closes: #679130 - * Enable parallel building in debian/rules. - - -- Guus Sliepen Tue, 26 Jun 2012 18:28:34 +0200 - -tinc (1.0.19-1) unstable; urgency=low - - * New upstream release. - * Bump debian/compat so tinc gets built with hardening flags. - * Allow tinc-pidfile in /etc/network/interfaces. - - -- Guus Sliepen Mon, 25 Jun 2012 20:29:22 +0200 - -tinc (1.0.18-1) unstable; urgency=low - - * New upstream release. - - -- Guus Sliepen Sun, 25 Mar 2012 18:52:15 +0200 - -tinc (1.0.17-1) unstable; urgency=low - - * New upstream release. - * Enable support for UML and VDE. - - -- Guus Sliepen Sat, 10 Mar 2012 14:50:00 +0100 - -tinc (1.0.16-1) unstable; urgency=low - - * New upstream release. - * Mention alarm option in /etc/init.d/tinc's usage information. - Closes: #631761 - - -- Guus Sliepen Sat, 23 Jul 2011 14:37:56 +0200 - -tinc (1.0.15-1) unstable; urgency=low - - * New upstream release. - * Send SIGALRM to running tinc daemons whenever an interface is brought up - with the ifupdown framework. Based on a patch from Joachim Breitner. - Closes: #629880 - * Allow tinc daemons to be started using ifupdown. - - -- Guus Sliepen Fri, 24 Jun 2011 18:21:51 +0200 - -tinc (1.0.14-1) unstable; urgency=low - - * New upstream release. - * Bump Standards-Version. - - -- Guus Sliepen Mon, 09 May 2011 00:25:37 +0200 - -tinc (1.0.13-1) unstable; urgency=low - - * New upstream release. - - -- Guus Sliepen Tue, 13 Apr 2010 12:06:36 +0200 - -tinc (1.0.12-2) unstable; urgency=low - - * Remove debconf questions. Closes: #572116 - Apparently debconf may not be used to ask a question at install time and - use the answer at upgrade time. Instead of kludging around this - restriction, no questions are asked anymore, and tinc will now always be - restarted when upgrading. - * Wait up to 5 seconds for tinc daemon to stop before restarting it. - - -- Guus Sliepen Tue, 02 Mar 2010 14:01:36 +0100 - -tinc (1.0.12-1) unstable; urgency=low - - * New upstream release. - * Bump Standards-Version. - * Migrate from CDBS to debhelper. - * Convert source package to 3.0 (quilt) format. - * Remove useless tinc.modules. - * Use init.d script from Michael Tokarev, allowing per-network arguments to - tincd. - * Remove update-rc.d calls from postinst and postrm. - * Let the init.d script depend on $remote_fs. - - -- Guus Sliepen Thu, 04 Feb 2010 00:56:45 +0100 - -tinc (1.0.11-1) unstable; urgency=low - - * New upstream release. - * Cope with texi2html arbitrarily changing its output directory. - Closes: #552927 - * Do not stop tinc when configuring a new version, just restart after - the upgrade. - - -- Guus Sliepen Sun, 01 Nov 2009 20:37:16 +0100 - -tinc (1.0.10-1) unstable; urgency=low - - * New upstream release. - * Include Russian debconf translation. Closes: #548759 - - -- Guus Sliepen Sun, 18 Oct 2009 16:31:49 +0200 - -tinc (1.0.9-1) unstable; urgency=low - - * New upstream release. - - Binds IPv6 sockets only to IPv6. Closes: #440150 - * Update copyright file. Closes: #482566 - - -- Guus Sliepen Fri, 26 Dec 2008 13:25:05 +0100 - -tinc (1.0.8-2) unstable; urgency=low - - * Include Portugese debconf translation. Closes: #434191 - - -- Guus Sliepen Tue, 14 Aug 2007 13:50:27 +0200 - -tinc (1.0.8-1) unstable; urgency=low - - * New upstream release. Closes: #173987 - * Include german debconf translation. Closes: #412351 - * Build-Depend on texinfo. Closes: #424209 - - -- Guus Sliepen Wed, 16 May 2007 17:59:16 +0200 - -tinc (1.0.7-1) unstable; urgency=low - - * New upstream release. - - -- Guus Sliepen Fri, 5 Jan 2007 15:55:42 +0100 - -tinc (1.0.6-1) unstable; urgency=low - - * New upstream release. - - -- Guus Sliepen Mon, 18 Dec 2006 15:41:03 +0100 - -tinc (1.0.5-1) unstable; urgency=low - - * New upstream release. Closes: #391610 - * Add an LSB section to the init script. - - -- Guus Sliepen Tue, 14 Nov 2006 16:32:20 +0100 - -tinc (1.0.4-4) unstable; urgency=low - - * Include swedish debconf translation. Closes: #332963 - * Remove nets.boot on purge. Closes: #333303 - - -- Guus Sliepen Mon, 17 Oct 2005 12:34:32 +0200 - -tinc (1.0.4-3) unstable; urgency=low - - * Depend on debconf | debconf-2.0. - * Include vietnamese debconf translation. Closes: #322305 - * Include japanese debconf translation. Closes: #319591 - - -- Guus Sliepen Thu, 29 Sep 2005 11:15:34 +0200 - -tinc (1.0.4-2) unstable; urgency=low - - * Compensate for change in texinfo's output directory. Closes: #318562 - * Include Czech translation of the debconf questions. Closes: #312982 - - -- Guus Sliepen Sat, 16 Jul 2005 11:42:04 +0200 - -tinc (1.0.4-1) unstable; urgency=low - - * New upstream release. Closes: #294819 - * Update french translation of debconf template. Closes: #293371, #296148 - * Allow dashes in nets.boot. Closes: #296281 - - -- Guus Sliepen Wed, 4 May 2005 21:56:22 +0200 - -tinc (1.0.3-4) unstable; urgency=low - - * Call debconf early in postinst so it won't get confused by output - from other commands in the postinst script. Closes: #292920 - * If MAKEDEV doesn't know about net/tun, fall back to tun. - - -- Guus Sliepen Mon, 31 Jan 2005 13:27:16 +0100 - -tinc (1.0.3-3) unstable; urgency=low - - * Fix clean rule in debian/rules. - - -- Guus Sliepen Thu, 27 Jan 2005 23:16:59 +0000 - -tinc (1.0.3-2) unstable; urgency=low - - * Don't check for /dev/tap* in postinst if we don't create them anyway. - * MAKEDEV expects net/tun instead of tun. - * Don't ask if /dev/net/tun should be created, just do it. - Closes: #259489, #292450 - * Move $EXTRA from init.d/tinc to /etc/default/tinc. Closes: #281366 - - -- Guus Sliepen Thu, 27 Jan 2005 14:10:02 +0100 - -tinc (1.0.3-1) unstable; urgency=low - - * New upstream release. - * Adopting the package from Ivo. - * Use invoke-rc.d, and tell user to do so as well. Closes: #223276 - * Let force-reload do the same thing as reload. Closes: #230180 - - -- Guus Sliepen Fri, 1 Oct 2004 21:04:14 +0200 - -tinc (1.0.2-2) unstable; urgency=low - - * debian/control: Oops, really make that automake1.7. - - -- Ivo Timmermans Sat, 8 Nov 2003 21:53:04 +0100 - -tinc (1.0.2-1) unstable; urgency=low - - * New upstream release: - * Fix broken replies to CHAL_RESP. (Closes: #217646) - * debian/control: Updated automake build dependency to automake1.7. - (Closes: #219360) - - -- Ivo Timmermans Sat, 8 Nov 2003 19:56:04 +0100 - -tinc (1.0.1-2) unstable; urgency=low - - * debian/dirs: Removed, moved contents to tinc.dirs. - (Closes: #208591) - * debian/docs: Renamed to tinc.docs. - * debian/rules: Install the contents of doc/sample-config.tar.gz in - /usr/share/doc/tinc/examples instead of /etc/tinc. - * debian/Makefile*: Removed. - - -- Ivo Timmermans Wed, 10 Sep 2003 12:19:32 +0200 - -tinc (1.0.1-1) unstable; urgency=low - - * New upstream release. - * debian/patches/001_openbsd_device.c.patch: Removed. - - -- Ivo Timmermans Thu, 14 Aug 2003 17:03:28 +0200 - -tinc (1.0release-1) unstable; urgency=low - - * New upstream version. (Closes: #204639) - * Fixes switching back to normal logging mode when killing with - SIGINT twice. (Closes: #175633) - * Uses one SSL context struct for each connection, speeding up - encrypting/decrypting data; don't throw away out of sequence - packets. (Closes: #188874) - * Fixes handling of broadcast messages. (Closes: #175632) - * debian/rules: Use cdbs. - * debian/control: Build-Depend on cdbs, liblzo-dev. - * debian/patches/001_openbsd_device.c.patch: Sync openbsd/device.c to - latest CVS version. - - -- Ivo Timmermans Sun, 10 Aug 2003 16:13:29 +0200 - -tinc (1.0pre8-6) unstable; urgency=low - - * debian/po/fr.po: Added French debconf translation. (Closes: #201803) - - -- Ivo Timmermans Fri, 18 Jul 2003 10:03:20 +0200 - -tinc (1.0pre8-5) unstable; urgency=low - - * debian/*: Change to po-debconf, thanks to From: Michel Grentzinger - for the patch: - - change debhelper dependency to 4.1.16 (according to man - po-debconf), - - manually add nl translation in old tinc.templates (master), - - run debconf-gettextize debian/tinc.templates, - - move old templates files (debian/tinc.templates.*), - - change construction "If you say no" to "If you refuse", - * debian/rules: Call po2debconf. - * debian/rules: Don't copy COPYING.README to the package. - * debian/control: Update Standards-Version. - * debian/conffiles: Removed. - * debian/postinst: No longer use mknod directly, use MAKEDEV. - - -- Ivo Timmermans Tue, 15 Jul 2003 20:13:47 +0200 - -tinc (1.0pre8-4) unstable; urgency=low - - * src/net.h, src/net_packet.c, src/net_setup.c: Apply fix from CVS - for OpenSSL-related memory leaks. (Closes: #189432) - - -- Ivo Timmermans Mon, 5 May 2003 15:00:29 +0200 - -tinc (1.0pre8-3) unstable; urgency=low - - * m4/openssl.m4: Updated to CVS version. (Closes: #184400) - - -- Ivo Timmermans Thu, 13 Mar 2003 17:24:42 +0100 - -tinc (1.0pre8-2) unstable; urgency=low - - * debian/postinst: Create /dev/net/tun if it doesn't exist. - * debian/tinc.modules: Add alias for /dev/net/tun. - * debian/rules: Install tinc.modules. - * These things together: (Closes: #151967, #153156) - - -- Ivo Timmermans Wed, 13 Nov 2002 22:45:38 +0100 - -tinc (1.0pre8-1) unstable; urgency=low - - * New upstream version. - * debian/rules: - - DEB_BUILD_OPTIONS support. - - Enable --enable-tracing by default. - - -- Ivo Timmermans Tue, 17 Sep 2002 13:50:44 +0200 - -tinc (1.0pre7-3) unstable; urgency=low - - * Properly install _all_ info pages. (Closes: #144718) - - -- Ivo Timmermans Wed, 29 May 2002 14:01:21 +0200 - -tinc (1.0pre7-2) unstable; urgency=low - - * Dutch translation wasn't being installed. - - -- Ivo Timmermans Thu, 11 Apr 2002 09:26:14 +0200 - -tinc (1.0pre7-1) unstable; urgency=medium - - * New upstream release. - - -- Ivo Timmermans Tue, 9 Apr 2002 16:04:46 +0200 - -tinc (1.0pre6-3) unstable; urgency=medium - - * Synched with upstream CVS. - * Added build dependency on zlib1g-dev. (Closes: #141705) - - -- Ivo Timmermans Mon, 8 Apr 2002 21:19:31 +0200 - -tinc (1.0pre6-2) unstable; urgency=low - - * The Section was non-US again, so changed it back to main/net. - - -- Ivo Timmermans Thu, 28 Mar 2002 07:26:10 +0100 - -tinc (1.0pre6-1) unstable; urgency=low - - * New upstream release. - * Fixed text in debian/copyright - - -- Ivo Timmermans Wed, 27 Mar 2002 23:10:07 +0100 - -tinc (1.0pre5-4) unstable; urgency=low - - * Added a debconf question for restarting on upgrade. - * Added reload option to init.d, start with EXTRA='-d' default. - * Moved from non-US to main. - * Install example configuration files. - * The HTML documentation wasn't installed; fixed. - - -- Ivo Timmermans Tue, 26 Mar 2002 20:14:19 +0100 - -tinc (1.0pre5-3) unstable; urgency=low - - * Config variables are now treated case sentitivly again. - * Added a forgotten xstrdup. - - -- Ivo Timmermans Fri, 15 Feb 2002 12:35:17 +0100 - -tinc (1.0pre5-2) unstable; urgency=low - - * MaxTimeout accidentally wasn't configurable. (Closes: #119653) - - -- Ivo Timmermans Wed, 13 Feb 2002 13:36:54 +0100 - -tinc (1.0pre5-1) unstable; urgency=low - - * New upstream version. (Closes: #119653) - * Init script redone in sh. - - -- Ivo Timmermans Sun, 10 Feb 2002 16:39:53 +0100 - -tinc (1.0pre4-1.cvs010621.6) unstable; urgency=low - - * Somehow po-Makefile.in.in.diff got lost, readded. (Closes: #119157) - - -- Ivo Timmermans Thu, 15 Nov 2001 17:00:03 +0100 - -tinc (1.0pre4-1.cvs010621.5) unstable; urgency=low - - * Fix a typo in postinst that let it MAKEDEV even on devfs. - (Closes: #116034) - - -- Ivo Timmermans Thu, 18 Oct 2001 09:35:16 +0200 - -tinc (1.0pre4-1.cvs010621.4) unstable; urgency=low - - * Ask before creating the device files. (Closes: #111099) - * Add a section to the info file. - - -- Ivo Timmermans Fri, 12 Oct 2001 20:47:09 +0200 - -tinc (1.0pre4-1.cvs010621.3) unstable; urgency=low - - * Build and install html documentation. (Closes: #106843) - * Remove build-time dependency on libc6-dev. - - -- Ivo Timmermans Mon, 30 Jul 2001 22:03:52 +0200 - -tinc (1.0pre4-1.cvs010621.2) unstable; urgency=low - - * Changed location of the pidfile. (Closes: #102798) - - -- Ivo Timmermans Sun, 1 Jul 2001 01:57:43 +0200 - -tinc (1.0pre4-1.cvs010621.1) unstable; urgency=low - - * New upstream version. (Closes: #98730) - * Rebuilding automatically inserted new config.{sub|guess}. - (Closes: #98165) - * Updated Standards-Version. - * Don't include a sample configuration file. - - -- Ivo Timmermans Thu, 21 Jun 2001 14:08:49 +0200 - -tinc (1.0pre3-5) unstable; urgency=low - - * Fixed an error in the init script that prevented tinc from - starting correctly. - - -- Ivo Timmermans Thu, 8 Feb 2001 02:45:09 +0100 - -tinc (1.0pre3-4) unstable; urgency=low - - * Change build-depends for OpenSSL to libssl096-dev - (Closes: #84197, #84873). - - -- Ivo Timmermans Sun, 4 Feb 2001 22:43:22 +0100 - -tinc (1.0pre3-3) unstable; urgency=low - - * Set architecture to any (really this time!) (Closes: #80451). - * Section set to non-US - - -- Ivo Timmermans Tue, 23 Jan 2001 22:52:53 +0100 - -tinc (1.0pre3-2) unstable; urgency=low - - * Set architecture to any (Closes: #80451). - * Added tinc.modules with some useful module aliases. - - -- Ivo Timmermans Sat, 13 Jan 2001 16:10:57 +0100 - -tinc (1.0pre3-1) unstable; urgency=low - - * New upstream version (1.0pre3) (Closes: #71274). - * Better Depends and Build-Depends lines. - * Dropped dependencies on libgmp, added libssl. - * doc-base.tinc: New file. - * Deleted the file shlibs, as there on longer is a libblowfish. - * Patch po/Makefile.in.in from po-Makefile.in.in.diff if necessary. - * Use dh_perl to get accurate perl dependencies. - - -- Ivo Timmermans Thu, 9 Nov 2000 21:58:40 +0100 - -tinc (1.0pre2-1.1) unstable; urgency=low - - * NMU at Ivo's request as his application is being processed, and his - sponsor is based in the US. - - -- J.H.M. Dassen (Ray) Wed, 28 Jun 2000 21:52:30 +0200 - -tinc (1.0pre2-1) unstable; urgency=low - - * postinst creates a file /etc/tinc/nets.boot, containing all networks - to be started upon system startup; - * init.d script starts all networks from that list. - * postinst script creates tap devices. - - -- Ivo Timmermans Tue, 16 May 2000 00:06:25 +0200 - -tinc (1.0pre1-0.4) unstable; urgency=low - - * postinst script. - - -- Ivo Timmermans Mon, 15 May 2000 19:22:05 +0200 - -tinc (1.0pre1-0.3) unstable; urgency=low - - * system startup script. - - -- Ivo Timmermans Sun, 14 May 2000 22:58:02 +0200 - -tinc (1.0pre1-0.2) unstable; urgency=low - - * Included the blowfish license. - - -- Ivo Timmermans Fri, 21 Apr 2000 17:07:50 +0200 - -tinc (1.0pre1-0.1) unstable; urgency=low - - * Initial Release. - - -- Ivo Timmermans Fri, 21 Apr 2000 17:07:50 +0200 - - diff --git a/debian/control b/debian/control deleted file mode 100644 index 98c0678..0000000 --- a/debian/control +++ /dev/null @@ -1,20 +0,0 @@ -Source: tinc -Section: net -Priority: optional -Maintainer: Guus Sliepen -Standards-Version: 4.4.0 -Build-Depends: libssl-dev, debhelper-compat (= 12), gettext, texinfo, zlib1g-dev, liblzo2-dev -Homepage: http://www.tinc-vpn.org/ -Vcs-Browser: https://salsa.debian.org/guus/tinc -Vcs-Git: https://salsa.debian.org/guus/tinc.git -Rules-Requires-Root: no - -Package: tinc -Architecture: any -Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6) -Description: Virtual Private Network daemon - tinc is a daemon with which you can create a virtual private network - (VPN). One daemon can handle multiple connections, so you can - create an entire (moderately sized) VPN with only one daemon per - participating computer. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index c8a6fb8..0000000 --- a/debian/copyright +++ /dev/null @@ -1,34 +0,0 @@ -This package was debianized by Ivo Timmermans on -Fri, 21 Apr 2000 17:07:50 +0200. - -It was downloaded from http://www.tinc-vpn.org/ - -Upstream Authors: - Guus Sliepen - Ivo Timmermans - -Copyright (C) 1998-2005 Ivo Timmermans - 1998-2008 Guus Sliepen - - 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 of the License, or - (at your option) any later version. - -On Debian GNU/Linux systems, the complete text of the GNU General Public -License version 2 can be found in /usr/share/common-licenses/GPL-2. - -The following applies to tinc: - -This program is released under the GPL with the additional exemption -that compiling, linking, and/or using OpenSSL is allowed. You may -provide binary packages linked to the OpenSSL libraries, provided that -all other requirements of the GPL are met. - -The following applies to the LZO library: - -Hereby I grant a special exception to the tinc VPN project -(http://tinc.nl.linux.org/) to link the LZO library with the OpenSSL library -(http://www.openssl.org). - -Markus F.X.J. Oberhumer diff --git a/debian/doc-base.tinc b/debian/doc-base.tinc deleted file mode 100644 index a37f46a..0000000 --- a/debian/doc-base.tinc +++ /dev/null @@ -1,10 +0,0 @@ -Document: tinc -Title: tinc Manual -Author: Ivo Timmermans, Guus Sliepen -Abstract: This manual describes how to set up a Virtual Private - Network with tinc. -Section: System/Security - -Format: HTML -Files: /usr/share/doc/tinc/tinc.html/* -Index: /usr/share/doc/tinc/tinc.html/index.html diff --git a/debian/info b/debian/info deleted file mode 100644 index 5468d6c..0000000 --- a/debian/info +++ /dev/null @@ -1 +0,0 @@ -doc/tinc.info diff --git a/debian/patches/fix-incorrect-icmpv6-checksum b/debian/patches/fix-incorrect-icmpv6-checksum deleted file mode 100644 index 4448b88..0000000 --- a/debian/patches/fix-incorrect-icmpv6-checksum +++ /dev/null @@ -1,65 +0,0 @@ -Package: tinc -Version: 1.0.33-1 -Severity: important - -Dear Guus, - -I have been using tinc since 2009 and it is great! - -When PMTUDiscovery=yes and Mode=switch, and if ipv6 is used inside -tinc, the ICMPv6 "Packet Too Big" packets have incorrect checksums. -It can be reproduced by `ping6 -s 1800` and `tcpdump -i -`. Consequently, the host ignores the tinc-generated -ICMPv6 packets, PMTUDiscovery does not work and the connections freeze -when data flows are big. - -I find the bug is gone if the function "inet_checksum" in route.c is -not inlined, either by compiling tinc with "-O2 --fno-inline-functions", or apply a patch such as, - -diff --git a/src/route.c b/src/route.c -index ff82c06e..cd55383a 100644 ---- a/src/route.c -+++ b/src/route.c -@@ -60,7 +60,7 @@ static const size_t opt_size = sizeof(struct nd_opt_hdr); - - /* RFC 1071 */ - --static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) { -+__attribute__ ((noinline)) static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) { - uint16_t *p = data; - uint32_t checksum = prevsum ^ 0xFFFF; - - - -I have tested with gcc-7.3.0 and gcc-5.4.0. They behaved the same. I -am not good at assembly to find out what really happened, but it is -for sure that inet_checksum does not work as expected if compiled -inline. - -Thanks! - -Yours, -Benda - --- System Information: -Debian Release: buster/sid - APT prefers unstable - APT policy: (500, 'unstable') -Architecture: amd64 (x86_64) - -Kernel: Linux 4.9.0-5-amd64 (SMP w/8 CPU cores) -Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) -Shell: /bin/sh linked to /bin/dash -Init: sysvinit (via /sbin/init) - -Versions of packages tinc depends on: -ii libc6 2.26-2 -ii liblzo2-2 2.08-1.2+b2 -ii libssl1.1 1.1.0g-2 -ii lsb-base 9.20170808 -ii zlib1g 1:1.2.8.dfsg-5 - -tinc recommends no packages. - -tinc suggests no packages. diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index a4c8974..0000000 --- a/debian/patches/series +++ /dev/null @@ -1,2 +0,0 @@ -fix-incorrect-icmpv6-checksum -support-etc-defaults-tinc diff --git a/debian/patches/support-etc-defaults-tinc b/debian/patches/support-etc-defaults-tinc deleted file mode 100644 index 80b3d86..0000000 --- a/debian/patches/support-etc-defaults-tinc +++ /dev/null @@ -1,12 +0,0 @@ ---- a/systemd/tinc@.service.in -+++ b/systemd/tinc@.service.in -@@ -9,7 +9,8 @@ - [Service] - Type=simple - WorkingDirectory=@sysconfdir@/tinc/%i --ExecStart=@sbindir@/tincd -n %i -D -+EnvironmentFile=/etc/default/tinc -+ExecStart=@sbindir@/tincd -n %i -D $EXTRA - ExecReload=@sbindir@/tincd -n %i -kHUP - KillMode=mixed - Restart=on-failure diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index c4f5d53..0000000 --- a/debian/postinst +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -NETSFILE="/etc/tinc/nets.boot" - -set -e - -case "$1" in - configure) - if [ ! -e /dev/.devfsd ] ; then if [ ! -e /dev/.devfs ] ; then - if [ ! -e /dev/net/tun ] ; then if [ ! -e /dev/tun ] ; then if [ -e /dev/MAKEDEV ]; then - echo "Creating tun device..." - cd /dev && ./MAKEDEV net/tun 2>/dev/null || ./MAKEDEV tun 2>/dev/null || echo "Failed to create tun device." - fi; fi; fi - fi; fi - - if [ ! -e $NETSFILE ] ; then - echo "## This file contains all names of the networks to be started on system startup when using sysvinit." > $NETSFILE - echo "## If you are using systemd, use systemctl enable tinc@netname to enable individual networks." >> $NETSFILE - fi - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -#DEBHELPER# diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index dc3247b..0000000 --- a/debian/postrm +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = purge ]; then - rm -f /etc/tinc/nets.boot -fi - -#DEBHELPER# diff --git a/debian/preinst b/debian/preinst deleted file mode 100644 index 721a2bd..0000000 --- a/debian/preinst +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -NETSFILE="/etc/tinc/nets.boot" -SYSTEM="/lib/systemd/system" -WANTS="/etc/systemd/system/multi-user.target.wants" - -set -e - -case "$1" in - upgrade) - if dpkg --compare-versions "$2" '<<' "1.0.27-1"; then - if [ -f "$NETSFILE" ]; then - echo -n "Creating systemd service instances from nets.boot:" - mkdir -p "$WANTS" - egrep '^[ ]*[a-zA-Z0-9_-]+' $NETSFILE | while read net args; do - echo -n " $net" - ln -s "$SYSTEM/tinc@.service" "$WANTS/tinc@$net.service" 2>/dev/null || true - done - echo "." - fi - fi - ;; - - *) - ;; -esac - -#DEBHELPER# diff --git a/debian/rules b/debian/rules deleted file mode 100755 index ee2949d..0000000 --- a/debian/rules +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ - -override_dh_clean: - dh_clean - rm -f doc/tinc.info - -override_dh_auto_configure: - dh_auto_configure -- --enable-uml --with-systemd=/lib/systemd/system --runstatedir=/run - -override_dh_auto_install: - dh_auto_install -- install-html - # Remove info dir file - rm -f debian/tinc/usr/share/info/dir diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/tinc.default b/debian/tinc.default deleted file mode 100644 index bca2432..0000000 --- a/debian/tinc.default +++ /dev/null @@ -1,7 +0,0 @@ -# Extra options to be passed to tincd. -# EXTRA="-d" - -# Limits to be configured for the tincd process. Please read your shell -# (pointed by /bin/sh) documentation for ulimit. You probably want to raise the -# max locked memory value if using both --mlock and --user flags. -# LIMITS="-l 1024" diff --git a/debian/tinc.dirs b/debian/tinc.dirs deleted file mode 100644 index 1eae2e2..0000000 --- a/debian/tinc.dirs +++ /dev/null @@ -1,7 +0,0 @@ -usr/sbin -usr/share -etc -etc/init.d -usr/share/locale -usr/share/doc/tinc -etc/tinc diff --git a/debian/tinc.docs b/debian/tinc.docs deleted file mode 100644 index eb9b151..0000000 --- a/debian/tinc.docs +++ /dev/null @@ -1,3 +0,0 @@ -NEWS -README -AUTHORS diff --git a/debian/tinc.files b/debian/tinc.files deleted file mode 100644 index 3d376cc..0000000 --- a/debian/tinc.files +++ /dev/null @@ -1,6 +0,0 @@ -usr/sbin/tincd -usr/share/man -etc -usr/share/doc/tinc -usr/share/locale -usr/share/info diff --git a/debian/tinc.if-post-down b/debian/tinc.if-post-down deleted file mode 100755 index e173476..0000000 --- a/debian/tinc.if-post-down +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$METHOD" = loopback -o -z "$IF_TINC_NET" ]; then - exit 0 -fi - -# Determine location of the PID file - -EXTRA="" -if [ -n "$IF_TINC_PIDFILE" ]; then - EXTRA="--pidfile=$IF_TINC_PIDFILE" -else - IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid -fi - -# Stop the tinc daemon - -read pid rest < $IF_TINC_PIDFILE 2>/dev/null - -/usr/sbin/tincd -n "$IF_TINC_NET" -k $EXTRA - -# Wait for it to shut down properly - -/bin/sleep 0.1 -i=0; -while [ -f $IF_TINC_PIDFILE ] ; do - if [ ! -e "/proc/$pid" ] ; then - exit 0 - fi - - if [ $i = '30' ] ; then - echo 'Failed to stop tinc daemon!' - exit 1 - fi - /bin/sleep 0.1 - i=$(($i+1)) -done - -exit 0 diff --git a/debian/tinc.if-pre-up b/debian/tinc.if-pre-up deleted file mode 100755 index 68a3b53..0000000 --- a/debian/tinc.if-pre-up +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$METHOD" = loopback -o -z "$IF_TINC_NET" ]; then - exit 0 -fi - -# Read options from /etc/default - -[ -r /etc/default/tinc ] && . /etc/default/tinc - -# Set process limits - -setlimits() { - while [ $# -gt 0 ]; do - parm=$1 ; shift - if [ -n "$1" -a "${1#-}" = "$1" ]; then - value=$1 ; shift - ulimit $parm $value - else - ulimit $parm - fi - done -} - -test -n "$LIMITS" && setlimits $LIMITS - -# Read options from /etc/network/interfaces - -[ -n "$IF_TINC_CONFIG" ] && EXTRA="$EXTRA -c $IF_TINC_CONFIG" -[ -n "$IF_TINC_DEBUG" ] && EXTRA="$EXTRA -d$IF_TINC_DEBUG" -[ -n "$IF_TINC_MLOCK" ] && EXTRA="$EXTRA --mlock" -[ -n "$IF_TINC_LOGFILE" ] && EXTRA="$EXTRA --logfile=$IF_TINC_LOGFILE" -[ -n "$IF_TINC_PIDFILE" ] && EXTRA="$EXTRA --pidfile=$IF_TINC_PIDFILE" || IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid -[ -n "$IF_TINC_CHROOT" ] && EXTRA="$EXTRA --chroot" -[ -n "$IF_TINC_USER" ] && EXTRA="$EXTRA --user=$IF_TINC_USER" - - -# Start tinc daemon - -/usr/sbin/tincd -n "$IF_TINC_NET" -o "Interface=$IFACE" $EXTRA - -# Wait for it to come up properly - -/bin/sleep 0.1 -i=0; -while [ ! -f $IF_TINC_PIDFILE ] ; do - if [ $i = '30' ] ; then - echo 'Failed to start tinc daemon!' - exit 1 - fi - /bin/sleep 0.1 - i=$(($i+1)) -done - -while read pid rest < $IF_TINC_PIDFILE ; do - if [ -e "/proc/$pid" ] ; then - exit 0 - fi - - if [ $i = '30' ] ; then - echo 'Failed to start tinc daemon!' - exit 1 - fi - /bin/sleep 0.1 - i=$(($i+1)) -done - -exit 0 diff --git a/debian/tinc.if-up b/debian/tinc.if-up deleted file mode 100755 index 364f88f..0000000 --- a/debian/tinc.if-up +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$METHOD" = loopback -o -n "$IF_TINC_NET" ]; then - exit 0 -fi - -invoke-rc.d tinc alarm || exit 0 diff --git a/debian/tinc.init b/debian/tinc.init deleted file mode 100644 index 44ff4cf..0000000 --- a/debian/tinc.init +++ /dev/null @@ -1,140 +0,0 @@ -#! /bin/sh -# -### BEGIN INIT INFO -# Provides: tinc -# Required-Start: $remote_fs $network -# Required-Stop: $remote_fs $network -# Should-Start: $syslog $named -# Should-Stop: $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start tinc daemons -# Description: Create a file $NETSFILE (/etc/tinc/nets.boot), -# and put all the names of the networks in there. -# These names must be valid directory names under -# $TCONF (/etc/tinc). Lines starting with a # will be -# ignored in this file. -### END INIT INFO -# -# Based on Lubomir Bulej's Redhat init script. - -. /lib/lsb/init-functions - -DAEMON="/usr/sbin/tincd" -NAME="tinc" -DESC="tinc daemons" -TCONF="/etc/tinc" -NETSFILE="$TCONF/nets.boot" -NETS="" - -test -f $DAEMON || exit 0 - -[ -r /etc/default/tinc ] && . /etc/default/tinc - -# foreach_net "what-to-say" action [arguments...] -foreach_net() { - if [ ! -f $NETSFILE ] ; then - echo "Please create $NETSFILE." - exit 0 - fi - echo -n "$1" - shift - egrep '^[ ]*[a-zA-Z0-9_-]+' $NETSFILE | while read net args; do - echo -n " $net" - "$@" $net $args - done - echo "." -} - -signal_running() { - for i in /var/run/tinc.*pid; do - if [ -f "$i" ]; then - head -1 $i | while read pid; do - kill -$1 $pid - done - fi - done -} - -setlimits() { - while [ $# -gt 0 ]; do - parm=$1 ; shift - if [ -n "$1" -a "${1#-}" = "$1" ]; then - value=$1 ; shift - ulimit $parm $value - else - ulimit $parm - fi - done -} - -test -n "$LIMITS" && setlimits $LIMITS - -start() { - $DAEMON $EXTRA -n "$@" -} - -stop() { - [ -f /var/run/tinc.$1.pid ] || return - read pid rest /dev/null || return - - $DAEMON -n $1 -k || return - - i=0; - /bin/sleep 0.5 - - # Wait for the pidfile to disappear - while [ -f /var/run/tinc.$1.pid ]; do - # And check that there is an actual process running - kill -0 "$pid" 2>/dev/null || return - - if [ $i = '10' ] ; then - # It's still alive, kill it again and give up - $DAEMON -n $1 -k && /bin/sleep 0.5 - break - else - echo -n "." - i=$(($i+1)) - fi - - /bin/sleep 0.5 - done -} - -reload() { - $DAEMON -n $1 -kHUP -} - -alarm() { - $DAEMON -n $1 -kALRM -} - -restart() { - stop "$@" - start "$@" -} - -case "$1" in - start) - foreach_net "Starting $DESC:" start - ;; - stop) - foreach_net "Stopping $DESC:" stop - ;; - reload|force-reload) - foreach_net "Reloading $DESC configuration:" reload - ;; - restart) - foreach_net "Restarting $DESC:" restart - ;; - alarm) - signal_running ALRM - ;; - *) - echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload|alarm}" - exit 1 - ;; -esac - -exit 0 diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc deleted file mode 100644 index a79b551..0000000 --- a/debian/upstream/signing-key.asc +++ /dev/null @@ -1,70 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQINBEVZzTABEADawFv/ibQ48uA1eRhL07vdM36Pcq2HDyuyNA+vYEalNH4jLmha -nGPvDALWwX0DXIWDAG8zeTj8s8zliLIjuPS4WRI2YdKIvWeG9fEvpKSXVWa42ica -dpzn/H2aBd4Ax6rQaiTXKOvxANAp2Veb+73ssPV5AL00uGTpzhh98xQzfFQCZ9ZL -YSVPqbMed5oCt/4jM9FBO2CuBtkfiO0dVVYtW7FAVjcIlE2NaZol/KGvz7wsS+yA -dE42W0l5MdQueLmTF4AIUSSTyPFGMQoyqh+MPif73Y589IGcW6GdfKYWnVDo6Trh -HOhcEky+uTYKb6NL0vrJgUiYVMzAOXFDdJni1eQGO6EfZRNYtTga3alWq/jVelK7 -BID5JyNbkrTAqdPnhJGivVyk8gGX3+Hng8rkXTfWhp6yAYau1QfBm0F2tIQmpL1C -+7DoLvFErboQf685jXJBjzyvsJxB2ZLH1OOw6mNL0hy2LFkIyGza/bktY2em4apo -KWV5AM5LpyW6THH1oDS7706xFNkf4IFhKE0hKPzBiRnMDjRtMI131lkc5+P8Lqf5 -jLTCFUgbEhU6Dz2YjhHAumVm0NWJETUpFDtVvMrqk+mp5xldUOWRNlYQC5aQOyda -eHOlNzB/BFbPhKMWI/zWlEH6f0t6WjHb4iwpWO47511aVNHF59aPzbAHxwARAQAB -tC9UaW5jIERldmVsb3BtZW50IFRlYW0gPHRpbmMtZGV2ZWxAdGluYy12cG4ub3Jn -PokCNgQTAQIAIAUCRVnNMAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEEpg -hLnA1x9KxOAQAMPhO2WTXv9AaGQBQhyyoGseKoSfcRjtI9YEfE0OInQQ2E+SPYF/ -dkfeLGAUqa4foTYQlMqfw70vBhTdVCb7HLTGn6/ICFUtDwakUQCgUQGlUVQiondA -8W6jj+QWrh5BQhHuXy2nCVaKnksu0/xQPsJotghxuYqaot3iJ4qVw9iT/Yeo9irH -Ffftqu0OVCdQ5zQuFNI9YCv/C83L59ecH7bOzYz2efTyobvxrhmgQtgOQwCWOE09 -Kr3veM9KLG33YoXlqv8QN/3CwtsJvSwfhj+R2JowZC7RqHe/yznRzmRMsgbrolxi -uiJLonGxcNNkD7WhXi7/zL4A/JaC27XrFf1MPLv8aiTwnOIfrXd5jawpauUOZOXK -UjIZHlIqviB0r5s7A+AFeHW38Tp9VzNuQ7aEl5bHbSXV+s7DTAwGb279z0AVaJ3h -5hWFxupw7UoGdzROwCBYzeX3sioAL6QvkXua8X6zOH45VEiSwrRX3Hlx/MLo7Z4g -PWgFLf6WviHQXCG834To1XIwUk9RgNsL7OzGjtaCuRymADImKMNwierq2zTfoRFQ -v9onIadIMF1fsc70hiBG9yAi36MEuk4VxG8Jc3PQQfSFm4RWazv1k3E0AAIob2Ek -DLVjvLO62Navo/OQ6D7yyiX0qes5S7/k3F1h8+87eRn3yxZE2kbxPg8KuQENBEVZ -zYYBCACoYgExmMKEtABL3pir/IXI4exR/45hkP6txFIrkVQb8DGJ9H39kiDr4gtj -F+pvcgMpec35S3m4fJ7WhDNvbDB4ZvONc1NMKs9cqDXfB+TLWPm4W+SkcKUrs+nK -i8l7ieggTALJcvRoLTX2EFmUFrD6y870W3rK2SfC/0VJX8Ou5cPbwCeueExjo5x0 -3gNfu0jWUS0cyA9y+1rVVekrLuJY/+SI4jv3gdzrYbxD0f6dpbpC37QHoJdd0KGF -acPtT2azjY+HxW10EA3Aw9oZWFXnb1nFg2RbDpkaGLmLbaXweltLyw154UmCXxym -PXPqi9bSfEkj0GiYrapk4mW114u9ABEBAAGJA0QEGAECAA8FAkVZzYcCGwIFCQHh -M4ABKQkQSmCEucDXH0rAXSAEGQECAAYFAkVZzYcACgkQ017duBDeLmmu3wf/TFZM -tLKxiyQPtGSTE3eULPdWCEMDZXdSPTY0QHM7Zvh+qn1ei+iFpD0549MYnBEAwDIV -4o62Nrcg8IPu0CEkZIAn2JiFFGYvMGk91awZGV1GS3umd7Dt349E1oKDPZVzRn+j -QIKarXxxabRmx2s/dZZgSs/eguWTboBFmvls9tVfe8x/xPvcHFmqHVUoGKEJy6Tm -no+s4yNjpc5wAaRml+GYf1tK9WMFuZn79qKxkYv4WI96dXR0FL59YbFRkkaI+1/b -G31MvWTqVjY1nJGslByFPUUB8Ca1djtp1gx6NXnOYr3V5MEDfdbjjPu79No+/y6M -tIua5yNtSRlk2nKhIqo3D/sGQ/uHijiMRAtoLhiyqYMc9W9vx/KOoCUHoMJqE39a -Eputvgwwo0rwgSmNfB1dzneFojBdJ47WBSHC8NKtkpJj6mzvvlaI9jmEpK54x3nl -OmBj3X/xaepoRGAtrmgTBP4A9hSjrTMGu/tUQjlX+Xcr6n3g7GSVe5FpUyIMPXEU -+JZDTiEUyn1OdzfNGmnWP+KJX5pQVq4czf5XK6otLZJELDVw/Hbjnjmdz5WOKgEH -jSof3WPeMBgPAcd/cMAZeiGtWM1UpJBHqEXTkthmrpmtRftJKDbooNM9d5OwKiT+ -I3vNBv/plMSr8NDjhTWC+ihrN6RBj1vaqpDgGpucPhoO2hwNqWuI4q5WUKtCyw6J -An7ErNaH4c0nVaZq6kJ8Vxdt+LpKYmOsJ8y9xtl6StcrkKNn+6ZfCfee7DEo2bvb -scfpqJqqOqb5KOagTpYs8mo6yQ3leRvFtoeBOQHVQzct23EwOMxbDyeunT50a1eH -MZTEWuIiuCUudM81QXU46oIcaAtj8tpG0Tmnku9g27EjwxUt+8kVmhlPHMb2TdoF -k5d0ce+JuxIG5+i+t8sUCorMc8zfp4g1bxZeMOcPnfyO3bSW11EVcN7ZxHlFC+XE -YOByP50CM3P8lItPlQ+WpY9kYWjiwu9kVPaGQ16G47nspngJInU5dhka3KJGtIZe -q7kBDQRFWc3GAQgAz/JUs24niKsd0ZtOjUWd4R4y0gjS0kC/vvLL2gbXYkA9tcjG -5iEvVWJY34QsudX0v1ULsVnJ89X/gsk8hAhAia1TQm+0Qq+MSxEaQkMSaOO8N70U -XzgH1dielvpea20WO4MyWQuRIJ0K2nsGmEPnt6ZP7fK8HVHFNggP/mQ6LMu1reAF -gvb8cEtjb9B5QaCUEoLjsbsuo+vLW7AWy4GfIRNESHw2Qt08AUaGrihpu6zi7N2b -QkHHJtqa63GzYJ+kYzAVvrFJXdwL/TRXLBzv+6yyvYSIHi8uB6/o6CZN6hpjfpME -ph+oYPqXeNOyMd1E9Kg8ymcPrNyQKfE3WnCRXQARAQABiQIlBBgBAgAPBQJFWc3H -AhsMBQkB4TOAAAoJEEpghLnA1x9KXYMP/3D9JYti6C8DWuX2hWv+2SUbLcMa5u1e -ETewIo5S3mqGWSaxX4YLPVRkZ1lOLmFysOLimf0thYm7IsatLcWmBdYUpK92ilvr -Sk2sKlhrOoBXEX/79Kz+Aj5PjeyiQxgQ7Ba/afwhU6aTqs2Dp1T0YNu2eBvV+1QH -lZnW2Wh96zzwc0dJUuY9eBk5Fgpu08Wce7o6jxFPtVyAaQa0zcNAmw2TSY7wbunJ -WTl9OgATAyqVCuhWW7AnPcSqkH8lQigSc00wfqJKOD2Us0FqN6UKDCZTyQkdP6hx -G+3aUkkvGSOxy7u9bVWmrikuJMoiIY/CH/m+GcJJATVibI7t5MhhtBGySKc3PAwc -58sVe9AnbDvs84efrNP59j2KG2KKqcqjTGAmKyJnG3N50xJGakDIsqfneIRNWpEE -pOOPaOqR4qnPAS9OSt9A3hqBpWPjQcScd6AuO+J2PE5y23pTnb9PtLBQb5e4VFiv -N54u8j4bU2CO0SC2isZ3CR68dPHthWsxt4XbjhgktjbpQRQ8L2EDBQ8oE13GOrOw -P8x4Q0eC5uzkXNyRqzKOsxlZEuc+75aDDd3M2GDw08FG7GI1p/L+NgenwT+9TmFX -2hOKVrjgyx+fPut1t5DJJubDWXGOK33qvrL7HTCEv1zz7LNbbPwwNHK4lfMAWuJW -D9wc3Y9Se/P/ -=5MAs ------END PGP PUBLIC KEY BLOCK----- diff --git a/debian/watch b/debian/watch deleted file mode 100644 index f29609e..0000000 --- a/debian/watch +++ /dev/null @@ -1,2 +0,0 @@ -version=3 -opts=pgpsigurlmangle=s/$/.sig/ http://www.tinc-vpn.org/packages/tinc-(1\.0\.\d+)\.tar\.gz diff --git a/depcomp b/depcomp index 6b39162..b39f98f 100755 --- a/depcomp +++ b/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2018-03-07.03; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 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 @@ -16,7 +16,7 @@ scriptversion=2018-03-07.03; # UTC # 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, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,7 +783,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/doc/Makefile.in b/doc/Makefile.in index 81e9c93..b179c5e 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -329,8 +329,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -575,10 +575,7 @@ ctags CTAGS: cscope cscopelist: -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) +distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/doc/texinfo.tex b/doc/texinfo.tex index deca599..85f184c 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -1,11 +1,13 @@ % texinfo.tex -- TeX macros to handle Texinfo files. -% +% % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2020-02-11.09} +\def\texinfoversion{2013-02-01.11} % -% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -18,7 +20,7 @@ % General Public License for more details. % % You should have received a copy of the GNU General Public License -% along with this program. If not, see . +% along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without @@ -27,9 +29,9 @@ % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or -% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or -% https://www.gnu.org/software/texinfo/ (the Texinfo home page) +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % @@ -53,7 +55,7 @@ % extent. You can get the existing language-specific files from the % full Texinfo distribution. % -% The GNU Texinfo home page is https://www.gnu.org/software/texinfo. +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} @@ -64,10 +66,6 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -% LaTeX's \typeout. This ensures that the messages it is used for -% are identical in format to the corresponding ones from latex/pdflatex. -\def\typeout{\immediate\write17}% - \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -98,9 +96,7 @@ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ -\let\ptexsp=\sp \let\ptexstar=\* -\let\ptexsup=\sup \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode @@ -159,13 +155,22 @@ \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -% Give the space character the catcode for a space. -\def\spaceisspace{\catcode`\ =10\relax} - -% Likewise for ^^M, the end of line character. -\def\endlineisspace{\catcode13=10\relax} +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} +% sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& +\chardef\colonChar = `\: +\chardef\commaChar = `\, \chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\hashChar = `\# +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ @@ -188,6 +193,17 @@ wide-spread wrap-around } +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make @@ -218,7 +234,7 @@ % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. -% +% \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} @@ -232,16 +248,17 @@ \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} -% Output routine +% Do @cropmarks to get crop marks. % - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 % -\def\finalout{\overfullrule=0pt } - \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. @@ -253,145 +270,99 @@ % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top -% of a page, or that at the bottom of a page. - -% \domark is called twice inside \chapmacro, to add one -% mark before the section break, and one after. -% In the second call \prevchapterdefs is the same as \currentchapterdefs, -% and \prevsectiondefs is the same as \currentsectiondefs. -% Then if the page is not broken at the mark, some of the previous -% section appears on the page, and we can get the name of this section -% from \firstmark for @everyheadingmarks top. -% @everyheadingmarks bottom uses \botmark. -% -% See page 260 of The TeXbook. +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... \def\domark{% - \toks0=\expandafter{\currentchapterdefs}% - \toks2=\expandafter{\currentsectiondefs}% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% - \toks8=\expandafter{\currentcolordefs}% + \toks8=\expandafter{\lastcolordefs}% \mark{% - \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top - \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom - \noexpand\else \the\toks8 % 2: color marks + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 }% } - -% \gettopheadingmarks, \getbottomheadingmarks, -% \getcolormarks - extract needed part of mark. -% % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% - \ifcase0\the\savedtopmark\fi + \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} -\def\getcolormarks{\ifcase2\the\savedtopmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. -\def\currentchapterdefs{} -\def\currentsectiondefs{} -\def\currentsection{} +\def\lastchapterdefs{} +\def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} -\def\currentcolordefs{} - -% Margin to add to right of even pages, to left of odd pages. -\newdimen\bindingoffset -\newdimen\normaloffset -\newdimen\txipagewidth \newdimen\txipageheight +\def\lastcolordefs{} % Main output routine. -% \chardef\PAGE = 255 -\newtoks\defaultoutput -\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} -\output=\expandafter{\the\defaultoutput} +\output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox -% When outputting the double column layout for indices, an output routine -% is run several times, which hides the original value of \topmark. This -% can lead to a page heading being output and duplicating the chapter heading -% of the index. Hence, save the contents of \topmark at the beginning of -% the output routine. The saved contents are valid until we actually -% \shipout a page. -% -% (We used to run a short output routine to actually set \topmark and -% \firstmark to the right values, but if this was called with an empty page -% containing whatsits for writing index entries, the whatsits would be thrown -% away and the index auxiliary file would remain empty.) -% -\newtoks\savedtopmark -\newif\iftopmarksaved -\topmarksavedtrue -\def\savetopmark{% - \iftopmarksaved\else - \global\savedtopmark=\expandafter{\topmark}% - \global\topmarksavedtrue - \fi -} - -% \onepageout takes a vbox as an argument. -% \shipout a vbox for a single page, adding an optional header, footer -% and footnote. This also causes index entries for this page to be written -% to the auxiliary files. -% +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. \def\onepageout#1{% - \hoffset=\normaloffset + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % - % Retrieve the information for the headings from the marks in the page, - % and call Plain TeX's \makeheadline and \makefootline, which use the - % values in \headline and \footline. - % - % This is used to check if we are on the first page of a chapter. - \ifcase1\the\savedtopmark\fi - \let\prevchaptername\thischaptername - \ifcase0\firstmark\fi - \let\curchaptername\thischaptername - % - \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi - % - \ifx\curchaptername\prevchaptername - \let\thischapterheading\thischapter - \else - % \thischapterheading is the same as \thischapter except it is blank - % for the first page of a chapter. This is to prevent the chapter name - % being shown twice. - \def\thischapterheading{}% - \fi - % - % Common context changes for both heading and footing. % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). - \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} - % - \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% - % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi - \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% - % Set context for writing to auxiliary files like index files. % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % - \atdummies % don't expand commands in the output. - \turnoffactive + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt @@ -402,17 +373,31 @@ \unvbox\footlinebox \fi % - }% - }% - \global\topmarksavedfalse + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen -% Main part of page, including any footnotes -\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) @@ -423,13 +408,20 @@ \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } - -% Argument parsing +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. -% For example, \def\foo{\parsearg\fooxxx}. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% @@ -448,8 +440,7 @@ }% } -% First remove any @comment, then any @c comment. Pass the result on to -% \argcheckspaces. +% First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} @@ -486,13 +477,14 @@ % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} - -% \parseargdef - define a command taking an argument on the line -% % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } @@ -682,26 +674,21 @@ \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. - \addgroupbox - \prevdepth = \dimen1 - \checkinserts -} - -\def\addgroupbox{ % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\txipageheight + \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox + \prevdepth = \dimen1 + \checkinserts } - % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. @@ -825,6 +812,36 @@ where each line of input produces a line of output.} \temp } +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). This command +% is not documented, not supported, and doesn't work. +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} @@ -913,14 +930,13 @@ where each line of input produces a line of output.} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment - - -\def\c{\begingroup \catcode`\^^M=\active% -\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\cxxx} -{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} % -\let\comment\c +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +% +\let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. @@ -991,23 +1007,69 @@ where each line of input produces a line of output.} % paragraph. % \gdef\dosuppressfirstparagraphindent{% - \gdef\indent {\restorefirstparagraphindent \indent}% - \gdef\noindent{\restorefirstparagraphindent \noindent}% - \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% } -% + \gdef\restorefirstparagraphindent{% - \global\let\indent = \ptexindent - \global\let\noindent = \ptexnoindent - \global\everypar = {}% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax -% @setfilename INFO-FILENAME - ignored -\let\setfilename=\comment +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} @@ -1025,95 +1087,10 @@ where each line of input produces a line of output.} \newtoks\toksC \newtoks\toksD \newbox\boxA -\newbox\boxB \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest -% -% For LuaTeX -% - -\newif\iftxiuseunicodedestname -\txiuseunicodedestnamefalse % For pdfTeX etc. - -\ifx\luatexversion\thisisundefined -\else - % Use Unicode destination names - \txiuseunicodedestnametrue - % Escape PDF strings with converting UTF-16 from UTF-8 - \begingroup - \catcode`\%=12 - \directlua{ - function UTF16oct(str) - tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') - for c in string.utfvalues(str) do - if c < 0x10000 then - tex.sprint( - string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. - string.char(0x5c) .. string.char(0x25) .. '03o', - math.floor(c / 256), math.floor(c % 256))) - else - c = c - 0x10000 - local c_hi = c / 1024 + 0xd800 - local c_lo = c % 1024 + 0xdc00 - tex.sprint( - string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. - string.char(0x5c) .. string.char(0x25) .. '03o' .. - string.char(0x5c) .. string.char(0x25) .. '03o' .. - string.char(0x5c) .. string.char(0x25) .. '03o', - math.floor(c_hi / 256), math.floor(c_hi % 256), - math.floor(c_lo / 256), math.floor(c_lo % 256))) - end - end - end - } - \endgroup - \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} - % Escape PDF strings without converting - \begingroup - \directlua{ - function PDFescstr(str) - for c in string.bytes(str) do - if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then - tex.sprint(-2, - string.format(string.char(0x5c) .. string.char(0x25) .. '03o', - c)) - else - tex.sprint(-2, string.char(c)) - end - end - end - } - % The -2 in the arguments here gives all the input to TeX catcode 12 - % (other) or 10 (space), preventing undefined control sequence errors. See - % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html - % - \endgroup - \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} - \ifnum\luatexversion>84 - % For LuaTeX >= 0.85 - \def\pdfdest{\pdfextension dest} - \let\pdfoutput\outputmode - \def\pdfliteral{\pdfextension literal} - \def\pdfcatalog{\pdfextension catalog} - \def\pdftexversion{\numexpr\pdffeedback version\relax} - \let\pdfximage\saveimageresource - \let\pdfrefximage\useimageresource - \let\pdflastximage\lastsavedimageresourceindex - \def\pdfendlink{\pdfextension endlink\relax} - \def\pdfoutline{\pdfextension outline} - \def\pdfstartlink{\pdfextension startlink} - \def\pdffontattr{\pdfextension fontattr} - \def\pdfobj{\pdfextension obj} - \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} - \let\pdfpagewidth\pagewidth - \let\pdfpageheight\pageheight - \edef\pdfhorigin{\pdfvariable horigin} - \edef\pdfvorigin{\pdfvariable vorigin} - \fi -\fi - % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined @@ -1127,21 +1104,11 @@ where each line of input produces a line of output.} \fi \fi -\newif\ifpdforxetex -\pdforxetexfalse -\ifpdf - \pdforxetextrue -\fi -\ifx\XeTeXrevision\thisisundefined\else - \pdforxetextrue -\fi - - % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. -% +% % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so @@ -1154,21 +1121,12 @@ where each line of input produces a line of output.} \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. - \xdef#1{#1}% \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } -\def\txiescapepdfutfsixteen#1{% - \ifx\pdfescapestrutfsixteen\thisisundefined - % No UTF-16 converting macro available. - \txiescapepdf{#1}% - \else - \xdef#1{\pdfescapestrutfsixteen{#1}}% - \fi -} \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot @@ -1177,23 +1135,21 @@ output) for that.)} \ifpdf % - % Color manipulation macros using ideas from pdfcolor.tex, + % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead - % of actual black. The dark red here is dark enough to print on paper as - % nearly black, but still distinguishable for online viewing. We use - % black by default, though. + % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % - % rg sets the color for filling (usual text, etc.); - % RG sets the color for stroking (thin rules, e.g., normal _'s). + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% - \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } @@ -1201,7 +1157,7 @@ output) for that.)} \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} - \def\currentcolordefs{} + \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt @@ -1278,83 +1234,24 @@ output) for that.)} \pdfrefximage \pdflastximage \fi} % - \def\setpdfdestname#1{{% + \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts - \makevalueexpandable \turnoffactive - \iftxiuseunicodedestname - \ifx \declaredencoding \latone - % Pass through Latin-1 characters. - % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. - \else - \ifx \declaredencoding \utfeight - % Pass through Unicode characters. - \else - % Use ASCII approximations in destination names. - \passthroughcharsfalse - \fi - \fi - \else - % Use ASCII approximations in destination names. - \passthroughcharsfalse - \fi + \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname - }} - % - \def\setpdfoutlinetext#1{{% - \indexnofonts - \makevalueexpandable - \turnoffactive - \ifx \declaredencoding \latone - % The PDF format can use an extended form of Latin-1 in bookmark - % strings. See Appendix D of the PDF Reference, Sixth Edition, for - % the "PDFDocEncoding". - \passthroughcharstrue - % Pass through Latin-1 characters. - % LuaTeX: Convert to Unicode - % pdfTeX: Use Latin-1 as PDFDocEncoding - \def\pdfoutlinetext{#1}% - \else - \ifx \declaredencoding \utfeight - \ifx\luatexversion\thisisundefined - % For pdfTeX with UTF-8. - % TODO: the PDF format can use UTF-16 in bookmark strings, - % but the code for this isn't done yet. - % Use ASCII approximations. - \passthroughcharsfalse - \def\pdfoutlinetext{#1}% - \else - % For LuaTeX with UTF-8. - % Pass through Unicode characters for title texts. - \passthroughcharstrue - \def\pdfoutlinetext{#1}% - \fi - \else - % For non-Latin-1 or non-UTF-8 encodings. - % Use ASCII approximations. - \passthroughcharsfalse - \def\pdfoutlinetext{#1}% - \fi - \fi - % LuaTeX: Convert to UTF-16 - % pdfTeX: Use Latin-1 as PDFDocEncoding - \txiescapepdfutfsixteen\pdfoutlinetext - }} - % - \def\pdfmkdest#1{% - \setpdfdestname{#1}% \safewhatsit{\pdfdest name{\pdfdestname} xyz}% - } + }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % - % by default, use black for everything. - \def\urlcolor{\rgbBlack} - \def\linkcolor{\rgbBlack} + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\rgbDarkRed} + \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines @@ -1376,13 +1273,18 @@ output) for that.)} % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. - \setpdfoutlinetext{#1} - \setpdfdestname{#3} - \ifx\pdfdestname\empty - \def\pdfdestname{#4}% + \edef\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + \txiescapepdf\pdfoutlinedest \fi % - \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% @@ -1446,7 +1348,7 @@ output) for that.)} % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. - % + % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike @@ -1502,9 +1404,6 @@ output) for that.)} \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} - % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may - % be a simple number, or a list of numbers in the case of an index - % entry. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} @@ -1540,298 +1439,42 @@ output) for that.)} \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput -% -% For XeTeX -% -\ifx\XeTeXrevision\thisisundefined -\else - % - % XeTeX version check - % - \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 - % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. - % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). - % For avoiding PDF destination name replacement, we use this special - % instead of xdvipdfmx's command line option `-C 0x0010'. - \special{dvipdfmx:config C 0x0010} - % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. - % It can handle Unicode destination names for PDF. - \txiuseunicodedestnametrue - \else - % XeTeX < 0.99996 (TeX Live < 2016) cannot use the - % `dvipdfmx:config' special. - % So for avoiding PDF destination name replacement, - % xdvipdfmx's command line option `-C 0x0010' is necessary. - % - % XeTeX < 0.99995 can not handle Unicode destination names for PDF - % because xdvipdfmx 20150315 has a UTF-16 conversion issue. - % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). - \txiuseunicodedestnamefalse - \fi - % - % Color support - % - \def\rgbDarkRed{0.50 0.09 0.12} - \def\rgbBlack{0 0 0} - % - \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} - % - % Set color, and create a mark which defines \thiscolor accordingly, - % so that \makeheadline knows which color to restore. - \def\setcolor#1{% - \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% - \domark - \pdfsetcolor{#1}% - } - % - \def\maincolor{\rgbBlack} - \pdfsetcolor{\maincolor} - \edef\thiscolor{\maincolor} - \def\currentcolordefs{} - % - \def\makefootline{% - \baselineskip24pt - \line{\pdfsetcolor{\maincolor}\the\footline}% - } - % - \def\makeheadline{% - \vbox to 0pt{% - \vskip-22.5pt - \line{% - \vbox to8.5pt{}% - % Extract \thiscolor definition from the marks. - \getcolormarks - % Typeset the headline with \maincolor, then restore the color. - \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% - }% - \vss - }% - \nointerlineskip - } - % - % PDF outline support - % - % Emulate pdfTeX primitive - \def\pdfdest name#1 xyz{% - \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% - } - % - \def\setpdfdestname#1{{% - % We have to set dummies so commands such as @code, and characters - % such as \, aren't expanded when present in a section title. - \indexnofonts - \makevalueexpandable - \turnoffactive - \iftxiuseunicodedestname - % Pass through Unicode characters. - \else - % Use ASCII approximations in destination names. - \passthroughcharsfalse - \fi - \def\pdfdestname{#1}% - \txiescapepdf\pdfdestname - }} - % - \def\setpdfoutlinetext#1{{% - \turnoffactive - % Always use Unicode characters in title texts. - \def\pdfoutlinetext{#1}% - % For XeTeX, xdvipdfmx converts to UTF-16. - % So we do not convert. - \txiescapepdf\pdfoutlinetext - }} - % - \def\pdfmkdest#1{% - \setpdfdestname{#1}% - \safewhatsit{\pdfdest name{\pdfdestname} xyz}% - } - % - % by default, use black for everything. - \def\urlcolor{\rgbBlack} - \def\linkcolor{\rgbBlack} - \def\endlink{\setcolor{\maincolor}\pdfendlink} - % - \def\dopdfoutline#1#2#3#4{% - \setpdfoutlinetext{#1} - \setpdfdestname{#3} - \ifx\pdfdestname\empty - \def\pdfdestname{#4}% - \fi - % - \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A - << /S /GoTo /D (\pdfdestname) >> >> }% - } - % - \def\pdfmakeoutlines{% - \begingroup - % - % For XeTeX, counts of subentries are not necessary. - % Therefore, we read toc only once. - % - % We use node names as destinations. - \def\partentry##1##2##3##4{}% ignore parts in the outlines - \def\numchapentry##1##2##3##4{% - \dopdfoutline{##1}{1}{##3}{##4}}% - \def\numsecentry##1##2##3##4{% - \dopdfoutline{##1}{2}{##3}{##4}}% - \def\numsubsecentry##1##2##3##4{% - \dopdfoutline{##1}{3}{##3}{##4}}% - \def\numsubsubsecentry##1##2##3##4{% - \dopdfoutline{##1}{4}{##3}{##4}}% - % - \let\appentry\numchapentry% - \let\appsecentry\numsecentry% - \let\appsubsecentry\numsubsecentry% - \let\appsubsubsecentry\numsubsubsecentry% - \let\unnchapentry\numchapentry% - \let\unnsecentry\numsecentry% - \let\unnsubsecentry\numsubsecentry% - \let\unnsubsubsecentry\numsubsubsecentry% - % - % For XeTeX, xdvipdfmx converts strings to UTF-16. - % Therefore, the encoding and the language may not be considered. - % - \indexnofonts - \setupdatafile - % We can have normal brace characters in the PDF outlines, unlike - % Texinfo index files. So set that up. - \def\{{\lbracecharliteral}% - \def\}{\rbracecharliteral}% - \catcode`\\=\active \otherbackslash - \input \tocreadfilename - \endgroup - } - {\catcode`[=1 \catcode`]=2 - \catcode`{=\other \catcode`}=\other - \gdef\lbracecharliteral[{]% - \gdef\rbracecharliteral[}]% - ] - \special{pdf:docview << /PageMode /UseOutlines >> } - % ``\special{pdf:tounicode ...}'' is not necessary - % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. - % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, - % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. - % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). -% - \def\skipspaces#1{\def\PP{#1}\def\D{|}% - \ifx\PP\D\let\nextsp\relax - \else\let\nextsp\skipspaces - \addtokens{\filename}{\PP}% - \advance\filenamelength by 1 - \fi - \nextsp} - \def\getfilename#1{% - \filenamelength=0 - % If we don't expand the argument now, \skipspaces will get - % snagged on things like "@value{foo}". - \edef\temp{#1}% - \expandafter\skipspaces\temp|\relax - } - % make a live url in pdf output. - \def\pdfurl#1{% - \begingroup - % it seems we really need yet another set of dummies; have not - % tried to figure out what each command should do in the context - % of @url. for now, just make @/ a no-op, that's the only one - % people have actually reported a problem with. - % - \normalturnoffactive - \def\@{@}% - \let\/=\empty - \makevalueexpandable - % do we want to go so far as to use \indexnofonts instead of just - % special-casing \var here? - \def\var##1{##1}% - % - \leavevmode\setcolor{\urlcolor}% - \special{pdf:bann << /Border [0 0 0] - /Subtype /Link /A << /S /URI /URI (#1) >> >>}% - \endgroup} - \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} - \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} - \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} - \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS|\relax - \ifx\first0\adn0 - \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 - \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 - \else - \ifnum0=\countA\else\makelink\fi - \ifx\first.\let\next=\done\else - \let\next=\maketoks - \addtokens{\toksB}{\the\toksD} - \ifx\first,\addtokens{\toksB}{\space}\fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next} - \def\makelink{\addtokens{\toksB}% - {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} - \def\pdflink#1{% - \special{pdf:bann << /Border [0 0 0] - /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% - \setcolor{\linkcolor}#1\endlink} - \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -% - % - % @image support - % - % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). - \def\doxeteximage#1#2#3{% - \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% - \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% - % - % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among - % others). Let's try in that order, PDF first since if - % someone has a scalable image, presumably better to use that than a - % bitmap. - \let\xeteximgext=\empty - \begingroup - \openin 1 #1.pdf \ifeof 1 - \openin 1 #1.PDF \ifeof 1 - \openin 1 #1.png \ifeof 1 - \openin 1 #1.jpg \ifeof 1 - \openin 1 #1.jpeg \ifeof 1 - \openin 1 #1.JPG \ifeof 1 - \errmessage{Could not find image file #1 for XeTeX}% - \else \gdef\xeteximgext{JPG}% - \fi - \else \gdef\xeteximgext{jpeg}% - \fi - \else \gdef\xeteximgext{jpg}% - \fi - \else \gdef\xeteximgext{png}% - \fi - \else \gdef\xeteximgext{PDF}% - \fi - \else \gdef\xeteximgext{pdf}% - \fi - \closein 1 - \endgroup - % - \def\xetexpdfext{pdf}% - \ifx\xeteximgext\xetexpdfext - \XeTeXpdffile "#1".\xeteximgext "" - \else - \def\xetexpdfext{PDF}% - \ifx\xeteximgext\xetexpdfext - \XeTeXpdffile "#1".\xeteximgext "" - \else - \XeTeXpicfile "#1".\xeteximgext "" - \fi - \fi - \ifdim \wd0 >0pt width \xeteximagewidth \fi - \ifdim \wd2 >0pt height \xeteximageheight \fi \relax - } -\fi - - -% \message{fonts,} +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. @@ -2179,10 +1822,8 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} -\setfont\defsl\slshape{10}{\magstep1}{OT1} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} -\def\df{\let\ttfont=\deftt \let\bffont = \defbf -\let\ttslfont=\defttsl \let\slfont=\defsl \bf} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -2212,20 +1853,6 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} -% Fonts for math mode superscripts (7pt). -\def\sevennominalsize{7pt} -\setfont\sevenrm\rmshape{7}{1000}{OT1} -\setfont\seventt\ttshape{10}{700}{OT1TT} -\setfont\sevenbf\bfshape{10}{700}{OT1} -\setfont\sevenit\itshape{7}{1000}{OT1IT} -\setfont\sevensl\slshape{10}{700}{OT1} -\setfont\sevensf\sfshape{10}{700}{OT1} -\setfont\sevensc\scshape{10}{700}{OT1} -\setfont\seventtsl\ttslshape{10}{700}{OT1TT} -\font\seveni=cmmi7 -\font\sevensy=cmsy7 -\def\sevenecsize{0700} - % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -2257,7 +1884,6 @@ end % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} -\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} @@ -2283,7 +1909,7 @@ end \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} -% Reduced fonts for @acronym in text (10pt). +% Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} @@ -2327,10 +1953,8 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} -\setfont\defsl\slshape{10}{\magstephalf}{OT1} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} -\def\df{\let\ttfont=\deftt \let\bffont = \defbf -\let\slfont=\defsl \let\ttslfont=\defttsl \bf} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -2360,20 +1984,6 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} -% Fonts for math mode superscripts (7pt). -\def\sevennominalsize{7pt} -\setfont\sevenrm\rmshape{7}{1000}{OT1} -\setfont\seventt\ttshape{10}{700}{OT1TT} -\setfont\sevenbf\bfshape{10}{700}{OT1} -\setfont\sevenit\itshape{7}{1000}{OT1IT} -\setfont\sevensl\slshape{10}{700}{OT1} -\setfont\sevensf\sfshape{10}{700}{OT1} -\setfont\sevensc\scshape{10}{700}{OT1} -\setfont\seventtsl\ttslshape{10}{700}{OT1TT} -\font\seveni=cmmi7 -\font\sevensy=cmsy7 -\def\sevenecsize{0700} - % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -2430,7 +2040,7 @@ end \font\ssecsy=cmsy10 \def\ssececsize{1000} -% Reduced fonts for @acronym in text (9pt). +% Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} @@ -2450,12 +2060,6 @@ end \rm } % end of 10pt text font size definitions, \definetextfontsizex -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000}{OT1} -\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 -\setfont\shortcontsl\slshape{12}{1000}{OT1} -\setfont\shortconttt\ttshape{12}{1000}{OT1TT} - % We provide the user-level command % @fonttextsize 10 @@ -2482,121 +2086,102 @@ end \endgroup } -% -% Change the current font style to #1, remembering it in \curfontstyle. -% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in -% italics, not bold italics. -% -\def\setfontstyle#1{% - \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. - \csname #1font\endcsname % change the current font -} - -\def\rm{\fam=0 \setfontstyle{rm}} -\def\it{\fam=\itfam \setfontstyle{it}} -\def\sl{\fam=\slfam \setfontstyle{sl}} -\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} -\def\tt{\fam=\ttfam \setfontstyle{tt}} - -% Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf. -\newfam\sffam -\def\sf{\fam=\sffam \setfontstyle{sf}} - -% We don't need math for this font style. -\def\ttsl{\setfontstyle{ttsl}} - % In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. -% We don't bother to reset \scriptscriptfont; awaiting user need. +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% - \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont - \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont - \textfont\ttfam=\ttfont \textfont\sffam=\sffont - % - % Fonts for superscript. Note that the 7pt fonts are used regardless - % of the current font size. - \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy - \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl - \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt - \scriptfont\sffam=\sevensf + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf } -% - -% The font-changing commands (all called \...fonts) redefine the meanings -% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs -% to also set the current \fam for math mode. Our \STYLE (e.g., \rm) -% commands hardwire \STYLEfont to set the current font. -% -% The fonts used for \ifont are for "math italics" (\itfont is for italics -% in regular text). \syfont is also used in math mode only. +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used -% in, e.g., the LaTeX logo and acronyms. +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. % % This all needs generalizing, badly. % +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{27pt}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} -\def\assignfonts#1{% - \expandafter\let\expandafter\rmfont\csname #1rm\endcsname - \expandafter\let\expandafter\itfont\csname #1it\endcsname - \expandafter\let\expandafter\slfont\csname #1sl\endcsname - \expandafter\let\expandafter\bffont\csname #1bf\endcsname - \expandafter\let\expandafter\ttfont\csname #1tt\endcsname - \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname - \expandafter\let\expandafter\sffont \csname #1sf\endcsname - \expandafter\let\expandafter\ifont \csname #1i\endcsname - \expandafter\let\expandafter\syfont \csname #1sy\endcsname - \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname -} - -\newif\ifrmisbold - -% Select smaller font size with the current style. Used to change font size -% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for -% normal roman text, also use bold fonts for roman text in the smaller size. -\def\switchtolllsize{% - \expandafter\assignfonts\expandafter{\lllsize}% - \ifrmisbold - \let\rmfont\bffont - \fi - \csname\curfontstyle\endcsname -}% - -\def\switchtolsize{% - \expandafter\assignfonts\expandafter{\lsize}% - \ifrmisbold - \let\rmfont\bffont - \fi - \csname\curfontstyle\endcsname -}% - -\def\definefontsetatsize#1#2#3#4#5{% -\expandafter\def\csname #1fonts\endcsname{% - \def\curfontsize{#1}% - \def\lsize{#2}\def\lllsize{#3}% - \csname rmisbold#5\endcsname - \assignfonts{#1}% - \resetmathfonts - \setleading{#4}% -}} - -\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} -\definefontsetatsize{title} {chap} {subsec} {27pt} {true} -\definefontsetatsize{chap} {sec} {text} {19pt} {true} -\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} -\definefontsetatsize{ssec} {text} {small} {15pt} {true} -\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} -\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} -\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} - -\def\titlefont#1{{\titlefonts\rm #1}} -\let\subsecfonts = \ssecfonts -\let\subsubsecfonts = \ssecfonts +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -2634,11 +2219,26 @@ end % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost -% style. +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% + \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } @@ -2700,15 +2300,11 @@ end % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% - \ifmonospace - \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% - \else \char'15 \fi + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% \else \char'15 \fi - \else - '% - \fi + \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. @@ -2716,21 +2312,17 @@ end % the code environments to do likewise. % \def\codequoteleft{% - \ifmonospace - \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - % [Knuth] pp. 380,381,391 - % \relax disables Spanish ligatures ?` and !` of \tt font. - \relax`% - \else \char'22 \fi + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% \else \char'22 \fi - \else - \relax`% - \fi + \else \char'22 \fi } % Commands to set the quote options. -% +% \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword @@ -2771,7 +2363,7 @@ end % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% - \ifusingtt + \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next @@ -2785,10 +2377,8 @@ end \ifx\next,% \else\ifx\next-% \else\ifx\next.% - \else\ifx\next\.% - \else\ifx\next\comma% \else\ptexslash - \fi\fi\fi\fi\fi + \fi\fi\fi \aftersmartic } @@ -2836,8 +2426,8 @@ end % \catcode`@=11 \def\plainfrenchspacing{% - \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m - \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% @@ -2850,7 +2440,7 @@ end % @t, explicit typewriter. \def\t#1{% - {\tt \plainfrenchspacing #1}% + {\tt \rawbackslash \plainfrenchspacing #1}% \null } @@ -2877,6 +2467,7 @@ end % Turn off hyphenation. \nohyphenation % + \rawbackslash \plainfrenchspacing #1% }% @@ -2884,14 +2475,14 @@ end } % We *must* turn on hyphenation at `-' and `_' in @code. -% (But see \codedashfinish below.) % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate at a dash. -- rms. +% and arrange explicitly to hyphenate at a dash. +% -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active @@ -2908,35 +2499,14 @@ end \let-\normaldash \let_\realunder \fi - % Given -foo (with a single dash), we do not want to allow a break - % after the hyphen. - \global\let\codedashprev=\codedash - % \codex } - % - \gdef\codedash{\futurelet\next\codedashfinish} - \gdef\codedashfinish{% - \normaldash % always output the dash character itself. - % - % Now, output a discretionary to allow a line break, unless - % (a) the next character is a -, or - % (b) the preceding character is a -. - % E.g., given --posix, we do not want to allow a break after either -. - % Given --foo-bar, we do want to allow a break between the - and the b. - \ifx\next\codedash \else - \ifx\codedashprev\codedash - \else \discretionary{}{}{}\fi - \fi - % we need the space after the = for the case when \next itself is a - % space token; it would get swallowed otherwise. As in @code{- a}. - \global\let\codedashprev= \next - } } -\def\normaldash{-} -% + \def\codex #1{\tclose{#1}\endgroup} +\def\normaldash{-} +\def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) @@ -2978,21 +2548,37 @@ end \let\file=\code \let\option=\code -% @uref (abbreviation for `urlref') aka @url takes an optional -% (comma-separated) second argument specifying the text to display and -% an optional third arg as text to display instead of (rather than in -% addition to) the url itself. First (mandatory) arg is the url. +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. +% (This \urefnobreak definition isn't used now, leaving it for a while +% for comparison.) +\def\urefnobreak#1{\dourefnobreak #1,,,\finish} +\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} -% TeX-only option to allow changing PDF output to show only the second -% arg (if given), and not the url (which is then just the link target). -\newif\ifurefurlonlylink - -% The main macro is \urefbreak, which allows breaking at expected -% places within the url. (There used to be another version, which -% didn't support automatic breaking.) +% This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak -% \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces @@ -3001,32 +2587,12 @@ end \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else - \setbox0 = \hbox{\ignorespaces #2}% look for second arg + \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf - % For pdfTeX and LuaTeX - \ifurefurlonlylink - % PDF plus option to not display url, show just arg - \unhbox0 - \else - % PDF, normally display both arg and url for consistency, - % visibility, if the pdf is eventually used to print, etc. - \unhbox0\ (\urefcode{#1})% - \fi + \unhbox0 % PDF: 2nd arg given, show only it \else - \ifx\XeTeXrevision\thisisundefined - \unhbox0\ (\urefcode{#1})% DVI, always show arg and url - \else - % For XeTeX - \ifurefurlonlylink - % PDF plus option to not display url, show just arg - \unhbox0 - \else - % PDF, normally display both arg and url for consistency, - % visibility, if the pdf is eventually used to print, etc. - \unhbox0\ (\urefcode{#1})% - \fi - \fi + \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it @@ -3037,9 +2603,9 @@ end % Allow line breaks around only a few characters (only). \def\urefcatcodes{% - \catcode`\&=\active \catcode`\.=\active - \catcode`\#=\active \catcode`\?=\active - \catcode`\/=\active + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active } { \urefcatcodes @@ -3063,33 +2629,39 @@ end \global\def/{\normalslash} } -\def\urefcodeamp{\urefprebreak \&\urefpostbreak} -\def\urefcodedot{\urefprebreak .\urefpostbreak} -\def\urefcodehash{\urefprebreak \#\urefpostbreak} -\def\urefcodequest{\urefprebreak ?\urefpostbreak} +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } +\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% - \urefprebreak \slashChar + \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. - \ifx\next/\else \urefpostbreak \fi + \ifx\next/\else \urefpoststretch \fi } } -% By default we'll break after the special characters, but some people like to -% break before the special chars, so allow that. Also allow no breaking at -% all, for manual control. -% +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore - \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter - \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% @@ -3099,19 +2671,6 @@ end \def\wordbefore{before} \def\wordnone{none} -% Allow a ragged right output to aid breaking long URL's. There can -% be a break at the \allowbreak with no extra glue (if the existing stretch in -% the line is sufficent), a break at the \penalty100 with extra glue added -% at the end of the line, or no break at all here. -% Changing the value of the penalty and/or the amount of stretch affects how -% preferrable one choice is over the other. -\def\urefallowbreak{% - \allowbreak - \hskip 0pt plus 2 em\relax - \penalty300 - \hskip 0pt plus -2 em\relax -} - \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. @@ -3122,7 +2681,7 @@ end % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} -\ifpdforxetex +\ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces @@ -3201,13 +2760,18 @@ end % \def\dmn#1{\thinspace #1} +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% - {\switchtolsize #1}% + {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% @@ -3253,24 +2817,21 @@ end \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% - \ifmmode\else % only go into math if not in math mode already - \tex - \mathunderscore - \let\\ = \mathbackslash - \mathactive - % make the texinfo accent commands work in math mode - \let\"=\ddot - \let\'=\acute - \let\==\bar - \let\^=\hat - \let\`=\grave - \let\u=\breve - \let\v=\check - \let\~=\tilde - \let\dotaccent=\dot - % have to provide another name for sup operator - \let\mathopsup=\sup - $\expandafter\finishmath\fi + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -3293,22 +2854,13 @@ end } } -% for @sub and @sup, if in math mode, just do a normal sub/superscript. -% If in text, use math to place as sub/superscript, but switch -% into text mode, with smaller fonts. This is a different font than the -% one used for real math sub/superscripts (8pt vs. 7pt), but let's not -% fix it (significant additions to font machinery) until someone notices. -% -\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} -\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% -% -\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} -\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. -% +% \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} @@ -3316,15 +2868,6 @@ end \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } -% -% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if -% FMTNAME is tex, else ELSE-TEXT. -\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} -\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% - \def\inlinefmtname{#1}% - \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi -} -% % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being @@ -3332,7 +2875,7 @@ end % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. -% +% \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% @@ -3341,23 +2884,6 @@ end \endgroup % close group opened by \tex. } -% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. -% -\long\def\inlineifset#1{\doinlineifset #1,\finish} -\long\def\doinlineifset#1,#2,\finish{% - \def\inlinevarname{#1}% - \expandafter\ifx\csname SET\inlinevarname\endcsname\relax - \else\ignorespaces#2\fi -} - -% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. -% -\long\def\inlineifclear#1{\doinlineifclear #1,\finish} -\long\def\doinlineifclear#1,#2,\finish{% - \def\inlinevarname{#1}% - \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi -} - \message{glyphs,} % and logos. @@ -3367,10 +2893,23 @@ end \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. -\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} -\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} -\let\{=\lbracechar -\let\}=\rbracechar +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup % @comma{} to avoid , parsing problems. \let\comma = , @@ -3388,8 +2927,8 @@ end % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} -\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} -\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -3418,12 +2957,12 @@ end {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt - % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. + % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. - \switchtolllsize A% + \selectfonts\lllsize A% \fi }% \vss @@ -3432,16 +2971,11 @@ end \TeX } -% Some math mode symbols. Define \ensuremath to switch into math mode -% unless we are already there. Expansion tricks may not be needed here, -% but safer, and can't hurt. -\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} -\def\ensuredmath#1{$\relax#1$} -% -\def\bullet{\ensuremath\ptexbullet} -\def\geq{\ensuremath\ge} -\def\leq{\ensuremath\le} -\def\minus{\ensuremath-} +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm @@ -3489,7 +3023,7 @@ end % \newbox\errorbox % -{\ttfont \global\dimen0 = 3em}% Width of the box. +{\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} @@ -3605,15 +3139,8 @@ end \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % -% Use the European Computer Modern fonts (cm-super in outline format) -% for non-CM glyphs. That is ec* for regular text and tc* for the text -% companion symbols (LaTeX TS1 encoding). Both are part of the ec -% package and follow the same conventions. -% -\def\ecfont{\etcfont{e}} -\def\tcfont{\etcfont{t}} -% -\def\etcfont#1{% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. +\def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so @@ -3622,14 +3149,14 @@ end \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: - \font\thisecfont = #1ctt\ecsize \space at \nominalsize + \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: - \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: - \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont @@ -3640,7 +3167,7 @@ end % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% - $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } @@ -3673,16 +3200,13 @@ end \newif\ifseenauthor \newif\iffinishedtitlepage -% @setcontentsaftertitlepage used to do an implicit @contents or -% @shortcontents after @end titlepage, but it is now obsolete. -\def\setcontentsaftertitlepage{% - \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo - command; move your @contents command if you want the contents - after the title page.}}% -\def\setshortcontentsaftertitlepage{% - \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo - command; move your @shortcontents and @contents commands if you - want the contents after the title page.}}% +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% @@ -3724,6 +3248,20 @@ end % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi } \def\finishtitlepage{% @@ -3734,11 +3272,12 @@ end % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used -% inside a \vbox, and fonts need to be set appropriately first. \par should -% be specified before the end of the \vbox, since a vbox is a group. -% +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% \def\raggedtitlesettings{% - \rm + \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 @@ -3747,7 +3286,7 @@ end % Macros to be used within @titlepage: -\let\subtitlerm=\rmfont +\let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% @@ -3773,7 +3312,7 @@ end \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\secfonts\rm \leftline{#1}}% + {\secfonts\rmisbold \leftline{#1}}% \fi } @@ -3787,7 +3326,7 @@ end \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make \makeheadline and \makefootline in Plain TeX use those variables +% Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -3826,7 +3365,7 @@ end % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\txipageheight by -12pt + \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } @@ -3843,17 +3382,13 @@ end % @everyheadingmarks % @everyfootingmarks -% These define \getoddheadingmarks, \getevenheadingmarks, -% \getoddfootingmarks, and \getevenfootingmarks, each to one of -% \gettopheadingmarks, \getbottomheadingmarks. -% \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} -\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } -\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% @@ -3874,7 +3409,7 @@ end % By default, they are off at the start of a document, % and turned `on' after @end titlepage. -\parseargdef\headings{\csname HEADINGS#1\endcsname} +\def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% @@ -3894,7 +3429,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager @@ -3905,8 +3440,8 @@ end \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -3917,7 +3452,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3925,8 +3460,8 @@ end \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } @@ -4104,7 +3639,7 @@ end \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % - % Try typesetting the item mark so that if the document erroneously says + % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if @@ -4136,12 +3671,7 @@ end \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % - \ifinner\else - \vadjust{\penalty 1200}% not good to break after first line of item. - \fi - % We can be in inner vertical mode in a footnote, although an - % @itemize looks awful there. - }% + \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } @@ -4360,22 +3890,18 @@ end % multitable-only commands. % -% @headitem starts a heading row, which we typeset in bold. Assignments -% have to be global since we are inside the implicit group of an -% alignment entry. \everycr below resets \everytab so we don't have to +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr - \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % -% default for tables with no headings. -\let\headitemcrhook=\relax -% % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. @@ -4406,15 +3932,15 @@ end % \everycr = {% \noalign{% - \global\everytab={}% Reset from possible headitem. + \global\everytab={}% \global\colcount=0 % Reset the column counter. - % - % Check for saved footnotes, etc.: + % Check for saved footnotes, etc. \checkinserts - % - % Perhaps a \nobreak, then reset: - \headitemcrhook - \global\let\headitemcrhook=\relax + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. }% }% % @@ -4653,7 +4179,7 @@ end \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\-=\active \catcode`\_=\active + \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue @@ -4666,6 +4192,14 @@ end } } +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% @@ -4675,36 +4209,10 @@ end \fi } -% Like \expandablevalue, but completely expandable (the \message in the -% definition above operates at the execution level of TeX). Used when -% writing to auxiliary files, due to the expansion that \write does. -% If flag is undefined, pass through an unexpanded @value command: maybe it -% will be set by the time it is read back in. -% -% NB flag names containing - or _ may not work here. -\def\dummyvalue#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \string\value{#1}% - \else - \csname SET#1\endcsname - \fi -} - -% Used for @value's in index entries to form the sort key: expand the @value -% if possible, otherwise sort late. -\def\indexnofontsvalue#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - ZZZZZZZ% - \else - \csname SET#1\endcsname - \fi -} - % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % -% To get the special treatment we need for `@end ifset,' we call -% \makecond and then redefine. +% To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} @@ -4735,7 +4243,7 @@ end % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. -% +% \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % @@ -4775,16 +4283,19 @@ end % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} -% \newindex {foo} defines an index named IX. -% It automatically defines \IXindex such that -% \IXindex ...rest of line... puts an entry in the index IX. -% It also defines \IXindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is IX. +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% - \expandafter\chardef\csname#1indfile\endcsname=0 + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } @@ -4798,19 +4309,14 @@ end \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% - \expandafter\chardef\csname#1indfile\endcsname=0 + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } -% The default indices: -\newindex{cp}% concepts, -\newcodeindex{fn}% functions, -\newcodeindex{vr}% variables, -\newcodeindex{tp}% types, -\newcodeindex{ky}% keys -\newcodeindex{pg}% and programs. - % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. @@ -4824,7 +4330,14 @@ end % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% - \requireopenindexfile{#3}% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \relax + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname donesynindex#2\endcsname = 1 + \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp @@ -4832,57 +4345,108 @@ end \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } -% Define \doindex, the driver for all index macros. +% Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, -% and it is the two-letter name of the index. +% and it is "foo", the name of the index. -\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} -\def\doindexxxx #1{\doind{\indexname}{#1}} +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} -\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} - -% Used for the aux, toc and index files to prevent expansion of Texinfo -% commands. +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. % -\def\atdummies{% - \definedummyletter\@% - \definedummyletter\ % - \definedummyletter\{% - \definedummyletter\}% - \definedummyletter\&% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these unexpandable (because we define \tt as a dummy) + % definitions when @{ or @} appear in index entry text. Also, more + % complicated, when \tex is in effect and \{ is a \delimiter again. + % We can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. Perhaps we + % should define @lbrace and @rbrace commands a la @comma. + \def\{{{\tt\char123}}% + \def\}{{\tt\char125}}% + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty % % Do the redefinitions. - \definedummies + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies \otherbackslash } -% \definedummyword defines \#1 as \string\#1\space, thus effectively -% preventing its expansion. This is used only for control words, -% not control letters, because the \space would be incorrect for -% control characters, but is needed to separate the control word -% from whatever follows. +% Called from \indexdummies and \atdummies. % -% These can be used both for control words that take an argument and -% those that do not. If it is followed by {arg} in the input, then -% that will dutifully get written to the index (or wherever). -% -% For control letters, we have \definedummyletter, which omits the -% space. -% -\def\definedummyword #1{\def#1{\string#1\space}}% -\def\definedummyletter#1{\def#1{\string#1}}% -\let\definedummyaccent\definedummyletter - -% Called from \atdummies to prevent the expansion of commands. -% -\def\definedummies{% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter % - \let\commondummyword\definedummyword - \let\commondummyletter\definedummyletter - \let\commondummyaccent\definedummyaccent \commondummiesnofonts % \definedummyletter\_% @@ -4923,10 +4487,7 @@ end \definedummyword\TeX % % Assorted special characters. - \definedummyword\ampchar - \definedummyword\atchar \definedummyword\arrow - \definedummyword\backslashchar \definedummyword\bullet \definedummyword\comma \definedummyword\copyright @@ -4945,7 +4506,6 @@ end \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq - \definedummyword\mathopsup \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds @@ -4959,135 +4519,88 @@ end \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result - \definedummyword\sub - \definedummyword\sup \definedummyword\textdegree % - \definedummyword\subentry - % % We want to disable all macros so that they are not expanded by \write. \macrolist - \let\value\dummyvalue % \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable } -% \commondummiesnofonts: common to \definedummies and \indexnofonts. -% Define \commondummyletter, \commondummyaccent and \commondummyword before -% using. Used for accents, font commands, and various control letters. +% \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. - \commondummyletter\!% - \commondummyaccent\"% - \commondummyaccent\'% - \commondummyletter\*% - \commondummyaccent\,% - \commondummyletter\.% - \commondummyletter\/% - \commondummyletter\:% - \commondummyaccent\=% - \commondummyletter\?% - \commondummyaccent\^% - \commondummyaccent\`% - \commondummyaccent\~% - \commondummyword\u - \commondummyword\v - \commondummyword\H - \commondummyword\dotaccent - \commondummyword\ogonek - \commondummyword\ringaccent - \commondummyword\tieaccent - \commondummyword\ubaraccent - \commondummyword\udotaccent - \commondummyword\dotless + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless % % Texinfo font commands. - \commondummyword\b - \commondummyword\i - \commondummyword\r - \commondummyword\sansserif - \commondummyword\sc - \commondummyword\slanted - \commondummyword\t + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sansserif + \definedummyword\sc + \definedummyword\slanted + \definedummyword\t % % Commands that take arguments. - \commondummyword\abbr - \commondummyword\acronym - \commondummyword\anchor - \commondummyword\cite - \commondummyword\code - \commondummyword\command - \commondummyword\dfn - \commondummyword\dmn - \commondummyword\email - \commondummyword\emph - \commondummyword\env - \commondummyword\file - \commondummyword\image - \commondummyword\indicateurl - \commondummyword\inforef - \commondummyword\kbd - \commondummyword\key - \commondummyword\math - \commondummyword\option - \commondummyword\pxref - \commondummyword\ref - \commondummyword\samp - \commondummyword\strong - \commondummyword\tie - \commondummyword\U - \commondummyword\uref - \commondummyword\url - \commondummyword\var - \commondummyword\verb - \commondummyword\w - \commondummyword\xref + \definedummyword\abbr + \definedummyword\acronym + \definedummyword\anchor + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\dmn + \definedummyword\email + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\image + \definedummyword\indicateurl + \definedummyword\inforef + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref } -\let\indexlbrace\relax -\let\indexrbrace\relax -\let\indexatchar\relax -\let\indexbackslash\relax - -{\catcode`\@=0 -\catcode`\\=13 - @gdef@backslashdisappear{@def\{}} -} - -{ -\catcode`\<=13 -\catcode`\-=13 -\catcode`\`=13 - \gdef\indexnonalnumdisappear{% - \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else - % @set txiindexlquoteignore makes us ignore left quotes in the sort term. - % (Introduced for FSFS 2nd ed.) - \let`=\empty - \fi - % - \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else - \backslashdisappear - \fi - % - \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else - \def-{}% - \fi - \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else - \def<{}% - \fi - \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else - \def\@{}% - \fi - } - - \gdef\indexnonalnumreappear{% - \let-\normaldash - \let<\normalless - } -} - - % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string @@ -5095,11 +4608,12 @@ end % \def\indexnofonts{% % Accent commands should become @asis. - \def\commondummyaccent##1{\let##1\asis}% + \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. - \def\commondummyletter##1{\let##1\empty}% + \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. - \let\commondummyword\commondummyaccent + \let\definedummyword\definedummyaccent + % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command @@ -5112,10 +4626,14 @@ end \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % - \uccode`\1=`\{ \uppercase{\def\{{1}}% - \uccode`\1=`\} \uppercase{\def\}{1}}% - \let\lbracechar\{% - \let\rbracechar\}% + % Unfortunately, texindex is not prepared to handle braces in the + % content at all. So for index sorting, we map @{ and @} to strings + % starting with |, since that ASCII character is between ASCII { and }. + \def\{{|a}% + \def\lbracechar{|a}% + % + \def\}{|b}% + \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% @@ -5124,7 +4642,7 @@ end \def\L{L}% \def\OE{OE}% \def\O{O}% - \def\TH{TH}% + \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% @@ -5136,45 +4654,45 @@ end \def\o{o}% \def\questiondown{?}% \def\ss{ss}% - \def\th{th}% + \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % - % Assorted special characters. \defglyph gives the control sequence a - % definition that removes the {} that follows its use. - \defglyph\atchar{@}% - \defglyph\arrow{->}% - \defglyph\bullet{bullet}% - \defglyph\comma{,}% - \defglyph\copyright{copyright}% - \defglyph\dots{...}% - \defglyph\enddots{...}% - \defglyph\equiv{==}% - \defglyph\error{error}% - \defglyph\euro{euro}% - \defglyph\expansion{==>}% - \defglyph\geq{>=}% - \defglyph\guillemetleft{<<}% - \defglyph\guillemetright{>>}% - \defglyph\guilsinglleft{<}% - \defglyph\guilsinglright{>}% - \defglyph\leq{<=}% - \defglyph\lbracechar{\{}% - \defglyph\minus{-}% - \defglyph\point{.}% - \defglyph\pounds{pounds}% - \defglyph\print{-|}% - \defglyph\quotedblbase{"}% - \defglyph\quotedblleft{"}% - \defglyph\quotedblright{"}% - \defglyph\quoteleft{`}% - \defglyph\quoteright{'}% - \defglyph\quotesinglbase{,}% - \defglyph\rbracechar{\}}% - \defglyph\registeredsymbol{R}% - \defglyph\result{=>}% - \defglyph\textdegree{o}% + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\arrow{->}% + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\geq{>=}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\leq{<=}% + \def\minus{-}% + \def\point{.}% + \def\pounds{pounds}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\registeredsymbol{R}% + \def\result{=>}% + \def\textdegree{o}% + % + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax + \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. @@ -5187,200 +4705,75 @@ end % goes to end-of-line is not handled. % \macrolist - \let\value\indexnofontsvalue } -\def\defglyph#1#2{\def#1##1{#2}} % see above - +% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us +% ignore left quotes in the sort term. +{\catcode`\`=\active + \gdef\indexlquoteignore{\let`=\empty}} +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? +% Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. -\def\doind#1#2{% +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% \iflinks {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi % - \requireopenindexfile{#1}% \edef\writeto{\csname#1indfile\endcsname}% % - \def\indextext{#2}% - \safewhatsit\doindwrite + \safewhatsit\dosubindwrite }% \fi } -% Check if an index file has been opened, and if not, open it. -\def\requireopenindexfile#1{% -\ifnum\csname #1indfile\endcsname=0 - \expandafter\newwrite \csname#1indfile\endcsname - \edef\suffix{#1}% - % A .fls suffix would conflict with the file extension for the output - % of -recorder, so use .f1s instead. - \ifx\suffix\indexisfl\def\suffix{f1}\fi - % Open the file - \immediate\openout\csname#1indfile\endcsname \jobname.\suffix - % Using \immediate above here prevents an object entering into the current - % box, which could confound checks such as those in \safewhatsit for - % preceding skips. - \typeout{Writing index file \jobname.\suffix}% -\fi} -\def\indexisfl{fl} - -% Definition for writing index entry sort key. -{ -\catcode`\-=13 -\gdef\indexwritesortas{% - \begingroup - \indexnonalnumreappear - \indexwritesortasxxx} -\gdef\indexwritesortasxxx#1{% - \xdef\indexsortkey{#1}\endgroup} -} - -\def\indexwriteseealso#1{ - \gdef\pagenumbertext{\string\seealso{#1}}% -} -\def\indexwriteseeentry#1{ - \gdef\pagenumbertext{\string\seeentry{#1}}% -} - -% The default definitions -\def\sortas#1{}% -\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only -\def\putwordSeeAlso{See also} -\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only - - -% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": -% * Set \bracedtext to "{aaa}{bbb}" -% * Set \fullindexsortkey to "aaa @subentry ZZZ" -% * If @seealso occurs, set \pagenumbertext +% Write the entry in \toks0 to the index file: % -\def\splitindexentry#1{% - \gdef\fullindexsortkey{}% - \xdef\bracedtext{}% - \def\sep{}% - \def\seealso##1{}% - \def\seeentry##1{}% - \expandafter\doindexsegment#1\subentry\finish\subentry -} - -% append the results from the next segment -\def\doindexsegment#1\subentry{% - \def\segment{#1}% - \ifx\segment\isfinish - \else - % - % Fully expand the segment, throwing away any @sortas directives, and - % trim spaces. - \edef\trimmed{\segment}% - \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% - % - \xdef\bracedtext{\bracedtext{\trimmed}}% - % - % Get the string to sort by. Process the segment with all - % font commands turned off. - \bgroup - \let\sortas\indexwritesortas - \let\seealso\indexwriteseealso - \let\seeentry\indexwriteseeentry - \indexnofonts - % The braces around the commands are recognized by texindex. - \def\lbracechar{{\string\indexlbrace}}% - \def\rbracechar{{\string\indexrbrace}}% - \let\{=\lbracechar - \let\}=\rbracechar - \def\@{{\string\indexatchar}}% - \def\atchar##1{\@}% - \def\backslashchar{{\string\indexbackslash}}% - \uccode`\~=`\\ \uppercase{\let~\backslashchar}% - % - \let\indexsortkey\empty - \global\let\pagenumbertext\empty - % Execute the segment and throw away the typeset output. This executes - % any @sortas or @seealso commands in this segment. - \setbox\dummybox = \hbox{\segment}% - \ifx\indexsortkey\empty{% - \indexnonalnumdisappear - \xdef\trimmed{\segment}% - \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% - \xdef\indexsortkey{\trimmed}% - \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi - }\fi - % - % Append to \fullindexsortkey. - \edef\tmp{\gdef\noexpand\fullindexsortkey{% - \fullindexsortkey\sep\indexsortkey}}% - \tmp - \egroup - \def\sep{\subentry}% - % - \expandafter\doindexsegment - \fi -} -\def\isfinish{\finish}% -\newbox\dummybox % used above - -\let\subentry\relax - -% Use \ instead of @ in index files. To support old texi2dvi and texindex. -% This works without changing the escape character used in the toc or aux -% files because the index entries are fully expanded here, and \string uses -% the current value of \escapechar. -\def\escapeisbackslash{\escapechar=`\\} - -% Use \ in index files by default. texi2dvi didn't support @ as the escape -% character (as it checked for "\entry" in the files, and not "@entry"). When -% the new version of texi2dvi has had a chance to become more prevalent, then -% the escape character can change back to @ again. This should be an easy -% change to make now because both @ and \ are only used as escape characters in -% index files, never standing for themselves. -% -\set txiindexescapeisbackslash - -% Write the entry in \indextext to the index file. -% -\def\doindwrite{% - \maybemarginindex - % - \atdummies - % - \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else - \escapeisbackslash +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % - % For texindex which always views { and } as separators. - \def\{{\lbracechar{}}% - \def\}{\rbracechar{}}% - \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. % - % Split the entry into primary entry and any subentries, and get the index - % sort key. - \splitindexentry\indextext + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. - % \edef\temp{% \write\writeto{% - \string\entry{\fullindexsortkey}% - {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% - \bracedtext}% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } -% Put the index entry in the margin if desired (undocumented). -\def\maybemarginindex{% - \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% - \fi -} -\let\SETmarginindex=\relax - - % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it @@ -5467,14 +4860,9 @@ end % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} -% \entry {topic}{} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. -% \secondary {subtopic}{} -% for a subtopic with sub-subtopics -% \tertiary {subtopic}{subsubtopic}{pagelist} -% for each sub-subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. @@ -5486,6 +4874,11 @@ end \def\tindex {\tpindex} \def\pindex {\pgindex} +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. @@ -5499,123 +4892,57 @@ end \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % - % See comment in \requireopenindexfile. - \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi - % % See if the index file exists and is nonempty. - \openin 1 \jobname.\indexname s + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent - \typeout{No file \jobname.\indexname s.}% \else + % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. - \read 1 to \thisline + \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else - \expandafter\printindexzz\thisline\relax\relax\finish% + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns \fi \fi \closein 1 \endgroup} -% If the index file starts with a backslash, forgo reading the index -% file altogether. If somebody upgrades texinfo.tex they may still have -% old index files using \ as the escape character. Reading this would -% at best lead to typesetting garbage, at worst a TeX syntax error. -\def\printindexzz#1#2\finish{% - \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax - \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 - \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax -\errmessage{% -ERROR: A sorted index file in an obsolete format was skipped. -To fix this problem, please upgrade your version of 'texi2dvi' -or 'texi2pdf' to that at . -If you are using an old version of 'texindex' (part of the Texinfo -distribution), you may also need to upgrade to a newer version (at least 6.0). -You may be able to typeset the index if you run -'texindex \jobname.\indexname' yourself. -You could also try setting the 'txiindexescapeisbackslash' flag by -running a command like -'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do -this, Texinfo will try to use index files in the old format. -If you continue to have problems, deleting the index files and starting again -might help (with 'rm \jobname.?? \jobname.??s')% -}% - \else - (Skipped sorted index file in obsolete format) - \fi - \else - \begindoublecolumns - \input \jobname.\indexname s - \enddoublecolumns - \fi - \else - \begindoublecolumns - \catcode`\\=0\relax - \catcode`\@=12\relax - \input \jobname.\indexname s - \enddoublecolumns - \fi -} - % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 -\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 -\catcode`\$=3 -\gdef\initialglyphs{% - % special control sequences used in the index sort key - \let\indexlbrace\{% - \let\indexrbrace\}% - \let\indexatchar\@% - \def\indexbackslash{\math{\backslash}}% +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % - % Some changes for non-alphabetic characters. Using the glyphs from the - % math fonts looks more consistent than the typewriter font used elsewhere - % for these characters. - \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} - % - % In case @\ is used for backslash - \uppercase{\let\\=~} - % Can't get bold backslash so don't use bold forward slash - \catcode`\/=13 - \def/{{\secrmnotbold \normalslash}}% - \def-{{\normaldash\normaldash}}% en dash `--' - \def^{{\chapbf \normalcaret}}% - \def~{{\chapbf \normaltilde}}% - \def\_{% - \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% - \def|{$\vert$}% - \def<{$\less$}% - \def>{$\gtr$}% - \def+{$\normalplus$}% -}} - -\def\initial{% - \bgroup - \initialglyphs - \initialx -} - -\def\initialx#1{% % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. - % The glue before the bonus allows a little bit of space at the - % bottom of a column to reduce an increase in inter-line spacing. \nobreak - \vskip 0pt plus 5\baselineskip - \penalty -300 - \vskip 0pt plus -5\baselineskip + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -5623,24 +4950,24 @@ might help (with 'rm \jobname.?? \jobname.??s')% % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. - \vskip 1.67\baselineskip plus 1\baselineskip - \leftline{\secfonts \kern-0.05em \secbf #1}% - % \secfonts is inside the argument of \leftline so that the change of - % \baselineskip will not affect any glue inserted before the vbox that - % \leftline creates. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip - \egroup % \initialglyphs -} - -\newdimen\entryrightmargin -\entryrightmargin=0pt +}} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 \def\entry{% \begingroup % @@ -5648,14 +4975,38 @@ might help (with 'rm \jobname.?? \jobname.??s')% % affect previous text. \par % + % Do not fill out the last line with white space. + \parfillskip = 0in + % % No extra space above this paragraph. \parskip = 0in % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% - \def\entrybreak{\hfil\break}% An undocumented command + \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry @@ -5663,148 +5014,85 @@ might help (with 'rm \jobname.?? \jobname.??s')% } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% - % Save the text of the entry - \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. - % Not absorbing as a macro argument reduces the chance of problems - % with catcodes occurring. } -{\catcode`\@=11 -\gdef\finishentry#1{% - \egroup % end box A - \dimen@ = \wd\boxA % Length of text of entry - \global\setbox\boxA=\hbox\bgroup - \unhbox\boxA - % #1 is the page number. +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else % - % Get the width of the page numbers, and only use - % leaders if they are present. - \global\setbox\boxB = \hbox{#1}% - \ifdim\wd\boxB = 0pt - \null\nobreak\hfill\ % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA \else - % - \null\nobreak\indexdotfill % Have leaders before the page number. - % - \ifpdforxetex - \pdfgettoks#1.% - \hskip\skip\thinshrinkable\the\toksA - \else - \hskip\skip\thinshrinkable #1% - \fi + \ #1% \fi - \egroup % end \boxA - \ifdim\wd\boxB = 0pt - \noindent\unhbox\boxA\par - \nobreak - \else\bgroup - % We want the text of the entries to be aligned to the left, and the - % page numbers to be aligned to the right. - % - \parindent = 0pt - \advance\leftskip by 0pt plus 1fil - \advance\leftskip by 0pt plus -1fill - \rightskip = 0pt plus -1fil - \advance\rightskip by 0pt plus 1fill - % Cause last line, which could consist of page numbers on their own - % if the list of page numbers is long, to be aligned to the right. - \parfillskip=0pt plus -1fill - % - \advance\rightskip by \entryrightmargin - % Determine how far we can stretch into the margin. - % This allows, e.g., "Appendix H GNU Free Documentation License" to - % fit on one line in @letterpaper format. - \ifdim\entryrightmargin>2.1em - \dimen@i=2.1em - \else - \dimen@i=0em - \fi - \advance \parfillskip by 0pt minus 1\dimen@i - % - \dimen@ii = \hsize - \advance\dimen@ii by -1\leftskip - \advance\dimen@ii by -1\entryrightmargin - \advance\dimen@ii by 1\dimen@i - \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line - \ifdim\dimen@ > 0.8\dimen@ii % due to long index text - % Try to split the text roughly evenly. \dimen@ will be the length of - % the first line. - \dimen@ = 0.7\dimen@ - \dimen@ii = \hsize - \ifnum\dimen@>\dimen@ii - % If the entry is too long (for example, if it needs more than - % two lines), use all the space in the first line. - \dimen@ = \dimen@ii - \fi - \advance\leftskip by 0pt plus 1fill % ragged right - \advance \dimen@ by 1\rightskip - \parshape = 2 0pt \dimen@ 0em \dimen@ii - % Ideally we'd add a finite glue at the end of the first line only, - % instead of using \parshape with explicit line lengths, but TeX - % doesn't seem to provide a way to do such a thing. - % - % Indent all lines but the first one. - \advance\leftskip by 1em - \advance\parindent by -1em - \fi\fi - \indent % start paragraph - \unhbox\boxA - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % Word spacing - no stretch - \spaceskip=\fontdimen2\font minus \fontdimen4\font - % - \linepenalty=1000 % Discourage line breaks. - \hyphenpenalty=5000 % Discourage hyphenation. - % - \par % format the paragraph - \egroup % The \vbox \fi + \par \endgroup -}} - -\newskip\thinshrinkable -\skip\thinshrinkable=.15em minus .15em +} % Like plain.tex's \dotfill, except uses up at least 1 em. -% The filll stretch here overpowers both the fil and fill stretch to push -% the page number to the right. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} - + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} -\def\secondary{\indententry{0.5cm}} -\def\tertiary{\indententry{1cm}} - -\def\indententry#1#2#3{% - \bgroup - \leftskip=#1 - \entry{#2}{#3}% - \egroup -} +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 % private names +\catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns - % If not much space left on page, start a new page. - \ifdim\pagetotal>0.8\vsize\vfill\eject\fi - % % Grab any single-column material above us. \output = {% - \savetopmark + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. @@ -5838,31 +5126,27 @@ might help (with 'rm \jobname.?? \jobname.??s')% \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % - % Get the available space for the double columns -- the normal - % (undoubled) page height minus any material left over from the - % previous page. - \advance\vsize by -\ht\partialpage + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) \vsize = 2\vsize - % - % For the benefit of balancing columns - \advance\baselineskip by 0pt plus 0.5pt } % The double-column output routine for all double-column pages except -% the last, which is done by \balancecolumns. +% the last. % \def\doublecolumnout{% - % - \savetopmark \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. \dimen@ = \vsize \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. - \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ - \global\advance\vsize by 2\ht\partialpage - \onepageout\pagesofar % empty except for the first time we are called - \unvbox\PAGE + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 \penalty\outputpenalty } % @@ -5873,11 +5157,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize - \hbox to\txipagewidth{\box0\hfil\box2}% + \hbox to\pagewidth{\box0\hfil\box2}% } - - -% Finished with double columns. +% +% All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the @@ -5900,7 +5183,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns - % and the final section into the vbox of \txipageheight (see + % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the @@ -5908,88 +5191,53 @@ might help (with 'rm \jobname.?? \jobname.??s')% \penalty0 % \output = {% - % Split the last of the double-column material. - \savetopmark + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. \balancecolumns - }% - \eject % call the \output just set - \ifdim\pagetotal=0pt - % Having called \balancecolumns once, we do not + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal - % definition right away. - \global\output=\expandafter{\the\defaultoutput} - % - \endgroup % started in \begindoublecolumns - % Leave the double-column material on the current page, no automatic - % page break. - \box\balancedcolumns - % - % \pagegoal was set to the doubled \vsize above, since we restarted - % the current page. We're now back to normal single-column - % typesetting, so reset \pagegoal to the normal \vsize. - \global\vsize = \txipageheight % - \pagegoal = \txipageheight % - \else - % We had some left-over material. This might happen when \doublecolumnout - % is called in \balancecolumns. Try again. - \expandafter\enddoublecolumns - \fi -} -\newbox\balancedcolumns -\setbox\balancedcolumns=\vbox{shouldnt see this}% -% -% Only called for the last of the double column material. \doublecolumnout -% does the others. -\def\balancecolumns{% - \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. - \dimen@ = \ht0 - \ifdim\dimen@<7\baselineskip - % Don't split a short final column in two. - \setbox2=\vbox{}% - \global\setbox\balancedcolumns=\vbox{\pagesofar}% - \else - % double the leading vertical space - \advance\dimen@ by \topskip - \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - \dimen@ii = \dimen@ - \splittopskip = \topskip - % Loop until left column is at least as high as the right column. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht1<\ht3 - \global\advance\dimen@ by 1pt - \repeat - }% - % Now the left column is in box 1, and the right column in box 3. - % - % Check whether the left column has come out higher than the page itself. - % (Note that we have doubled \vsize for the double columns, so - % the actual height of the page is 0.5\vsize). - \ifdim2\ht1>\vsize - % It appears that we have been called upon to balance too much material. - % Output some of it with \doublecolumnout, leaving the rest on the page. - \setbox\PAGE=\box0 - \doublecolumnout - \else - % Compare the heights of the two columns. - \ifdim4\ht1>5\ht3 - % Column heights are too different, so don't make their bottoms - % flush with each other. - \setbox2=\vbox to \ht1 {\unvbox3\vfill}% - \setbox0=\vbox to \ht1 {\unvbox1\vfill}% - \else - % Make column bottoms flush with each other. - \setbox2=\vbox to\ht1{\unvbox3\unskip}% - \setbox0=\vbox to\ht1{\unvbox1\unskip}% - \fi - \global\setbox\balancedcolumns=\vbox{\pagesofar}% - \fi - \fi + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar } \catcode`\@ = \other @@ -6004,14 +5252,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \null \vskip.3\vsize % move it down on the page a bit \begingroup - \noindent \titlefonts\rm #1\par % the text + \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page - % This outputs a mark at the end of the page that clears \thischapter - % and \thissection, as is done in \startcontents. - \let\pchapsepmacro\relax - \chapmacro{}{Yomitfromtoc}{}% \chapoddpage \endgroup } @@ -6085,9 +5329,11 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 @@ -6254,6 +5500,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax @@ -6263,7 +5512,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\top\unnumbered % Sections. -% +% \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 @@ -6286,7 +5535,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% } % Subsections. -% +% % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% @@ -6311,7 +5560,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% } % Subsubsections. -% +% % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% @@ -6377,11 +5626,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} - -% Start a new page \def\chappager{\par\vfill\supereject} - -% \chapoddpage - start on an odd page for a new chapter % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. @@ -6396,7 +5641,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi } -\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager @@ -6417,37 +5662,33 @@ might help (with 'rm \jobname.?? \jobname.??s')% \CHAPPAGon -% \chapmacro - Chapter opening. +% Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. -% Not used for @heading series. % % To test against our argument. \def\Ynothingkeyword{Ynothing} -\def\Yappendixkeyword{Yappendix} \def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% - \expandafter\ifx\thisenv\titlepage\else - \checkenv{}% chapters, etc., should not start inside an environment. - \fi % Insert the first mark before the heading break (see notes for \domark). - \let\prevchapterdefs=\currentchapterdefs - \let\prevsectiondefs=\currentsectiondefs - \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword - \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword - \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% - \xdef\currentchapterdefs{% + \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible @@ -6458,7 +5699,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% }% \else \toks0={#1}% - \xdef\currentchapterdefs{% + \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible @@ -6478,18 +5719,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Now the second mark, after the heading break. No break points % between here and the heading. - \let\prevchapterdefs=\currentchapterdefs - \let\prevsectiondefs=\currentsectiondefs + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs \domark % {% - \chapfonts \rm - \let\footnote=\errfootnoteheading % give better error message + \chapfonts \rmisbold % - % Have to define \currentsection before calling \donoderef, because the + % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. - \gdef\currentsection{#1}% + \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. @@ -6537,6 +5777,30 @@ might help (with 'rm \jobname.?? \jobname.??s')% } +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % @@ -6554,34 +5818,27 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Print any size, any type, section title. % -% #1 is the text of the title, -% #2 is the section level (sec/subsec/subsubsec), -% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), -% #4 is the section number. +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% + \checkenv{}% should not be in an environment. + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rmisbold + % \def\sectionlevel{#2}% \def\temptype{#3}% % - % It is ok for the @heading series commands to appear inside an - % environment (it's been historically allowed, though the logic is - % dubious), but not the others. - \ifx\temptype\Yomitfromtockeyword\else - \checkenv{}% non-@*heading should not be in an environment. - \fi - \let\footnote=\errfootnoteheading - % - % Switch to the right set of fonts. - \csname #2fonts\endcsname \rm - % % Insert first mark before the heading break (see notes for \domark). - \let\prevsectiondefs=\currentsectiondefs + \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword - \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword @@ -6589,7 +5846,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% - \xdef\currentsectiondefs{% + \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible @@ -6602,7 +5859,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \else \ifx\sectionlevel\seckeyword \toks0={#1}% - \xdef\currentsectiondefs{% + \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible @@ -6628,28 +5885,28 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Now the second mark, after the heading break. No break points % between here and the heading. - \global\let\prevsectiondefs=\currentsectiondefs + \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% - \gdef\currentsection{#1}% + \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, - % and don't redefine \currentsection. + % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% - \gdef\currentsection{#1}% + \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% - \gdef\currentsection{#1}% + \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. @@ -6739,9 +5996,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. - \ifpdforxetex - \global\pdfmakepagedesttrue - \fi + \ifpdf \global\pdfmakepagedesttrue \fi } @@ -6790,7 +6045,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. - \entryrightmargin=\contentsrightmargin % Don't use the full line length. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi @@ -6884,15 +6139,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} -\def\partentry#1#2#3#4{% - % Add stretch and a bonus for breaking the page before the part heading. - % This reduces the chance of the page being broken immediately after the - % part heading, before a following chapter heading. - \vskip 0pt plus 5\baselineskip - \penalty-300 - \vskip 0pt plus -5\baselineskip - \dochapentry{\numeralbox\labelspace#1}{}% -} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% @@ -6903,7 +6150,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} - +% % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% @@ -6918,7 +6165,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} @@ -6951,8 +6198,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup - % Move the page numbers slightly to the right - \advance\entryrightmargin by -0.05em \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup @@ -7007,14 +6252,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other - \catcode `\`=\other - \catcode `\'=\other + \catcode`\`=\other + \catcode`\'=\other + \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % - % Inverse of the list at the beginning of the file. \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc @@ -7030,11 +6275,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash - \let\sp=\ptexsp \let\*=\ptexstar - %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode \let\t=\ptext - \expandafter \let\csname top\endcsname=\ptextop % we've made it outer + \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% @@ -7064,24 +6307,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% - % =10000 instead of <10000 because of a special case in \itemzzz and - % \sectionheading, q.v. - \ifnum \lastpenalty=10000 \else - \advance\envskipamount by \parskip - \endgraf - \ifdim\lastskip<\envskipamount - \removelastskip - \ifnum\lastpenalty<10000 - % Penalize breaking before the environment, because preceding text - % often leads into it. - \penalty100 - \fi - \vskip\envskipamount - \fi - \fi -}} - -\def\afterenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else @@ -7097,13 +6322,19 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi }} +\let\afterenvbreak = \aboveenvbreak + % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. - +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} @@ -7118,18 +6349,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \newskip\lskip\newskip\rskip -% only require the font if @cartouche is actually used -\def\cartouchefontdefs{% - \font\circle=lcircle10\relax - \circthick=\fontdimen8\circle -} -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip - - \envdef\cartouche{% - \cartouchefontdefs \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip @@ -7141,13 +6361,15 @@ might help (with 'rm \jobname.?? \jobname.??s')% % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % - \setbox\groupbox=\vbox\bgroup + \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup @@ -7171,7 +6393,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \egroup \cartbot \egroup - \addgroupbox \checkinserts } @@ -7181,7 +6402,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak - \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy + \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output @@ -7310,7 +6531,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% - \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par @@ -7369,7 +6590,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. -% +% \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% @@ -7472,7 +6693,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would - % never \starttabbox and the \egroup would end verbatim mode. + % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% @@ -7535,12 +6756,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% {% \makevalueexpandable \setupverbatim - {% - \indexnofonts % Allow `@@' and other weird things in file names. - \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% - \edef\tmp{\noexpand\input #1 } - \expandafter - }\tmp + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 \afterenvbreak }% } @@ -7553,7 +6771,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as -% possible is desirable. +% possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} @@ -7648,7 +6866,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \temp } -% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } +% \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. @@ -7669,7 +6887,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. -% +% \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword @@ -7685,21 +6903,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi\fi } -% \dosubind {index}{topic}{subtopic} -% -% If SUBTOPIC is present, precede it with a space, and call \doind. -% (At some time during the 20th century, this made a two-level entry in an -% index such as the operation index. Nobody seemed to notice the change in -% behaviour though.) -\def\dosubind#1#2#3{% - \def\thirdarg{#3}% - \ifx\thirdarg\empty - \doind{#1}{#2}% - \else - \doind{#1}{#2\space#3}% - \fi -} - % Untyped functions: % @deffn category name args @@ -7714,6 +6917,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } @@ -7864,14 +7068,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: - \hfil\vadjust{\nobreak}\break + \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% - {\rm\enskip}% hskip 0.5 em of \rmfont + {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. @@ -7920,7 +7124,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } -\let\ampchar\& \newcount\parencount @@ -8001,23 +7204,34 @@ might help (with 'rm \jobname.?? \jobname.??s')% } \fi -% Used at the time of macro expansion. -% Argument is macro body with arguments substituted -\def\scanmacro#1{% +\def\scanmacro#1{\begingroup \newlinechar`\^^M - \def\xeatspaces{\eatspaces}% + \let\xeatspaces\eatspaces % - % Process the macro body under the current catcode regime. - \scantokens{#1@comment}% + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % - % The \comment is to remove the \newlinechar added by \scantokens, and - % can be noticed by \parsearg. Note \c isn't used because this means cedilla - % in math mode. -} + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten as + % part of reading whitespace after a control sequence. It does not + % eat a catcode 13 newline. There's no good way to handle the two + % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX + % would then have different behavior). See the Macro Details node in + % the manual for the workaround we recommend for macros and + % line-oriented commands. + % + \scantokens{#1\empty}% +\endgroup} -% Used for copying and captions \def\scanexp#1{% - \expandafter\scanmacro\expandafter{#1}% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp } \newcount\paramno % Count of parameters @@ -8025,7 +7239,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newif\ifrecursive % Is it recursive? % List of all defined macros in the form -% \commondummyword\macro1\commondummyword\macro2... +% \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} @@ -8033,7 +7247,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% - \toks0 = \expandafter{\macrolist\commondummyword#1}% + \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } @@ -8083,47 +7297,48 @@ might help (with 'rm \jobname.?? \jobname.??s')% \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other + \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other - \passthroughcharstrue + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt - \catcode`\@=\other \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt - \catcode`\ =\other - \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } -% Used when scanning braced macro arguments. Note, however, that catcode -% changes here are ineffectual if the macro invocation was nested inside -% an argument to another Texinfo command. -\def\macroargctxt{% +\def\macroargctxt{% used when scanning invocations \scanctxt - \catcode`\ =\active - \catcode`\@=\other - \catcode`\^^M=\other - \catcode`\\=\active + \catcode`\\=0 } +% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" +% for the single characters \ { }. Thus, we end up with the "commands" +% that would be written @\ @{ @} in a Texinfo document. +% +% We already have @{ and @}. For @\, we define it here, and only for +% this purpose, to produce a typewriter backslash (so, the @\ that we +% define for @math can't be used with @macro calls): +% +\def\\{\normalbackslash}% +% +% We would like to do this for \, too, since that is what makeinfo does. +% But it is not possible, because Texinfo already has a command @, for a +% cedilla accent. Documents must use @comma{} instead. +% +% \anythingelse will almost certainly be an error of some kind. -\def\macrolineargctxt{% used for whole-line arguments without braces - \scanctxt - \catcode`\@=\other - \catcode`\{=\other - \catcode`\}=\other -} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -8176,7 +7391,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax - \let\commondummyword\unmacrodo + \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else @@ -8191,40 +7406,61 @@ might help (with 'rm \jobname.?? \jobname.??s')% \ifx #1\relax % remove this \else - \noexpand\commondummyword \noexpand#1% + \noexpand\definedummyword \noexpand#1% \fi } -% \getargs -- Parse the arguments to a @macro line. Set \macname to -% the name of the macro, and \argl to the braced argument list. +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} -% This made use of the feature that if the last token of a -% is #, then the preceding argument is delimited by -% an opening brace, and that opening brace is not consumed. -% Parse the optional {params} list to @macro or @rmacro. -% Set \paramno to the number of arguments, -% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a -% three-param macro.) Define \macarg.BLAH for each BLAH in the params -% list to some hook where the argument is to be expanded. If there are -% less than 10 arguments that hook is to be replaced by ##N where N +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument si to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be -% defined `a la TeX in the macro body. +% defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % -% If there are 10 or more arguments, a different technique is used: see -% \parsemmanyargdef. +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. % +% The same technique is used to protect \eatspaces till just before +% the macro is used. +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, you need that no macro has more than 256 arguments, otherwise an +% error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax - % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments @@ -8239,46 +7475,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} -% \parsemacbody, \parsermacbody -% -% Read recursive and nonrecursive macro bodies. (They're different since -% rec and nonrec macros end differently.) -% -% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro -% body to be transformed. -% Set \macrobody to the body of the macro, and call \defmacro. -% -{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% -\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% -{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% -\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% - -% Make @ a letter, so that we can make private-to-Texinfo macro names. -\edef\texiatcatcode{\the\catcode`\@} -\catcode `@=11\relax - -%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% - -% If there are 10 or more arguments, a different technique is used, where the -% hook remains in the body, and when macro is to be expanded the body is -% processed again to replace the arguments. -% -% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the -% argument N value and then \edef the body (nothing else will expand because of -% the catcode regime under which the body was input). -% -% If you compile with TeX (not eTeX), and you have macros with 10 or more -% arguments, no macro can have more than 256 arguments (else error). -% -% In case that there are 10 or more arguments we parse again the arguments -% list to set new definitions for the \macarg.BLAH macros corresponding to -% each BLAH argument. It was anyhow needed to parse already once this list -% in order to count the arguments, and as macros with at most 9 arguments -% are by far more frequent than macro with 10 or more arguments, defining -% twice the \macarg.BLAH macros does not cost too much processing power. \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax - \else + \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa @@ -8291,6 +7490,16 @@ might help (with 'rm \jobname.?? \jobname.??s')% \advance\paramno by 1\relax \fi\next} +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) +% + +\catcode `\@\texiatcatcode +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax @@ -8298,7 +7507,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its -% definition. It gets all the arguments' values and assigns them to macros +% definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name @@ -8319,6 +7528,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% \getargvals@@ \fi } + +% \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. @@ -8362,8 +7573,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% } % Replace arguments by their values in the macro body, and place the result -% in macro \@tempa. -% +% in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument @@ -8387,9 +7597,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } -% Define the named-macro outside of this group and then close this group. -% -\def\macargexpandinbody@{% +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ @@ -8426,8 +7635,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% \next } -% Trailing missing arguments are set to empty. -% +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ @@ -8457,191 +7672,99 @@ might help (with 'rm \jobname.?? \jobname.??s')% \long\def#2{#4}% } - -%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% - - -% This defines a Texinfo @macro or @rmacro, called by \parsemacbody. -% \macrobody has the body of the macro in it, with placeholders for -% its parameters, looking like "\xeatspaces{\hash 1}". -% \paramno is the number of parameters -% \paramlist is a TeX parameter text, e.g. "#1,#2,#3," -% There are four cases: macros of zero, one, up to nine, and many arguments. +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. +% Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file -% they're defined in: @include reads the file inside a group. +% they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars - \ifnum\paramno=1 - \def\xeatspaces##1{##1}% - % This removes the pair of braces around the argument. We don't - % use \eatspaces, because this can cause ends of lines to be lost - % when the argument to \eatspaces is read, leading to line-based - % commands like "@itemize" not being read correctly. + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi \else - \let\xeatspaces\relax % suppress expansion - \fi - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup - \noexpand\spaceisspace - \noexpand\endlineisspace - \noexpand\expandafter % skip any whitespace after the macro name. - \expandafter\noexpand\csname\the\macname @@@\endcsname}% - \expandafter\xdef\csname\the\macname @@@\endcsname{% - \egroup - \noexpand\scanmacro{\macrobody}}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname @@@\endcsname}% - \expandafter\xdef\csname\the\macname @@@\endcsname##1{% - \egroup - \noexpand\scanmacro{\macrobody}% - }% - \else % at most 9 - \ifnum\paramno<10\relax - % @MACNAME sets the context for reading the macro argument - % @MACNAME@@ gets the argument, processes backslashes and appends a - % comma. - % @MACNAME@@@ removes braces surrounding the argument list. - % @MACNAME@@@@ scans the macro body with arguments substituted. + \ifcase\paramno + % 0 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup - \noexpand\expandafter % This \expandafter skip any spaces after the - \noexpand\macroargctxt % macro before we change the catcode of space. - \noexpand\expandafter - \expandafter\noexpand\csname\the\macname @@\endcsname}% - \expandafter\xdef\csname\the\macname @@\endcsname##1{% - \noexpand\passargtomacro - \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% - \expandafter\xdef\csname\the\macname @@@\endcsname##1{% - \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname @@@@\endcsname\paramlist{% - \egroup\noexpand\scanmacro{\macrobody}}% - \else % 10 or more: + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\getargvals@{\the\macname}{\argl}% - }% - \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody - \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi \fi \fi} -\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes +\catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape -@catcode`@_=11 % private names -@catcode`@!=11 % used as argument separator - -% \passargtomacro#1#2 - -% Call #1 with a list of tokens #2, with any doubled backslashes in #2 -% compressed to one. -% -% This implementation works by expansion, and not execution (so we cannot use -% \def or similar). This reduces the risk of this failing in contexts where -% complete expansion is done with no execution (for example, in writing out to -% an auxiliary file for an index entry). -% -% State is kept in the input stream: the argument passed to -% @look_ahead, @gobble_and_check_finish and @add_segment is -% -% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) -% -% where: -% THE_MACRO - name of the macro we want to call -% ARG_RESULT - argument list we build to pass to that macro -% PENDING_BS - either a backslash or nothing -% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next - -@gdef@passargtomacro#1#2{% - @add_segment #1!{}@relax#2\@_finish\% -} -@gdef@_finish{@_finishx} @global@let@_finishx@relax - -% #1 - THE_MACRO ARG_RESULT -% #2 - PENDING_BS -% #3 - NEXT_TOKEN -% #4 used to look ahead -% -% If the next token is not a backslash, process the rest of the argument; -% otherwise, remove the next token. -@gdef@look_ahead#1!#2#3#4{% - @ifx#4\% - @expandafter@gobble_and_check_finish - @else - @expandafter@add_segment - @fi#1!{#2}#4#4% -} - -% #1 - THE_MACRO ARG_RESULT -% #2 - PENDING_BS -% #3 - NEXT_TOKEN -% #4 should be a backslash, which is gobbled. -% #5 looks ahead -% -% Double backslash found. Add a single backslash, and look ahead. -@gdef@gobble_and_check_finish#1!#2#3#4#5{% - @add_segment#1\!{}#5#5% -} - -@gdef@is_fi{@fi} - -% #1 - THE_MACRO ARG_RESULT -% #2 - PENDING_BS -% #3 - NEXT_TOKEN -% #4 is input stream until next backslash -% -% Input stream is either at the start of the argument, or just after a -% backslash sequence, either a lone backslash, or a doubled backslash. -% NEXT_TOKEN contains the first token in the input stream: if it is \finish, -% finish; otherwise, append to ARG_RESULT the segment of the argument up until -% the next backslash. PENDING_BACKSLASH contains a backslash to represent -% a backslash just before the start of the input stream that has not been -% added to ARG_RESULT. -@gdef@add_segment#1!#2#3#4\{% -@ifx#3@_finish - @call_the_macro#1!% -@else - % append the pending backslash to the result, followed by the next segment - @expandafter@is_fi@look_ahead#1#2#4!{\}@fi - % this @fi is discarded by @look_ahead. - % we can't get rid of it with \expandafter because we don't know how - % long #4 is. -} - -% #1 - THE_MACRO -% #2 - ARG_RESULT -% #3 discards the res of the conditional in @add_segment, and @is_fi ends the -% conditional. -@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} - -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% \braceorline MAC is used for a one-argument macro MAC. It checks -% whether the next non-whitespace character is a {. It sets the context -% for reading the argument (slightly different in the two cases). Then, -% to read the argument, in the whole-line case, it then calls the regular -% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. -% +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg). +% \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% - \ifx\nchar\bgroup - \macroargctxt - \expandafter\passargtomacro - \else - \macrolineargctxt\expandafter\parsearg + \ifx\nchar\bgroup\else + \expandafter\parsearg \fi \macnamexxx} @@ -8684,29 +7807,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} -\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} - -% Used so that the @top node doesn't have to be wrapped in an @ifnottex -% conditional. -% \doignore goes to more effort to skip nested conditionals but we don't need -% that here. -\def\omittopnode{% - \ifx\lastnode\wordTop - \expandafter\ignorenode\fi -} -\def\wordTop{Top} - -% Until the next @node or @bye command, divert output to a box that is not -% output. -\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}% -\ignorenodebye -} - -{\let\bye\relax -\gdef\ignorenodebye{\let\bye\ignorenodebyedef} -\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} -% The redefinition of \bye here is because it is declared \outer +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} +\let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the @@ -8729,7 +7832,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: -% 1) NAME-title - the current sectioning name taken from \currentsection, +% 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. @@ -8743,15 +7846,12 @@ might help (with 'rm \jobname.?? \jobname.??s')% \pdfmkdest{#1}% \iflinks {% - \requireauxfile \atdummies % preserve commands, but don't expand them - % match definition in \xrdef, \refx, \xrefX. - \def\value##1{##1}% \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% - \toks0 = \expandafter{\currentsection}% + \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout @@ -8763,7 +7863,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. -% +% \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword @@ -8779,18 +7879,15 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi\fi } -% +% % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % -\def\pxref{\putwordsee{} \xrefXX} -\def\xref{\putwordSee{} \xrefXX} -\def\ref{\xrefXX} - -\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} -\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox @@ -8837,10 +7934,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Make link in pdf output. \ifpdf - % For pdfTeX and LuaTeX {\indexnofonts - \makevalueexpandable \turnoffactive + \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. @@ -8848,74 +7944,35 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. - \setpdfdestname{#1}% - % - \ifx\pdfdestname\empty - \def\pdfdestname{Top}% no empty targets + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 - goto file{\the\filename.pdf} name{\pdfdestname}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% \else - goto name{\pdfmkpgn{\pdfdestname}}% + goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% - \else - \ifx\XeTeXrevision\thisisundefined - \else - % For XeTeX - {\indexnofonts - \makevalueexpandable - \turnoffactive - % This expands tokens, so do it after making catcode changes, so _ - % etc. don't get their TeX definitions. This ignores all spaces in - % #4, including (wrongly) those in the middle of the filename. - \getfilename{#4}% - % - % This (wrongly) does not take account of leading or trailing - % spaces in #1, which should be ignored. - \setpdfdestname{#1}% - % - \ifx\pdfdestname\empty - \def\pdfdestname{Top}% no empty targets - \fi - % - \leavevmode - \ifnum\filenamelength>0 - % With default settings, - % XeTeX (xdvipdfmx) replaces link destination names with integers. - % In this case, the replaced destination names of - % remote PDFs are no longer known. In order to avoid a replacement, - % you can use xdvipdfmx's command line option `-C 0x0010'. - % If you use XeTeX 0.99996+ (TeX Live 2016+), - % this command line option is no longer necessary - % because we can use the `dvipdfmx:config' special. - \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A - << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% - \else - \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A - << /S /GoTo /D (\pdfdestname) >> >>}% - \fi - }% - \setcolor{\linkcolor}% - \fi \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive - \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% - % - % Float references are printed completely differently: "Figure 1.2" - % instead of "[somenode], p.3". \iffloat distinguishes them by - % \Xthisreftitle being set to a magic string. \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". @@ -8932,34 +7989,40 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi \else % node/anchor (non-float) references. - % + % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. - % + % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. - % + % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. - % + % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % @@ -8968,35 +8031,26 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - % Add a , if xref followed by a space - \if\space\noexpand\tokenafterxref ,% - \else\ifx\ \tokenafterxref ,% @TAB - \else\ifx\*\tokenafterxref ,% @* - \else\ifx\ \tokenafterxref ,% @SPACE - \else\ifx\ - \tokenafterxref ,% @NL - \else\ifx\tie\tokenafterxref ,% @tie - \fi\fi\fi\fi\fi\fi \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). -% +% % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. -% +% % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. -% +% % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. -% +% \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% @@ -9043,14 +8097,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi\fi\fi } -% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX -% is output afterwards if non-empty. +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% \def\refx#1#2{% - \requireauxfile {% \indexnofonts - \turnoffactive - \def\value##1{##1}% + \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% @@ -9075,28 +8128,20 @@ might help (with 'rm \jobname.?? \jobname.??s')% #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. Define a control -% sequence for a cross-reference target (we prepend XR to the control sequence -% name to avoid collisions). The value is the page number. If this is a float -% type, we have more work to do. +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% - {% Expand the node or anchor name to remove control sequences. - % \turnoffactive stops 8-bit characters being changed to commands - % like @'e. \refx does the same to retrieve the value in the definition. + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. \indexnofonts \turnoffactive - \def\value##1{##1}% \xdef\safexrefname{#1}% }% % - \bgroup - \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% - \egroup - % We put the \gdef inside a group to avoid the definitions building up on - % TeX's save stack, which can cause it to run out of space for aux files with - % thousands of lines. \gdef doesn't use the save stack, but \csname does - % when it defines an unknown control sequence as \relax. + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname @@ -9119,23 +8164,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi } -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate at the beginning of the file. -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - -% Used when writing to the aux file, or when using data from it. -\def\requireauxfile{% - \iflinks - \tryauxfile - % Open the new aux file. TeX will close it automatically at exit. - \immediate\openout\auxfile=\jobname.aux - \fi - \global\let\requireauxfile=\relax % Only do this once. -} - % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% @@ -9175,6 +8203,19 @@ might help (with 'rm \jobname.?? \jobname.??s')% \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... @@ -9192,7 +8233,24 @@ might help (with 'rm \jobname.?? \jobname.??s')% \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % - \catcode`\\=\active + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 @@ -9226,6 +8284,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % @@ -9249,15 +8309,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \gdef\dofootnote{% \insert\footins\bgroup - % - % Nested footnotes are not supported in TeX, that would take a lot - % more work. (\startsavinginserts does not suffice.) - \let\footnote=\errfootnotenest - % % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. - \hsize=\txipagewidth + \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox @@ -9291,24 +8346,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% } }%end \catcode `\@=11 -\def\errfootnotenest{% - \errhelp=\EMsimple - \errmessage{Nested footnotes not supported in texinfo.tex, - even though they work in makeinfo; sorry} -} - -\def\errfootnoteheading{% - \errhelp=\EMsimple - \errmessage{Footnotes in chapters, sections, etc., are not supported} -} - % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. -% + % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. @@ -9382,7 +8426,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get - it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.} + it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined @@ -9406,7 +8450,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names - \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro % If the image is by itself, center it. \ifvmode \imagevmodetrue @@ -9436,26 +8479,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Output the image. \ifpdf - % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else - \ifx\XeTeXrevision\thisisundefined - % For epsf.tex - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}% - \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% - \else - % For XeTeX - \doxeteximage{#1}{#2}{#3}% - \fi + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image - \fi + \fi \ifx\centersub\centerV \egroup \fi \endgroup} @@ -9523,13 +8557,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% \global\advance\floatno by 1 % {% - % This magic value for \currentsection is output by \setref as the + % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % - \edef\currentsection{\floatmagic=\safefloattype}% + \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi @@ -9572,7 +8606,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \ifx\thiscaption\empty \else \ifx\floatident\empty \else - \appendtomacro\captionline{: }% had ident, so need a colon between + \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. @@ -9596,20 +8630,32 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% - \requireauxfile \atdummies % - \ifx\thisshortcaption\empty - \def\gtemp{\thiscaption}% - \else - \def\gtemp{\thisshortcaption}% - \fi + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident - \ifx\gtemp\empty \else : \gtemp \fi}}% + \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % \checkinserts } @@ -9652,7 +8698,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic -% \currentsection value which we \setref above. +% \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % @@ -9723,20 +8769,20 @@ might help (with 'rm \jobname.?? \jobname.??s')% { \catcode`\_ = \active \globaldefs=1 -\parseargdef\documentlanguage{% +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. - \let_ = \normalunderscore % normal _ character for filename test \openin 1 txi-#1.tex \ifeof 1 - \documentlanguagetrywithoutunderscore #1_\finish + \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX -} +\endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. @@ -9784,70 +8830,6 @@ directory should work if nowhere else does.} \global\righthyphenmin = #3\relax } -% XeTeX and LuaTeX can handle Unicode natively. -% Their default I/O uses UTF-8 sequences instead of a byte-wise operation. -% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. -% -\newif\iftxinativeunicodecapable -\newif\iftxiusebytewiseio - -\ifx\XeTeXrevision\thisisundefined - \ifx\luatexversion\thisisundefined - \txinativeunicodecapablefalse - \txiusebytewiseiotrue - \else - \txinativeunicodecapabletrue - \txiusebytewiseiofalse - \fi -\else - \txinativeunicodecapabletrue - \txiusebytewiseiofalse -\fi - -% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex -% for non-UTF-8 (byte-wise) encodings. -% -\def\setbytewiseio{% - \ifx\XeTeXrevision\thisisundefined - \else - \XeTeXdefaultencoding "bytes" % For subsequent files to be read - \XeTeXinputencoding "bytes" % For document root file - % Unfortunately, there seems to be no corresponding XeTeX command for - % output encoding. This is a problem for auxiliary index and TOC files. - % The only solution would be perhaps to write out @U{...} sequences in - % place of non-ASCII characters. - \fi - - \ifx\luatexversion\thisisundefined - \else - \directlua{ - local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub - local function convert_char (char) - return utf8_char(byte(char)) - end - - local function convert_line (line) - return gsub(line, ".", convert_char) - end - - callback.register("process_input_buffer", convert_line) - - local function convert_line_out (line) - local line_out = "" - for c in string.utfvalues(line) do - line_out = line_out .. string.char(c) - end - return line_out - end - - callback.register("process_output_buffer", convert_line_out) - } - \fi - - \txiusebytewiseiotrue -} - - % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % @@ -9870,9 +8852,7 @@ directory should work if nowhere else does.} % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % -\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} -\def\documentencodingzzz#1{% - % +\parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % @@ -9888,66 +8868,35 @@ directory should work if nowhere else does.} \asciichardefs % \else \ifx \declaredencoding \lattwo - \iftxinativeunicodecapable - \setbytewiseio - \fi \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone - \iftxinativeunicodecapable - \setbytewiseio - \fi \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine - \iftxinativeunicodecapable - \setbytewiseio - \fi \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight - \iftxinativeunicodecapable - % For native Unicode handling (XeTeX and LuaTeX) - \nativeunicodechardefs - \else - % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) - \setnonasciicharscatcode\active - % since we already invoked \utfeightchardefs at the top level - % (below), do not re-invoke it, otherwise our check for duplicated - % definitions gets triggered. Making non-ascii chars active is - % sufficient. - \fi + \setnonasciicharscatcode\active + \utfeightchardefs % \else - \message{Ignoring unknown document encoding: #1.}% + \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii - % - \ifx\XeTeXrevision\thisisundefined - \else - \ifx \declaredencoding \utfeight - \else - \ifx \declaredencoding \ascii - \else - \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % - non-ASCII characters in auxiliary files.}% - \fi - \fi - \fi } -% emacs-page % A message to be logged when using a character that isn't available % the default font encoding (OT1). % -\def\missingcharmsg#1{\message{Character missing, sorry: #1.}} +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} @@ -9957,119 +8906,111 @@ directory should work if nowhere else does.} % macros containing the character definitions. \setnonasciicharscatcode\active % - -\def\gdefchar#1#2{% -\gdef#1{% - \ifpassthroughchars - \string#1% - \else - #2% - \fi -}} - % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdefchar^^a0{\tie} - \gdefchar^^a1{\exclamdown} - \gdefchar^^a2{{\tcfont \char162}} % cent - \gdefchar^^a3{\pounds{}} - \gdefchar^^a4{{\tcfont \char164}} % currency - \gdefchar^^a5{{\tcfont \char165}} % yen - \gdefchar^^a6{{\tcfont \char166}} % broken bar - \gdefchar^^a7{\S} - \gdefchar^^a8{\"{}} - \gdefchar^^a9{\copyright{}} - \gdefchar^^aa{\ordf} - \gdefchar^^ab{\guillemetleft{}} - \gdefchar^^ac{\ensuremath\lnot} - \gdefchar^^ad{\-} - \gdefchar^^ae{\registeredsymbol{}} - \gdefchar^^af{\={}} + \gdef^^a0{\tie} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} % - \gdefchar^^b0{\textdegree} - \gdefchar^^b1{$\pm$} - \gdefchar^^b2{$^2$} - \gdefchar^^b3{$^3$} - \gdefchar^^b4{\'{}} - \gdefchar^^b5{$\mu$} - \gdefchar^^b6{\P} - \gdefchar^^b7{\ensuremath\cdot} - \gdefchar^^b8{\cedilla\ } - \gdefchar^^b9{$^1$} - \gdefchar^^ba{\ordm} - \gdefchar^^bb{\guillemetright{}} - \gdefchar^^bc{$1\over4$} - \gdefchar^^bd{$1\over2$} - \gdefchar^^be{$3\over4$} - \gdefchar^^bf{\questiondown} + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} % - \gdefchar^^c0{\`A} - \gdefchar^^c1{\'A} - \gdefchar^^c2{\^A} - \gdefchar^^c3{\~A} - \gdefchar^^c4{\"A} - \gdefchar^^c5{\ringaccent A} - \gdefchar^^c6{\AE} - \gdefchar^^c7{\cedilla C} - \gdefchar^^c8{\`E} - \gdefchar^^c9{\'E} - \gdefchar^^ca{\^E} - \gdefchar^^cb{\"E} - \gdefchar^^cc{\`I} - \gdefchar^^cd{\'I} - \gdefchar^^ce{\^I} - \gdefchar^^cf{\"I} + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} % - \gdefchar^^d0{\DH} - \gdefchar^^d1{\~N} - \gdefchar^^d2{\`O} - \gdefchar^^d3{\'O} - \gdefchar^^d4{\^O} - \gdefchar^^d5{\~O} - \gdefchar^^d6{\"O} - \gdefchar^^d7{$\times$} - \gdefchar^^d8{\O} - \gdefchar^^d9{\`U} - \gdefchar^^da{\'U} - \gdefchar^^db{\^U} - \gdefchar^^dc{\"U} - \gdefchar^^dd{\'Y} - \gdefchar^^de{\TH} - \gdefchar^^df{\ss} + \gdef^^bb{\guillemetright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} % - \gdefchar^^e0{\`a} - \gdefchar^^e1{\'a} - \gdefchar^^e2{\^a} - \gdefchar^^e3{\~a} - \gdefchar^^e4{\"a} - \gdefchar^^e5{\ringaccent a} - \gdefchar^^e6{\ae} - \gdefchar^^e7{\cedilla c} - \gdefchar^^e8{\`e} - \gdefchar^^e9{\'e} - \gdefchar^^ea{\^e} - \gdefchar^^eb{\"e} - \gdefchar^^ec{\`{\dotless i}} - \gdefchar^^ed{\'{\dotless i}} - \gdefchar^^ee{\^{\dotless i}} - \gdefchar^^ef{\"{\dotless i}} + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} % - \gdefchar^^f0{\dh} - \gdefchar^^f1{\~n} - \gdefchar^^f2{\`o} - \gdefchar^^f3{\'o} - \gdefchar^^f4{\^o} - \gdefchar^^f5{\~o} - \gdefchar^^f6{\"o} - \gdefchar^^f7{$\div$} - \gdefchar^^f8{\o} - \gdefchar^^f9{\`u} - \gdefchar^^fa{\'u} - \gdefchar^^fb{\^u} - \gdefchar^^fc{\"u} - \gdefchar^^fd{\'y} - \gdefchar^^fe{\th} - \gdefchar^^ff{\"y} + \gdef^^d0{\DH} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\TH} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\dh} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\th} + \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. @@ -10077,119 +9018,119 @@ directory should work if nowhere else does.} % Encoding is almost identical to Latin1. \latonechardefs % - \gdefchar^^a4{\euro{}} - \gdefchar^^a6{\v S} - \gdefchar^^a8{\v s} - \gdefchar^^b4{\v Z} - \gdefchar^^b8{\v z} - \gdefchar^^bc{\OE} - \gdefchar^^bd{\oe} - \gdefchar^^be{\"Y} + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% - \gdefchar^^a0{\tie} - \gdefchar^^a1{\ogonek{A}} - \gdefchar^^a2{\u{}} - \gdefchar^^a3{\L} - \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdefchar^^a5{\v L} - \gdefchar^^a6{\'S} - \gdefchar^^a7{\S} - \gdefchar^^a8{\"{}} - \gdefchar^^a9{\v S} - \gdefchar^^aa{\cedilla S} - \gdefchar^^ab{\v T} - \gdefchar^^ac{\'Z} - \gdefchar^^ad{\-} - \gdefchar^^ae{\v Z} - \gdefchar^^af{\dotaccent Z} + \gdef^^a0{\tie} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} % - \gdefchar^^b0{\textdegree{}} - \gdefchar^^b1{\ogonek{a}} - \gdefchar^^b2{\ogonek{ }} - \gdefchar^^b3{\l} - \gdefchar^^b4{\'{}} - \gdefchar^^b5{\v l} - \gdefchar^^b6{\'s} - \gdefchar^^b7{\v{}} - \gdefchar^^b8{\cedilla\ } - \gdefchar^^b9{\v s} - \gdefchar^^ba{\cedilla s} - \gdefchar^^bb{\v t} - \gdefchar^^bc{\'z} - \gdefchar^^bd{\H{}} - \gdefchar^^be{\v z} - \gdefchar^^bf{\dotaccent z} + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} % - \gdefchar^^c0{\'R} - \gdefchar^^c1{\'A} - \gdefchar^^c2{\^A} - \gdefchar^^c3{\u A} - \gdefchar^^c4{\"A} - \gdefchar^^c5{\'L} - \gdefchar^^c6{\'C} - \gdefchar^^c7{\cedilla C} - \gdefchar^^c8{\v C} - \gdefchar^^c9{\'E} - \gdefchar^^ca{\ogonek{E}} - \gdefchar^^cb{\"E} - \gdefchar^^cc{\v E} - \gdefchar^^cd{\'I} - \gdefchar^^ce{\^I} - \gdefchar^^cf{\v D} + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} % - \gdefchar^^d0{\DH} - \gdefchar^^d1{\'N} - \gdefchar^^d2{\v N} - \gdefchar^^d3{\'O} - \gdefchar^^d4{\^O} - \gdefchar^^d5{\H O} - \gdefchar^^d6{\"O} - \gdefchar^^d7{$\times$} - \gdefchar^^d8{\v R} - \gdefchar^^d9{\ringaccent U} - \gdefchar^^da{\'U} - \gdefchar^^db{\H U} - \gdefchar^^dc{\"U} - \gdefchar^^dd{\'Y} - \gdefchar^^de{\cedilla T} - \gdefchar^^df{\ss} + \gdef^^d0{\DH} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} % - \gdefchar^^e0{\'r} - \gdefchar^^e1{\'a} - \gdefchar^^e2{\^a} - \gdefchar^^e3{\u a} - \gdefchar^^e4{\"a} - \gdefchar^^e5{\'l} - \gdefchar^^e6{\'c} - \gdefchar^^e7{\cedilla c} - \gdefchar^^e8{\v c} - \gdefchar^^e9{\'e} - \gdefchar^^ea{\ogonek{e}} - \gdefchar^^eb{\"e} - \gdefchar^^ec{\v e} - \gdefchar^^ed{\'{\dotless{i}}} - \gdefchar^^ee{\^{\dotless{i}}} - \gdefchar^^ef{\v d} + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'{\dotless{i}}} + \gdef^^ee{\^{\dotless{i}}} + \gdef^^ef{\v d} % - \gdefchar^^f0{\dh} - \gdefchar^^f1{\'n} - \gdefchar^^f2{\v n} - \gdefchar^^f3{\'o} - \gdefchar^^f4{\^o} - \gdefchar^^f5{\H o} - \gdefchar^^f6{\"o} - \gdefchar^^f7{$\div$} - \gdefchar^^f8{\v r} - \gdefchar^^f9{\ringaccent u} - \gdefchar^^fa{\'u} - \gdefchar^^fb{\H u} - \gdefchar^^fc{\"u} - \gdefchar^^fd{\'y} - \gdefchar^^fe{\cedilla t} - \gdefchar^^ff{\dotaccent{}} + \gdef^^f0{\dh} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. @@ -10219,94 +9160,38 @@ directory should work if nowhere else does.} \fi } -% Give non-ASCII bytes the active definitions for processing UTF-8 sequences \begingroup \catcode`\~13 - \catcode`\$12 \catcode`\"12 - % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp - % substituting ~ and $ with a character token of that value. \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx - \uccode`\$\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} - % For bytes other than the first in a UTF-8 sequence. Not expected to - % be expanded except when writing to auxiliary files. - \countUTFx = "80 - \countUTFy = "C2 - \def\UTFviiiTmp{% - \gdef~{% - \ifpassthroughchars $\fi}}% - \UTFviiiLoop - \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% - \gdef~{% - \ifpassthroughchars $% - \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% - \gdef~{% - \ifpassthroughchars $% - \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% - \gdef~{% - \ifpassthroughchars $% - \else\expandafter\UTFviiiFourOctets\expandafter$\fi - }}% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup -\def\globallet{\global\let} % save some \expandafter's below - -% @U{xxxx} to produce U+xxxx, if we support it. -\def\U#1{% - \expandafter\ifx\csname uni:#1\endcsname \relax - \iftxinativeunicodecapable - % All Unicode characters can be used if native Unicode handling is - % active. However, if the font does not have the glyph, - % letters are missing. - \begingroup - \uccode`\.="#1\relax - \uppercase{.} - \endgroup - \else - \errhelp = \EMsimple - \errmessage{Unicode character U+#1 not supported, sorry}% - \fi - \else - \csname uni:#1\endcsname - \fi -} - -% These macros are used here to construct the name of a control -% sequence to be defined. -\def\UTFviiiTwoOctetsName#1#2{% - \csname u8:#1\string #2\endcsname}% -\def\UTFviiiThreeOctetsName#1#2#3{% - \csname u8:#1\string #2\string #3\endcsname}% -\def\UTFviiiFourOctetsName#1#2#3#4{% - \csname u8:#1\string #2\string #3\string #4\endcsname}% - -% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), -% provide a definition macro to replace a Unicode character; -% this gets used by the @U command -% \begingroup \catcode`\"=12 \catcode`\<=12 @@ -10315,838 +9200,465 @@ directory should work if nowhere else does.} \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 - \gdef\DeclareUnicodeCharacterUTFviii#1#2{% + + \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax + %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref - - % Give \u8:... its definition. The sequence of seven \expandafter's - % expands after the \gdef three times, e.g. - % - % 1. \UTFviiTwoOctetsName B1 B2 - % 2. \csname u8:B1 \string B2 \endcsname - % 3. \u8: B1 B2 (a single control sequence token) - % - \expandafter\expandafter - \expandafter\expandafter - \expandafter\expandafter - \expandafter\gdef \UTFviiiTmp{#2}% - % - \expandafter\ifx\csname uni:#1\endcsname \relax \else - \message{Internal error, already defined: #1}% - \fi - % - % define an additional control sequence for this code point. - \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% \endgroup} - % - % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp - % to the corresponding UTF-8 sequence. + \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% - \parseUTFviiiB C\UTFviiiTwoOctetsName.,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% - \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% - \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } - % Extract a byte from the end of the UTF-8 representation of \countUTFx. - % It must be a non-initial byte in the sequence. - % Change \uccode of #1 for it to be used in \parseUTFviiiB as one - % of the bytes. \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 - \countUTFy = \countUTFz % Save to be the future value of \countUTFz. + \countUTFy = \countUTFz \multiply\countUTFz by 64 - - % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract - % in order to get the last five bits. \advance\countUTFx by -\countUTFz - - % Convert this to the byte in the UTF-8 sequence. \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} - % Used to put a UTF-8 byte sequence into \UTFviiiTmp - % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 - % sequence. - % #2 is one of the \UTFviii*OctetsName macros. - % #3 is always a full stop (.) - % #4 is a template for the other bytes in the sequence. The values for these - % bytes is substituted in here with \uppercase using the \uccode's. \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup -% For native Unicode handling (XeTeX and LuaTeX), -% provide a definition macro that sets a catcode to `other' non-globally -% -\def\DeclareUnicodeCharacterNativeOther#1#2{% - \catcode"#1=\other -} - -% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M -% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) -% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) -% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A -% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B -% -% Many of our renditions are less than wonderful, and all the missing -% characters are available somewhere. Loading the necessary fonts -% awaits user request. We can't truly support Unicode without -% reimplementing everything that's been done in LaTeX for many years, -% plus probably using luatex or xetex, and who knows what else. -% We won't be doing that here in this simple file. But we can try to at -% least make most of the characters not bomb out. -% -\def\unicodechardefs{% - \DeclareUnicodeCharacter{00A0}{\tie}% - \DeclareUnicodeCharacter{00A1}{\exclamdown}% - \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent - \DeclareUnicodeCharacter{00A3}{\pounds{}}% - \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency - \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen - \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar - \DeclareUnicodeCharacter{00A7}{\S}% - \DeclareUnicodeCharacter{00A8}{\"{ }}% - \DeclareUnicodeCharacter{00A9}{\copyright{}}% - \DeclareUnicodeCharacter{00AA}{\ordf}% - \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% - \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% - \DeclareUnicodeCharacter{00AD}{\-}% - \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% - \DeclareUnicodeCharacter{00AF}{\={ }}% - % - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% - \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% - \DeclareUnicodeCharacter{00B2}{$^2$}% - \DeclareUnicodeCharacter{00B3}{$^3$}% - \DeclareUnicodeCharacter{00B4}{\'{ }}% - \DeclareUnicodeCharacter{00B5}{$\mu$}% - \DeclareUnicodeCharacter{00B6}{\P}% - \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% - \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% - \DeclareUnicodeCharacter{00B9}{$^1$}% - \DeclareUnicodeCharacter{00BA}{\ordm}% - \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% - \DeclareUnicodeCharacter{00BC}{$1\over4$}% - \DeclareUnicodeCharacter{00BD}{$1\over2$}% - \DeclareUnicodeCharacter{00BE}{$3\over4$}% - \DeclareUnicodeCharacter{00BF}{\questiondown}% - % - \DeclareUnicodeCharacter{00C0}{\`A}% - \DeclareUnicodeCharacter{00C1}{\'A}% - \DeclareUnicodeCharacter{00C2}{\^A}% - \DeclareUnicodeCharacter{00C3}{\~A}% - \DeclareUnicodeCharacter{00C4}{\"A}% - \DeclareUnicodeCharacter{00C5}{\AA}% - \DeclareUnicodeCharacter{00C6}{\AE}% - \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% - \DeclareUnicodeCharacter{00C8}{\`E}% - \DeclareUnicodeCharacter{00C9}{\'E}% - \DeclareUnicodeCharacter{00CA}{\^E}% - \DeclareUnicodeCharacter{00CB}{\"E}% - \DeclareUnicodeCharacter{00CC}{\`I}% - \DeclareUnicodeCharacter{00CD}{\'I}% - \DeclareUnicodeCharacter{00CE}{\^I}% - \DeclareUnicodeCharacter{00CF}{\"I}% - % - \DeclareUnicodeCharacter{00D0}{\DH}% - \DeclareUnicodeCharacter{00D1}{\~N}% - \DeclareUnicodeCharacter{00D2}{\`O}% - \DeclareUnicodeCharacter{00D3}{\'O}% - \DeclareUnicodeCharacter{00D4}{\^O}% - \DeclareUnicodeCharacter{00D5}{\~O}% - \DeclareUnicodeCharacter{00D6}{\"O}% - \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% - \DeclareUnicodeCharacter{00D8}{\O}% - \DeclareUnicodeCharacter{00D9}{\`U}% - \DeclareUnicodeCharacter{00DA}{\'U}% - \DeclareUnicodeCharacter{00DB}{\^U}% - \DeclareUnicodeCharacter{00DC}{\"U}% - \DeclareUnicodeCharacter{00DD}{\'Y}% - \DeclareUnicodeCharacter{00DE}{\TH}% - \DeclareUnicodeCharacter{00DF}{\ss}% - % - \DeclareUnicodeCharacter{00E0}{\`a}% - \DeclareUnicodeCharacter{00E1}{\'a}% - \DeclareUnicodeCharacter{00E2}{\^a}% - \DeclareUnicodeCharacter{00E3}{\~a}% - \DeclareUnicodeCharacter{00E4}{\"a}% - \DeclareUnicodeCharacter{00E5}{\aa}% - \DeclareUnicodeCharacter{00E6}{\ae}% - \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% - \DeclareUnicodeCharacter{00E8}{\`e}% - \DeclareUnicodeCharacter{00E9}{\'e}% - \DeclareUnicodeCharacter{00EA}{\^e}% - \DeclareUnicodeCharacter{00EB}{\"e}% - \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% - \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% - \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% - \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% - % - \DeclareUnicodeCharacter{00F0}{\dh}% - \DeclareUnicodeCharacter{00F1}{\~n}% - \DeclareUnicodeCharacter{00F2}{\`o}% - \DeclareUnicodeCharacter{00F3}{\'o}% - \DeclareUnicodeCharacter{00F4}{\^o}% - \DeclareUnicodeCharacter{00F5}{\~o}% - \DeclareUnicodeCharacter{00F6}{\"o}% - \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% - \DeclareUnicodeCharacter{00F8}{\o}% - \DeclareUnicodeCharacter{00F9}{\`u}% - \DeclareUnicodeCharacter{00FA}{\'u}% - \DeclareUnicodeCharacter{00FB}{\^u}% - \DeclareUnicodeCharacter{00FC}{\"u}% - \DeclareUnicodeCharacter{00FD}{\'y}% - \DeclareUnicodeCharacter{00FE}{\th}% - \DeclareUnicodeCharacter{00FF}{\"y}% - % - \DeclareUnicodeCharacter{0100}{\=A}% - \DeclareUnicodeCharacter{0101}{\=a}% - \DeclareUnicodeCharacter{0102}{\u{A}}% - \DeclareUnicodeCharacter{0103}{\u{a}}% - \DeclareUnicodeCharacter{0104}{\ogonek{A}}% - \DeclareUnicodeCharacter{0105}{\ogonek{a}}% - \DeclareUnicodeCharacter{0106}{\'C}% - \DeclareUnicodeCharacter{0107}{\'c}% - \DeclareUnicodeCharacter{0108}{\^C}% - \DeclareUnicodeCharacter{0109}{\^c}% - \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% - \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% - \DeclareUnicodeCharacter{010C}{\v{C}}% - \DeclareUnicodeCharacter{010D}{\v{c}}% - \DeclareUnicodeCharacter{010E}{\v{D}}% - \DeclareUnicodeCharacter{010F}{d'}% - % - \DeclareUnicodeCharacter{0110}{\DH}% - \DeclareUnicodeCharacter{0111}{\dh}% - \DeclareUnicodeCharacter{0112}{\=E}% - \DeclareUnicodeCharacter{0113}{\=e}% - \DeclareUnicodeCharacter{0114}{\u{E}}% - \DeclareUnicodeCharacter{0115}{\u{e}}% - \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% - \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% - \DeclareUnicodeCharacter{0118}{\ogonek{E}}% - \DeclareUnicodeCharacter{0119}{\ogonek{e}}% - \DeclareUnicodeCharacter{011A}{\v{E}}% - \DeclareUnicodeCharacter{011B}{\v{e}}% - \DeclareUnicodeCharacter{011C}{\^G}% - \DeclareUnicodeCharacter{011D}{\^g}% - \DeclareUnicodeCharacter{011E}{\u{G}}% - \DeclareUnicodeCharacter{011F}{\u{g}}% - % - \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% - \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% - \DeclareUnicodeCharacter{0122}{\cedilla{G}}% - \DeclareUnicodeCharacter{0123}{\cedilla{g}}% - \DeclareUnicodeCharacter{0124}{\^H}% - \DeclareUnicodeCharacter{0125}{\^h}% - \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% - \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% - \DeclareUnicodeCharacter{0128}{\~I}% - \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% - \DeclareUnicodeCharacter{012A}{\=I}% - \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% - \DeclareUnicodeCharacter{012C}{\u{I}}% - \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% - \DeclareUnicodeCharacter{012E}{\ogonek{I}}% - \DeclareUnicodeCharacter{012F}{\ogonek{i}}% - % - \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% - \DeclareUnicodeCharacter{0131}{\dotless{i}}% - \DeclareUnicodeCharacter{0132}{IJ}% - \DeclareUnicodeCharacter{0133}{ij}% - \DeclareUnicodeCharacter{0134}{\^J}% - \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% - \DeclareUnicodeCharacter{0136}{\cedilla{K}}% - \DeclareUnicodeCharacter{0137}{\cedilla{k}}% - \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% - \DeclareUnicodeCharacter{0139}{\'L}% - \DeclareUnicodeCharacter{013A}{\'l}% - \DeclareUnicodeCharacter{013B}{\cedilla{L}}% - \DeclareUnicodeCharacter{013C}{\cedilla{l}}% - \DeclareUnicodeCharacter{013D}{L'}% should kern - \DeclareUnicodeCharacter{013E}{l'}% should kern - \DeclareUnicodeCharacter{013F}{L\U{00B7}}% - % - \DeclareUnicodeCharacter{0140}{l\U{00B7}}% - \DeclareUnicodeCharacter{0141}{\L}% - \DeclareUnicodeCharacter{0142}{\l}% - \DeclareUnicodeCharacter{0143}{\'N}% - \DeclareUnicodeCharacter{0144}{\'n}% - \DeclareUnicodeCharacter{0145}{\cedilla{N}}% - \DeclareUnicodeCharacter{0146}{\cedilla{n}}% - \DeclareUnicodeCharacter{0147}{\v{N}}% - \DeclareUnicodeCharacter{0148}{\v{n}}% - \DeclareUnicodeCharacter{0149}{'n}% - \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% - \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% - \DeclareUnicodeCharacter{014C}{\=O}% - \DeclareUnicodeCharacter{014D}{\=o}% - \DeclareUnicodeCharacter{014E}{\u{O}}% - \DeclareUnicodeCharacter{014F}{\u{o}}% - % - \DeclareUnicodeCharacter{0150}{\H{O}}% - \DeclareUnicodeCharacter{0151}{\H{o}}% - \DeclareUnicodeCharacter{0152}{\OE}% - \DeclareUnicodeCharacter{0153}{\oe}% - \DeclareUnicodeCharacter{0154}{\'R}% - \DeclareUnicodeCharacter{0155}{\'r}% - \DeclareUnicodeCharacter{0156}{\cedilla{R}}% - \DeclareUnicodeCharacter{0157}{\cedilla{r}}% - \DeclareUnicodeCharacter{0158}{\v{R}}% - \DeclareUnicodeCharacter{0159}{\v{r}}% - \DeclareUnicodeCharacter{015A}{\'S}% - \DeclareUnicodeCharacter{015B}{\'s}% - \DeclareUnicodeCharacter{015C}{\^S}% - \DeclareUnicodeCharacter{015D}{\^s}% - \DeclareUnicodeCharacter{015E}{\cedilla{S}}% - \DeclareUnicodeCharacter{015F}{\cedilla{s}}% - % - \DeclareUnicodeCharacter{0160}{\v{S}}% - \DeclareUnicodeCharacter{0161}{\v{s}}% - \DeclareUnicodeCharacter{0162}{\cedilla{T}}% - \DeclareUnicodeCharacter{0163}{\cedilla{t}}% - \DeclareUnicodeCharacter{0164}{\v{T}}% - \DeclareUnicodeCharacter{0165}{\v{t}}% - \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% - \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% - \DeclareUnicodeCharacter{0168}{\~U}% - \DeclareUnicodeCharacter{0169}{\~u}% - \DeclareUnicodeCharacter{016A}{\=U}% - \DeclareUnicodeCharacter{016B}{\=u}% - \DeclareUnicodeCharacter{016C}{\u{U}}% - \DeclareUnicodeCharacter{016D}{\u{u}}% - \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% - \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% - % - \DeclareUnicodeCharacter{0170}{\H{U}}% - \DeclareUnicodeCharacter{0171}{\H{u}}% - \DeclareUnicodeCharacter{0172}{\ogonek{U}}% - \DeclareUnicodeCharacter{0173}{\ogonek{u}}% - \DeclareUnicodeCharacter{0174}{\^W}% - \DeclareUnicodeCharacter{0175}{\^w}% - \DeclareUnicodeCharacter{0176}{\^Y}% - \DeclareUnicodeCharacter{0177}{\^y}% - \DeclareUnicodeCharacter{0178}{\"Y}% - \DeclareUnicodeCharacter{0179}{\'Z}% - \DeclareUnicodeCharacter{017A}{\'z}% - \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% - \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% - \DeclareUnicodeCharacter{017D}{\v{Z}}% - \DeclareUnicodeCharacter{017E}{\v{z}}% - \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% - % - \DeclareUnicodeCharacter{01C4}{D\v{Z}}% - \DeclareUnicodeCharacter{01C5}{D\v{z}}% - \DeclareUnicodeCharacter{01C6}{d\v{z}}% - \DeclareUnicodeCharacter{01C7}{LJ}% - \DeclareUnicodeCharacter{01C8}{Lj}% - \DeclareUnicodeCharacter{01C9}{lj}% - \DeclareUnicodeCharacter{01CA}{NJ}% - \DeclareUnicodeCharacter{01CB}{Nj}% - \DeclareUnicodeCharacter{01CC}{nj}% - \DeclareUnicodeCharacter{01CD}{\v{A}}% - \DeclareUnicodeCharacter{01CE}{\v{a}}% - \DeclareUnicodeCharacter{01CF}{\v{I}}% - % - \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% - \DeclareUnicodeCharacter{01D1}{\v{O}}% - \DeclareUnicodeCharacter{01D2}{\v{o}}% - \DeclareUnicodeCharacter{01D3}{\v{U}}% - \DeclareUnicodeCharacter{01D4}{\v{u}}% - % - \DeclareUnicodeCharacter{01E2}{\={\AE}}% - \DeclareUnicodeCharacter{01E3}{\={\ae}}% - \DeclareUnicodeCharacter{01E6}{\v{G}}% - \DeclareUnicodeCharacter{01E7}{\v{g}}% - \DeclareUnicodeCharacter{01E8}{\v{K}}% - \DeclareUnicodeCharacter{01E9}{\v{k}}% - % - \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% - \DeclareUnicodeCharacter{01F1}{DZ}% - \DeclareUnicodeCharacter{01F2}{Dz}% - \DeclareUnicodeCharacter{01F3}{dz}% - \DeclareUnicodeCharacter{01F4}{\'G}% - \DeclareUnicodeCharacter{01F5}{\'g}% - \DeclareUnicodeCharacter{01F8}{\`N}% - \DeclareUnicodeCharacter{01F9}{\`n}% - \DeclareUnicodeCharacter{01FC}{\'{\AE}}% - \DeclareUnicodeCharacter{01FD}{\'{\ae}}% - \DeclareUnicodeCharacter{01FE}{\'{\O}}% - \DeclareUnicodeCharacter{01FF}{\'{\o}}% - % - \DeclareUnicodeCharacter{021E}{\v{H}}% - \DeclareUnicodeCharacter{021F}{\v{h}}% - % - \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% - \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% - \DeclareUnicodeCharacter{0228}{\cedilla{E}}% - \DeclareUnicodeCharacter{0229}{\cedilla{e}}% - \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% - \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% - % - \DeclareUnicodeCharacter{0232}{\=Y}% - \DeclareUnicodeCharacter{0233}{\=y}% - \DeclareUnicodeCharacter{0237}{\dotless{j}}% - % - \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% - % - % Greek letters upper case - \DeclareUnicodeCharacter{0391}{{\it A}}% - \DeclareUnicodeCharacter{0392}{{\it B}}% - \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% - \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% - \DeclareUnicodeCharacter{0395}{{\it E}}% - \DeclareUnicodeCharacter{0396}{{\it Z}}% - \DeclareUnicodeCharacter{0397}{{\it H}}% - \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% - \DeclareUnicodeCharacter{0399}{{\it I}}% - \DeclareUnicodeCharacter{039A}{{\it K}}% - \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% - \DeclareUnicodeCharacter{039C}{{\it M}}% - \DeclareUnicodeCharacter{039D}{{\it N}}% - \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% - \DeclareUnicodeCharacter{039F}{{\it O}}% - \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% - \DeclareUnicodeCharacter{03A1}{{\it P}}% - %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma - \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% - \DeclareUnicodeCharacter{03A4}{{\it T}}% - \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% - \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% - \DeclareUnicodeCharacter{03A7}{{\it X}}% - \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% - \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% - % - % Vowels with accents - \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% - \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% - \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% - \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% - \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% - \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% - % - % Standalone accent - \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% - % - % Greek letters lower case - \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% - \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% - \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% - \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% - \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% - \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% - \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% - \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% - \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% - \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% - \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% - \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% - \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% - \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% - \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron - \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% - \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% - \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% - \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% - \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% - \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% - \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% - \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% - \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% - \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% - % - % More Greek vowels with accents - \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% - \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% - \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% - \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% - \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% - % - % Variant Greek letters - \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% - \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% - \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% - % - \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% - \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% - \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% - \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% - \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% - \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% - \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% - \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% - \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% - \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% - \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% - \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% - % - \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% - \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% - % - \DeclareUnicodeCharacter{1E20}{\=G}% - \DeclareUnicodeCharacter{1E21}{\=g}% - \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% - \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% - \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% - \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% - \DeclareUnicodeCharacter{1E26}{\"H}% - \DeclareUnicodeCharacter{1E27}{\"h}% - % - \DeclareUnicodeCharacter{1E30}{\'K}% - \DeclareUnicodeCharacter{1E31}{\'k}% - \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% - \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% - \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% - \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% - \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% - \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% - \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% - \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% - \DeclareUnicodeCharacter{1E3E}{\'M}% - \DeclareUnicodeCharacter{1E3F}{\'m}% - % - \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% - \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% - \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% - \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% - \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% - \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% - \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% - \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% - \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% - \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% - % - \DeclareUnicodeCharacter{1E54}{\'P}% - \DeclareUnicodeCharacter{1E55}{\'p}% - \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% - \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% - \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% - \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% - \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% - \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% - \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% - \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% - % - \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% - \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% - \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% - \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% - \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% - \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% - \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% - \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% - \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% - \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% - % - \DeclareUnicodeCharacter{1E7C}{\~V}% - \DeclareUnicodeCharacter{1E7D}{\~v}% - \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% - \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% - % - \DeclareUnicodeCharacter{1E80}{\`W}% - \DeclareUnicodeCharacter{1E81}{\`w}% - \DeclareUnicodeCharacter{1E82}{\'W}% - \DeclareUnicodeCharacter{1E83}{\'w}% - \DeclareUnicodeCharacter{1E84}{\"W}% - \DeclareUnicodeCharacter{1E85}{\"w}% - \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% - \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% - \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% - \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% - \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% - \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% - \DeclareUnicodeCharacter{1E8C}{\"X}% - \DeclareUnicodeCharacter{1E8D}{\"x}% - \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% - \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% - % - \DeclareUnicodeCharacter{1E90}{\^Z}% - \DeclareUnicodeCharacter{1E91}{\^z}% - \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% - \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% - \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% - \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% - \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% - \DeclareUnicodeCharacter{1E97}{\"t}% - \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% - \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% - % - \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% - \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% - % - \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% - \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% - \DeclareUnicodeCharacter{1EBC}{\~E}% - \DeclareUnicodeCharacter{1EBD}{\~e}% - % - \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% - \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% - \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% - \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% - % - \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% - \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% - % - \DeclareUnicodeCharacter{1EF2}{\`Y}% - \DeclareUnicodeCharacter{1EF3}{\`y}% - \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% - % - \DeclareUnicodeCharacter{1EF8}{\~Y}% - \DeclareUnicodeCharacter{1EF9}{\~y}% - % - % Punctuation - \DeclareUnicodeCharacter{2013}{--}% - \DeclareUnicodeCharacter{2014}{---}% - \DeclareUnicodeCharacter{2018}{\quoteleft{}}% - \DeclareUnicodeCharacter{2019}{\quoteright{}}% - \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% - \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% - \DeclareUnicodeCharacter{201D}{\quotedblright{}}% - \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% - \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% - \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% - \DeclareUnicodeCharacter{2022}{\bullet{}}% - \DeclareUnicodeCharacter{202F}{\thinspace}% - \DeclareUnicodeCharacter{2026}{\dots{}}% - \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% - \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% - % - \DeclareUnicodeCharacter{20AC}{\euro{}}% - % - \DeclareUnicodeCharacter{2192}{\expansion{}}% - \DeclareUnicodeCharacter{21D2}{\result{}}% - % - % Mathematical symbols - \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% - \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% - \DeclareUnicodeCharacter{2208}{\ensuremath\in}% - \DeclareUnicodeCharacter{2212}{\minus{}}% - \DeclareUnicodeCharacter{2217}{\ast}% - \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% - \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% - \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% - \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% - \DeclareUnicodeCharacter{2261}{\equiv{}}% - \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% - \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% - \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% - \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% - % - \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% - \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% - \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% - \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% - \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% - \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% - \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% - \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% - \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% - \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% - \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% - \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% - \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% - \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% - \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% - \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% - \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% - \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% - \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% - \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% - \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% - \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% - \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% - \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% - \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% - \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% - \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% - \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% - \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% - \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% - \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% - \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% - \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% - \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% - \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% - \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% - \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% - \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% - \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% - \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% - \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% - \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% - \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% - \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% - \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% - \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% - \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% - \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% - \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% - \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% - \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% - \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% - \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% - \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% - \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% - \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% - \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% - \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% - \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% - \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% - \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% - \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% - \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% - \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% - \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% - \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% - \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% - \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% - \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% - \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% - \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% - \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% - \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% - \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% - \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% - \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% - \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% - \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% - \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% - \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% - \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% - \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% - \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% - \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% - \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% - \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% - \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% - \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% - \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% - \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% - \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% - % - \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% - \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% - \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% - \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% - \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}% - \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% - \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% - \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% - \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% - \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% - \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% - \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% - \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% - \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% - \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% - \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% - \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% - \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% - \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% - \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% - \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% - \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% - \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% - \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% - \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% - \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% - \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% - \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% - \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% - % - \global\mathchardef\checkmark="1370% actually the square root sign - \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% -}% end of \unicodechardefs - -% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) -% It makes the setting that replace UTF-8 byte sequence. \def\utfeightchardefs{% - \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii - \unicodechardefs -} + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} -% Whether the active definitions of non-ASCII characters expand to -% non-active tokens with the same character code. This is used to -% write characters literally, instead of using active definitions for -% printing the correct glyphs. -\newif\ifpassthroughchars -\passthroughcharsfalse + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} -% For native Unicode handling (XeTeX and LuaTeX), -% provide a definition macro to replace/pass-through a Unicode character -% -\def\DeclareUnicodeCharacterNative#1#2{% - \catcode"#1=\active - \def\dodeclareunicodecharacternative##1##2##3{% - \begingroup - \uccode`\~="##2\relax - \uppercase{\gdef~}{% - \ifpassthroughchars - ##1% - \else - ##3% - \fi - } - \endgroup - } - \begingroup - \uccode`\.="#1\relax - \uppercase{\def\UTFNativeTmp{.}}% - \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% - \endgroup -} + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} -% Native Unicode handling (XeTeX and LuaTeX) character replacing definition. -% It activates the setting that replaces Unicode characters. -\def\nativeunicodechardefs{% - \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative - \unicodechardefs -} + \DeclareUnicodeCharacter{00D0}{\DH} + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} + \DeclareUnicodeCharacter{00DF}{\ss} -% For native Unicode handling (XeTeX and LuaTeX), -% make the character token expand -% to the sequences given in \unicodechardefs for printing. -\def\DeclareUnicodeCharacterNativeAtU#1#2{% - \def\UTFAtUTmp{#2} - \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp -} + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F0}{\dh} + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs -% @U command definitions for native Unicode handling (XeTeX and LuaTeX). -\def\nativeunicodechardefsatu{% - \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU - \unicodechardefs -} % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } -% Define all Unicode characters we know about. This makes UTF-8 the default -% input encoding and allows @U to work. -\iftxinativeunicodecapable - \nativeunicodechardefsatu -\else - \utfeightchardefs -\fi +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + \message{formatting,} @@ -11196,12 +9708,12 @@ directory should work if nowhere else does.} \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin - \txipageheight = \vsize + \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in - \txipagewidth = \hsize + \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax @@ -11213,14 +9725,6 @@ directory should work if nowhere else does.} % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in - \else - \ifx\XeTeXrevision\thisisundefined - \special{papersize=#8,#7}% - \else - \pdfpageheight #7\relax - \pdfpagewidth #8\relax - % XeTeX does not have \pdfhorigin and \pdfvorigin. - \fi \fi % \setleading{\textleading} @@ -11253,6 +9757,7 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.3in \tolerance = 700 + \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} @@ -11270,6 +9775,7 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.25in \tolerance = 700 + \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} @@ -11295,6 +9801,7 @@ directory should work if nowhere else does.} {297mm}{210mm}% % \tolerance = 700 + \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} @@ -11313,6 +9820,7 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.2in \tolerance = 800 + \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm @@ -11354,11 +9862,9 @@ directory should work if nowhere else does.} % \dimen0 = #1\relax \advance\dimen0 by \voffset - \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page % \dimen2 = \hsize \advance\dimen2 by \normaloffset - \advance\dimen2 by 1in % reference point is 1 inch from left edge of page % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% @@ -11370,9 +9876,6 @@ directory should work if nowhere else does.} % \letterpaper -% Default value of \hfuzz, for suppressing warnings about overfull hboxes. -\hfuzz = 1pt - \message{and turning on texinfo input format.} @@ -11409,47 +9912,44 @@ directory should work if nowhere else does.} % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} -% Set catcodes for Texinfo file - -% Active characters for printing the wanted glyph. +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. -% + \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote -\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde -\chardef\hatchar=`\^ -\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} -\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } -\catcode`\|=\active \def|{{\tt\char124}} - +\catcode`\|=\active +\def|{{\tt\char124}} \chardef \less=`\< -\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless +\catcode`\<=\active +\def<{{\tt \less}} \chardef \gtr=`\> -\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr -\catcode`\+=\active \def+{{\tt \char 43}} -\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix -\catcode`\-=\active \let-=\normaldash +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix - -% used for headline/footline in the output routine, in case the page -% breaks in the middle of an @tex block. -\def\texinfochars{% - \let< = \activeless - \let> = \activegtr - \let~ = \activetilde - \let^ = \activehat - \markupsetuplqdefault \markupsetuprqdefault - \let\b = \strong - \let\i = \smartitalic - % in principle, all other definitions in \tex have to be undone too. -} +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. @@ -11463,118 +9963,81 @@ directory should work if nowhere else does.} % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \realbackslash is an actual character `\' with catcode other. -{\catcode`\\=\other @gdef@realbackslash{\}} +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} -% In Texinfo, backslash is an active character; it prints the backslash +% In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. -% Print a typewriter backslash. For math mode, we can't simply use -% \backslashcurfont: the story here is that in math mode, the \char -% of \backslashcurfont ends up printing the roman \ from the math symbol -% font (because \char in math mode uses the \mathcode, and plain.tex -% sets \mathcode`\\="026E). Hence we use an explicit \mathchar, +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. -@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} -@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. - +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash +% \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. +% the literal character `\'. Also revert - to its normal character, in +% case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% - @passthroughcharstrue @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater + @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde - @let\=@ttbackslash @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have @fixbackslash turn them back on. -@catcode`+=@other @catcode`@_=@other +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive -% \enablebackslashhack - allow file to begin `\input texinfo' -% % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. -% If the file did not have a `\input texinfo', then it is turned off after -% the first line; otherwise the first `\' in the file would cause an error. -% This is used on the very last line of this file, texinfo.tex. -% We also use @c to call @fixbackslash, in case ends of lines are hidden. -{ -@catcode`@^=7 -@catcode`@^^M=13@gdef@enablebackslashhack{% - @global@let\ = @eatinput% - @catcode`@^^M=13% - @def@c{@fixbackslash@c}% - % Definition for the newline at the end of this file. - @def ^^M{@let^^M@secondlinenl}% - % Definition for a newline in the main Texinfo file. - @gdef @secondlinenl{@fixbackslash}% - % In case the first line has a whole-line command on it - @let@originalparsearg@parsearg - @def@parsearg{@fixbackslash@originalparsearg} -}} - -{@catcode`@^=7 @catcode`@^^M=13% -@gdef@eatinput input texinfo#1^^M{@fixbackslash}} - -% Emergency active definition of newline, in case an active newline token -% appears by mistake. -{@catcode`@^=7 @catcode13=13% -@gdef@enableemergencynewline{% - @gdef^^M{% - @par% - %@par% -}}} - +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% @gdef@fixbackslash{% - @ifx\@eatinput @let\ = @ttbackslash @fi - @catcode13=5 % regular end of line - @enableemergencynewline - @let@c=@comment - @let@parsearg@originalparsearg - % Also turn back on active characters that might appear in the input - % file name, in case not using a pre-dumped format. + @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active - % - % If texinfo.cnf is present on the system, read it. - % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets - % called at the beginning of every Texinfo file. Not opening texinfo.cnf - % directly in this file, texinfo.tex, makes it possible to make a format - % file for Texinfo. - % - @openin 1 texinfo.cnf - @ifeof 1 @else @input texinfo.cnf @fi - @closein 1 } - % Say @foo, not \foo, in error messages. @escapechar = `@@ @@ -11602,8 +10065,8 @@ directory should work if nowhere else does.} @markupsetuprqdefault @c Local variables: -@c eval: (add-hook 'before-save-hook 'time-stamp) -@c page-delimiter: "^\\\\message\\|emacs-page" +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @@ -11611,4 +10074,6 @@ directory should work if nowhere else does.} @c vim:sw=2: -@enablebackslashhack +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/doc/tinc.info b/doc/tinc.info index 7ee4d91..332704c 100644 --- a/doc/tinc.info +++ b/doc/tinc.info @@ -1,14 +1,14 @@ -This is tinc.info, produced by makeinfo version 6.7 from tinc.texi. +This is tinc.info, produced by makeinfo version 6.5 from tinc.texi. INFO-DIR-SECTION Networking tools START-INFO-DIR-ENTRY * tinc: (tinc). The tinc Manual. END-INFO-DIR-ENTRY -This is the info manual for tinc version 1.0.36, a Virtual Private +This is the info manual for tinc version 1.0.34, a Virtual Private Network daemon. - Copyright (C) 1998-2019 Ivo Timmermans, Guus Sliepen + Copyright (C) 1998-2018 Ivo Timmermans, Guus Sliepen and Wessel Dankers . Permission is granted to make and distribute verbatim copies of this @@ -117,10 +117,10 @@ for both the receiving and sending end, it has become largely runtime-configurable--in short, it has become a full-fledged professional package. - Tinc also allows more than two sites to connect to each other and -form a single VPN. Traditionally VPNs are created by making tunnels, -which only have two endpoints. Larger VPNs with more sites are created -by adding more tunnels. Tinc takes another approach: only endpoints are + Tinc also allows more than two sites to connect to eachother and form +a single VPN. Traditionally VPNs are created by making tunnels, which +only have two endpoints. Larger VPNs with more sites are created by +adding more tunnels. Tinc takes another approach: only endpoints are specified, the software itself will take care of creating the tunnels. This allows for easier configuration and improved scalability. @@ -373,9 +373,9 @@ if available. Make sure you install the development AND runtime versions of this package. If you have to install zlib manually, you can get the source code -from . Instructions on how to configure, build and -install this package are included within the package. Please make sure -you build development and runtime libraries (which is the default). +from . Instructions on how to configure, build +and install this package are included within the package. Please make +sure you build development and runtime libraries (which is the default).  File: tinc.info, Node: lzo, Prev: zlib, Up: Libraries @@ -791,13 +791,13 @@ DeviceType = (platform dependent) uml (not compiled in by default) Create a UNIX socket with the filename specified by DEVICE, or - '/run/NETNAME.umlsocket' if not specified. Tinc will wait for - a User Mode Linux instance to connect to this socket. + '/var/run/NETNAME.umlsocket' if not specified. Tinc will wait + for a User Mode Linux instance to connect to this socket. vde (not compiled in by default) Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch, using the UNIX socket specified - by DEVICE, or '/run/vde.ctl' if not specified. + by DEVICE, or '/var/run/vde.ctl' if not specified. Also, in case tinc does not seem to correctly interpret packets received from the virtual network device, it can be used to change @@ -1597,7 +1597,7 @@ command line options. '/var/log/tinc.NETNAME.log'. '--pidfile=FILE' - Write PID to FILE instead of '/run/tinc.NETNAME.pid'. + Write PID to FILE instead of '/var/run/tinc.NETNAME.pid'. '--bypass-security' Disables encryption and authentication. Only useful for debugging. @@ -1939,7 +1939,8 @@ correct destination MAC address. In those modes every interface should have a unique MAC address, so make sure they are not the same. Because switch and hub modes rely on MAC addresses to function correctly, these modes cannot be used on the following operating systems which don't have -a 'tap' style virtual network device: NetBSD, Darwin and Solaris. +a 'tap' style virtual network device: OpenBSD, NetBSD, Darwin and +Solaris.  File: tinc.info, Node: The meta-connection, Prev: The UDP tunnel, Up: The connection @@ -2278,7 +2279,7 @@ address these issues in tinc 2.0. Cryptography is a hard thing to get right. We cannot make any guarantees. Time, review and feedback are the only things that can prove the security of any cryptographic product. If you wish to review -tinc or give us feedback, you are strongly encouraged to do so. +tinc or give us feedback, you are stronly encouraged to do so.  File: tinc.info, Node: Platform specific information, Next: About us, Prev: Technical information, Up: Top @@ -2329,6 +2330,11 @@ Solaris 'ifconfig' INTERFACE 'inet6 plumb up' Darwin (Mac OS X) 'ifconfig' INTERFACE 'inet6' ADDRESS 'prefixlen' PREFIXLENGTH Windows 'netsh interface ipv6 add address' INTERFACE 'static' ADDRESS/PREFIXLENGTH + On some platforms, when running tinc in switch mode, the VPN +interface must be set to tap mode with an ifconfig command: + +OpenBSD 'ifconfig' INTERFACE 'link0' + On Linux, it is possible to create a persistent tun/tap interface which will continue to exist even if tinc quit, although this is normally not required. It can be useful to set up a tun/tap interface @@ -2720,71 +2726,66 @@ Node: Top806 Node: Introduction1105 Node: Virtual Private Networks1915 Node: tinc3639 -Node: Supported platforms5167 -Node: Preparations5868 -Node: Configuring the kernel6124 -Node: Configuration of Linux kernels6534 -Node: Configuration of FreeBSD kernels7389 -Node: Configuration of OpenBSD kernels7854 -Node: Configuration of NetBSD kernels8211 -Node: Configuration of Solaris kernels8616 -Node: Configuration of Darwin (Mac OS X) kernels9279 -Node: Configuration of Windows10098 -Node: Libraries10638 -Node: LibreSSL/OpenSSL11047 -Node: zlib13589 -Node: lzo14618 -Node: Installation15601 -Node: Building and installing tinc16511 -Node: Darwin (Mac OS X) build environment17171 -Node: Cygwin (Windows) build environment17736 -Node: MinGW (Windows) build environment18325 -Node: System files18919 -Node: Device files19184 -Node: Other files19600 -Node: Configuration20213 -Node: Configuration introduction20524 -Node: Multiple networks21792 -Node: How connections work23218 -Node: Configuration files24440 -Node: Main configuration variables25934 -Node: Host configuration variables42182 -Node: Scripts47714 -Node: How to configure50980 -Node: Generating keypairs52238 -Node: Network interfaces52737 -Node: Example configuration54585 -Node: Running tinc59910 -Node: Runtime options60500 -Node: Signals64125 -Node: Debug levels65316 -Node: Solving problems66252 -Node: Error messages67804 -Node: Sending bug reports71813 -Node: Technical information72760 -Node: The connection72991 -Node: The UDP tunnel73303 -Node: The meta-connection76355 -Node: The meta-protocol77824 -Node: Security82841 -Node: Authentication protocol83983 -Node: Encryption of network packets89028 -Node: Security issues90404 -Node: Platform specific information92044 -Node: Interface configuration92304 -Node: Routes94600 -Node: Automatically starting tinc96650 -Node: Linux96873 -Node: Windows98094 -Node: Other platforms98599 -Node: About us98881 -Node: Contact information99056 -Node: Authors99459 -Node: Concept Index99864 +Node: Supported platforms5166 +Node: Preparations5867 +Node: Configuring the kernel6123 +Node: Configuration of Linux kernels6533 +Node: Configuration of FreeBSD kernels7388 +Node: Configuration of OpenBSD kernels7853 +Node: Configuration of NetBSD kernels8210 +Node: Configuration of Solaris kernels8615 +Node: Configuration of Darwin (Mac OS X) kernels9278 +Node: Configuration of Windows10097 +Node: Libraries10637 +Node: LibreSSL/OpenSSL11046 +Node: zlib13588 +Node: lzo14620 +Node: Installation15603 +Node: Building and installing tinc16513 +Node: Darwin (Mac OS X) build environment17173 +Node: Cygwin (Windows) build environment17738 +Node: MinGW (Windows) build environment18327 +Node: System files18921 +Node: Device files19186 +Node: Other files19602 +Node: Configuration20215 +Node: Configuration introduction20526 +Node: Multiple networks21794 +Node: How connections work23220 +Node: Configuration files24442 +Node: Main configuration variables25936 +Node: Host configuration variables42192 +Node: Scripts47724 +Node: How to configure50990 +Node: Generating keypairs52248 +Node: Network interfaces52747 +Node: Example configuration54595 +Node: Running tinc59920 +Node: Runtime options60510 +Node: Signals64139 +Node: Debug levels65330 +Node: Solving problems66266 +Node: Error messages67818 +Node: Sending bug reports71827 +Node: Technical information72774 +Node: The connection73005 +Node: The UDP tunnel73317 +Node: The meta-connection76378 +Node: The meta-protocol77847 +Node: Security82864 +Node: Authentication protocol84006 +Node: Encryption of network packets89051 +Node: Security issues90427 +Node: Platform specific information92066 +Node: Interface configuration92326 +Node: Routes94797 +Node: Automatically starting tinc96847 +Node: Linux97070 +Node: Windows98291 +Node: Other platforms98796 +Node: About us99078 +Node: Contact information99253 +Node: Authors99656 +Node: Concept Index100061  End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/doc/tinc.texi b/doc/tinc.texi index 0420e6f..532bbb5 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -15,7 +15,7 @@ This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon. -Copyright @copyright{} 1998-2019 Ivo Timmermans, +Copyright @copyright{} 1998-2018 Ivo Timmermans, Guus Sliepen and Wessel Dankers . @@ -39,7 +39,7 @@ permission notice identical to this one. @vskip 0pt plus 1filll This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon. -Copyright @copyright{} 1998-2019 Ivo Timmermans, +Copyright @copyright{} 1998-2018 Ivo Timmermans, Guus Sliepen and Wessel Dankers . @@ -155,7 +155,7 @@ professional package. @cindex traditional VPNs @cindex scalability -Tinc also allows more than two sites to connect to each other and form a single VPN. +Tinc also allows more than two sites to connect to eachother and form a single VPN. Traditionally VPNs are created by making tunnels, which only have two endpoints. Larger VPNs with more sites are created by adding more tunnels. Tinc takes another approach: only endpoints are specified, @@ -421,7 +421,7 @@ available. Make sure you install the development AND runtime versions of this package. If you have to install zlib manually, you can get the source code -from @url{https://zlib.net/}. Instructions on how to configure, +from @url{http://www.zlib.net/}. Instructions on how to configure, build and install this package are included within the package. Please make sure you build development and runtime libraries (which is the default). @@ -2075,7 +2075,7 @@ In switch or hub modes ARP does work so the sender already knows the correct des In those modes every interface should have a unique MAC address, so make sure they are not the same. Because switch and hub modes rely on MAC addresses to function correctly, these modes cannot be used on the following operating systems which don't have a `tap' style virtual network device: -NetBSD, Darwin and Solaris. +OpenBSD, NetBSD, Darwin and Solaris. @c ================================================================== @@ -2433,7 +2433,7 @@ We will address these issues in tinc 2.0. Cryptography is a hard thing to get right. We cannot make any guarantees. Time, review and feedback are the only things that can prove the security of any cryptographic product. If you wish to review -tinc or give us feedback, you are strongly encouraged to do so. +tinc or give us feedback, you are stronly encouraged to do so. @c ================================================================== @@ -2500,6 +2500,13 @@ For IPv6 addresses: @tab @code{netsh interface ipv6 add address} @var{interface} @code{static} @var{address}/@var{prefixlength} @end multitable +On some platforms, when running tinc in switch mode, the VPN interface must be set to tap mode with an ifconfig command: + +@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface} +@item OpenBSD +@tab @code{ifconfig} @var{interface} @code{link0} +@end multitable + On Linux, it is possible to create a persistent tun/tap interface which will continue to exist even if tinc quit, although this is normally not required. It can be useful to set up a tun/tap interface owned by a non-root user, so diff --git a/doc/tincinclude.texi b/doc/tincinclude.texi index ab2a41a..7eac5f3 100644 --- a/doc/tincinclude.texi +++ b/doc/tincinclude.texi @@ -1,5 +1,5 @@ -@set VERSION 1.0.36 +@set VERSION 1.0.34 @set PACKAGE tinc @set sysconfdir /etc @set localstatedir /var -@set runstatedir /run +@set runstatedir /var/run diff --git a/install-sh b/install-sh index 20d8b2e..59990a1 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,18 +271,15 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename. + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac + dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` @@ -291,11 +288,6 @@ do fi fi - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -332,16 +324,14 @@ do # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 @@ -444,25 +434,14 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && - { test -z "$stripcmd" || { - # Create $dsttmp read-write so that cp doesn't create it read-only, - # which would cause strip to fail. - if test -z "$doit"; then - : >"$dsttmp" # No need to fork-exec 'touch'. - else - $doit touch "$dsttmp" - fi - } - } && - $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -521,9 +500,9 @@ do done # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" +# time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: diff --git a/missing b/missing index 8d0eaad..f62bbae 100755 --- a/missing +++ b/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2018-03-07.03; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2018-03-07.03; # UTC # 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, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" +# time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: diff --git a/src/Makefile.in b/src/Makefile.in index 5d52921..a1def2b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -178,29 +178,7 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/avl_tree.Po ./$(DEPDIR)/conf.Po \ - ./$(DEPDIR)/connection.Po ./$(DEPDIR)/dropin.Po \ - ./$(DEPDIR)/dummy_device.Po ./$(DEPDIR)/edge.Po \ - ./$(DEPDIR)/event.Po ./$(DEPDIR)/fake-getaddrinfo.Po \ - ./$(DEPDIR)/fake-getnameinfo.Po ./$(DEPDIR)/getopt.Po \ - ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/graph.Po \ - ./$(DEPDIR)/list.Po ./$(DEPDIR)/logger.Po ./$(DEPDIR)/meta.Po \ - ./$(DEPDIR)/multicast_device.Po ./$(DEPDIR)/net.Po \ - ./$(DEPDIR)/net_packet.Po ./$(DEPDIR)/net_setup.Po \ - ./$(DEPDIR)/net_socket.Po ./$(DEPDIR)/netutl.Po \ - ./$(DEPDIR)/node.Po ./$(DEPDIR)/pidfile.Po \ - ./$(DEPDIR)/process.Po ./$(DEPDIR)/protocol.Po \ - ./$(DEPDIR)/protocol_auth.Po ./$(DEPDIR)/protocol_edge.Po \ - ./$(DEPDIR)/protocol_key.Po ./$(DEPDIR)/protocol_misc.Po \ - ./$(DEPDIR)/protocol_subnet.Po ./$(DEPDIR)/proxy.Po \ - ./$(DEPDIR)/raw_socket_device.Po ./$(DEPDIR)/route.Po \ - ./$(DEPDIR)/subnet.Po ./$(DEPDIR)/tincd.Po \ - ./$(DEPDIR)/uml_device.Po ./$(DEPDIR)/utils.Po \ - ./$(DEPDIR)/vde_device.Po bsd/$(DEPDIR)/device.Po \ - bsd/$(DEPDIR)/tunemu.Po cygwin/$(DEPDIR)/device.Po \ - linux/$(DEPDIR)/device.Po mingw/$(DEPDIR)/device.Po \ - solaris/$(DEPDIR)/device.Po +am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -376,8 +354,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -504,56 +482,50 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl_tree.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropin.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getaddrinfo.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getnameinfo.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multicast_device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_packet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_setup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_socket.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_auth.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_edge.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_key.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_misc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_subnet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_socket_device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subnet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincd.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml_device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vde_device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/tunemu.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@cygwin/$(DEPDIR)/device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@mingw/$(DEPDIR)/device.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@solaris/$(DEPDIR)/device.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl_tree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getaddrinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getnameinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multicast_device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_setup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_auth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_edge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_key.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_misc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_subnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_socket_device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml_device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vde_device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/tunemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@cygwin/$(DEPDIR)/device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@mingw/$(DEPDIR)/device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@solaris/$(DEPDIR)/device.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -623,10 +595,7 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) +distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -708,50 +677,7 @@ clean: clean-am clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/avl_tree.Po - -rm -f ./$(DEPDIR)/conf.Po - -rm -f ./$(DEPDIR)/connection.Po - -rm -f ./$(DEPDIR)/dropin.Po - -rm -f ./$(DEPDIR)/dummy_device.Po - -rm -f ./$(DEPDIR)/edge.Po - -rm -f ./$(DEPDIR)/event.Po - -rm -f ./$(DEPDIR)/fake-getaddrinfo.Po - -rm -f ./$(DEPDIR)/fake-getnameinfo.Po - -rm -f ./$(DEPDIR)/getopt.Po - -rm -f ./$(DEPDIR)/getopt1.Po - -rm -f ./$(DEPDIR)/graph.Po - -rm -f ./$(DEPDIR)/list.Po - -rm -f ./$(DEPDIR)/logger.Po - -rm -f ./$(DEPDIR)/meta.Po - -rm -f ./$(DEPDIR)/multicast_device.Po - -rm -f ./$(DEPDIR)/net.Po - -rm -f ./$(DEPDIR)/net_packet.Po - -rm -f ./$(DEPDIR)/net_setup.Po - -rm -f ./$(DEPDIR)/net_socket.Po - -rm -f ./$(DEPDIR)/netutl.Po - -rm -f ./$(DEPDIR)/node.Po - -rm -f ./$(DEPDIR)/pidfile.Po - -rm -f ./$(DEPDIR)/process.Po - -rm -f ./$(DEPDIR)/protocol.Po - -rm -f ./$(DEPDIR)/protocol_auth.Po - -rm -f ./$(DEPDIR)/protocol_edge.Po - -rm -f ./$(DEPDIR)/protocol_key.Po - -rm -f ./$(DEPDIR)/protocol_misc.Po - -rm -f ./$(DEPDIR)/protocol_subnet.Po - -rm -f ./$(DEPDIR)/proxy.Po - -rm -f ./$(DEPDIR)/raw_socket_device.Po - -rm -f ./$(DEPDIR)/route.Po - -rm -f ./$(DEPDIR)/subnet.Po - -rm -f ./$(DEPDIR)/tincd.Po - -rm -f ./$(DEPDIR)/uml_device.Po - -rm -f ./$(DEPDIR)/utils.Po - -rm -f ./$(DEPDIR)/vde_device.Po - -rm -f bsd/$(DEPDIR)/device.Po - -rm -f bsd/$(DEPDIR)/tunemu.Po - -rm -f cygwin/$(DEPDIR)/device.Po - -rm -f linux/$(DEPDIR)/device.Po - -rm -f mingw/$(DEPDIR)/device.Po - -rm -f solaris/$(DEPDIR)/device.Po + -rm -rf ./$(DEPDIR) bsd/$(DEPDIR) cygwin/$(DEPDIR) linux/$(DEPDIR) mingw/$(DEPDIR) solaris/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -797,50 +723,7 @@ install-ps-am: installcheck-am: installcheck-sbinPROGRAMS maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/avl_tree.Po - -rm -f ./$(DEPDIR)/conf.Po - -rm -f ./$(DEPDIR)/connection.Po - -rm -f ./$(DEPDIR)/dropin.Po - -rm -f ./$(DEPDIR)/dummy_device.Po - -rm -f ./$(DEPDIR)/edge.Po - -rm -f ./$(DEPDIR)/event.Po - -rm -f ./$(DEPDIR)/fake-getaddrinfo.Po - -rm -f ./$(DEPDIR)/fake-getnameinfo.Po - -rm -f ./$(DEPDIR)/getopt.Po - -rm -f ./$(DEPDIR)/getopt1.Po - -rm -f ./$(DEPDIR)/graph.Po - -rm -f ./$(DEPDIR)/list.Po - -rm -f ./$(DEPDIR)/logger.Po - -rm -f ./$(DEPDIR)/meta.Po - -rm -f ./$(DEPDIR)/multicast_device.Po - -rm -f ./$(DEPDIR)/net.Po - -rm -f ./$(DEPDIR)/net_packet.Po - -rm -f ./$(DEPDIR)/net_setup.Po - -rm -f ./$(DEPDIR)/net_socket.Po - -rm -f ./$(DEPDIR)/netutl.Po - -rm -f ./$(DEPDIR)/node.Po - -rm -f ./$(DEPDIR)/pidfile.Po - -rm -f ./$(DEPDIR)/process.Po - -rm -f ./$(DEPDIR)/protocol.Po - -rm -f ./$(DEPDIR)/protocol_auth.Po - -rm -f ./$(DEPDIR)/protocol_edge.Po - -rm -f ./$(DEPDIR)/protocol_key.Po - -rm -f ./$(DEPDIR)/protocol_misc.Po - -rm -f ./$(DEPDIR)/protocol_subnet.Po - -rm -f ./$(DEPDIR)/proxy.Po - -rm -f ./$(DEPDIR)/raw_socket_device.Po - -rm -f ./$(DEPDIR)/route.Po - -rm -f ./$(DEPDIR)/subnet.Po - -rm -f ./$(DEPDIR)/tincd.Po - -rm -f ./$(DEPDIR)/uml_device.Po - -rm -f ./$(DEPDIR)/utils.Po - -rm -f ./$(DEPDIR)/vde_device.Po - -rm -f bsd/$(DEPDIR)/device.Po - -rm -f bsd/$(DEPDIR)/tunemu.Po - -rm -f cygwin/$(DEPDIR)/device.Po - -rm -f linux/$(DEPDIR)/device.Po - -rm -f mingw/$(DEPDIR)/device.Po - -rm -f solaris/$(DEPDIR)/device.Po + -rm -rf ./$(DEPDIR) bsd/$(DEPDIR) cygwin/$(DEPDIR) linux/$(DEPDIR) mingw/$(DEPDIR) solaris/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -860,19 +743,19 @@ uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-sbinPROGRAMS cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installcheck-sbinPROGRAMS installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am \ + installcheck-sbinPROGRAMS installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile diff --git a/src/conf.c b/src/conf.c index 3f81877..c933f09 100644 --- a/src/conf.c +++ b/src/conf.c @@ -81,9 +81,18 @@ config_t *new_config(void) { } void free_config(config_t *cfg) { - free(cfg->variable); - free(cfg->value); - free(cfg->file); + if(cfg->variable) { + free(cfg->variable); + } + + if(cfg->value) { + free(cfg->value); + } + + if(cfg->file) { + free(cfg->file); + } + free(cfg); } @@ -195,7 +204,7 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) { } bool get_config_subnet(const config_t *cfg, subnet_t **result) { - subnet_t subnet = {0}; + subnet_t subnet = {}; if(!cfg) { return false; @@ -423,11 +432,7 @@ bool read_server_config(void) { // And we try to read the ones that end with ".conf" if(l > 5 && !strcmp(".conf", & ep->d_name[ l - 5 ])) { - if((size_t)snprintf(fname, sizeof(fname), "%s/%s", dname, ep->d_name) >= sizeof(fname)) { - logger(LOG_ERR, "Pathname too long: %s/%s", dname, ep->d_name); - return false; - } - + snprintf(fname, sizeof(fname), "%s/%s", dname, ep->d_name); x = read_config_file(config_tree, fname); } } @@ -467,14 +472,9 @@ static void disable_old_keys(const char *filename) { return; } - int len = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename); + snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename); - if(len < 0 || len >= PATH_MAX) { - fprintf(stderr, "Pathname too long: %s.tmp\n", filename); - w = NULL; - } else { - w = fopen(tmpfile, "w"); - } + w = fopen(tmpfile, "w"); while(fgets(buf, sizeof(buf), r)) { if(!strncmp(buf, "-----BEGIN RSA", 14)) { @@ -573,12 +573,7 @@ FILE *ask_and_open(const char *filename, const char *what) { #endif /* The directory is a relative path or a filename. */ getcwd(directory, sizeof(directory)); - - if((size_t)snprintf(abspath, sizeof(abspath), "%s/%s", directory, fn) >= sizeof(abspath)) { - fprintf(stderr, "Pathname too long: %s/%s\n", directory, fn); - return NULL; - } - + snprintf(abspath, sizeof(abspath), "%s/%s", directory, fn); fn = abspath; } diff --git a/src/connection.c b/src/connection.c index d137af1..38b3ccf 100644 --- a/src/connection.c +++ b/src/connection.c @@ -96,13 +96,13 @@ void free_connection_partially(connection_t *c) { c->outbudget = 0; if(c->inctx) { - EVP_CIPHER_CTX_reset(c->inctx); + EVP_CIPHER_CTX_cleanup(c->inctx); free(c->inctx); c->inctx = NULL; } if(c->outctx) { - EVP_CIPHER_CTX_reset(c->outctx); + EVP_CIPHER_CTX_cleanup(c->outctx); free(c->outctx); c->outctx = NULL; } diff --git a/src/connection.h b/src/connection.h index d619e85..8c2d9f3 100644 --- a/src/connection.h +++ b/src/connection.h @@ -24,10 +24,6 @@ #include #include -#if OPENSSL_VERSION_NUMBER < 0x10100000L -#define EVP_CIPHER_CTX_reset(c) EVP_CIPHER_CTX_cleanup(c) -#endif - #include "avl_tree.h" #define OPTION_INDIRECT 0x0001 @@ -46,8 +42,7 @@ typedef struct connection_status_t { unsigned int decryptin: 1; /* 1 if we have to decrypt incoming traffic */ unsigned int mst: 1; /* 1 if this connection is part of a minimum spanning tree */ unsigned int proxy_passed: 1; /* 1 if we are connecting via a proxy and we have finished talking with it */ - unsigned int tarpit: 1; /* 1 if the connection should be added to the tarpit */ - unsigned int unused: 21; + unsigned int unused: 22; } connection_status_t; #include "edge.h" diff --git a/src/dummy_device.c b/src/dummy_device.c index d1d751b..4b01072 100644 --- a/src/dummy_device.c +++ b/src/dummy_device.c @@ -37,8 +37,6 @@ static bool setup_device(void) { } static void close_device(void) { - free(device); - free(iface); } static bool read_packet(vpn_packet_t *packet) { diff --git a/src/fake-getaddrinfo.c b/src/fake-getaddrinfo.c index 1ee11c5..231bd5c 100644 --- a/src/fake-getaddrinfo.c +++ b/src/fake-getaddrinfo.c @@ -2,10 +2,10 @@ * fake library for ssh * * This file includes getaddrinfo(), freeaddrinfo() and gai_strerror(). - * These functions are defined in rfc2133. + * These funtions are defined in rfc2133. * * But these functions are not implemented correctly. The minimum subset - * is implemented for ssh use only. For example, this routine assumes + * is implemented for ssh use only. For exapmle, this routine assumes * that ai_family is AF_INET. Don't use it for another purpose. */ diff --git a/src/fake-getnameinfo.c b/src/fake-getnameinfo.c index e51bce2..88b78a5 100644 --- a/src/fake-getnameinfo.c +++ b/src/fake-getnameinfo.c @@ -2,10 +2,10 @@ * fake library for ssh * * This file includes getnameinfo(). - * These functions are defined in rfc2133. + * These funtions are defined in rfc2133. * * But these functions are not implemented correctly. The minimum subset - * is implemented for ssh use only. For example, this routine assumes + * is implemented for ssh use only. For exapmle, this routine assumes * that ai_family is AF_INET. Don't use it for another purpose. */ diff --git a/src/getopt.c b/src/getopt.c index 741c7f2..1f6c27b 100644 --- a/src/getopt.c +++ b/src/getopt.c @@ -83,7 +83,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif #endif -#if defined (WIN32) && !defined (__CYGWIN32__) +#if defined (WIN32) && !defined (__CYGWIN32__32) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() diff --git a/src/graph.c b/src/graph.c index c63fdf9..832e017 100644 --- a/src/graph.c +++ b/src/graph.c @@ -274,9 +274,9 @@ static void sssp_bfs(void) { n->mtuevent = NULL; } - xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); xasprintf(&envp[3], "NODE=%s", n->name); sockaddr2str(&n->address, &address, &port); xasprintf(&envp[4], "REMOTEADDRESS=%s", address); @@ -360,13 +360,13 @@ void dump_graph(void) { /* dump all nodes first */ for(node = node_tree->head; node; node = node->next) { n = node->data; - fprintf(file, " \"%s\" [label = \"%s\"];\n", n->name, n->name); + fprintf(file, " %s [label = \"%s\"];\n", n->name, n->name); } /* now dump all edges */ for(node = edge_weight_tree->head; node; node = node->next) { e = node->data; - fprintf(file, " \"%s\" -> \"%s\";\n", e->from->name, e->to->name); + fprintf(file, " %s -> %s;\n", e->from->name, e->to->name); } fprintf(file, "}\n"); diff --git a/src/net.c b/src/net.c index 37ae116..1fecd88 100644 --- a/src/net.c +++ b/src/net.c @@ -180,22 +180,6 @@ static int build_fdset(fd_set *readset, fd_set *writeset) { return max; } -/* Put a misbehaving connection in the tarpit */ -void tarpit(int fd) { - static int pits[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - static int next_pit = 0; - - if(pits[next_pit] != -1) { - closesocket(pits[next_pit]); - } - - pits[next_pit++] = fd; - - if(next_pit >= (int)(sizeof pits / sizeof pits[0])) { - next_pit = 0; - } -} - /* Terminate a connection: - Close the socket @@ -219,11 +203,7 @@ void terminate_connection(connection_t *c, bool report) { } if(c->socket) { - if(c->status.tarpit) { - tarpit(c->socket); - } else { - closesocket(c->socket); - } + closesocket(c->socket); } if(c->edge) { @@ -319,7 +299,6 @@ static void check_dead_connections(void) { closesocket(c->socket); do_outgoing_connection(c); } else { - c->status.tarpit = true; terminate_connection(c, false); } } @@ -401,7 +380,6 @@ static void check_network_activity(fd_set *readset, fd_set *writeset) { if(FD_ISSET(c->socket, readset)) { if(!receive_meta(c)) { - c->status.tarpit = true; terminate_connection(c, c->status.active); continue; } diff --git a/src/net.h b/src/net.h index a9becb6..a73cb04 100644 --- a/src/net.h +++ b/src/net.h @@ -150,7 +150,6 @@ extern void flush_queue(struct node_t *n); extern bool read_rsa_public_key(struct connection_t *c); extern void send_mtu_probe(struct node_t *n); extern void load_all_subnets(void); -extern void tarpit(int fd); #ifndef HAVE_MINGW #define closesocket(s) close(s) diff --git a/src/net_setup.c b/src/net_setup.c index f26007b..5eddb1a 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "avl_tree.h" #include "conf.h" @@ -240,7 +239,7 @@ static bool read_rsa_private_key(void) { return false; } -#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN) +#if !defined(HAVE_MINGW) && !defined(HAVE___CYGWIN32__) struct stat s; if(!fstat(fileno(fp), &s)) { @@ -389,8 +388,8 @@ static bool setup_myself(void) { char *address = NULL; char *proxy = NULL; char *space; - char *envp[5] = {0}; - struct addrinfo *ai, *aip, hint = {0}; + char *envp[5] = {}; + struct addrinfo *ai, *aip, hint = {}; bool choice; int i, err; int replaywin_int; @@ -853,15 +852,15 @@ static bool setup_myself(void) { } /* Run tinc-up script to further initialize the tap interface */ - xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); xasprintf(&envp[3], "NAME=%s", myself->name); #ifdef HAVE_MINGW Sleep(1000); #endif -#ifdef HAVE_CYGWIN +#ifdef HAVE___CYGWIN32__ sleep(1); #endif execute_script("tinc-up", envp); @@ -1069,7 +1068,7 @@ bool setup_network(void) { void close_network_connections(void) { avl_node_t *node, *next; connection_t *c; - char *envp[5] = {0}; + char *envp[5] = {}; int i; for(node = connection_tree->head; node; node = next) { @@ -1100,9 +1099,9 @@ void close_network_connections(void) { close(listen_socket[i].udp); } - xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); xasprintf(&envp[3], "NAME=%s", myself->name); exit_requests(); diff --git a/src/net_socket.c b/src/net_socket.c index 6195c16..3467804 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -639,9 +639,6 @@ void setup_outgoing_connection(outgoing_t *outgoing) { new connection */ bool handle_new_meta_connection(int sock) { - static const int max_accept_burst = 10; - static int last_accept_burst; - static int last_accept_time; connection_t *c; sockaddr_t sa; int fd; @@ -654,22 +651,6 @@ bool handle_new_meta_connection(int sock) { return false; } - if(last_accept_time == now) { - last_accept_burst++; - - if(last_accept_burst >= max_accept_burst) { - if(last_accept_burst == max_accept_burst) { - ifdebug(CONNECTIONS) logger(LOG_WARNING, "Throttling incoming connections"); - } - - tarpit(fd); - return false; - } - } else { - last_accept_burst = 0; - last_accept_time = now; - } - sockaddrunmap(&sa); c = new_connection(); @@ -691,6 +672,7 @@ bool handle_new_meta_connection(int sock) { connection_add(c); c->allow_request = ID; + send_id(c); return true; } diff --git a/src/netutl.c b/src/netutl.c index abe3d87..3c2a77d 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -33,7 +33,7 @@ bool hostnames = false; Return NULL on failure. */ struct addrinfo *str2addrinfo(const char *address, const char *service, int socktype) { - struct addrinfo *ai = NULL, hint = {0}; + struct addrinfo *ai = NULL, hint = {}; int err; hint.ai_family = addressfamily; @@ -55,7 +55,7 @@ struct addrinfo *str2addrinfo(const char *address, const char *service, int sock } sockaddr_t str2sockaddr(const char *address, const char *port) { - struct addrinfo *ai = NULL, hint = {0}; + struct addrinfo *ai = NULL, hint = {}; sockaddr_t result; int err; diff --git a/src/node.c b/src/node.c index 03be21c..12bc38f 100644 --- a/src/node.c +++ b/src/node.c @@ -140,7 +140,7 @@ void node_del(node_t *n) { } node_t *lookup_node(char *name) { - node_t n = {0}; + node_t n = {}; n.name = name; @@ -148,7 +148,7 @@ node_t *lookup_node(char *name) { } node_t *lookup_node_udp(const sockaddr_t *sa) { - node_t n = {0}; + node_t n = {}; n.address = *sa; n.name = NULL; diff --git a/src/protocol.c b/src/protocol.c index 4f74d3b..d04f9ef 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -193,7 +193,7 @@ void exit_requests(void) { } bool seen_request(char *request) { - past_request_t *new, p = {0}; + past_request_t *new, p = {}; p.request = request; diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 15807c3..95bb751 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -60,7 +60,7 @@ bool id_h(connection_t *c) { /* Check if identity is a valid name */ - if(!check_id(name) || !strcmp(name, myself->name)) { + if(!check_id(name)) { logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ID", c->name, c->hostname, "invalid name"); return false; @@ -96,11 +96,6 @@ bool id_h(connection_t *c) { } c->allow_request = ACK; - - if(!c->outgoing) { - send_id(c); - } - return send_ack(c); } @@ -120,10 +115,6 @@ bool id_h(connection_t *c) { c->allow_request = METAKEY; - if(!c->outgoing) { - send_id(c); - } - return send_metakey(c); } @@ -310,8 +301,7 @@ bool metakey_h(connection_t *c) { c->inbudget = byte_budget(c->incipher); c->status.decryptin = true; } else { - logger(LOG_ERR, "%s (%s) uses null cipher!", c->name, c->hostname); - return false; + c->incipher = NULL; } c->inmaclength = maclength; @@ -329,8 +319,7 @@ bool metakey_h(connection_t *c) { return false; } } else { - logger(LOG_ERR, "%s (%s) uses null digest!", c->name, c->hostname); - return false; + c->indigest = NULL; } c->incompression = compression; @@ -404,11 +393,7 @@ bool challenge_h(connection_t *c) { /* Rest is done by send_chal_reply() */ - if(c->outgoing) { - return send_chal_reply(c); - } else { - return true; - } + return send_chal_reply(c); } bool send_chal_reply(connection_t *c) { @@ -510,10 +495,6 @@ bool chal_reply_h(connection_t *c) { c->allow_request = ACK; - if(!c->outgoing) { - send_chal_reply(c); - } - return send_ack(c); } diff --git a/src/protocol_edge.c b/src/protocol_edge.c index a1cf640..be48e0d 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -70,7 +70,7 @@ bool add_edge_h(connection_t *c) { /* Check if names are valid */ - if(!check_id(from_name) || !check_id(to_name) || !strcmp(from_name, to_name)) { + if(!check_id(from_name) || !check_id(to_name)) { logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ADD_EDGE", c->name, c->hostname, "invalid name"); return false; @@ -197,7 +197,7 @@ bool del_edge_h(connection_t *c) { /* Check if names are valid */ - if(!check_id(from_name) || !check_id(to_name) || !strcmp(from_name, to_name)) { + if(!check_id(from_name) || !check_id(to_name)) { logger(LOG_ERR, "Got bad %s from %s (%s): %s", "DEL_EDGE", c->name, c->hostname, "invalid name"); return false; diff --git a/src/protocol_key.c b/src/protocol_key.c index 6140a53..ee292b6 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -286,11 +286,6 @@ bool ans_key_h(connection_t *c) { return true; } } else { - if(from->outkeylength != 1) { - logger(LOG_ERR, "Node %s (%s) uses wrong keylength!", from->name, from->hostname); - return true; - } - from->outcipher = NULL; } diff --git a/src/protocol_subnet.c b/src/protocol_subnet.c index 2c4d08f..01aed64 100644 --- a/src/protocol_subnet.c +++ b/src/protocol_subnet.c @@ -46,7 +46,7 @@ bool add_subnet_h(connection_t *c) { char subnetstr[MAX_STRING_SIZE]; char name[MAX_STRING_SIZE]; node_t *owner; - subnet_t s = {0}, *new, *old; + subnet_t s = {}, *new, *old; if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) { logger(LOG_ERR, "Got bad %s from %s (%s)", "ADD_SUBNET", c->name, @@ -160,7 +160,7 @@ bool del_subnet_h(connection_t *c) { char subnetstr[MAX_STRING_SIZE]; char name[MAX_STRING_SIZE]; node_t *owner; - subnet_t s = {0}, *find; + subnet_t s = {}, *find; if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) { logger(LOG_ERR, "Got bad %s from %s (%s)", "DEL_SUBNET", c->name, diff --git a/src/route.c b/src/route.c index f8b11bb..8b7a13c 100644 --- a/src/route.c +++ b/src/route.c @@ -116,8 +116,8 @@ static void swap_mac_addresses(vpn_packet_t *packet) { /* RFC 792 */ static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, length_t ether_size, uint8_t type, uint8_t code) { - struct ip ip = {0}; - struct icmp icmp = {0}; + struct ip ip = {}; + struct icmp icmp = {}; struct in_addr ip_src; struct in_addr ip_dst; @@ -218,7 +218,7 @@ static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, length_ static void route_ipv6_unreachable(node_t *source, vpn_packet_t *packet, length_t ether_size, uint8_t type, uint8_t code) { struct ip6_hdr ip6; - struct icmp6_hdr icmp6 = {0}; + struct icmp6_hdr icmp6 = {}; uint16_t checksum; struct { @@ -581,7 +581,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et ifdebug(TRAFFIC) logger(LOG_INFO, "Fragmenting packet of %d bytes to %s (%s)", packet->len, dest->name, dest->hostname); offset = packet->data + ether_size + ip_size; - maxlen = (MAX(dest->mtu, 590) - ether_size - ip_size) & ~0x7; + maxlen = (dest->mtu - ether_size - ip_size) & ~0x7; ip_off = ntohs(ip.ip_off); origf = ip_off & ~IP_OFFMASK; ip_off &= IP_OFFMASK; @@ -632,13 +632,11 @@ static void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) { } if(!subnet->owner->status.reachable) { - route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_UNREACH); - return; + return route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_UNREACH); } if(forwarding_mode == FMODE_OFF && source != myself && subnet->owner != myself) { - route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_ANO); - return; + return route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_ANO); } if(decrement_ttl && source != myself && subnet->owner != myself) @@ -658,8 +656,7 @@ static void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) { } if(directonly && subnet->owner != via) { - route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_ANO); - return; + return route_ipv4_unreachable(source, packet, ether_size, ICMP_DEST_UNREACH, ICMP_NET_ANO); } if(via && packet->len > MAX(via->mtu, 590) && via != myself) { @@ -726,20 +723,17 @@ static void route_ipv6_unicast(node_t *source, vpn_packet_t *packet) { } if(!subnet->owner->status.reachable) { - route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOROUTE); - return; + return route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOROUTE); } if(forwarding_mode == FMODE_OFF && source != myself && subnet->owner != myself) { - route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN); - return; + return route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN); } - if(decrement_ttl && source != myself && subnet->owner != myself) { + if(decrement_ttl && source != myself && subnet->owner != myself) if(!do_decrement_ttl(source, packet)) { return; } - } if(priorityinheritance) { packet->priority = ((packet->data[14] & 0x0f) << 4) | (packet->data[15] >> 4); @@ -753,8 +747,7 @@ static void route_ipv6_unicast(node_t *source, vpn_packet_t *packet) { } if(directonly && subnet->owner != via) { - route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN); - return; + return route_ipv6_unreachable(source, packet, ether_size, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN); } if(via && packet->len > MAX(via->mtu, 1294) && via != myself) { @@ -882,7 +875,7 @@ static void route_neighborsol(node_t *source, vpn_packet_t *packet) { memcpy(packet->data, packet->data + ETH_ALEN, ETH_ALEN); /* copy destination address */ packet->data[ETH_ALEN * 2 - 1] ^= 0xFF; /* mangle source address so it looks like it's not from us */ - ip6.ip6_dst = ip6.ip6_src; /* swap destination and source protocol address */ + ip6.ip6_dst = ip6.ip6_src; /* swap destination and source protocoll address */ ip6.ip6_src = ns.nd_ns_target; if(has_opt) { diff --git a/src/subnet.c b/src/subnet.c index 154fd80..b4c7913 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -1,6 +1,6 @@ /* subnet.c -- handle subnet lookups and lists - Copyright (C) 2000-2019 Guus Sliepen , + Copyright (C) 2000-2014 Guus Sliepen , 2000-2005 Ivo Timmermans This program is free software; you can redistribute it and/or modify @@ -205,85 +205,21 @@ void subnet_del(node_t *n, subnet_t *subnet) { /* Ascii representation of subnets */ bool str2net(subnet_t *subnet, const char *subnetstr) { - char str[1024]; - strncpy(str, subnetstr, sizeof(str)); - str[sizeof(str) - 1] = 0; - int consumed; - - int weight = 10; - char *weight_separator = strchr(str, '#'); - - if(weight_separator) { - char *weight_str = weight_separator + 1; - - if(sscanf(weight_str, "%d%n", &weight, &consumed) < 1) { - return false; - } - - if(weight_str[consumed]) { - return false; - } - - *weight_separator = 0; - } - - int prefixlength = -1; - char *prefixlength_separator = strchr(str, '/'); - - if(prefixlength_separator) { - char *prefixlength_str = prefixlength_separator + 1; - - if(sscanf(prefixlength_str, "%d%n", &prefixlength, &consumed) < 1) { - return false; - } - - if(prefixlength_str[consumed]) { - return false; - } - - *prefixlength_separator = 0; - - if(prefixlength < 0) { - return false; - } - } - + int i, l; uint16_t x[8]; + int weight = 10; - if(sscanf(str, "%hx:%hx:%hx:%hx:%hx:%hx%n", &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &consumed) >= 6 && !str[consumed]) { - /* - Normally we should check that each part has two digits to prevent ambiguities. - However, in old tinc versions net2str() will aggressively return MAC addresses with one-digit parts, - so we have to accept them otherwise we would be unable to parse ADD_SUBNET messages. - */ - if(prefixlength >= 0) { - return false; - } - - subnet->type = SUBNET_MAC; - subnet->weight = weight; - - for(int i = 0; i < 6; i++) { - subnet->net.mac.address.x[i] = x[i]; - } - - return true; - } - - if(sscanf(str, "%hu.%hu.%hu.%hu%n", &x[0], &x[1], &x[2], &x[3], &consumed) >= 4 && !str[consumed]) { - if(prefixlength == -1) { - prefixlength = 32; - } - - if(prefixlength > 32) { + if(sscanf(subnetstr, "%hu.%hu.%hu.%hu/%d#%d", + &x[0], &x[1], &x[2], &x[3], &l, &weight) >= 5) { + if(l < 0 || l > 32) { return false; } subnet->type = SUBNET_IPV4; - subnet->net.ipv4.prefixlength = prefixlength; + subnet->net.ipv4.prefixlength = l; subnet->weight = weight; - for(int i = 0; i < 4; i++) { + for(i = 0; i < 4; i++) { if(x[i] > 255) { return false; } @@ -294,73 +230,152 @@ bool str2net(subnet_t *subnet, const char *subnetstr) { return true; } - /* IPv6 */ - - char *last_colon = strrchr(str, ':'); - - if(last_colon && sscanf(last_colon, ":%hu.%hu.%hu.%hu%n", &x[0], &x[1], &x[2], &x[3], &consumed) >= 4 && !last_colon[consumed]) { - /* Dotted quad suffix notation, convert to standard IPv6 notation */ - for(int i = 0; i < 4; i++) - if(x[i] > 255) { - return false; - } - - snprintf(last_colon, sizeof(str) - (last_colon - str), ":%02x%02x:%02x%02x", x[0], x[1], x[2], x[3]); - } - - char *double_colon = strstr(str, "::"); - - if(double_colon) { - /* Figure out how many zero groups we need to expand */ - int zero_group_count = 8; - - for(const char *cur = str; *cur; cur++) - if(*cur != ':') { - zero_group_count--; - - while(cur[1] && cur[1] != ':') { - cur++; - } - } - - if(zero_group_count < 1) { - return false; - } - - /* Split the double colon in the middle to make room for zero groups */ - double_colon++; - memmove(double_colon + (zero_group_count * 2 - 1), double_colon, strlen(double_colon) + 1); - - /* Write zero groups in the resulting gap, overwriting the second colon */ - for(int i = 0; i < zero_group_count; i++) { - memcpy(&double_colon[i * 2], "0:", 2); - } - - /* Remove any leading or trailing colons */ - if(str[0] == ':') { - memmove(&str[0], &str[1], strlen(&str[1]) + 1); - } - - if(str[strlen(str) - 1] == ':') { - str[strlen(str) - 1] = 0; - } - } - - if(sscanf(str, "%hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx%n", - &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &x[6], &x[7], &consumed) >= 8 && !str[consumed]) { - if(prefixlength == -1) { - prefixlength = 128; - } - - if(prefixlength > 128) { + if(sscanf(subnetstr, "%hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx/%d#%d", + &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &x[6], &x[7], + &l, &weight) >= 9) { + if(l < 0 || l > 128) { return false; } subnet->type = SUBNET_IPV6; - subnet->net.ipv6.prefixlength = prefixlength; + subnet->net.ipv6.prefixlength = l; subnet->weight = weight; - for(int i = 0; i < 8; i++) { + for(i = 0; i < 8; i++) { + subnet->net.ipv6.address.x[i] = htons(x[i]); + } + + return true; + } + + if(sscanf(subnetstr, "%hu.%hu.%hu.%hu#%d", &x[0], &x[1], &x[2], &x[3], &weight) >= 4) { + subnet->type = SUBNET_IPV4; + subnet->net.ipv4.prefixlength = 32; + subnet->weight = weight; + + for(i = 0; i < 4; i++) { + if(x[i] > 255) { + return false; + } + + subnet->net.ipv4.address.x[i] = x[i]; + } + + return true; + } + + if(sscanf(subnetstr, "%hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx#%d", + &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &x[6], &x[7], &weight) >= 8) { + subnet->type = SUBNET_IPV6; + subnet->net.ipv6.prefixlength = 128; + subnet->weight = weight; + + for(i = 0; i < 8; i++) { + subnet->net.ipv6.address.x[i] = htons(x[i]); + } + + return true; + } + + if(sscanf(subnetstr, "%hx:%hx:%hx:%hx:%hx:%hx#%d", + &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &weight) >= 6) { + subnet->type = SUBNET_MAC; + subnet->weight = weight; + + for(i = 0; i < 6; i++) { + subnet->net.mac.address.x[i] = x[i]; + } + + return true; + } + + // IPv6 short form + if(strstr(subnetstr, "::")) { + const char *p; + char *q; + int colons = 0; + + // Count number of colons + for(p = subnetstr; *p; p++) + if(*p == ':') { + colons++; + } + + if(colons > 7) { + return false; + } + + // Scan numbers before the double colon + p = subnetstr; + + for(i = 0; i < colons; i++) { + if(*p == ':') { + break; + } + + x[i] = strtoul(p, &q, 0x10); + + if(!q || p == q || *q != ':') { + return false; + } + + p = ++q; + } + + p++; + colons -= i; + + if(!i) { + p++; + colons--; + } + + if(!*p || *p == '/' || *p == '#') { + colons--; + } + + // Fill in the blanks + for(; i < 8 - colons; i++) { + x[i] = 0; + } + + // Scan the remaining numbers + for(; i < 8; i++) { + x[i] = strtoul(p, &q, 0x10); + + if(!q || p == q) { + return false; + } + + if(i == 7) { + p = q; + break; + } + + if(*q != ':') { + return false; + } + + p = ++q; + } + + l = 128; + + if(*p == '/') { + sscanf(p, "/%d#%d", &l, &weight); + } else if(*p == '#') { + sscanf(p, "#%d", &weight); + } + + if(l < 0 || l > 128) { + return false; + } + + subnet->type = SUBNET_IPV6; + subnet->net.ipv6.prefixlength = l; + subnet->weight = weight; + + for(i = 0; i < 8; i++) { subnet->net.ipv6.address.x[i] = htons(x[i]); } @@ -372,7 +387,7 @@ bool str2net(subnet_t *subnet, const char *subnetstr) { bool net2str(char *netstr, int len, const subnet_t *subnet) { if(!netstr || !subnet) { - logger(LOG_ERR, "net2str() was called with netstr=%p, subnet=%p!", (void *)netstr, (void *)subnet); + logger(LOG_ERR, "net2str() was called with netstr=%p, subnet=%p!", netstr, subnet); return false; } @@ -577,9 +592,9 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { // Prepare environment variables to be passed to the script - xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); xasprintf(&envp[3], "NODE=%s", owner->name); xasprintf(&envp[4], "NAME=%s", myself->name); @@ -612,8 +627,13 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { } // Prepare the SUBNET and WEIGHT variables - free(envp[5]); - free(envp[6]); + if(envp[5]) { + free(envp[5]); + } + + if(envp[6]) { + free(envp[6]); + } xasprintf(&envp[5], "SUBNET=%s", netstr); xasprintf(&envp[6], "WEIGHT=%s", weight); @@ -639,7 +659,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { } } - for(i = 0; i < 9; i++) { + for(i = 0; envp[i] && i < 9; i++) { free(envp[i]); } } diff --git a/src/tincd.c b/src/tincd.c index 066ad9c..bc04f5f 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -1,7 +1,7 @@ /* tincd.c -- the main file for tincd Copyright (C) 1998-2005 Ivo Timmermans - 2000-2019 Guus Sliepen + 2000-2018 Guus Sliepen 2008 Max Rijevski 2009 Michael Tokarev 2010 Julien Muchembled @@ -37,10 +37,7 @@ #include #include #include -#ifndef OPENSSL_NO_ENGINE #include -#endif -#include #ifdef HAVE_LZO #include LZO1X_H @@ -437,10 +434,7 @@ static bool keygen(int bits) { BN_GENCB_set(cb, indicator, NULL); rsa_key = RSA_new(); - - if(BN_hex2bn(&e, "10001") == 0) { - abort(); - } + BN_hex2bn(&e, "10001"); if(!rsa_key || !e) { abort(); @@ -565,11 +559,25 @@ static void make_names(void) { } static void free_names() { - free(identname); - free(netname); - free(pidfilename); - free(logfilename); - free(confbase); + if(identname) { + free(identname); + } + + if(netname) { + free(netname); + } + + if(pidfilename) { + free(pidfilename); + } + + if(logfilename) { + free(logfilename); + } + + if(confbase) { + free(confbase); + } } static bool drop_privs() { @@ -654,7 +662,7 @@ int main(int argc, char **argv) { if(show_version) { printf("%s version %s\n", PACKAGE, VERSION); - printf("Copyright (C) 1998-2019 Ivo Timmermans, Guus Sliepen and others.\n" + printf("Copyright (C) 1998-2018 Ivo Timmermans, Guus Sliepen and others.\n" "See the AUTHORS file for a complete list.\n\n" "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" "and you are welcome to redistribute it under certain conditions;\n" @@ -688,14 +696,14 @@ int main(int argc, char **argv) { init_configuration(&config_tree); -#ifndef OPENSSL_NO_ENGINE + /* Slllluuuuuuurrrrp! */ + + RAND_load_file("/dev/urandom", 1024); + ENGINE_load_builtin_engines(); ENGINE_register_all_complete(); -#endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L OpenSSL_add_all_algorithms(); -#endif if(generate_keys) { read_server_config(); @@ -814,13 +822,9 @@ end: free(priority); -#if OPENSSL_VERSION_NUMBER < 0x10100000L EVP_cleanup(); ERR_free_strings(); -#ifndef OPENSSL_NO_ENGINE ENGINE_cleanup(); -#endif -#endif exit_configuration(&config_tree); list_delete_list(cmdline_conf); diff --git a/src/uml_device.c b/src/uml_device.c index 66de431..49f26ff 100644 --- a/src/uml_device.c +++ b/src/uml_device.c @@ -181,7 +181,10 @@ void close_device(void) { unlink(device); free(device); - free(iface); + + if(iface) { + free(iface); + } } static bool read_packet(vpn_packet_t *packet) { diff --git a/src/utils.c b/src/utils.c index 70a5c99..28f60e8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -54,8 +54,8 @@ void bin2hex(char *src, char *dst, int length) { } } -#if defined(HAVE_MINGW) || defined(HAVE_CYGWIN) -#ifdef HAVE_CYGWIN +#if defined(HAVE_MINGW) || defined(HAVE___CYGWIN32__) +#ifdef HAVE___CYGWIN32__ #include #endif diff --git a/src/utils.h b/src/utils.h index 7952025..fbeae5e 100644 --- a/src/utils.h +++ b/src/utils.h @@ -24,11 +24,8 @@ extern bool hex2bin(char *src, char *dst, int length); extern void bin2hex(char *src, char *dst, int length); -#if defined(HAVE_MINGW) || defined(HAVE_CYGWIN) -extern const char *winerror(int); -#endif - #ifdef HAVE_MINGW +extern const char *winerror(int); #define strerror(x) ((x)>0?strerror(x):winerror(GetLastError())) #define sockerrno WSAGetLastError() #define sockstrerror(x) winerror(x) diff --git a/src/xalloc.h b/src/xalloc.h index cda0871..0eecda5 100644 --- a/src/xalloc.h +++ b/src/xalloc.h @@ -2,7 +2,7 @@ #define TINC_XALLOC_H /* - xalloc.h -- malloc and related functions with out of memory checking + xalloc.h -- malloc and related fuctions with out of memory checking Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. Copyright (C) 2011-2017 Guus Sliepen diff --git a/systemd/Makefile.in b/systemd/Makefile.in index e27e947..b7f47b8 100644 --- a/systemd/Makefile.in +++ b/systemd/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -281,8 +281,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -321,10 +321,7 @@ ctags CTAGS: cscope cscopelist: -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) +distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \