Commit e668176e authored by Paul Eggert's avatar Paul Eggert

Merge from gnulib

This incorporates:
2015-10-13 binary-io, u64, unistd: port to strict C
2015-09-26 c-ctype: do not worry about EBCDIC + char signed
2015-09-25 c-ctype: port better to z/OS EBCDIC
2015-09-25 gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
* doc/misc/texinfo.tex, lib/binary-io.c, lib/c-ctype.h, lib/u64.c:
* lib/unistd.c, m4/gnulib-common.m4, m4/gnulib-comp.m4:
Copy from gnulib.
parent 2cc412cd
......@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2015-09-20.17}
\def\texinfoversion{2015-10-09.18}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
......@@ -530,14 +530,13 @@
%
\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%
}
......@@ -1416,6 +1415,7 @@
\normalturnoffactive
\def\@{@}%
\let\/=\empty
\let\xprocessmacroarg=\eatspaces % in case we are in a macro expansion
\makevalueexpandable
% do we want to go so far as to use \indexnofonts instead of just
% special-casing \var here?
......@@ -4864,11 +4864,17 @@
\def\requireopenindexfile#1{%
\ifnum\csname #1indfile\endcsname=0
\expandafter\newwrite \csname#1indfile\endcsname
\immediate\openout\csname#1indfile\endcsname \jobname.#1 % Open the file
\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 here prevents an object entering into the current box,
% which could confound checks such as those in \safewhatsit for preceding
% skips.
\fi}
\def\indexisfl{fl}
% Output \ as {\indexbackslash}, because \ is an escape character in
% the index files.
......@@ -5059,7 +5065,9 @@
% as its first line, TeX doesn't complain about mismatched braces
% (because it thinks @} is a control sequence).
\catcode`\@ = 11
\openin 1 \jobname.#1s
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
\openin 1 \jobname.\indexname s
\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
......@@ -5251,7 +5259,7 @@
% cursed by a Unix daemon.
\setbox\boxA = \hbox{#1}%
\ifdim\wd\boxA = 0pt
\ %
\null\nobreak\hfill\ %
\else
%
\null\nobreak\indexdotfill % Have leaders before the page number.
......@@ -5558,7 +5566,8 @@
\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, like is done in \startcontents.
% and \thissection, as is done in \startcontents.
\let\pchapsepmacro\relax
\chapmacro{}{Yomitfromtoc}{}%
\chapoddpage
\endgroup
......@@ -9339,7 +9348,8 @@
% @documentencoding sets the definition of non-ASCII characters
% according to the specified encoding.
%
\parseargdef\documentencoding{%
\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
\def\documentencodingzzz#1{%
% Encoding being declared for the document.
\def\declaredencoding{\csname #1.enc\endcsname}%
%
......@@ -10066,6 +10076,9 @@
\DeclareUnicodeCharacter{02DB}{\ogonek{ }}
% Greek letters
\DeclareUnicodeCharacter{03C0}{\ensuremath\pi}
\DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
\DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
\DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
......@@ -10193,6 +10206,7 @@
\DeclareUnicodeCharacter{1EF8}{\~Y}
\DeclareUnicodeCharacter{1EF9}{\~y}
% Punctuation
\DeclareUnicodeCharacter{2013}{--}
\DeclareUnicodeCharacter{2014}{---}
\DeclareUnicodeCharacter{2018}{\quoteleft}
......@@ -10204,18 +10218,34 @@
\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}{\point}
\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}
\global\mathchardef\checkmark="1370 % actually the square root sign
\DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}
}% end of \utfeightchardefs
% US-ASCII character definitions.
......
#include <config.h>
#define BINARY_IO_INLINE _GL_EXTERN_INLINE
#include "binary-io.h"
typedef int dummy;
......@@ -78,82 +78,65 @@ extern "C" {
# error "Only ASCII and EBCDIC are supported"
#endif
#define _C_CTYPE_SIGNED_EBCDIC ('A' < 0)
#if 'A' < 0
# error "EBCDIC and char is signed -- not supported"
#endif
/* Cases for control characters. */
#define _C_CTYPE_CNTRL \
case '\a': case '\b': case '\f': case '\n': \
case '\r': case '\t': case '\v': \
_C_CTYPE_OTHER_CNTRL
/* ASCII control characters other than those with \-letter escapes. */
#if C_CTYPE_ASCII
# define _C_CTYPE_CNTRL \
# define _C_CTYPE_OTHER_CNTRL \
case '\x00': case '\x01': case '\x02': case '\x03': \
case '\x04': case '\x05': case '\x06': case '\x07': \
case '\x08': case '\x09': case '\x0a': case '\x0b': \
case '\x0c': case '\x0d': case '\x0e': case '\x0f': \
case '\x10': case '\x11': case '\x12': case '\x13': \
case '\x14': case '\x15': case '\x16': case '\x17': \
case '\x18': case '\x19': case '\x1a': case '\x1b': \
case '\x1c': case '\x1d': case '\x1e': case '\x1f': \
case '\x7f'
case '\x04': case '\x05': case '\x06': case '\x0e': \
case '\x0f': case '\x10': case '\x11': case '\x12': \
case '\x13': case '\x14': case '\x15': case '\x16': \
case '\x17': case '\x18': case '\x19': case '\x1a': \
case '\x1b': case '\x1c': case '\x1d': case '\x1e': \
case '\x1f': case '\x7f'
#else
/* Use EBCDIC code page 1047's assignments for ASCII control chars;
assume all EBCDIC code pages agree about these assignments. */
# define _C_CTYPE_CNTRL \
# define _C_CTYPE_OTHER_CNTRL \
case '\x00': case '\x01': case '\x02': case '\x03': \
case '\x05': case '\x07': case '\x0b': case '\x0c': \
case '\x0d': case '\x0e': case '\x0f': case '\x10': \
case '\x11': case '\x12': case '\x13': case '\x16': \
case '\x18': case '\x19': case '\x1c': case '\x1d': \
case '\x1e': case '\x1f': case '\x25': case '\x26': \
case '\x27': case '\x2d': case '\x2e': case '\x2f': \
case '\x32': case '\x37': case '\x3c': case '\x3d': \
case '\x3f'
case '\x07': case '\x0e': case '\x0f': case '\x10': \
case '\x11': case '\x12': case '\x13': case '\x18': \
case '\x19': case '\x1c': case '\x1d': case '\x1e': \
case '\x1f': case '\x26': case '\x27': case '\x2d': \
case '\x2e': case '\x32': case '\x37': case '\x3c': \
case '\x3d': case '\x3f'
#endif
/* Cases for hex letter digits, digits, lower, and upper, offset by N. */
/* Cases for lowercase hex letters, and lowercase letters, all offset by N. */
#define _C_CTYPE_A_THRU_F_N(n) \
#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
case 'e' + (n): case 'f' + (n): \
case 'A' + (n): case 'B' + (n): case 'C' + (n): case 'D' + (n): \
case 'E' + (n): case 'F' + (n)
#define _C_CTYPE_DIGIT_N(n) \
case '0' + (n): case '1' + (n): case '2' + (n): case '3' + (n): \
case '4' + (n): case '5' + (n): case '6' + (n): case '7' + (n): \
case '8' + (n): case '9' + (n)
case 'e' + (n): case 'f' + (n)
#define _C_CTYPE_LOWER_N(n) \
case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
case 'e' + (n): case 'f' + (n): case 'g' + (n): case 'h' + (n): \
case 'i' + (n): case 'j' + (n): case 'k' + (n): case 'l' + (n): \
case 'm' + (n): case 'n' + (n): case 'o' + (n): case 'p' + (n): \
case 'q' + (n): case 'r' + (n): case 's' + (n): case 't' + (n): \
case 'u' + (n): case 'v' + (n): case 'w' + (n): case 'x' + (n): \
case 'y' + (n): case 'z' + (n)
#define _C_CTYPE_UPPER_N(n) \
case 'A' + (n): case 'B' + (n): case 'C' + (n): case 'D' + (n): \
case 'E' + (n): case 'F' + (n): case 'G' + (n): case 'H' + (n): \
case 'I' + (n): case 'J' + (n): case 'K' + (n): case 'L' + (n): \
case 'M' + (n): case 'N' + (n): case 'O' + (n): case 'P' + (n): \
case 'Q' + (n): case 'R' + (n): case 'S' + (n): case 'T' + (n): \
case 'U' + (n): case 'V' + (n): case 'W' + (n): case 'X' + (n): \
case 'Y' + (n): case 'Z' + (n)
/* Given MACRO_N, expand to all the cases for the corresponding class. */
#if _C_CTYPE_SIGNED_EBCDIC
# define _C_CTYPE_CASES(macro_n) macro_n (0): macro_n (256)
#else
# define _C_CTYPE_CASES(macro_n) macro_n (0)
#endif
/* Cases for hex letter digits, digits, lower, and upper, with another
case for unsigned char if the original char is negative. */
#define _C_CTYPE_A_THRU_F _C_CTYPE_CASES (_C_CTYPE_A_THRU_F_N)
#define _C_CTYPE_DIGIT _C_CTYPE_CASES (_C_CTYPE_DIGIT_N)
#define _C_CTYPE_LOWER _C_CTYPE_CASES (_C_CTYPE_LOWER_N)
#define _C_CTYPE_UPPER _C_CTYPE_CASES (_C_CTYPE_UPPER_N)
/* The punct class differs because some punctuation characters may be
negative while others are nonnegative. Instead of attempting to
define _C_CTYPE_PUNCT, define just the plain chars here, and do any
cases-plus-256 by hand after using this macro. */
#define _C_CTYPE_PUNCT_PLAIN \
_C_CTYPE_LOWER_A_THRU_F_N(n): \
case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
/* Cases for hex letters, digits, lower, punct, and upper. */
#define _C_CTYPE_A_THRU_F \
_C_CTYPE_LOWER_A_THRU_F_N (0): \
_C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a')
#define _C_CTYPE_DIGIT \
case '0': case '1': case '2': case '3': \
case '4': case '5': case '6': case '7': \
case '8': case '9'
#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0)
#define _C_CTYPE_PUNCT \
case '!': case '"': case '#': case '$': \
case '%': case '&': case '\'': case '(': \
case ')': case '*': case '+': case ',': \
......@@ -162,6 +145,8 @@ extern "C" {
case '?': case '@': case '[': case '\\': \
case ']': case '^': case '_': case '`': \
case '{': case '|': case '}': case '~'
#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
/* Function definitions. */
......@@ -189,7 +174,6 @@ c_isalnum (int c)
_C_CTYPE_LOWER:
_C_CTYPE_UPPER:
return true;
default:
return false;
}
......@@ -203,7 +187,6 @@ c_isalpha (int c)
_C_CTYPE_LOWER:
_C_CTYPE_UPPER:
return true;
default:
return false;
}
......@@ -220,107 +203,9 @@ c_isascii (int c)
_C_CTYPE_CNTRL:
_C_CTYPE_DIGIT:
_C_CTYPE_LOWER:
_C_CTYPE_PUNCT:
_C_CTYPE_UPPER:
_C_CTYPE_PUNCT_PLAIN:
#if '!' < 0
case '!' + 256:
#endif
#if '"' < 0
case '"' + 256:
#endif
#if '#' < 0
case '#' + 256:
#endif
#if '$' < 0
case '$' + 256:
#endif
#if '%' < 0
case '%' + 256:
#endif
#if '&' < 0
case '&' + 256:
#endif
#if '\'' < 0
case '\'' + 256:
#endif
#if '(' < 0
case '(' + 256:
#endif
#if ')' < 0
case ')' + 256:
#endif
#if '*' < 0
case '*' + 256:
#endif
#if '+' < 0
case '+' + 256:
#endif
#if ',' < 0
case ',' + 256:
#endif
#if '-' < 0
case '-' + 256:
#endif
#if '.' < 0
case '.' + 256:
#endif
#if '/' < 0
case '/' + 256:
#endif
#if ':' < 0
case ':' + 256:
#endif
#if ';' < 0
case ';' + 256:
#endif
#if '<' < 0
case '<' + 256:
#endif
#if '=' < 0
case '=' + 256:
#endif
#if '>' < 0
case '>' + 256:
#endif
#if '?' < 0
case '?' + 256:
#endif
#if '@' < 0
case '@' + 256:
#endif
#if '[' < 0
case '[' + 256:
#endif
#if '\\' < 0
case '\\' + 256:
#endif
#if ']' < 0
case ']' + 256:
#endif
#if '^' < 0
case '^' + 256:
#endif
#if '_' < 0
case '_' + 256:
#endif
#if '`' < 0
case '`' + 256:
#endif
#if '{' < 0
case '{' + 256:
#endif
#if '|' < 0
case '|' + 256:
#endif
#if '}' < 0
case '}' + 256:
#endif
#if '~' < 0
case '~' + 256:
#endif
return true;
default:
return false;
}
......@@ -363,107 +248,9 @@ c_isgraph (int c)
{
_C_CTYPE_DIGIT:
_C_CTYPE_LOWER:
_C_CTYPE_PUNCT:
_C_CTYPE_UPPER:
_C_CTYPE_PUNCT_PLAIN:
#if '!' < 0
case '!' + 256:
#endif
#if '"' < 0
case '"' + 256:
#endif
#if '#' < 0
case '#' + 256:
#endif
#if '$' < 0
case '$' + 256:
#endif
#if '%' < 0
case '%' + 256:
#endif
#if '&' < 0
case '&' + 256:
#endif
#if '\'' < 0
case '\'' + 256:
#endif
#if '(' < 0
case '(' + 256:
#endif
#if ')' < 0
case ')' + 256:
#endif
#if '*' < 0
case '*' + 256:
#endif
#if '+' < 0
case '+' + 256:
#endif
#if ',' < 0
case ',' + 256:
#endif
#if '-' < 0
case '-' + 256:
#endif
#if '.' < 0
case '.' + 256:
#endif
#if '/' < 0
case '/' + 256:
#endif
#if ':' < 0
case ':' + 256:
#endif
#if ';' < 0
case ';' + 256:
#endif
#if '<' < 0
case '<' + 256:
#endif
#if '=' < 0
case '=' + 256:
#endif
#if '>' < 0
case '>' + 256:
#endif
#if '?' < 0
case '?' + 256:
#endif
#if '@' < 0
case '@' + 256:
#endif
#if '[' < 0
case '[' + 256:
#endif
#if '\\' < 0
case '\\' + 256:
#endif
#if ']' < 0
case ']' + 256:
#endif
#if '^' < 0
case '^' + 256:
#endif
#if '_' < 0
case '_' + 256:
#endif
#if '`' < 0
case '`' + 256:
#endif
#if '{' < 0
case '{' + 256:
#endif
#if '|' < 0
case '|' + 256:
#endif
#if '}' < 0
case '}' + 256:
#endif
#if '~' < 0
case '~' + 256:
#endif
return true;
default:
return false;
}
......@@ -489,107 +276,9 @@ c_isprint (int c)
case ' ':
_C_CTYPE_DIGIT:
_C_CTYPE_LOWER:
_C_CTYPE_PUNCT:
_C_CTYPE_UPPER:
_C_CTYPE_PUNCT_PLAIN:
#if '!' < 0
case '!' + 256:
#endif
#if '"' < 0
case '"' + 256:
#endif
#if '#' < 0
case '#' + 256:
#endif
#if '$' < 0
case '$' + 256:
#endif
#if '%' < 0
case '%' + 256:
#endif
#if '&' < 0
case '&' + 256:
#endif
#if '\'' < 0
case '\'' + 256:
#endif
#if '(' < 0
case '(' + 256:
#endif
#if ')' < 0
case ')' + 256:
#endif
#if '*' < 0
case '*' + 256:
#endif
#if '+' < 0
case '+' + 256:
#endif
#if ',' < 0
case ',' + 256:
#endif
#if '-' < 0
case '-' + 256:
#endif
#if '.' < 0
case '.' + 256:
#endif
#if '/' < 0
case '/' + 256:
#endif
#if ':' < 0
case ':' + 256:
#endif
#if ';' < 0
case ';' + 256:
#endif
#if '<' < 0
case '<' + 256:
#endif
#if '=' < 0
case '=' + 256:
#endif
#if '>' < 0
case '>' + 256:
#endif
#if '?' < 0
case '?' + 256:
#endif
#if '@' < 0
case '@' + 256:
#endif
#if '[' < 0
case '[' + 256:
#endif
#if '\\' < 0
case '\\' + 256:
#endif
#if ']' < 0
case ']' + 256:
#endif
#if '^' < 0
case '^' + 256:
#endif
#if '_' < 0
case '_' + 256:
#endif
#if '`' < 0
case '`' + 256:
#endif
#if '{' < 0
case '{' + 256:
#endif
#if '|' < 0
case '|' + 256:
#endif
#if '}' < 0
case '}' + 256:
#endif
#if '~' < 0
case '~' + 256:
#endif
return true;
default:
return false;
}
......@@ -600,105 +289,8 @@ c_ispunct (int c)
{
switch (c)
{
_C_CTYPE_PUNCT_PLAIN:
#if '!' < 0
case '!' + 256:
#endif
#if '"' < 0
case '"' + 256:
#endif
#if '#' < 0
case '#' + 256:
#endif
#if '$' < 0
case '$' + 256:
#endif
#if '%' < 0
case '%' + 256:
#endif
#if '&' < 0
case '&' + 256:
#endif
#if '\'' < 0
case '\'' + 256:
#endif
#if '(' < 0
case '(' + 256: