Bash-5.3-alpha release

This commit is contained in:
Chet Ramey
2024-04-22 10:33:38 -04:00
parent f3b6bd1945
commit 622d318652
700 changed files with 136534 additions and 96420 deletions
+1 -7
View File
@@ -2,7 +2,7 @@
/* A minimal stdlib.h containing extern declarations for those functions
that bash uses. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993,2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -32,13 +32,7 @@ extern double strtod ();
/* Memory allocation functions. */
/* Generic pointer type. */
#ifndef PTR_T
#if defined (__STDC__)
# define PTR_T void *
#else
# define PTR_T char *
#endif
#endif /* PTR_T */
extern PTR_T malloc ();
+3 -11
View File
@@ -1,7 +1,7 @@
/* memalloc.h -- consolidate code for including alloca.h or malloc.h and
defining alloca. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993,2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -45,17 +45,9 @@
# include <alloca.h>
# endif /* !IBMESA */
# else /* !HAVE_ALLOCA_H || C_ALLOCA */
# if defined (__hpux) && defined (__STDC__) && !defined (alloca)
extern void *alloca ();
# else
# if !defined (alloca)
# if defined (__STDC__)
# if !defined (alloca)
extern void *alloca (size_t);
# else
extern char *alloca ();
# endif /* !__STDC__ */
# endif /* !alloca */
# endif /* !__hpux || !__STDC__ && !alloca */
# endif /* !alloca */
# endif /* !HAVE_ALLOCA_H || C_ALLOCA */
#endif /* !__GNUC__ || C_ALLOCA */
+1 -7
View File
@@ -1,6 +1,6 @@
/* ocache.h -- a minimal object caching implementation. */
/* Copyright (C) 2002 Free Software Foundation, Inc.
/* Copyright (C) 2002,2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -22,13 +22,7 @@
#define _OCACHE_H_ 1
#ifndef PTR_T
#if defined (__STDC__)
# define PTR_T void *
#else
# define PTR_T char *
#endif
#endif /* PTR_T */
#define OC_MEMSET(memp, xch, nbytes) \
+2 -2
View File
@@ -21,13 +21,13 @@
#ifndef _POSIXSELECT_H_
#define _POSIXSELECT_H_
#if defined (FD_SET) && !defined (HAVE_SELECT)
#if defined (FD_SET) && !defined (HAVE_SELECT) && !defined (_WIN32)
# define HAVE_SELECT 1
#endif
#if defined (HAVE_SELECT)
# if !defined (HAVE_SYS_SELECT_H) || !defined (M_UNIX)
# include <sys/time.h>
# include "posixtime.h"
# endif
#endif /* HAVE_SELECT */
#if defined (HAVE_SYS_SELECT_H)
+11 -2
View File
@@ -1,6 +1,6 @@
/* posixtime.h -- wrapper for time.h, sys/times.h mess. */
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -49,9 +49,18 @@ struct timeval
#endif
#if !HAVE_GETTIMEOFDAY
extern int gettimeofday PARAMS((struct timeval *, void *));
extern int gettimeofday (struct timeval * restrict, void * restrict);
#endif
/* consistently use gettimeofday for time information */
static inline time_t
getnow(void)
{
struct timeval now;
gettimeofday (&now, 0);
return now.tv_sec;
}
/* These exist on BSD systems, at least. */
#if !defined (timerclear)
# define timerclear(tvp) do { (tvp)->tv_sec = 0; (tvp)->tv_usec = 0; } while (0)
+15
View File
@@ -71,6 +71,21 @@ is_basic (char c)
& 1;
}
#if 0
/* XXX - FUTURE */
/* All locale encodings (see localcharset.h) map the characters 0x00..0x7F
to U+0000..U+007F, like ASCII, except for
CP864 different mapping of '%'
SHIFT_JIS different mappings of 0x5C, 0x7E
JOHAB different mapping of 0x5C
However, these characters in the range 0x20..0x7E are in the ISO C
"basic character set" and in the POSIX "portable character set", which
ISO C and POSIX guarantee to be single-byte. Thus, locales with these
encodings are not POSIX compliant. And they are most likely not in use
any more (as of 2023). */
#define is_basic(c) ((unsigned char) (c) < 0x80)
#endif
#else
static inline int
+32 -6
View File
@@ -1,6 +1,6 @@
/* shmbutil.h -- utility functions for multibyte characters. */
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
/* Copyright (C) 2002-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -29,13 +29,13 @@
#if defined (HANDLE_MULTIBYTE)
#include "shmbchar.h"
extern size_t xwcsrtombs PARAMS((char *, const wchar_t **, size_t, mbstate_t *));
extern size_t xmbsrtowcs PARAMS((wchar_t *, const char **, size_t, mbstate_t *));
extern size_t xdupmbstowcs PARAMS((wchar_t **, char ***, const char *));
extern size_t xwcsrtombs (char *, const wchar_t **, size_t, mbstate_t *);
extern size_t xmbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *);
extern size_t xdupmbstowcs (wchar_t **, char ***, const char *);
extern size_t mbstrlen PARAMS((const char *));
extern size_t mbstrlen (const char *);
extern char *xstrchr PARAMS((const char *, int));
extern char *xstrchr (const char *, int);
extern int locale_mb_cur_max; /* XXX */
extern int locale_utf8locale; /* XXX */
@@ -55,6 +55,9 @@ extern int locale_utf8locale; /* XXX */
#define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0)
#define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80)
/* Is an eight-bit quantity a valid character in the current locale? */
#define VALID_SINGLEBYTE_CHAR(c) (locale_utf8locale == 0 || ((c) & 0x80) == 0)
#else /* !HANDLE_MULTIBYTE */
#undef MB_LEN_MAX
@@ -83,6 +86,8 @@ extern int locale_utf8locale; /* XXX */
#define UTF8_SINGLEBYTE(c) (1)
#define UTF8_MBFIRSTCHAR(c) (0)
#defined VALID_SINGLEBYTE_CHAR(c) (1)
#endif /* !HANDLE_MULTIBYTE */
/* Declare and initialize a multibyte state. Call must be terminated
@@ -556,4 +561,25 @@ extern int locale_utf8locale; /* XXX */
goto add_string
#endif /* HANDLE_MULTIBYTE */
#if defined (HANDLE_MULTIBYTE)
static inline size_t
mbcharlen(char *s, size_t maxlen)
{
size_t l;
DECLARE_MBSTATE;
if (maxlen == 1 || is_basic (*s))
return 1;
else if (locale_utf8locale && UTF8_SINGLEBYTE (*s))
return (*s != 0);
else
l = mbrlen (s, maxlen, &state);
if (MB_INVALIDCH (l))
return (1);
return l;
}
#else
#define mbcharlen(s, n) (1)
#endif /* HANDLE_MULTIBYTE */
#endif /* _SH_MBUTIL_H_ */
+21 -21
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1999-2020 Free Software Foundation, Inc. */
/* Copyright (C) 1999-2020,2022 Free Software Foundation, Inc. */
/* This file is part of GNU Bash, the Bourne Again SHell.
@@ -67,24 +67,24 @@
/* Get and set terminal attributes for the file descriptor passed as
an argument. */
extern int ttgetattr PARAMS((int, TTYSTRUCT *));
extern int ttsetattr PARAMS((int, TTYSTRUCT *));
extern int ttgetattr (int, TTYSTRUCT *);
extern int ttsetattr (int, TTYSTRUCT *);
/* Save and restore the terminal's attributes from static storage. */
extern void ttsave PARAMS((void));
extern void ttrestore PARAMS((void));
extern void ttsave (void);
extern void ttrestore (void);
/* Return the attributes corresponding to the file descriptor (0 or 1)
passed as an argument. */
extern TTYSTRUCT *ttattr PARAMS((int));
extern TTYSTRUCT *ttattr (int);
/* These functions only operate on the passed TTYSTRUCT; they don't
actually change anything with the kernel's current tty settings. */
extern int tt_setonechar PARAMS((TTYSTRUCT *));
extern int tt_setnoecho PARAMS((TTYSTRUCT *));
extern int tt_seteightbit PARAMS((TTYSTRUCT *));
extern int tt_setnocanon PARAMS((TTYSTRUCT *));
extern int tt_setcbreak PARAMS((TTYSTRUCT *));
extern int tt_setonechar (TTYSTRUCT *);
extern int tt_setnoecho (TTYSTRUCT *);
extern int tt_seteightbit (TTYSTRUCT *);
extern int tt_setnocanon (TTYSTRUCT *);
extern int tt_setcbreak (TTYSTRUCT *);
/* These functions are all generally mutually exclusive. If you call
more than one (bracketed with calls to ttsave and ttrestore, of
@@ -94,19 +94,19 @@ extern int tt_setcbreak PARAMS((TTYSTRUCT *));
/* These functions work with a given file descriptor and set terminal
attributes */
extern int ttfd_onechar PARAMS((int, TTYSTRUCT *));
extern int ttfd_noecho PARAMS((int, TTYSTRUCT *));
extern int ttfd_eightbit PARAMS((int, TTYSTRUCT *));
extern int ttfd_nocanon PARAMS((int, TTYSTRUCT *));
extern int ttfd_onechar (int, TTYSTRUCT *);
extern int ttfd_noecho (int, TTYSTRUCT *);
extern int ttfd_eightbit (int, TTYSTRUCT *);
extern int ttfd_nocanon (int, TTYSTRUCT *);
extern int ttfd_cbreak PARAMS((int, TTYSTRUCT *));
extern int ttfd_cbreak (int, TTYSTRUCT *);
/* These functions work with fd 0 and the TTYSTRUCT saved with ttsave () */
extern int ttonechar PARAMS((void));
extern int ttnoecho PARAMS((void));
extern int tteightbit PARAMS((void));
extern int ttnocanon PARAMS((void));
extern int ttonechar (void);
extern int ttnoecho (void);
extern int tteightbit (void);
extern int ttnocanon (void);
extern int ttcbreak PARAMS((void));
extern int ttcbreak (void);
#endif
+7 -7
View File
@@ -1,7 +1,7 @@
/* stdc.h -- macros to make source compile on both ANSI C and K&R C
compilers. */
/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
/* Copyright (C) 1993-2021,2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -52,6 +52,9 @@
# if !defined (volatile)
# define volatile __volatile
# endif
# if !defined (restrict)
# define restrict __restrict
# endif
#else /* !__GNUC__ */
# if !defined (inline)
# define inline
@@ -62,6 +65,9 @@
# if !defined (volatile)
# define volatile
# endif
# if !defined (restrict)
# define restrict
# endif
#endif /* !__GNUC__ */
#endif /* !__STDC__ */
@@ -80,10 +86,4 @@
# define INLINE
#endif
#if defined (PREFER_STDARG)
# define SH_VA_START(va, arg) va_start(va, arg)
#else
# define SH_VA_START(va, arg) va_start(va)
#endif
#endif /* !_STDC_H_ */
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020,2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -49,7 +49,7 @@ struct tms
Return the elapsed real time from an arbitrary point in the
past (the bash emulation uses the epoch), or (clock_t) -1 for
errors. All times are in CLK_TCKths of a second. */
extern clock_t times PARAMS((struct tms *buffer));
extern clock_t times (struct tms *buffer);
#endif /* !HAVE_SYS_TIMES_H */
#endif /* _BASH_SYSTIMES_H */