bash-5.0 distribution sources and documentation

This commit is contained in:
Chet Ramey
2019-01-07 09:27:52 -05:00
parent 6444760999
commit d233b485e8
528 changed files with 84836 additions and 67099 deletions

View File

@@ -37,6 +37,7 @@ extern size_t mbstrlen __P((const char *));
extern char *xstrchr __P((const char *, int));
extern int locale_mb_cur_max; /* XXX */
extern int locale_utf8locale; /* XXX */
#ifndef MB_INVALIDCH
#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2)
@@ -49,6 +50,10 @@ extern int locale_mb_cur_max; /* XXX */
#define MBLEN(s, n) ((MB_CUR_MAX > 1) ? mblen ((s), (n)) : 1)
#define MBRLEN(s, n, p) ((MB_CUR_MAX > 1) ? mbrlen ((s), (n), (p)) : 1)
#define UTF8_SINGLEBYTE(c) (((c) & 0x80) == 0)
#define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0)
#define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80)
#else /* !HANDLE_MULTIBYTE */
#undef MB_LEN_MAX
@@ -74,6 +79,9 @@ extern int locale_mb_cur_max; /* XXX */
# define wchar_t int
#endif
#define UTF8_SINGLEBYTE(c) (1)
#define UTF8_MBFIRSTCHAR(c) (0)
#endif /* !HANDLE_MULTIBYTE */
/* Declare and initialize a multibyte state. Call must be terminated
@@ -109,6 +117,8 @@ extern int locale_mb_cur_max; /* XXX */
_f = is_basic ((_str)[_i]); \
if (_f) \
mblength = 1; \
else if (locale_utf8locale && (((_str)[_i] & 0x80) == 0)) \
mblength = (_str)[_i] != 0; \
else \
{ \
state_bak = state; \
@@ -149,6 +159,8 @@ extern int locale_mb_cur_max; /* XXX */
_f = is_basic (*(_str)); \
if (_f) \
mblength = 1; \
else if (locale_utf8locale && ((*(_str) & 0x80) == 0)) \
mblength = *(_str) != 0; \
else \
{ \
state_bak = state; \
@@ -267,6 +279,8 @@ extern int locale_mb_cur_max; /* XXX */
_k = is_basic (*(_src)); \
if (_k) \
mblength = 1; \
else if (locale_utf8locale && ((*(_src) & 0x80) == 0)) \
mblength = *(_src) != 0; \
else \
{ \
state_bak = state; \
@@ -440,6 +454,8 @@ extern int locale_mb_cur_max; /* XXX */
i = is_basic (*((_src) + (_si))); \
if (i) \
mblength = 1; \
else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \
mblength = (_src)[_si] != 0; \
else \
{ \
state_bak = state; \
@@ -478,6 +494,8 @@ extern int locale_mb_cur_max; /* XXX */
i = is_basic (*((_src) + (_si))); \
if (i) \
mblength = 1; \
else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \
mblength = (_src)[_si] != 0; \
else \
{ \
state_bak = state; \

View File

@@ -36,6 +36,16 @@
# endif
#endif
/* New definition to use, moving away from __P since it's part of a reserved
namespace */
#if !defined (PARAMS)
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
# define PARAMS(protos) protos
# else
# define PARAMS(protos) ()
# endif
#endif
/* Fortify, at least, has trouble with this definition */
#if defined (HAVE_STRINGIZE)
# define CPP_STRING(x) #x

View File

@@ -35,14 +35,23 @@
# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
#endif
#ifndef TYPE_SIGNED_MAGNITUDE
# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
#endif
#ifndef TYPE_WIDTH
# define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
#endif
#ifndef TYPE_MINIMUM
# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
: (t) 0))
# define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
#endif
#ifndef TYPE_MAXIMUM
# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
# define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
#endif
#ifdef HAVE_LONG_LONG