diff options
| author | Paul Eggert | 2019-04-30 09:44:38 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-30 09:45:08 -0700 |
| commit | 46b434a62cea06bdcb3c8d9ee18284ab59e9b012 (patch) | |
| tree | b14b9963adc009ecbf2f380630bf443a57f2ee87 | |
| parent | 826f1e260121edc5185e0ed3fa20a781fbddc9a2 (diff) | |
| download | emacs-46b434a62cea06bdcb3c8d9ee18284ab59e9b012.tar.gz emacs-46b434a62cea06bdcb3c8d9ee18284ab59e9b012.zip | |
Update from Gnulib
* build-aux/config.guess, doc/misc/texinfo.tex:
* lib/mktime-internal.h, lib/mktime.c, lib/timegm.c:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
| -rwxr-xr-x | build-aux/config.guess | 27 | ||||
| -rw-r--r-- | doc/misc/texinfo.tex | 516 | ||||
| -rw-r--r-- | lib/gnulib.mk.in | 1 | ||||
| -rw-r--r-- | lib/mktime-internal.h | 60 | ||||
| -rw-r--r-- | lib/mktime.c | 71 | ||||
| -rw-r--r-- | lib/timegm.c | 32 |
6 files changed, 349 insertions, 358 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess index 79d1317f52b..4cd9454b35c 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Attempt to guess a canonical system name. | 2 | # Attempt to guess a canonical system name. |
| 3 | # Copyright 1992-2019 Free Software Foundation, Inc. | 3 | # Copyright 1992-2019 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | timestamp='2019-03-04' | 5 | timestamp='2019-04-28' |
| 6 | 6 | ||
| 7 | # This file is free software; you can redistribute it and/or modify it | 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by | 8 | # under the terms of the GNU General Public License as published by |
| @@ -1468,6 +1468,14 @@ cat > "$dummy.c" <<EOF | |||
| 1468 | #include <sys/types.h> | 1468 | #include <sys/types.h> |
| 1469 | #include <sys/utsname.h> | 1469 | #include <sys/utsname.h> |
| 1470 | #endif | 1470 | #endif |
| 1471 | #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | ||
| 1472 | #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | ||
| 1473 | #include <signal.h> | ||
| 1474 | #if defined(_SIZE_T_) || defined(SIGLOST) | ||
| 1475 | #include <sys/utsname.h> | ||
| 1476 | #endif | ||
| 1477 | #endif | ||
| 1478 | #endif | ||
| 1471 | main () | 1479 | main () |
| 1472 | { | 1480 | { |
| 1473 | #if defined (sony) | 1481 | #if defined (sony) |
| @@ -1555,18 +1563,23 @@ main () | |||
| 1555 | printf ("vax-dec-bsd\n"); exit (0); | 1563 | printf ("vax-dec-bsd\n"); exit (0); |
| 1556 | #endif | 1564 | #endif |
| 1557 | #else | 1565 | #else |
| 1566 | #if defined(_SIZE_T_) || defined(SIGLOST) | ||
| 1567 | struct utsname un; | ||
| 1568 | uname (&un); | ||
| 1569 | printf ("vax-dec-ultrix%s\n", un.release); exit (0); | ||
| 1570 | #else | ||
| 1558 | printf ("vax-dec-ultrix\n"); exit (0); | 1571 | printf ("vax-dec-ultrix\n"); exit (0); |
| 1559 | #endif | 1572 | #endif |
| 1560 | #endif | 1573 | #endif |
| 1574 | #endif | ||
| 1561 | #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | 1575 | #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) |
| 1562 | #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | 1576 | #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) |
| 1563 | #include <signal.h> | 1577 | #if defined(_SIZE_T_) || defined(SIGLOST) |
| 1564 | #if defined(_SIZE_T_) /* >= ULTRIX4 */ | 1578 | struct utsname *un; |
| 1565 | printf ("mips-dec-ultrix4\n"); exit (0); | 1579 | uname (&un); |
| 1580 | printf ("mips-dec-ultrix%s\n", un.release); exit (0); | ||
| 1566 | #else | 1581 | #else |
| 1567 | #if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST) | 1582 | printf ("mips-dec-ultrix\n"); exit (0); |
| 1568 | printf ("mips-dec-ultrix3\n"); exit (0); | ||
| 1569 | #endif | ||
| 1570 | #endif | 1583 | #endif |
| 1571 | #endif | 1584 | #endif |
| 1572 | #endif | 1585 | #endif |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 192284cccc1..ccd112941ac 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,8 +3,7 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2019-03-03.15} | 6 | \def\texinfoversion{2019-04-12.13} |
| 7 | |||
| 8 | % | 7 | % |
| 9 | % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. | 8 | % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. |
| 10 | % | 9 | % |
| @@ -387,14 +386,8 @@ | |||
| 387 | % take effect in \write's, yet the group defined by the \vbox ends | 386 | % take effect in \write's, yet the group defined by the \vbox ends |
| 388 | % before the \shipout runs. | 387 | % before the \shipout runs. |
| 389 | % | 388 | % |
| 390 | \indexdummies % don't expand commands in the output. | 389 | \atdummies % don't expand commands in the output. |
| 391 | \normalturnoffactive % \ in index entries must not stay \, e.g., if | 390 | \turnoffactive |
| 392 | % the page break happens to be in the middle of an example. | ||
| 393 | % We don't want .vr (or whatever) entries like this: | ||
| 394 | % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} | ||
| 395 | % "\acronym" won't work when it's read back in; | ||
| 396 | % it needs to be | ||
| 397 | % {\code {{\backslashcurfont }acronym} | ||
| 398 | \shipout\vbox{% | 391 | \shipout\vbox{% |
| 399 | % Do this early so pdf references go to the beginning of the page. | 392 | % Do this early so pdf references go to the beginning of the page. |
| 400 | \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi | 393 | \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi |
| @@ -455,11 +448,10 @@ | |||
| 455 | }% | 448 | }% |
| 456 | } | 449 | } |
| 457 | 450 | ||
| 458 | % First remove any @comment, then any @c comment. Also remove a @texinfoc | 451 | % First remove any @comment, then any @c comment. Pass the result on to |
| 459 | % comment (see \scanmacro for details). Pass the result on to \argcheckspaces. | 452 | % \argcheckspaces. |
| 460 | \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} | 453 | \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} |
| 461 | \def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} | 454 | \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} |
| 462 | \def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} | ||
| 463 | 455 | ||
| 464 | % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. | 456 | % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. |
| 465 | % | 457 | % |
| @@ -1131,6 +1123,16 @@ where each line of input produces a line of output.} | |||
| 1131 | \fi | 1123 | \fi |
| 1132 | \fi | 1124 | \fi |
| 1133 | 1125 | ||
| 1126 | \newif\ifpdforxetex | ||
| 1127 | \pdforxetexfalse | ||
| 1128 | \ifpdf | ||
| 1129 | \pdforxetextrue | ||
| 1130 | \fi | ||
| 1131 | \ifx\XeTeXrevision\thisisundefined\else | ||
| 1132 | \pdforxetextrue | ||
| 1133 | \fi | ||
| 1134 | |||
| 1135 | |||
| 1134 | % PDF uses PostScript string constants for the names of xref targets, | 1136 | % PDF uses PostScript string constants for the names of xref targets, |
| 1135 | % for display in the outlines, and in other places. Thus, we have to | 1137 | % for display in the outlines, and in other places. Thus, we have to |
| 1136 | % double any backslashes. Otherwise, a name like "\node" will be | 1138 | % double any backslashes. Otherwise, a name like "\node" will be |
| @@ -2173,7 +2175,7 @@ end | |||
| 2173 | % A few fonts for @defun names and args. | 2175 | % A few fonts for @defun names and args. |
| 2174 | \setfont\defbf\bfshape{10}{\magstep1}{OT1} | 2176 | \setfont\defbf\bfshape{10}{\magstep1}{OT1} |
| 2175 | \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} | 2177 | \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} |
| 2176 | \setfont\defsl\slshape{10}{\magstep1}{OT1TT} | 2178 | \setfont\defsl\slshape{10}{\magstep1}{OT1} |
| 2177 | \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} | 2179 | \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} |
| 2178 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf | 2180 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf |
| 2179 | \let\ttslfont=\defttsl \let\slfont=\defsl \bf} | 2181 | \let\ttslfont=\defttsl \let\slfont=\defsl \bf} |
| @@ -2321,7 +2323,7 @@ end | |||
| 2321 | % A few fonts for @defun names and args. | 2323 | % A few fonts for @defun names and args. |
| 2322 | \setfont\defbf\bfshape{10}{\magstephalf}{OT1} | 2324 | \setfont\defbf\bfshape{10}{\magstephalf}{OT1} |
| 2323 | \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} | 2325 | \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} |
| 2324 | \setfont\defsl\slshape{10}{\magstephalf}{OT1TT} | 2326 | \setfont\defsl\slshape{10}{\magstephalf}{OT1} |
| 2325 | \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} | 2327 | \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} |
| 2326 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf | 2328 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf |
| 2327 | \let\slfont=\defsl \let\ttslfont=\defttsl \bf} | 2329 | \let\slfont=\defsl \let\ttslfont=\defttsl \bf} |
| @@ -2844,7 +2846,7 @@ end | |||
| 2844 | 2846 | ||
| 2845 | % @t, explicit typewriter. | 2847 | % @t, explicit typewriter. |
| 2846 | \def\t#1{% | 2848 | \def\t#1{% |
| 2847 | {\tt \rawbackslash \plainfrenchspacing #1}% | 2849 | {\tt \plainfrenchspacing #1}% |
| 2848 | \null | 2850 | \null |
| 2849 | } | 2851 | } |
| 2850 | 2852 | ||
| @@ -2871,7 +2873,6 @@ end | |||
| 2871 | % Turn off hyphenation. | 2873 | % Turn off hyphenation. |
| 2872 | \nohyphenation | 2874 | \nohyphenation |
| 2873 | % | 2875 | % |
| 2874 | \rawbackslash | ||
| 2875 | \plainfrenchspacing | 2876 | \plainfrenchspacing |
| 2876 | #1% | 2877 | #1% |
| 2877 | }% | 2878 | }% |
| @@ -3097,9 +3098,9 @@ end | |||
| 3097 | % Allow a ragged right output to aid breaking long URL's. Putting stretch in | 3098 | % Allow a ragged right output to aid breaking long URL's. Putting stretch in |
| 3098 | % between characters of the URL doesn't look good. | 3099 | % between characters of the URL doesn't look good. |
| 3099 | \def\urefallowbreak{% | 3100 | \def\urefallowbreak{% |
| 3100 | \hskip 0pt plus 1fil\relax | 3101 | \hskip 0pt plus 4 em\relax |
| 3101 | \allowbreak | 3102 | \allowbreak |
| 3102 | \hskip 0pt plus -1fil\relax | 3103 | \hskip 0pt plus -4 em\relax |
| 3103 | } | 3104 | } |
| 3104 | 3105 | ||
| 3105 | \urefbreakstyle after | 3106 | \urefbreakstyle after |
| @@ -3112,7 +3113,7 @@ end | |||
| 3112 | % So now @email is just like @uref, unless we are pdf. | 3113 | % So now @email is just like @uref, unless we are pdf. |
| 3113 | % | 3114 | % |
| 3114 | %\def\email#1{\angleleft{\tt #1}\angleright} | 3115 | %\def\email#1{\angleleft{\tt #1}\angleright} |
| 3115 | \ifpdf | 3116 | \ifpdforxetex |
| 3116 | \def\email#1{\doemail#1,,\finish} | 3117 | \def\email#1{\doemail#1,,\finish} |
| 3117 | \def\doemail#1,#2,#3\finish{\begingroup | 3118 | \def\doemail#1,#2,#3\finish{\begingroup |
| 3118 | \unsepspaces | 3119 | \unsepspaces |
| @@ -3122,18 +3123,7 @@ end | |||
| 3122 | \endlink | 3123 | \endlink |
| 3123 | \endgroup} | 3124 | \endgroup} |
| 3124 | \else | 3125 | \else |
| 3125 | \ifx\XeTeXrevision\thisisundefined | 3126 | \let\email=\uref |
| 3126 | \let\email=\uref | ||
| 3127 | \else | ||
| 3128 | \def\email#1{\doemail#1,,\finish} | ||
| 3129 | \def\doemail#1,#2,#3\finish{\begingroup | ||
| 3130 | \unsepspaces | ||
| 3131 | \pdfurl{mailto:#1}% | ||
| 3132 | \setbox0 = \hbox{\ignorespaces #2}% | ||
| 3133 | \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi | ||
| 3134 | \endlink | ||
| 3135 | \endgroup} | ||
| 3136 | \fi | ||
| 3137 | \fi | 3127 | \fi |
| 3138 | 3128 | ||
| 3139 | % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | 3129 | % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), |
| @@ -4667,19 +4657,6 @@ end | |||
| 4667 | } | 4657 | } |
| 4668 | } | 4658 | } |
| 4669 | 4659 | ||
| 4670 | % We have this subroutine so that we can handle at least some @value's | ||
| 4671 | % properly in indexes (we call \makevalueexpandable in \indexdummies). | ||
| 4672 | % The command has to be fully expandable (if the variable is set), since | ||
| 4673 | % the result winds up in the index file. This means that if the | ||
| 4674 | % variable's value contains other Texinfo commands, it's almost certain | ||
| 4675 | % it will fail (although perhaps we could fix that with sufficient work | ||
| 4676 | % to do a one-level expansion on the result, instead of complete). | ||
| 4677 | % | ||
| 4678 | % Unfortunately, this has the consequence that when _ is in the *value* | ||
| 4679 | % of an @set, it does not print properly in the roman fonts (get the cmr | ||
| 4680 | % dot accent at position 126 instead). No fix comes to mind, and it's | ||
| 4681 | % been this way since 2003 or earlier, so just ignore it. | ||
| 4682 | % | ||
| 4683 | \def\expandablevalue#1{% | 4660 | \def\expandablevalue#1{% |
| 4684 | \expandafter\ifx\csname SET#1\endcsname\relax | 4661 | \expandafter\ifx\csname SET#1\endcsname\relax |
| 4685 | {[No value for ``#1'']}% | 4662 | {[No value for ``#1'']}% |
| @@ -4708,7 +4685,7 @@ end | |||
| 4708 | % if possible, otherwise sort late. | 4685 | % if possible, otherwise sort late. |
| 4709 | \def\indexnofontsvalue#1{% | 4686 | \def\indexnofontsvalue#1{% |
| 4710 | \expandafter\ifx\csname SET#1\endcsname\relax | 4687 | \expandafter\ifx\csname SET#1\endcsname\relax |
| 4711 | ZZZZZZZ | 4688 | ZZZZZZZ% |
| 4712 | \else | 4689 | \else |
| 4713 | \csname SET#1\endcsname | 4690 | \csname SET#1\endcsname |
| 4714 | \fi | 4691 | \fi |
| @@ -4858,23 +4835,8 @@ end | |||
| 4858 | \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} | 4835 | \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} |
| 4859 | 4836 | ||
| 4860 | 4837 | ||
| 4861 | % Used when writing an index entry out to an index file to prevent | 4838 | % Used for the aux, toc and index files to prevent expansion of Texinfo |
| 4862 | % expansion of Texinfo commands that can appear in an index entry. | 4839 | % commands. |
| 4863 | % | ||
| 4864 | \def\indexdummies{% | ||
| 4865 | \escapechar = `\\ % use backslash in output files. | ||
| 4866 | \definedummyletter\@% | ||
| 4867 | \definedummyletter\ % | ||
| 4868 | % | ||
| 4869 | % For texindex which always views { and } as separators. | ||
| 4870 | \def\{{\lbracechar{}}% | ||
| 4871 | \def\}{\rbracechar{}}% | ||
| 4872 | % | ||
| 4873 | % Do the redefinitions. | ||
| 4874 | \definedummies | ||
| 4875 | } | ||
| 4876 | |||
| 4877 | % Used for the aux and toc files, where @ is the escape character. | ||
| 4878 | % | 4840 | % |
| 4879 | \def\atdummies{% | 4841 | \def\atdummies{% |
| 4880 | \definedummyletter\@% | 4842 | \definedummyletter\@% |
| @@ -4904,8 +4866,7 @@ end | |||
| 4904 | \def\definedummyletter#1{\def#1{\string#1}}% | 4866 | \def\definedummyletter#1{\def#1{\string#1}}% |
| 4905 | \let\definedummyaccent\definedummyletter | 4867 | \let\definedummyaccent\definedummyletter |
| 4906 | 4868 | ||
| 4907 | % Called from \indexdummies and \atdummies, to effectively prevent | 4869 | % Called from \atdummies to prevent the expansion of commands. |
| 4908 | % the expansion of commands. | ||
| 4909 | % | 4870 | % |
| 4910 | \def\definedummies{% | 4871 | \def\definedummies{% |
| 4911 | % | 4872 | % |
| @@ -4954,6 +4915,7 @@ end | |||
| 4954 | % Assorted special characters. | 4915 | % Assorted special characters. |
| 4955 | \definedummyword\atchar | 4916 | \definedummyword\atchar |
| 4956 | \definedummyword\arrow | 4917 | \definedummyword\arrow |
| 4918 | \definedummyword\backslashchar | ||
| 4957 | \definedummyword\bullet | 4919 | \definedummyword\bullet |
| 4958 | \definedummyword\comma | 4920 | \definedummyword\comma |
| 4959 | \definedummyword\copyright | 4921 | \definedummyword\copyright |
| @@ -5070,11 +5032,10 @@ end | |||
| 5070 | \commondummyword\xref | 5032 | \commondummyword\xref |
| 5071 | } | 5033 | } |
| 5072 | 5034 | ||
| 5073 | % This does nothing, but for a time it was recommended to use | ||
| 5074 | % \usebracesinindexestrue to be able to use braces in index entries. | ||
| 5075 | |||
| 5076 | \let\indexlbrace\relax | 5035 | \let\indexlbrace\relax |
| 5077 | \let\indexrbrace\relax | 5036 | \let\indexrbrace\relax |
| 5037 | \let\indexatchar\relax | ||
| 5038 | \let\indexbackslash\relax | ||
| 5078 | 5039 | ||
| 5079 | {\catcode`\@=0 | 5040 | {\catcode`\@=0 |
| 5080 | \catcode`\\=13 | 5041 | \catcode`\\=13 |
| @@ -5108,10 +5069,8 @@ end | |||
| 5108 | } | 5069 | } |
| 5109 | 5070 | ||
| 5110 | \gdef\indexnonalnumreappear{% | 5071 | \gdef\indexnonalnumreappear{% |
| 5111 | \useindexbackslash | ||
| 5112 | \let-\normaldash | 5072 | \let-\normaldash |
| 5113 | \let<\normalless | 5073 | \let<\normalless |
| 5114 | \def\@{@}% | ||
| 5115 | } | 5074 | } |
| 5116 | } | 5075 | } |
| 5117 | 5076 | ||
| @@ -5222,8 +5181,6 @@ end | |||
| 5222 | 5181 | ||
| 5223 | 5182 | ||
| 5224 | 5183 | ||
| 5225 | \let\SETmarginindex=\relax % put index entries in margin (undocumented)? | ||
| 5226 | |||
| 5227 | % #1 is the index name, #2 is the entry text. | 5184 | % #1 is the index name, #2 is the entry text. |
| 5228 | \def\doind#1#2{% | 5185 | \def\doind#1#2{% |
| 5229 | \iflinks | 5186 | \iflinks |
| @@ -5255,13 +5212,6 @@ end | |||
| 5255 | \fi} | 5212 | \fi} |
| 5256 | \def\indexisfl{fl} | 5213 | \def\indexisfl{fl} |
| 5257 | 5214 | ||
| 5258 | % Output \ as {\indexbackslash}, because \ is an escape character in | ||
| 5259 | % the index files. | ||
| 5260 | \let\indexbackslash=\relax | ||
| 5261 | {\catcode`\@=0 \catcode`\\=\active | ||
| 5262 | @gdef@useindexbackslash{@def\{{@indexbackslash}}} | ||
| 5263 | } | ||
| 5264 | |||
| 5265 | % Definition for writing index entry sort key. | 5215 | % Definition for writing index entry sort key. |
| 5266 | { | 5216 | { |
| 5267 | \catcode`\-=13 | 5217 | \catcode`\-=13 |
| @@ -5273,14 +5223,31 @@ end | |||
| 5273 | \xdef\indexsortkey{#1}\endgroup} | 5223 | \xdef\indexsortkey{#1}\endgroup} |
| 5274 | } | 5224 | } |
| 5275 | 5225 | ||
| 5226 | \def\indexwriteseealso#1{ | ||
| 5227 | \gdef\pagenumbertext{@seealso{#1}}% | ||
| 5228 | } | ||
| 5229 | \def\indexwriteseeentry#1{ | ||
| 5230 | \gdef\pagenumbertext{@seeentry{#1}}% | ||
| 5231 | } | ||
| 5232 | |||
| 5233 | % The default definitions | ||
| 5234 | \def\sortas#1{}% | ||
| 5235 | \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only | ||
| 5236 | \def\putwordSeeAlso{See also} | ||
| 5237 | \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only | ||
| 5238 | |||
| 5239 | |||
| 5276 | % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": | 5240 | % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": |
| 5277 | % * Set \bracedtext to "{aaa}{bbb}" | 5241 | % * Set \bracedtext to "{aaa}{bbb}" |
| 5278 | % * Set \fullindexsortkey to "aaa @subentry ZZZ" | 5242 | % * Set \fullindexsortkey to "aaa @subentry ZZZ" |
| 5243 | % * If @seealso occurs, set \pagenumbertext | ||
| 5279 | % | 5244 | % |
| 5280 | \def\splitindexentry#1{% | 5245 | \def\splitindexentry#1{% |
| 5281 | \gdef\fullindexsortkey{}% | 5246 | \gdef\fullindexsortkey{}% |
| 5282 | \xdef\bracedtext{}% | 5247 | \xdef\bracedtext{}% |
| 5283 | \def\sep{}% | 5248 | \def\sep{}% |
| 5249 | \def\seealso##1{}% | ||
| 5250 | \def\seeentry##1{}% | ||
| 5284 | \expandafter\doindexsegment#1\subentry\finish\subentry | 5251 | \expandafter\doindexsegment#1\subentry\finish\subentry |
| 5285 | } | 5252 | } |
| 5286 | 5253 | ||
| @@ -5292,7 +5259,6 @@ end | |||
| 5292 | % | 5259 | % |
| 5293 | % Fully expand the segment, throwing away any @sortas directives, and | 5260 | % Fully expand the segment, throwing away any @sortas directives, and |
| 5294 | % trim spaces. | 5261 | % trim spaces. |
| 5295 | \def\sortas##1{}% | ||
| 5296 | \edef\trimmed{\segment}% | 5262 | \edef\trimmed{\segment}% |
| 5297 | \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% | 5263 | \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% |
| 5298 | % | 5264 | % |
| @@ -5302,16 +5268,23 @@ end | |||
| 5302 | % font commands turned off. | 5268 | % font commands turned off. |
| 5303 | \bgroup | 5269 | \bgroup |
| 5304 | \let\sortas\indexwritesortas | 5270 | \let\sortas\indexwritesortas |
| 5271 | \let\seealso\indexwriteseealso | ||
| 5272 | \let\seeentry\indexwriteseeentry | ||
| 5305 | \indexnofonts | 5273 | \indexnofonts |
| 5306 | % The braces around the commands are recognized by texindex. | 5274 | % The braces around the commands are recognized by texindex. |
| 5307 | \def\lbracechar{{\indexlbrace}}% | 5275 | \def\lbracechar{{\string\indexlbrace}}% |
| 5308 | \def\rbracechar{{\indexrbrace}}% | 5276 | \def\rbracechar{{\string\indexrbrace}}% |
| 5309 | \let\{=\lbracechar | 5277 | \let\{=\lbracechar |
| 5310 | \let\}=\rbracechar | 5278 | \let\}=\rbracechar |
| 5279 | \def\@{{\string\indexatchar}}% | ||
| 5280 | \def\atchar##1{\@}% | ||
| 5281 | \def\backslashchar{{\string\indexbackslash}}% | ||
| 5282 | \uccode`\~=`\\ \uppercase{\let~\backslashchar}% | ||
| 5311 | % | 5283 | % |
| 5312 | \let\indexsortkey\empty | 5284 | \let\indexsortkey\empty |
| 5285 | \global\let\pagenumbertext\empty | ||
| 5313 | % Execute the segment and throw away the typeset output. This executes | 5286 | % Execute the segment and throw away the typeset output. This executes |
| 5314 | % any @sortas commands in this segment. | 5287 | % any @sortas or @seealso commands in this segment. |
| 5315 | \setbox\dummybox = \hbox{\segment}% | 5288 | \setbox\dummybox = \hbox{\segment}% |
| 5316 | \ifx\indexsortkey\empty{% | 5289 | \ifx\indexsortkey\empty{% |
| 5317 | \indexnonalnumdisappear | 5290 | \indexnonalnumdisappear |
| @@ -5332,21 +5305,31 @@ end | |||
| 5332 | \fi | 5305 | \fi |
| 5333 | } | 5306 | } |
| 5334 | \def\isfinish{\finish}% | 5307 | \def\isfinish{\finish}% |
| 5308 | \newbox\dummybox % used above | ||
| 5335 | 5309 | ||
| 5336 | \let\subentry\relax | 5310 | \let\subentry\relax |
| 5337 | 5311 | ||
| 5338 | % Write the entry in \toks0 to the index file. | 5312 | % Use \ instead of @ in index files. To support old texi2dvi and texindex. |
| 5313 | % This works without changing the escape character used in the toc or aux | ||
| 5314 | % files because the index entries are fully expanded here, and \string uses | ||
| 5315 | % the current value of \escapechar. | ||
| 5316 | \def\escapeisbackslash{\escapechar=`\\} | ||
| 5317 | |||
| 5318 | % Write the entry in \indextext to the index file. | ||
| 5339 | % | 5319 | % |
| 5340 | \def\doindwrite{% | 5320 | \def\doindwrite{% |
| 5341 | % Put the index entry in the margin if desired. | 5321 | \maybemarginindex |
| 5342 | \ifx\SETmarginindex\relax\else | 5322 | % |
| 5343 | \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% | 5323 | \atdummies |
| 5324 | % | ||
| 5325 | \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else | ||
| 5326 | \escapeisbackslash | ||
| 5344 | \fi | 5327 | \fi |
| 5345 | % | 5328 | % |
| 5346 | % Remember, we are within a group. | 5329 | % For texindex which always views { and } as separators. |
| 5347 | \indexdummies % Must do this here, since \bf, etc expand at this stage | 5330 | \def\{{\lbracechar{}}% |
| 5348 | \useindexbackslash % \indexbackslash isn't defined now so it will be output | 5331 | \def\}{\rbracechar{}}% |
| 5349 | % as is; and it will print as backslash. | 5332 | \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% |
| 5350 | % | 5333 | % |
| 5351 | % Split the entry into primary entry and any subentries, and get the index | 5334 | % Split the entry into primary entry and any subentries, and get the index |
| 5352 | % sort key. | 5335 | % sort key. |
| @@ -5360,11 +5343,21 @@ end | |||
| 5360 | % | 5343 | % |
| 5361 | \edef\temp{% | 5344 | \edef\temp{% |
| 5362 | \write\writeto{% | 5345 | \write\writeto{% |
| 5363 | \string\entry{\fullindexsortkey}{\noexpand\folio}\bracedtext}% | 5346 | \string\entry{\fullindexsortkey}% |
| 5347 | {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% | ||
| 5348 | \bracedtext}% | ||
| 5364 | }% | 5349 | }% |
| 5365 | \temp | 5350 | \temp |
| 5366 | } | 5351 | } |
| 5367 | \newbox\dummybox % used above | 5352 | |
| 5353 | % Put the index entry in the margin if desired (undocumented). | ||
| 5354 | \def\maybemarginindex{% | ||
| 5355 | \ifx\SETmarginindex\relax\else | ||
| 5356 | \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% | ||
| 5357 | \fi | ||
| 5358 | } | ||
| 5359 | \let\SETmarginindex=\relax | ||
| 5360 | |||
| 5368 | 5361 | ||
| 5369 | % Take care of unwanted page breaks/skips around a whatsit: | 5362 | % Take care of unwanted page breaks/skips around a whatsit: |
| 5370 | % | 5363 | % |
| @@ -5452,9 +5445,14 @@ end | |||
| 5452 | % \entry {topic}{pagelist} | 5445 | % \entry {topic}{pagelist} |
| 5453 | % for a topic that is used without subtopics | 5446 | % for a topic that is used without subtopics |
| 5454 | % \primary {topic} | 5447 | % \primary {topic} |
| 5448 | % \entry {topic}{} | ||
| 5455 | % for the beginning of a topic that is used with subtopics | 5449 | % for the beginning of a topic that is used with subtopics |
| 5456 | % \secondary {subtopic}{pagelist} | 5450 | % \secondary {subtopic}{pagelist} |
| 5457 | % for each subtopic. | 5451 | % for each subtopic. |
| 5452 | % \secondary {subtopic}{} | ||
| 5453 | % for a subtopic with sub-subtopics | ||
| 5454 | % \tertiary {subtopic}{subsubtopic}{pagelist} | ||
| 5455 | % for each sub-subtopic. | ||
| 5458 | 5456 | ||
| 5459 | % Define the user-accessible indexing commands | 5457 | % Define the user-accessible indexing commands |
| 5460 | % @findex, @vindex, @kindex, @cindex. | 5458 | % @findex, @vindex, @kindex, @cindex. |
| @@ -5479,14 +5477,10 @@ end | |||
| 5479 | \plainfrenchspacing | 5477 | \plainfrenchspacing |
| 5480 | \everypar = {}% don't want the \kern\-parindent from indentation suppression. | 5478 | \everypar = {}% don't want the \kern\-parindent from indentation suppression. |
| 5481 | % | 5479 | % |
| 5482 | % See if the index file exists and is nonempty. | ||
| 5483 | % Change catcode of @ here so that if the index file contains | ||
| 5484 | % \initial {@} | ||
| 5485 | % as its first line, TeX doesn't complain about mismatched braces | ||
| 5486 | % (because it thinks @} is a control sequence). | ||
| 5487 | \catcode`\@ = 12 | ||
| 5488 | % See comment in \requireopenindexfile. | 5480 | % See comment in \requireopenindexfile. |
| 5489 | \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi | 5481 | \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi |
| 5482 | % | ||
| 5483 | % See if the index file exists and is nonempty. | ||
| 5490 | \openin 1 \jobname.\indexname s | 5484 | \openin 1 \jobname.\indexname s |
| 5491 | \ifeof 1 | 5485 | \ifeof 1 |
| 5492 | % \enddoublecolumns gets confused if there is no text in the index, | 5486 | % \enddoublecolumns gets confused if there is no text in the index, |
| @@ -5496,8 +5490,6 @@ end | |||
| 5496 | \putwordIndexNonexistent | 5490 | \putwordIndexNonexistent |
| 5497 | \typeout{No file \jobname.\indexname s.}% | 5491 | \typeout{No file \jobname.\indexname s.}% |
| 5498 | \else | 5492 | \else |
| 5499 | \catcode`\\ = 0 | ||
| 5500 | % | ||
| 5501 | % If the index file exists but is empty, then \openin leaves \ifeof | 5493 | % If the index file exists but is empty, then \openin leaves \ifeof |
| 5502 | % false. We have to make TeX try to read something from the file, so | 5494 | % false. We have to make TeX try to read something from the file, so |
| 5503 | % it can discover if there is anything in it. | 5495 | % it can discover if there is anything in it. |
| @@ -5505,47 +5497,52 @@ end | |||
| 5505 | \ifeof 1 | 5497 | \ifeof 1 |
| 5506 | \putwordIndexIsEmpty | 5498 | \putwordIndexIsEmpty |
| 5507 | \else | 5499 | \else |
| 5508 | % Index files are almost Texinfo source, but we use \ as the escape | 5500 | \expandafter\printindexzz\thisline\relax\relax\finish% |
| 5509 | % character. It would be better to use @, but that's too big a change | ||
| 5510 | % to make right now. | ||
| 5511 | \def\indexbackslash{\ttbackslash}% | ||
| 5512 | \let\indexlbrace\{ % Likewise, set these sequences for braces | ||
| 5513 | \let\indexrbrace\} % used in the sort key. | ||
| 5514 | \begindoublecolumns | ||
| 5515 | \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty | ||
| 5516 | % | ||
| 5517 | % Read input from the index file line by line. | ||
| 5518 | \loopdo | ||
| 5519 | \ifeof1 \else | ||
| 5520 | \read 1 to \nextline | ||
| 5521 | \fi | ||
| 5522 | % | ||
| 5523 | \indexinputprocessing | ||
| 5524 | \thisline | ||
| 5525 | % | ||
| 5526 | \ifeof1\else | ||
| 5527 | \let\thisline\nextline | ||
| 5528 | \repeat | ||
| 5529 | %% | ||
| 5530 | \enddoublecolumns | ||
| 5531 | \fi | 5501 | \fi |
| 5532 | \fi | 5502 | \fi |
| 5533 | \closein 1 | 5503 | \closein 1 |
| 5534 | \endgroup} | 5504 | \endgroup} |
| 5535 | \def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} | ||
| 5536 | \def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} | ||
| 5537 | 5505 | ||
| 5538 | \def\indexinputprocessing{% | 5506 | % If the index file starts with a backslash, forgo reading the index |
| 5539 | \ifeof1 | 5507 | % file altogether. If somebody upgrades texinfo.tex they may still have |
| 5540 | \let\firsttoken\relax | 5508 | % old index files using \ as the escape character. Reading this would |
| 5509 | % at best lead to typesetting garbage, at worst a TeX syntax error. | ||
| 5510 | \def\printindexzz#1#2\finish{% | ||
| 5511 | \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax | ||
| 5512 | \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 | ||
| 5513 | \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax | ||
| 5514 | \errmessage{% | ||
| 5515 | ERROR: A sorted index file in an obsolete format was skipped. | ||
| 5516 | To fix this problem, please upgrade your version of 'texi2dvi' | ||
| 5517 | or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>. | ||
| 5518 | If you are using an old version of 'texindex' (part of the Texinfo | ||
| 5519 | distribution), you may also need to upgrade to a newer version (at least 6.0). | ||
| 5520 | You may be able to typeset the index if you run | ||
| 5521 | 'texindex \jobname.\indexname' yourself. | ||
| 5522 | You could also try setting the 'txiindexescapeisbackslash' flag by | ||
| 5523 | running a command like | ||
| 5524 | 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do | ||
| 5525 | this, Texinfo will try to use index files in the old format. | ||
| 5526 | If you continue to have problems, deleting the index files and starting again | ||
| 5527 | might help (with 'rm \jobname.?? \jobname.??s')% | ||
| 5528 | }% | ||
| 5529 | \else | ||
| 5530 | (Skipped sorted index file in obsolete format) | ||
| 5531 | \fi | ||
| 5532 | \else | ||
| 5533 | \begindoublecolumns | ||
| 5534 | \input \jobname.\indexname s | ||
| 5535 | \enddoublecolumns | ||
| 5536 | \fi | ||
| 5541 | \else | 5537 | \else |
| 5542 | \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% | 5538 | \message{trying to print index \indexname}% |
| 5543 | \act | 5539 | \begindoublecolumns |
| 5540 | \catcode`\\=0\relax | ||
| 5541 | \catcode`\@=12\relax | ||
| 5542 | \input \jobname.\indexname s | ||
| 5543 | \enddoublecolumns | ||
| 5544 | \fi | 5544 | \fi |
| 5545 | } | 5545 | } |
| 5546 | \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} | ||
| 5547 | \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} | ||
| 5548 | |||
| 5549 | 5546 | ||
| 5550 | % These macros are used by the sorted index file itself. | 5547 | % These macros are used by the sorted index file itself. |
| 5551 | % Change them to control the appearance of the index. | 5548 | % Change them to control the appearance of the index. |
| @@ -5554,12 +5551,19 @@ end | |||
| 5554 | \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 | 5551 | \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 |
| 5555 | \catcode`\$=3 | 5552 | \catcode`\$=3 |
| 5556 | \gdef\initialglyphs{% | 5553 | \gdef\initialglyphs{% |
| 5554 | % special control sequences used in the index sort key | ||
| 5555 | \let\indexlbrace\{% | ||
| 5556 | \let\indexrbrace\}% | ||
| 5557 | \let\indexatchar\@% | ||
| 5558 | \def\indexbackslash{\math{\backslash}}% | ||
| 5559 | % | ||
| 5557 | % Some changes for non-alphabetic characters. Using the glyphs from the | 5560 | % Some changes for non-alphabetic characters. Using the glyphs from the |
| 5558 | % math fonts looks more consistent than the typewriter font used elsewhere | 5561 | % math fonts looks more consistent than the typewriter font used elsewhere |
| 5559 | % for these characters. | 5562 | % for these characters. |
| 5560 | \def\indexbackslash{\math{\backslash}}% | 5563 | \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} |
| 5561 | \let\\=\indexbackslash | ||
| 5562 | % | 5564 | % |
| 5565 | % In case @\ is used for backslash | ||
| 5566 | \uppercase{\let\\=~} | ||
| 5563 | % Can't get bold backslash so don't use bold forward slash | 5567 | % Can't get bold backslash so don't use bold forward slash |
| 5564 | \catcode`\/=13 | 5568 | \catcode`\/=13 |
| 5565 | \def/{{\secrmnotbold \normalslash}}% | 5569 | \def/{{\secrmnotbold \normalslash}}% |
| @@ -5619,12 +5623,6 @@ end | |||
| 5619 | \def\entry{% | 5623 | \def\entry{% |
| 5620 | \begingroup | 5624 | \begingroup |
| 5621 | % | 5625 | % |
| 5622 | % For pdfTeX and XeTeX. | ||
| 5623 | % The redefinition of \domark stops marks being added in \pdflink to | ||
| 5624 | % preserve coloured links across page boundaries. Otherwise the marks | ||
| 5625 | % would get in the way of \lastbox in \insertentrybox. | ||
| 5626 | \let\domark\relax | ||
| 5627 | % | ||
| 5628 | % Start a new paragraph if necessary, so our assignments below can't | 5626 | % Start a new paragraph if necessary, so our assignments below can't |
| 5629 | % affect previous text. | 5627 | % affect previous text. |
| 5630 | \par | 5628 | \par |
| @@ -5657,35 +5655,31 @@ end | |||
| 5657 | \gdef\finishentry#1{% | 5655 | \gdef\finishentry#1{% |
| 5658 | \egroup % end box A | 5656 | \egroup % end box A |
| 5659 | \dimen@ = \wd\boxA % Length of text of entry | 5657 | \dimen@ = \wd\boxA % Length of text of entry |
| 5660 | \global\setbox\boxA=\hbox\bgroup\unhbox\boxA | 5658 | \global\setbox\boxA=\hbox\bgroup |
| 5661 | % #1 is the page number. | 5659 | \unhbox\boxA |
| 5662 | % | 5660 | % #1 is the page number. |
| 5663 | % Get the width of the page numbers, and only use | ||
| 5664 | % leaders if they are present. | ||
| 5665 | \global\setbox\boxB = \hbox{#1}% | ||
| 5666 | \ifdim\wd\boxB = 0pt | ||
| 5667 | \null\nobreak\hfill\ % | ||
| 5668 | \else | ||
| 5669 | % | ||
| 5670 | \null\nobreak\indexdotfill % Have leaders before the page number. | ||
| 5671 | % | 5661 | % |
| 5672 | \ifpdf | 5662 | % Get the width of the page numbers, and only use |
| 5673 | \pdfgettoks#1.% | 5663 | % leaders if they are present. |
| 5674 | \hskip\skip\thinshrinkable\the\toksA | 5664 | \global\setbox\boxB = \hbox{#1}% |
| 5665 | \ifdim\wd\boxB = 0pt | ||
| 5666 | \null\nobreak\hfill\ % | ||
| 5675 | \else | 5667 | \else |
| 5676 | \ifx\XeTeXrevision\thisisundefined | 5668 | % |
| 5677 | \hskip\skip\thinshrinkable #1% | 5669 | \null\nobreak\indexdotfill % Have leaders before the page number. |
| 5678 | \else | 5670 | % |
| 5671 | \ifpdforxetex | ||
| 5679 | \pdfgettoks#1.% | 5672 | \pdfgettoks#1.% |
| 5680 | \hskip\skip\thinshrinkable\the\toksA | 5673 | \hskip\skip\thinshrinkable\the\toksA |
| 5674 | \else | ||
| 5675 | \hskip\skip\thinshrinkable #1% | ||
| 5681 | \fi | 5676 | \fi |
| 5682 | \fi | 5677 | \fi |
| 5683 | \fi | ||
| 5684 | \egroup % end \boxA | 5678 | \egroup % end \boxA |
| 5685 | \ifdim\wd\boxB = 0pt | 5679 | \ifdim\wd\boxB = 0pt |
| 5686 | \global\setbox\entrybox=\vbox{\unhbox\boxA}% | 5680 | \noindent\unhbox\boxA\par |
| 5687 | \else | 5681 | \nobreak |
| 5688 | \global\setbox\entrybox=\vbox\bgroup | 5682 | \else\bgroup |
| 5689 | % We want the text of the entries to be aligned to the left, and the | 5683 | % We want the text of the entries to be aligned to the left, and the |
| 5690 | % page numbers to be aligned to the right. | 5684 | % page numbers to be aligned to the right. |
| 5691 | % | 5685 | % |
| @@ -5751,55 +5745,11 @@ end | |||
| 5751 | \egroup % The \vbox | 5745 | \egroup % The \vbox |
| 5752 | \fi | 5746 | \fi |
| 5753 | \endgroup | 5747 | \endgroup |
| 5754 | \dotheinsertentrybox | ||
| 5755 | }} | 5748 | }} |
| 5756 | 5749 | ||
| 5757 | \newskip\thinshrinkable | 5750 | \newskip\thinshrinkable |
| 5758 | \skip\thinshrinkable=.15em minus .15em | 5751 | \skip\thinshrinkable=.15em minus .15em |
| 5759 | 5752 | ||
| 5760 | \newbox\entrybox | ||
| 5761 | \def\insertentrybox{% | ||
| 5762 | \ourunvbox\entrybox | ||
| 5763 | } | ||
| 5764 | |||
| 5765 | % default definition | ||
| 5766 | \let\dotheinsertentrybox\insertentrybox | ||
| 5767 | |||
| 5768 | % Use \lastbox to take apart vbox box by box, and add each sub-box | ||
| 5769 | % to the current vertical list. | ||
| 5770 | \def\ourunvbox#1{% | ||
| 5771 | \bgroup % for local binding of \delayedbox | ||
| 5772 | % Remove the last box from box #1 | ||
| 5773 | \global\setbox#1=\vbox{% | ||
| 5774 | \unvbox#1% | ||
| 5775 | \unskip % remove any glue | ||
| 5776 | \unpenalty | ||
| 5777 | \global\setbox\interbox=\lastbox | ||
| 5778 | }% | ||
| 5779 | \setbox\delayedbox=\box\interbox | ||
| 5780 | \ifdim\ht#1=0pt\else | ||
| 5781 | \ourunvbox#1 % Repeat on what's left of the box | ||
| 5782 | \nobreak | ||
| 5783 | \fi | ||
| 5784 | \box\delayedbox | ||
| 5785 | \egroup | ||
| 5786 | } | ||
| 5787 | \newbox\delayedbox | ||
| 5788 | \newbox\interbox | ||
| 5789 | |||
| 5790 | % Used from \printindex. \firsttoken should be the first token | ||
| 5791 | % after the \entry. If it's not another \entry, we are at the last | ||
| 5792 | % line of a group of index entries, so insert a penalty to discourage | ||
| 5793 | % widowed index entries. | ||
| 5794 | \def\dotheinsertentryboxwithpenalty{% | ||
| 5795 | \ifx\firsttoken\isentry | ||
| 5796 | \else | ||
| 5797 | \penalty 9000 | ||
| 5798 | \fi | ||
| 5799 | \insertentrybox | ||
| 5800 | } | ||
| 5801 | \def\isentry{\entry}% | ||
| 5802 | |||
| 5803 | % Like plain.tex's \dotfill, except uses up at least 1 em. | 5753 | % Like plain.tex's \dotfill, except uses up at least 1 em. |
| 5804 | % The filll stretch here overpowers both the fil and fill stretch to push | 5754 | % The filll stretch here overpowers both the fil and fill stretch to push |
| 5805 | % the page number to the right. | 5755 | % the page number to the right. |
| @@ -5809,24 +5759,15 @@ end | |||
| 5809 | 5759 | ||
| 5810 | \def\primary #1{\line{#1\hfil}} | 5760 | \def\primary #1{\line{#1\hfil}} |
| 5811 | 5761 | ||
| 5812 | \newskip\secondaryindent \secondaryindent=0.5cm | 5762 | \def\secondary{\indententry{0.5cm}} |
| 5813 | \def\secondary#1#2{{% | 5763 | \def\tertiary{\indententry{1cm}} |
| 5814 | \parfillskip=0in | 5764 | |
| 5815 | \parskip=0in | 5765 | \def\indententry#1#2#3{% |
| 5816 | \hangindent=1in | 5766 | \bgroup |
| 5817 | \hangafter=1 | 5767 | \leftskip=#1 |
| 5818 | \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill | 5768 | \entry{#2}{#3}% |
| 5819 | \ifpdf | 5769 | \egroup |
| 5820 | \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. | 5770 | } |
| 5821 | \else | ||
| 5822 | \ifx\XeTeXrevision\thisisundefined | ||
| 5823 | #2 | ||
| 5824 | \else | ||
| 5825 | \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. | ||
| 5826 | \fi | ||
| 5827 | \fi | ||
| 5828 | \par | ||
| 5829 | }} | ||
| 5830 | 5771 | ||
| 5831 | % Define two-column mode, which we use to typeset indexes. | 5772 | % Define two-column mode, which we use to typeset indexes. |
| 5832 | % Adapted from the TeXbook, page 416, which is to say, | 5773 | % Adapted from the TeXbook, page 416, which is to say, |
| @@ -5844,17 +5785,6 @@ end | |||
| 5844 | \output = {% | 5785 | \output = {% |
| 5845 | \savetopmark | 5786 | \savetopmark |
| 5846 | % | 5787 | % |
| 5847 | % Here is a possibility not foreseen in manmac: if we accumulate a | ||
| 5848 | % whole lot of material, we might end up calling this \output | ||
| 5849 | % routine twice in a row (see the doublecol-lose test, which is | ||
| 5850 | % essentially a couple of indexes with @setchapternewpage off). In | ||
| 5851 | % that case we just ship out what is in \partialpage with the normal | ||
| 5852 | % output routine. Generally, \partialpage will be empty when this | ||
| 5853 | % runs and this will be a no-op. See the indexspread.tex test case. | ||
| 5854 | \ifvoid\partialpage \else | ||
| 5855 | \onepageout{\pagecontents\partialpage}% | ||
| 5856 | \fi | ||
| 5857 | % | ||
| 5858 | \global\setbox\partialpage = \vbox{% | 5788 | \global\setbox\partialpage = \vbox{% |
| 5859 | % Unvbox the main output page. | 5789 | % Unvbox the main output page. |
| 5860 | \unvbox\PAGE | 5790 | \unvbox\PAGE |
| @@ -6134,11 +6064,9 @@ end | |||
| 6134 | 6064 | ||
| 6135 | % @raisesections: treat @section as chapter, @subsection as section, etc. | 6065 | % @raisesections: treat @section as chapter, @subsection as section, etc. |
| 6136 | \def\raisesections{\global\advance\secbase by -1} | 6066 | \def\raisesections{\global\advance\secbase by -1} |
| 6137 | \let\up=\raisesections % original BFox name | ||
| 6138 | 6067 | ||
| 6139 | % @lowersections: treat @chapter as section, @section as subsection, etc. | 6068 | % @lowersections: treat @chapter as section, @section as subsection, etc. |
| 6140 | \def\lowersections{\global\advance\secbase by 1} | 6069 | \def\lowersections{\global\advance\secbase by 1} |
| 6141 | \let\down=\lowersections % original BFox name | ||
| 6142 | 6070 | ||
| 6143 | % we only have subsub. | 6071 | % we only have subsub. |
| 6144 | \chardef\maxseclevel = 3 | 6072 | \chardef\maxseclevel = 3 |
| @@ -6790,13 +6718,8 @@ end | |||
| 6790 | % 1 and 2 (the page numbers aren't printed), and so are the first | 6718 | % 1 and 2 (the page numbers aren't printed), and so are the first |
| 6791 | % two pages of the document. Thus, we'd have two destinations named | 6719 | % two pages of the document. Thus, we'd have two destinations named |
| 6792 | % `1', and two named `2'. | 6720 | % `1', and two named `2'. |
| 6793 | \ifpdf | 6721 | \ifpdforxetex |
| 6794 | \global\pdfmakepagedesttrue | 6722 | \global\pdfmakepagedesttrue |
| 6795 | \else | ||
| 6796 | \ifx\XeTeXrevision\thisisundefined | ||
| 6797 | \else | ||
| 6798 | \global\pdfmakepagedesttrue | ||
| 6799 | \fi | ||
| 6800 | \fi | 6723 | \fi |
| 6801 | } | 6724 | } |
| 6802 | 6725 | ||
| @@ -7159,11 +7082,7 @@ end | |||
| 7159 | 7082 | ||
| 7160 | % @cartouche ... @end cartouche: draw rectangle w/rounded corners around | 7083 | % @cartouche ... @end cartouche: draw rectangle w/rounded corners around |
| 7161 | % environment contents. | 7084 | % environment contents. |
| 7162 | \font\circle=lcircle10 | 7085 | |
| 7163 | \newdimen\circthick | ||
| 7164 | \newdimen\cartouter\newdimen\cartinner | ||
| 7165 | \newskip\normbskip\newskip\normpskip\newskip\normlskip | ||
| 7166 | \circthick=\fontdimen8\circle | ||
| 7167 | % | 7086 | % |
| 7168 | \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth | 7087 | \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth |
| 7169 | \def\ctr{{\hskip 6pt\circle\char'010}} | 7088 | \def\ctr{{\hskip 6pt\circle\char'010}} |
| @@ -7178,7 +7097,18 @@ end | |||
| 7178 | % | 7097 | % |
| 7179 | \newskip\lskip\newskip\rskip | 7098 | \newskip\lskip\newskip\rskip |
| 7180 | 7099 | ||
| 7100 | % only require the font if @cartouche is actually used | ||
| 7101 | \def\cartouchefontdefs{% | ||
| 7102 | \font\circle=lcircle10\relax | ||
| 7103 | \circthick=\fontdimen8\circle | ||
| 7104 | } | ||
| 7105 | \newdimen\circthick | ||
| 7106 | \newdimen\cartouter\newdimen\cartinner | ||
| 7107 | \newskip\normbskip\newskip\normpskip\newskip\normlskip | ||
| 7108 | |||
| 7109 | |||
| 7181 | \envdef\cartouche{% | 7110 | \envdef\cartouche{% |
| 7111 | \cartouchefontdefs | ||
| 7182 | \ifhmode\par\fi % can't be in the midst of a paragraph. | 7112 | \ifhmode\par\fi % can't be in the midst of a paragraph. |
| 7183 | \startsavinginserts | 7113 | \startsavinginserts |
| 7184 | \lskip=\leftskip \rskip=\rightskip | 7114 | \lskip=\leftskip \rskip=\rightskip |
| @@ -8050,36 +7980,18 @@ end | |||
| 8050 | } | 7980 | } |
| 8051 | \fi | 7981 | \fi |
| 8052 | 7982 | ||
| 8053 | % alias because \c means cedilla in @tex or @math | ||
| 8054 | \let\texinfoc=\c | ||
| 8055 | |||
| 8056 | \newcount\savedcatcodeone | ||
| 8057 | \newcount\savedcatcodetwo | ||
| 8058 | |||
| 8059 | % Used at the time of macro expansion. | 7983 | % Used at the time of macro expansion. |
| 8060 | % Argument is macro body with arguments substituted | 7984 | % Argument is macro body with arguments substituted |
| 8061 | \def\scanmacro#1{% | 7985 | \def\scanmacro#1{% |
| 8062 | \newlinechar`\^^M | 7986 | \newlinechar`\^^M |
| 8063 | \def\xeatspaces{\eatspaces}% | 7987 | \def\xeatspaces{\eatspaces}% |
| 8064 | % | 7988 | % |
| 8065 | % Temporarily undo catcode changes of \printindex. Set catcode of @ to | ||
| 8066 | % 0 so that @-commands in macro expansions aren't printed literally when | ||
| 8067 | % formatting an index file, where \ is used as the escape character. | ||
| 8068 | \savedcatcodeone=\catcode`\@ | ||
| 8069 | \savedcatcodetwo=\catcode`\\ | ||
| 8070 | \catcode`\@=0 | ||
| 8071 | \catcode`\\=\active | ||
| 8072 | % | ||
| 8073 | % Process the macro body under the current catcode regime. | 7989 | % Process the macro body under the current catcode regime. |
| 8074 | \scantokens{#1@texinfoc}% | 7990 | \scantokens{#1@comment}% |
| 8075 | % | ||
| 8076 | \catcode`\@=\savedcatcodeone | ||
| 8077 | \catcode`\\=\savedcatcodetwo | ||
| 8078 | % | 7991 | % |
| 8079 | % The \texinfoc is to remove the \newlinechar added by \scantokens, and | 7992 | % The \comment is to remove the \newlinechar added by \scantokens, and |
| 8080 | % can be noticed by \parsearg. | 7993 | % can be noticed by \parsearg. Note \c isn't used because this means cedilla |
| 8081 | % We avoid surrounding the call to \scantokens with \bgroup and \egroup | 7994 | % in math mode. |
| 8082 | % to allow macros to open or close groups themselves. | ||
| 8083 | } | 7995 | } |
| 8084 | 7996 | ||
| 8085 | % Used for copying and captions | 7997 | % Used for copying and captions |
| @@ -8180,12 +8092,14 @@ end | |||
| 8180 | \def\macroargctxt{% | 8092 | \def\macroargctxt{% |
| 8181 | \scanctxt | 8093 | \scanctxt |
| 8182 | \catcode`\ =\active | 8094 | \catcode`\ =\active |
| 8095 | \catcode`\@=\other | ||
| 8183 | \catcode`\^^M=\other | 8096 | \catcode`\^^M=\other |
| 8184 | \catcode`\\=\active | 8097 | \catcode`\\=\active |
| 8185 | } | 8098 | } |
| 8186 | 8099 | ||
| 8187 | \def\macrolineargctxt{% used for whole-line arguments without braces | 8100 | \def\macrolineargctxt{% used for whole-line arguments without braces |
| 8188 | \scanctxt | 8101 | \scanctxt |
| 8102 | \catcode`\@=\other | ||
| 8189 | \catcode`\{=\other | 8103 | \catcode`\{=\other |
| 8190 | \catcode`\}=\other | 8104 | \catcode`\}=\other |
| 8191 | } | 8105 | } |
| @@ -8749,9 +8663,29 @@ end | |||
| 8749 | % also remove a trailing comma, in case of something like this: | 8663 | % also remove a trailing comma, in case of something like this: |
| 8750 | % @node Help-Cross, , , Cross-refs | 8664 | % @node Help-Cross, , , Cross-refs |
| 8751 | \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} | 8665 | \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} |
| 8752 | \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} | 8666 | \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} |
| 8667 | |||
| 8668 | % Used so that the @top node doesn't have to be wrapped in an @ifnottex | ||
| 8669 | % conditional. | ||
| 8670 | % \doignore goes to more effort to skip nested conditionals but we don't need | ||
| 8671 | % that here. | ||
| 8672 | \def\omittopnode{% | ||
| 8673 | \ifx\lastnode\wordTop | ||
| 8674 | \expandafter\ignorenode\fi | ||
| 8675 | } | ||
| 8676 | \def\wordTop{Top} | ||
| 8677 | |||
| 8678 | % Until the next @node or @bye command, divert output to a box that is not | ||
| 8679 | % output. | ||
| 8680 | \def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}% | ||
| 8681 | \ignorenodebye | ||
| 8682 | } | ||
| 8683 | |||
| 8684 | {\let\bye\relax | ||
| 8685 | \gdef\ignorenodebye{\let\bye\ignorenodebyedef} | ||
| 8686 | \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} | ||
| 8687 | % The redefinition of \bye here is because it is declared \outer | ||
| 8753 | 8688 | ||
| 8754 | \let\nwnode=\node | ||
| 8755 | \let\lastnode=\empty | 8689 | \let\lastnode=\empty |
| 8756 | 8690 | ||
| 8757 | % Write a cross-reference definition for the current node. #1 is the | 8691 | % Write a cross-reference definition for the current node. #1 is the |
| @@ -9226,19 +9160,6 @@ end | |||
| 9226 | \catcode`\^^]=\other | 9160 | \catcode`\^^]=\other |
| 9227 | \catcode`\^^^=\other | 9161 | \catcode`\^^^=\other |
| 9228 | \catcode`\^^_=\other | 9162 | \catcode`\^^_=\other |
| 9229 | % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. | ||
| 9230 | % in xref tags, i.e., node names. But since ^^e4 notation isn't | ||
| 9231 | % supported in the main text, it doesn't seem desirable. Furthermore, | ||
| 9232 | % that is not enough: for node names that actually contain a ^ | ||
| 9233 | % character, we would end up writing a line like this: 'xrdef {'hat | ||
| 9234 | % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first | ||
| 9235 | % argument, and \hat is not an expandable control sequence. It could | ||
| 9236 | % all be worked out, but why? Either we support ^^ or we don't. | ||
| 9237 | % | ||
| 9238 | % The other change necessary for this was to define \auxhat: | ||
| 9239 | % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter | ||
| 9240 | % and then to call \auxhat in \setq. | ||
| 9241 | % | ||
| 9242 | \catcode`\^=\other | 9163 | \catcode`\^=\other |
| 9243 | % | 9164 | % |
| 9244 | % Special characters. Should be turned off anyway, but... | 9165 | % Special characters. Should be turned off anyway, but... |
| @@ -9256,14 +9177,7 @@ end | |||
| 9256 | \catcode`\%=\other | 9177 | \catcode`\%=\other |
| 9257 | \catcode`+=\other % avoid \+ for paranoia even though we've turned it off | 9178 | \catcode`+=\other % avoid \+ for paranoia even though we've turned it off |
| 9258 | % | 9179 | % |
| 9259 | % This is to support \ in node names and titles, since the \ | 9180 | \catcode`\\=\active |
| 9260 | % characters end up in a \csname. It's easier than | ||
| 9261 | % leaving it active and making its active definition an actual \ | ||
| 9262 | % character. What I don't understand is why it works in the *value* | ||
| 9263 | % of the xrdef. Seems like it should be a catcode12 \, and that | ||
| 9264 | % should not typeset properly. But it works, so I'm moving on for | ||
| 9265 | % now. --karl, 15jan04. | ||
| 9266 | \catcode`\\=\other | ||
| 9267 | % | 9181 | % |
| 9268 | % @ is our escape character in .aux files, and we need braces. | 9182 | % @ is our escape character in .aux files, and we need braces. |
| 9269 | \catcode`\{=1 | 9183 | \catcode`\{=1 |
| @@ -11534,11 +11448,9 @@ directory should work if nowhere else does.} | |||
| 11534 | % \backslashcurfont outputs one backslash character in current font, | 11448 | % \backslashcurfont outputs one backslash character in current font, |
| 11535 | % as in \char`\\. | 11449 | % as in \char`\\. |
| 11536 | \global\chardef\backslashcurfont=`\\ | 11450 | \global\chardef\backslashcurfont=`\\ |
| 11537 | \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work | ||
| 11538 | 11451 | ||
| 11539 | % \realbackslash is an actual character `\' with catcode other, and | 11452 | % \realbackslash is an actual character `\' with catcode other. |
| 11540 | % \doublebackslash is two of them (for the pdf outlines). | 11453 | {\catcode`\\=\other @gdef@realbackslash{\}} |
| 11541 | {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} | ||
| 11542 | 11454 | ||
| 11543 | % In Texinfo, backslash is an active character; it prints the backslash | 11455 | % In Texinfo, backslash is an active character; it prints the backslash |
| 11544 | % in fixed width font. | 11456 | % in fixed width font. |
| @@ -11556,10 +11468,8 @@ directory should work if nowhere else does.} | |||
| 11556 | @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} | 11468 | @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} |
| 11557 | @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. | 11469 | @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. |
| 11558 | 11470 | ||
| 11559 | % \rawbackslash defines an active \ to do \backslashcurfont. | ||
| 11560 | % \otherbackslash defines an active \ to be a literal `\' character with | 11471 | % \otherbackslash defines an active \ to be a literal `\' character with |
| 11561 | % catcode other. We switch back and forth between these. | 11472 | % catcode other. |
| 11562 | @gdef@rawbackslash{@let\=@backslashcurfont} | ||
| 11563 | @gdef@otherbackslash{@let\=@realbackslash} | 11473 | @gdef@otherbackslash{@let\=@realbackslash} |
| 11564 | 11474 | ||
| 11565 | % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of | 11475 | % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of |
| @@ -11631,7 +11541,7 @@ directory should work if nowhere else does.} | |||
| 11631 | @ifx\@eatinput @let\ = @ttbackslash @fi | 11541 | @ifx\@eatinput @let\ = @ttbackslash @fi |
| 11632 | @catcode13=5 % regular end of line | 11542 | @catcode13=5 % regular end of line |
| 11633 | @enableemergencynewline | 11543 | @enableemergencynewline |
| 11634 | @let@c=@texinfoc | 11544 | @let@c=@comment |
| 11635 | @let@parsearg@originalparsearg | 11545 | @let@parsearg@originalparsearg |
| 11636 | % Also turn back on active characters that might appear in the input | 11546 | % Also turn back on active characters that might appear in the input |
| 11637 | % file name, in case not using a pre-dumped format. | 11547 | % file name, in case not using a pre-dumped format. |
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index ade4ff8ebdb..1cbbff212bb 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in | |||
| @@ -1046,6 +1046,7 @@ datadir = @datadir@ | |||
| 1046 | datarootdir = @datarootdir@ | 1046 | datarootdir = @datarootdir@ |
| 1047 | docdir = @docdir@ | 1047 | docdir = @docdir@ |
| 1048 | dvidir = @dvidir@ | 1048 | dvidir = @dvidir@ |
| 1049 | emacs_major_version = @emacs_major_version@ | ||
| 1049 | etcdir = @etcdir@ | 1050 | etcdir = @etcdir@ |
| 1050 | etcdocdir = @etcdocdir@ | 1051 | etcdocdir = @etcdocdir@ |
| 1051 | exec_prefix = @exec_prefix@ | 1052 | exec_prefix = @exec_prefix@ |
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h index d13d89cfae7..52ab7814429 100644 --- a/lib/mktime-internal.h +++ b/lib/mktime-internal.h | |||
| @@ -1,40 +1,56 @@ | |||
| 1 | /* mktime variant that also uses an offset guess | 1 | /* Internals of mktime and related functions |
| 2 | |||
| 3 | Copyright 2016-2019 Free Software Foundation, Inc. | 2 | Copyright 2016-2019 Free Software Foundation, Inc. |
| 3 | This file is part of the GNU C Library. | ||
| 4 | Contributed by Paul Eggert <eggert@cs.ucla.edu>. | ||
| 4 | 5 | ||
| 5 | This program is free software; you can redistribute it and/or | 6 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU General Public | 7 | modify it under the terms of the GNU General Public |
| 7 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
| 8 | version 3 of the License, or (at your option) any later version. | 9 | version 3 of the License, or (at your option) any later version. |
| 9 | 10 | ||
| 10 | This program is distributed in the hope that it will be useful, | 11 | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | General Public License for more details. | 14 | General Public License for more details. |
| 14 | 15 | ||
| 15 | You should have received a copy of the GNU General Public | 16 | You should have received a copy of the GNU General Public |
| 16 | License along with this program; if not, see | 17 | License along with the GNU C Library; if not, see |
| 17 | <https://www.gnu.org/licenses/>. */ | 18 | <https://www.gnu.org/licenses/>. */ |
| 18 | 19 | ||
| 19 | #include <time.h> | 20 | #ifndef _LIBC |
| 21 | # include <time.h> | ||
| 22 | #endif | ||
| 20 | 23 | ||
| 21 | /* mktime_offset_t is a signed type wide enough to hold a UTC offset | 24 | /* mktime_offset_t is a signed type wide enough to hold a UTC offset |
| 22 | in seconds, and used as part of the type of the offset-guess | 25 | in seconds, and used as part of the type of the offset-guess |
| 23 | argument to mktime_internal. Use time_t on platforms where time_t | 26 | argument to mktime_internal. In Glibc, it is always long int. |
| 27 | When in Gnulib, use time_t on platforms where time_t | ||
| 24 | is signed, to be compatible with platforms like BeOS that export | 28 | is signed, to be compatible with platforms like BeOS that export |
| 25 | this implementation detail of mktime. On platforms where time_t is | 29 | this implementation detail of mktime. On platforms where time_t is |
| 26 | unsigned, GNU and POSIX code can assume 'int' is at least 32 bits | 30 | unsigned, GNU and POSIX code can assume 'int' is at least 32 bits |
| 27 | which is wide enough for a UTC offset. */ | 31 | which is wide enough for a UTC offset. */ |
| 28 | 32 | #ifdef _LIBC | |
| 29 | #if TIME_T_IS_SIGNED | 33 | typedef long int mktime_offset_t; |
| 34 | #elif defined TIME_T_IS_SIGNED | ||
| 30 | typedef time_t mktime_offset_t; | 35 | typedef time_t mktime_offset_t; |
| 31 | #else | 36 | #else |
| 32 | typedef int mktime_offset_t; | 37 | typedef int mktime_offset_t; |
| 33 | #endif | 38 | #endif |
| 34 | 39 | ||
| 35 | time_t mktime_internal (struct tm *, | 40 | /* The source code uses identifiers like __time64_t for glibc |
| 36 | struct tm * (*) (time_t const *, struct tm *), | 41 | timestamps that can contain 64-bit values even when time_t is only |
| 37 | mktime_offset_t *); | 42 | 32 bits. These are just macros for the ordinary identifiers unless |
| 43 | compiling within glibc when time_t is 32 bits. */ | ||
| 44 | #if ! (defined _LIBC && __TIMESIZE != 64) | ||
| 45 | # undef __time64_t | ||
| 46 | # define __time64_t time_t | ||
| 47 | # define __gmtime64_r __gmtime_r | ||
| 48 | # define __localtime64_r __localtime_r | ||
| 49 | # define __mktime64 mktime | ||
| 50 | # define __timegm64 timegm | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #ifndef _LIBC | ||
| 38 | 54 | ||
| 39 | /* Although glibc source code uses leading underscores, Gnulib wants | 55 | /* Although glibc source code uses leading underscores, Gnulib wants |
| 40 | ordinary names. | 56 | ordinary names. |
| @@ -45,9 +61,19 @@ time_t mktime_internal (struct tm *, | |||
| 45 | Similarly for gmtime_r. See the gnulib time_r module for one way | 61 | Similarly for gmtime_r. See the gnulib time_r module for one way |
| 46 | to implement this. */ | 62 | to implement this. */ |
| 47 | 63 | ||
| 48 | #undef __gmtime_r | 64 | # undef __gmtime_r |
| 49 | #undef __localtime_r | 65 | # undef __localtime_r |
| 50 | #define __gmtime_r gmtime_r | 66 | # define __gmtime_r gmtime_r |
| 51 | #define __localtime_r localtime_r | 67 | # define __localtime_r localtime_r |
| 68 | |||
| 69 | # define __mktime_internal mktime_internal | ||
| 70 | |||
| 71 | #endif | ||
| 52 | 72 | ||
| 53 | #define __mktime_internal mktime_internal | 73 | /* Subroutine of mktime. Return the time_t representation of TP and |
| 74 | normalize TP, given that a struct tm * maps to a time_t as performed | ||
| 75 | by FUNC. Record next guess for localtime-gmtime offset in *OFFSET. */ | ||
| 76 | extern __time64_t __mktime_internal (struct tm *tp, | ||
| 77 | struct tm *(*func) (__time64_t const *, | ||
| 78 | struct tm *), | ||
| 79 | mktime_offset_t *offset) attribute_hidden; | ||
diff --git a/lib/mktime.c b/lib/mktime.c index e3783d7a95e..b00af96c8c4 100644 --- a/lib/mktime.c +++ b/lib/mktime.c | |||
| @@ -112,11 +112,11 @@ my_tzset (void) | |||
| 112 | added to them, and then with another timestamp added, without | 112 | added to them, and then with another timestamp added, without |
| 113 | worrying about overflow. | 113 | worrying about overflow. |
| 114 | 114 | ||
| 115 | Much of the code uses long_int to represent time_t values, to | 115 | Much of the code uses long_int to represent __time64_t values, to |
| 116 | lessen the hassle of dealing with platforms where time_t is | 116 | lessen the hassle of dealing with platforms where __time64_t is |
| 117 | unsigned, and because long_int should suffice to represent all | 117 | unsigned, and because long_int should suffice to represent all |
| 118 | time_t values that mktime can generate even on platforms where | 118 | __time64_t values that mktime can generate even on platforms where |
| 119 | time_t is excessively wide. */ | 119 | __time64_t is wider than the int components of struct tm. */ |
| 120 | 120 | ||
| 121 | #if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60 | 121 | #if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60 |
| 122 | typedef long int long_int; | 122 | typedef long int long_int; |
| @@ -144,16 +144,15 @@ shr (long_int a, int b) | |||
| 144 | : a / (one << b) - (a % (one << b) < 0)); | 144 | : a / (one << b) - (a % (one << b) < 0)); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | /* Bounds for the intersection of time_t and long_int. */ | 147 | /* Bounds for the intersection of __time64_t and long_int. */ |
| 148 | 148 | ||
| 149 | static long_int const mktime_min | 149 | static long_int const mktime_min |
| 150 | = ((TYPE_SIGNED (time_t) && TYPE_MINIMUM (time_t) < TYPE_MINIMUM (long_int)) | 150 | = ((TYPE_SIGNED (__time64_t) |
| 151 | ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (time_t)); | 151 | && TYPE_MINIMUM (__time64_t) < TYPE_MINIMUM (long_int)) |
| 152 | ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (__time64_t)); | ||
| 152 | static long_int const mktime_max | 153 | static long_int const mktime_max |
| 153 | = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (time_t) | 154 | = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (__time64_t) |
| 154 | ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (time_t)); | 155 | ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (__time64_t)); |
| 155 | |||
| 156 | verify (TYPE_IS_INTEGER (time_t)); | ||
| 157 | 156 | ||
| 158 | #define EPOCH_YEAR 1970 | 157 | #define EPOCH_YEAR 1970 |
| 159 | #define TM_YEAR_BASE 1900 | 158 | #define TM_YEAR_BASE 1900 |
| @@ -252,23 +251,23 @@ tm_diff (long_int year, long_int yday, int hour, int min, int sec, | |||
| 252 | } | 251 | } |
| 253 | 252 | ||
| 254 | /* Use CONVERT to convert T to a struct tm value in *TM. T must be in | 253 | /* Use CONVERT to convert T to a struct tm value in *TM. T must be in |
| 255 | range for time_t. Return TM if successful, NULL (setting errno) on | 254 | range for __time64_t. Return TM if successful, NULL (setting errno) on |
| 256 | failure. */ | 255 | failure. */ |
| 257 | static struct tm * | 256 | static struct tm * |
| 258 | convert_time (struct tm *(*convert) (const time_t *, struct tm *), | 257 | convert_time (struct tm *(*convert) (const __time64_t *, struct tm *), |
| 259 | long_int t, struct tm *tm) | 258 | long_int t, struct tm *tm) |
| 260 | { | 259 | { |
| 261 | time_t x = t; | 260 | __time64_t x = t; |
| 262 | return convert (&x, tm); | 261 | return convert (&x, tm); |
| 263 | } | 262 | } |
| 264 | 263 | ||
| 265 | /* Use CONVERT to convert *T to a broken down time in *TP. | 264 | /* Use CONVERT to convert *T to a broken down time in *TP. |
| 266 | If *T is out of range for conversion, adjust it so that | 265 | If *T is out of range for conversion, adjust it so that |
| 267 | it is the nearest in-range value and then convert that. | 266 | it is the nearest in-range value and then convert that. |
| 268 | A value is in range if it fits in both time_t and long_int. | 267 | A value is in range if it fits in both __time64_t and long_int. |
| 269 | Return TP on success, NULL (setting errno) on failure. */ | 268 | Return TP on success, NULL (setting errno) on failure. */ |
| 270 | static struct tm * | 269 | static struct tm * |
| 271 | ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), | 270 | ranged_convert (struct tm *(*convert) (const __time64_t *, struct tm *), |
| 272 | long_int *t, struct tm *tp) | 271 | long_int *t, struct tm *tp) |
| 273 | { | 272 | { |
| 274 | long_int t1 = (*t < mktime_min ? mktime_min | 273 | long_int t1 = (*t < mktime_min ? mktime_min |
| @@ -310,7 +309,7 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), | |||
| 310 | } | 309 | } |
| 311 | 310 | ||
| 312 | 311 | ||
| 313 | /* Convert *TP to a time_t value, inverting | 312 | /* Convert *TP to a __time64_t value, inverting |
| 314 | the monotonic and mostly-unit-linear conversion function CONVERT. | 313 | the monotonic and mostly-unit-linear conversion function CONVERT. |
| 315 | Use *OFFSET to keep track of a guess at the offset of the result, | 314 | Use *OFFSET to keep track of a guess at the offset of the result, |
| 316 | compared to what the result would be for UTC without leap seconds. | 315 | compared to what the result would be for UTC without leap seconds. |
| @@ -318,9 +317,9 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), | |||
| 318 | If successful, set *TP to the canonicalized struct tm; | 317 | If successful, set *TP to the canonicalized struct tm; |
| 319 | otherwise leave *TP alone, return ((time_t) -1) and set errno. | 318 | otherwise leave *TP alone, return ((time_t) -1) and set errno. |
| 320 | This function is external because it is used also by timegm.c. */ | 319 | This function is external because it is used also by timegm.c. */ |
| 321 | time_t | 320 | __time64_t |
| 322 | __mktime_internal (struct tm *tp, | 321 | __mktime_internal (struct tm *tp, |
| 323 | struct tm *(*convert) (const time_t *, struct tm *), | 322 | struct tm *(*convert) (const __time64_t *, struct tm *), |
| 324 | mktime_offset_t *offset) | 323 | mktime_offset_t *offset) |
| 325 | { | 324 | { |
| 326 | struct tm tm; | 325 | struct tm tm; |
| @@ -520,9 +519,9 @@ __mktime_internal (struct tm *tp, | |||
| 520 | 519 | ||
| 521 | #if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS | 520 | #if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS |
| 522 | 521 | ||
| 523 | /* Convert *TP to a time_t value. */ | 522 | /* Convert *TP to a __time64_t value. */ |
| 524 | time_t | 523 | __time64_t |
| 525 | mktime (struct tm *tp) | 524 | __mktime64 (struct tm *tp) |
| 526 | { | 525 | { |
| 527 | /* POSIX.1 8.1.1 requires that whenever mktime() is called, the | 526 | /* POSIX.1 8.1.1 requires that whenever mktime() is called, the |
| 528 | time zone names contained in the external variable 'tzname' shall | 527 | time zone names contained in the external variable 'tzname' shall |
| @@ -531,7 +530,7 @@ mktime (struct tm *tp) | |||
| 531 | 530 | ||
| 532 | # if defined _LIBC || NEED_MKTIME_WORKING | 531 | # if defined _LIBC || NEED_MKTIME_WORKING |
| 533 | static mktime_offset_t localtime_offset; | 532 | static mktime_offset_t localtime_offset; |
| 534 | return __mktime_internal (tp, __localtime_r, &localtime_offset); | 533 | return __mktime_internal (tp, __localtime64_r, &localtime_offset); |
| 535 | # else | 534 | # else |
| 536 | # undef mktime | 535 | # undef mktime |
| 537 | return mktime (tp); | 536 | return mktime (tp); |
| @@ -539,11 +538,29 @@ mktime (struct tm *tp) | |||
| 539 | } | 538 | } |
| 540 | #endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */ | 539 | #endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */ |
| 541 | 540 | ||
| 542 | #ifdef weak_alias | 541 | #if defined _LIBC && __TIMESIZE != 64 |
| 543 | weak_alias (mktime, timelocal) | 542 | |
| 543 | libc_hidden_def (__mktime64) | ||
| 544 | |||
| 545 | time_t | ||
| 546 | mktime (struct tm *tp) | ||
| 547 | { | ||
| 548 | struct tm tm = *tp; | ||
| 549 | __time64_t t = __mktime64 (&tm); | ||
| 550 | if (in_time_t_range (t)) | ||
| 551 | { | ||
| 552 | *tp = tm; | ||
| 553 | return t; | ||
| 554 | } | ||
| 555 | else | ||
| 556 | { | ||
| 557 | __set_errno (EOVERFLOW); | ||
| 558 | return -1; | ||
| 559 | } | ||
| 560 | } | ||
| 561 | |||
| 544 | #endif | 562 | #endif |
| 545 | 563 | ||
| 546 | #ifdef _LIBC | 564 | weak_alias (mktime, timelocal) |
| 547 | libc_hidden_def (mktime) | 565 | libc_hidden_def (mktime) |
| 548 | libc_hidden_weak (timelocal) | 566 | libc_hidden_weak (timelocal) |
| 549 | #endif | ||
diff --git a/lib/timegm.c b/lib/timegm.c index 2ca57444d43..c440480cb2d 100644 --- a/lib/timegm.c +++ b/lib/timegm.c | |||
| @@ -18,17 +18,41 @@ | |||
| 18 | <http://www.gnu.org/licenses/>. */ | 18 | <http://www.gnu.org/licenses/>. */ |
| 19 | 19 | ||
| 20 | #ifndef _LIBC | 20 | #ifndef _LIBC |
| 21 | # include <config.h> | 21 | # include <libc-config.h> |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #include <time.h> | 24 | #include <time.h> |
| 25 | #include <errno.h> | ||
| 25 | 26 | ||
| 26 | #include "mktime-internal.h" | 27 | #include "mktime-internal.h" |
| 27 | 28 | ||
| 28 | time_t | 29 | __time64_t |
| 29 | timegm (struct tm *tmp) | 30 | __timegm64 (struct tm *tmp) |
| 30 | { | 31 | { |
| 31 | static mktime_offset_t gmtime_offset; | 32 | static mktime_offset_t gmtime_offset; |
| 32 | tmp->tm_isdst = 0; | 33 | tmp->tm_isdst = 0; |
| 33 | return __mktime_internal (tmp, __gmtime_r, &gmtime_offset); | 34 | return __mktime_internal (tmp, __gmtime64_r, &gmtime_offset); |
| 34 | } | 35 | } |
| 36 | |||
| 37 | #if defined _LIBC && __TIMESIZE != 64 | ||
| 38 | |||
| 39 | libc_hidden_def (__timegm64) | ||
| 40 | |||
| 41 | time_t | ||
| 42 | timegm (struct tm *tmp) | ||
| 43 | { | ||
| 44 | struct tm tm = *tmp; | ||
| 45 | __time64_t t = __timegm64 (&tm); | ||
| 46 | if (in_time_t_range (t)) | ||
| 47 | { | ||
| 48 | *tmp = tm; | ||
| 49 | return t; | ||
| 50 | } | ||
| 51 | else | ||
| 52 | { | ||
| 53 | __set_errno (EOVERFLOW); | ||
| 54 | return -1; | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | #endif | ||