commit bash-20200605 snapshot

This commit is contained in:
Chet Ramey
2020-06-05 14:34:49 -04:00
parent 32ba27b400
commit ab309487d5
120 changed files with 812 additions and 811 deletions
+11
View File
@@ -8517,3 +8517,14 @@ posixtime.h
lib/sh/gettimeofday.c
- gettimeofday: replacement function, so we don't have to use
HAVE_GETTIMEOFDAY in the rest of the code
6/5
---
{lots of files}.[ch]
builtins/{lots of files}.{c,h,def}
lib/glob/{lots of files}.[ch]
lib/malloc/{lots of files}.[ch]
lib/sh/{lots of files}.c
include/{lots of files}.h
examples/loadables/{lots of files}.c
- __P -> PARAMS
+9 -9
View File
@@ -1,7 +1,7 @@
/* alias.c -- Not a full alias, but just the kind that we use in the
shell. Csh style alias is somewhere else (`over there, in a box'). */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -48,17 +48,17 @@
#define ALIAS_HASH_BUCKETS 64 /* must be power of two */
typedef int sh_alias_map_func_t __P((alias_t *));
typedef int sh_alias_map_func_t PARAMS((alias_t *));
static void free_alias_data __P((PTR_T));
static alias_t **map_over_aliases __P((sh_alias_map_func_t *));
static void sort_aliases __P((alias_t **));
static int qsort_alias_compare __P((alias_t **, alias_t **));
static void free_alias_data PARAMS((PTR_T));
static alias_t **map_over_aliases PARAMS((sh_alias_map_func_t *));
static void sort_aliases PARAMS((alias_t **));
static int qsort_alias_compare PARAMS((alias_t **, alias_t **));
#if defined (READLINE)
static int skipquotes __P((char *, int));
static int skipws __P((char *, int));
static int rd_token __P((char *, int));
static int skipquotes PARAMS((char *, int));
static int skipws PARAMS((char *, int));
static int rd_token PARAMS((char *, int));
#endif
/* Non-zero means expand all words on the line. Otherwise, expand
+11 -11
View File
@@ -1,6 +1,6 @@
/* alias.h -- structure definitions. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -38,36 +38,36 @@ typedef struct alias {
/* The list of known aliases. */
extern HASH_TABLE *aliases;
extern void initialize_aliases __P((void));
extern void initialize_aliases PARAMS((void));
/* Scan the list of aliases looking for one with NAME. Return NULL
if the alias doesn't exist, else a pointer to the alias. */
extern alias_t *find_alias __P((char *));
extern alias_t *find_alias PARAMS((char *));
/* Return the value of the alias for NAME, or NULL if there is none. */
extern char *get_alias_value __P((char *));
extern char *get_alias_value PARAMS((char *));
/* Make a new alias from NAME and VALUE. If NAME can be found,
then replace its value. */
extern void add_alias __P((char *, char *));
extern void add_alias PARAMS((char *, char *));
/* Remove the alias with name NAME from the alias list. Returns
the index of the removed alias, or -1 if the alias didn't exist. */
extern int remove_alias __P((char *));
extern int remove_alias PARAMS((char *));
/* Remove all aliases. */
extern void delete_all_aliases __P((void));
extern void delete_all_aliases PARAMS((void));
/* Return an array of all defined aliases. */
extern alias_t **all_aliases __P((void));
extern alias_t **all_aliases PARAMS((void));
/* Expand a single word for aliases. */
extern char *alias_expand_word __P((char *));
extern char *alias_expand_word PARAMS((char *));
/* Return a new line, with any aliases expanded. */
extern char *alias_expand __P((char *));
extern char *alias_expand PARAMS((char *));
/* Helper definition for the parser */
extern void clear_string_list_expander __P((alias_t *));
extern void clear_string_list_expander PARAMS((alias_t *));
#endif /* _ALIAS_H_ */
+1 -1
View File
@@ -61,7 +61,7 @@
ae->next = new; \
} while (0)
static char *array_to_string_internal __P((ARRAY_ELEMENT *, ARRAY_ELEMENT *, char *, int));
static char *array_to_string_internal PARAMS((ARRAY_ELEMENT *, ARRAY_ELEMENT *, char *, int));
static char *spacesep = " ";
+35 -35
View File
@@ -1,7 +1,7 @@
/* array.h -- definitions for the interface exported by array.c that allows
the rest of the shell to manipulate array variables. */
/* Copyright (C) 1997-2009 Free Software Foundation, Inc.
/* Copyright (C) 1997-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -43,53 +43,53 @@ typedef struct array_element {
struct array_element *next, *prev;
} ARRAY_ELEMENT;
typedef int sh_ae_map_func_t __P((ARRAY_ELEMENT *, void *));
typedef int sh_ae_map_func_t PARAMS((ARRAY_ELEMENT *, void *));
/* Basic operations on entire arrays */
extern ARRAY *array_create __P((void));
extern void array_flush __P((ARRAY *));
extern void array_dispose __P((ARRAY *));
extern ARRAY *array_copy __P((ARRAY *));
extern ARRAY *array_slice __P((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *));
extern void array_walk __P((ARRAY *, sh_ae_map_func_t *, void *));
extern ARRAY *array_create PARAMS((void));
extern void array_flush PARAMS((ARRAY *));
extern void array_dispose PARAMS((ARRAY *));
extern ARRAY *array_copy PARAMS((ARRAY *));
extern ARRAY *array_slice PARAMS((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *));
extern void array_walk PARAMS((ARRAY *, sh_ae_map_func_t *, void *));
extern ARRAY_ELEMENT *array_shift __P((ARRAY *, int, int));
extern int array_rshift __P((ARRAY *, int, char *));
extern ARRAY_ELEMENT *array_unshift_element __P((ARRAY *));
extern int array_shift_element __P((ARRAY *, char *));
extern ARRAY_ELEMENT *array_shift PARAMS((ARRAY *, int, int));
extern int array_rshift PARAMS((ARRAY *, int, char *));
extern ARRAY_ELEMENT *array_unshift_element PARAMS((ARRAY *));
extern int array_shift_element PARAMS((ARRAY *, char *));
extern ARRAY *array_quote __P((ARRAY *));
extern ARRAY *array_quote_escapes __P((ARRAY *));
extern ARRAY *array_dequote __P((ARRAY *));
extern ARRAY *array_dequote_escapes __P((ARRAY *));
extern ARRAY *array_remove_quoted_nulls __P((ARRAY *));
extern ARRAY *array_quote PARAMS((ARRAY *));
extern ARRAY *array_quote_escapes PARAMS((ARRAY *));
extern ARRAY *array_dequote PARAMS((ARRAY *));
extern ARRAY *array_dequote_escapes PARAMS((ARRAY *));
extern ARRAY *array_remove_quoted_nulls PARAMS((ARRAY *));
extern char *array_subrange __P((ARRAY *, arrayind_t, arrayind_t, int, int, int));
extern char *array_patsub __P((ARRAY *, char *, char *, int));
extern char *array_modcase __P((ARRAY *, char *, int, int));
extern char *array_subrange PARAMS((ARRAY *, arrayind_t, arrayind_t, int, int, int));
extern char *array_patsub PARAMS((ARRAY *, char *, char *, int));
extern char *array_modcase PARAMS((ARRAY *, char *, int, int));
/* Basic operations on array elements. */
extern ARRAY_ELEMENT *array_create_element __P((arrayind_t, char *));
extern ARRAY_ELEMENT *array_copy_element __P((ARRAY_ELEMENT *));
extern void array_dispose_element __P((ARRAY_ELEMENT *));
extern ARRAY_ELEMENT *array_create_element PARAMS((arrayind_t, char *));
extern ARRAY_ELEMENT *array_copy_element PARAMS((ARRAY_ELEMENT *));
extern void array_dispose_element PARAMS((ARRAY_ELEMENT *));
extern int array_insert __P((ARRAY *, arrayind_t, char *));
extern ARRAY_ELEMENT *array_remove __P((ARRAY *, arrayind_t));
extern char *array_reference __P((ARRAY *, arrayind_t));
extern int array_insert PARAMS((ARRAY *, arrayind_t, char *));
extern ARRAY_ELEMENT *array_remove PARAMS((ARRAY *, arrayind_t));
extern char *array_reference PARAMS((ARRAY *, arrayind_t));
/* Converting to and from arrays */
extern WORD_LIST *array_to_word_list __P((ARRAY *));
extern ARRAY *array_from_word_list __P((WORD_LIST *));
extern WORD_LIST *array_keys_to_word_list __P((ARRAY *));
extern WORD_LIST *array_to_word_list PARAMS((ARRAY *));
extern ARRAY *array_from_word_list PARAMS((WORD_LIST *));
extern WORD_LIST *array_keys_to_word_list PARAMS((ARRAY *));
extern ARRAY *array_assign_list __P((ARRAY *, WORD_LIST *));
extern ARRAY *array_assign_list PARAMS((ARRAY *, WORD_LIST *));
extern char **array_to_argv __P((ARRAY *));
extern char **array_to_argv PARAMS((ARRAY *));
extern char *array_to_kvpair __P((ARRAY *, int));
extern char *array_to_assign __P((ARRAY *, int));
extern char *array_to_string __P((ARRAY *, char *, int));
extern ARRAY *array_from_string __P((char *, char *));
extern char *array_to_kvpair PARAMS((ARRAY *, int));
extern char *array_to_assign PARAMS((ARRAY *, int));
extern char *array_to_string PARAMS((ARRAY *, char *, int));
extern ARRAY *array_from_string PARAMS((char *, char *));
/* Flags for array_shift */
#define AS_DISPOSE 0x01
+1 -1
View File
@@ -44,7 +44,7 @@
#include "assoc.h"
#include "builtins/common.h"
static WORD_LIST *assoc_to_word_list_internal __P((HASH_TABLE *, int));
static WORD_LIST *assoc_to_word_list_internal PARAMS((HASH_TABLE *, int));
/* assoc_create == hash_create */
+20 -20
View File
@@ -1,6 +1,6 @@
/* bashhist.h -- interface to the bash history functions in bashhist.c. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -64,26 +64,26 @@ extern int history_expansion_inhibited;
extern int double_quotes_inhibit_history_expansion;
# endif /* BANG_HISTORY */
extern void bash_initialize_history __P((void));
extern void bash_history_reinit __P((int));
extern void bash_history_disable __P((void));
extern void bash_history_enable __P((void));
extern void bash_clear_history __P((void));
extern int bash_delete_histent __P((int));
extern int bash_delete_history_range __P((int, int));
extern int bash_delete_last_history __P((void));
extern void load_history __P((void));
extern void save_history __P((void));
extern int maybe_append_history __P((char *));
extern int maybe_save_shell_history __P((void));
extern char *pre_process_line __P((char *, int, int));
extern void maybe_add_history __P((char *));
extern void bash_add_history __P((char *));
extern int check_add_history __P((char *, int));
extern int history_number __P((void));
extern void bash_initialize_history PARAMS((void));
extern void bash_history_reinit PARAMS((int));
extern void bash_history_disable PARAMS((void));
extern void bash_history_enable PARAMS((void));
extern void bash_clear_history PARAMS((void));
extern int bash_delete_histent PARAMS((int));
extern int bash_delete_history_range PARAMS((int, int));
extern int bash_delete_last_history PARAMS((void));
extern void load_history PARAMS((void));
extern void save_history PARAMS((void));
extern int maybe_append_history PARAMS((char *));
extern int maybe_save_shell_history PARAMS((void));
extern char *pre_process_line PARAMS((char *, int, int));
extern void maybe_add_history PARAMS((char *));
extern void bash_add_history PARAMS((char *));
extern int check_add_history PARAMS((char *, int));
extern int history_number PARAMS((void));
extern void setup_history_ignore __P((char *));
extern void setup_history_ignore PARAMS((char *));
extern char *last_history_line __P((void));
extern char *last_history_line PARAMS((void));
#endif /* _BASHHIST_H_ */
+2 -2
View File
@@ -4,7 +4,7 @@
/* Original version by tromey@cns.caltech.edu, Fri Feb 7 1992. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -41,7 +41,7 @@
#include "shell.h"
#include <readline/readline.h>
static int _strcompare __P((char **, char **));
static int _strcompare PARAMS((char **, char **));
/* Find greatest common prefix of two strings. */
static int
+8 -8
View File
@@ -1,6 +1,6 @@
/* braces.c -- code for doing word expansion in curly braces. */
/* Copyright (C) 1987-2018 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -59,7 +59,7 @@ extern int errno;
#define BRACE_SEQ_SPECIFIER ".."
extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
extern int asprintf PARAMS((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
/* Basic idea:
@@ -73,12 +73,12 @@ extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__
/* The character which is used to separate arguments. */
static const int brace_arg_separator = ',';
#if defined (__P)
static int brace_gobbler __P((char *, size_t, int *, int));
static char **expand_amble __P((char *, size_t, int));
static char **expand_seqterm __P((char *, size_t));
static char **mkseq __P((intmax_t, intmax_t, intmax_t, int, int));
static char **array_concat __P((char **, char **));
#if defined (PARAMS)
static int brace_gobbler PARAMS((char *, size_t, int *, int));
static char **expand_amble PARAMS((char *, size_t, int));
static char **expand_seqterm PARAMS((char *, size_t));
static char **mkseq PARAMS((intmax_t, intmax_t, intmax_t, int, int));
static char **array_concat PARAMS((char **, char **));
#else
static int brace_gobbler ();
static char **expand_amble ();
+2 -2
View File
@@ -1,7 +1,7 @@
This file is alias.def, from which is created alias.c
It implements the builtins "alias" and "unalias" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -63,7 +63,7 @@ $END
/* Flags for print_alias */
#define AL_REUSABLE 0x01
static void print_alias __P((alias_t *, int));
static void print_alias PARAMS((alias_t *, int));
/* Hack the alias command in a Korn shell way. */
int
+3 -3
View File
@@ -1,6 +1,6 @@
/* bashgetopt.h -- extern declarations for stuff defined in bashgetopt.c. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -36,7 +36,7 @@ extern int list_opttype;
extern WORD_LIST *lcurrent;
extern WORD_LIST *loptend;
extern int internal_getopt __P((WORD_LIST *, char *));
extern void reset_internal_getopt __P((void));
extern int internal_getopt PARAMS((WORD_LIST *, char *));
extern void reset_internal_getopt PARAMS((void));
#endif /* !__BASH_GETOPT_H */
+2 -2
View File
@@ -1,7 +1,7 @@
This file is break.def, from which is created break.c.
It implements the builtins "break" and "continue" in Bash.
Copyright (C) 1987-2009 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -46,7 +46,7 @@ $END
#include "../execute_cmd.h"
#include "common.h"
static int check_loop_level __P((void));
static int check_loop_level PARAMS((void));
/* The depth of while's and until's. */
int loop_level = 0;
+7 -7
View File
@@ -1,7 +1,7 @@
This file is cd.def, from which is created cd.c. It implements the
builtins "cd" and "pwd" in Bash.
Copyright (C) 1987-2016 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -56,13 +56,13 @@ extern int errno;
extern const char * const bash_getcwd_errstr;
static int bindpwd __P((int));
static int setpwd __P((char *));
static char *resetpwd __P((char *));
static int change_to_directory __P((char *, int, int));
static int bindpwd PARAMS((int));
static int setpwd PARAMS((char *));
static char *resetpwd PARAMS((char *));
static int change_to_directory PARAMS((char *, int, int));
static int cdxattr __P((char *, char **));
static void resetxattr __P((void));
static int cdxattr PARAMS((char *, char **));
static void resetxattr PARAMS((void));
/* Change this to 1 to get cd spelling correction by default. */
int cdspelling = 0;
+2 -2
View File
@@ -1,7 +1,7 @@
This file is command.def, from which is created command.c.
It implements the builtin "command" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -57,7 +57,7 @@ $END
#include "common.h"
#if defined (_CS_PATH) && defined (HAVE_CONFSTR) && !HAVE_DECL_CONFSTR
extern size_t confstr __P((int, char *, size_t));
extern size_t confstr PARAMS((int, char *, size_t));
#endif
/* Run the commands mentioned in LIST without paying attention to shell
+10 -10
View File
@@ -1,7 +1,7 @@
This file is complete.def, from which is created complete.c.
It implements the builtins "complete", "compgen", and "compopt" in Bash.
Copyright (C) 1999-2019 Free Software Foundation, Inc.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -84,18 +84,18 @@ struct _optflags {
int Iflag;
};
static int find_compact __P((char *));
static int find_compopt __P((char *));
static int find_compact PARAMS((char *));
static int find_compopt PARAMS((char *));
static int build_actions __P((WORD_LIST *, struct _optflags *, unsigned long *, unsigned long *));
static int build_actions PARAMS((WORD_LIST *, struct _optflags *, unsigned long *, unsigned long *));
static int remove_cmd_completions __P((WORD_LIST *));
static int remove_cmd_completions PARAMS((WORD_LIST *));
static int print_one_completion __P((char *, COMPSPEC *));
static int print_compitem __P((BUCKET_CONTENTS *));
static void print_compopts __P((const char *, COMPSPEC *, int));
static void print_all_completions __P((void));
static int print_cmd_completions __P((WORD_LIST *));
static int print_one_completion PARAMS((char *, COMPSPEC *));
static int print_compitem PARAMS((BUCKET_CONTENTS *));
static void print_compopts PARAMS((const char *, COMPSPEC *, int));
static void print_all_completions PARAMS((void));
static int print_cmd_completions PARAMS((WORD_LIST *));
static char *Garg, *Warg, *Parg, *Sarg, *Xarg, *Farg, *Carg;
+2 -2
View File
@@ -90,8 +90,8 @@ $END
#include "builtext.h"
#include "bashgetopt.h"
static SHELL_VAR *declare_find_variable __P((const char *, int, int));
static int declare_internal __P((register WORD_LIST *, int));
static SHELL_VAR *declare_find_variable PARAMS((const char *, int, int));
static int declare_internal PARAMS((register WORD_LIST *, int));
/* Declare or change variable attributes. */
int
+7 -7
View File
@@ -1,7 +1,7 @@
This file is enable.def, from which is created enable.c.
It implements the builtin "enable" in Bash.
Copyright (C) 1987-2016 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -84,13 +84,13 @@ $END
#define SFLAG 0x20
#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
static int dyn_load_builtin __P((WORD_LIST *, int, char *));
static int dyn_load_builtin PARAMS((WORD_LIST *, int, char *));
#endif
#if defined (HAVE_DLCLOSE)
static int dyn_unload_builtin __P((char *));
static void delete_builtin __P((struct builtin *));
static int local_dlclose __P((void *));
static int dyn_unload_builtin PARAMS((char *));
static void delete_builtin PARAMS((struct builtin *));
static int local_dlclose PARAMS((void *));
#endif
#define STRUCT_SUFFIX "_struct"
@@ -98,8 +98,8 @@ static int local_dlclose __P((void *));
#define LOAD_SUFFIX "_builtin_load"
#define UNLOAD_SUFFIX "_builtin_unload"
static void list_some_builtins __P((int));
static int enable_shell_command __P((char *, int));
static void list_some_builtins PARAMS((int));
static int enable_shell_command PARAMS((char *, int));
/* Enable/disable shell commands present in LIST. If list is not specified,
then print out a list of shell commands showing which are enabled and
+2 -2
View File
@@ -1,6 +1,6 @@
/* evalstring.c - evaluate a string as one or more shell commands. */
/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
/* Copyright (C) 1996-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -63,7 +63,7 @@ extern int errno;
int parse_and_execute_level = 0;
static int cat_file __P((REDIRECT *));
static int cat_file PARAMS((REDIRECT *));
#define PE_TAG "parse_and_execute top"
#define PS_TAG "parse_string top"
+2 -2
View File
@@ -1,7 +1,7 @@
This file is exit.def, from which is created exit.c.
It implements the builtins "exit", and "logout" in Bash.
Copyright (C) 1987-2009 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -50,7 +50,7 @@ $END
extern int check_jobs_at_exit;
static int exit_or_logout __P((WORD_LIST *));
static int exit_or_logout PARAMS((WORD_LIST *));
static int sourced_logout;
int
+2 -2
View File
@@ -1,7 +1,7 @@
This file is fg_bg.def, from which is created fg_bg.c.
It implements the builtins "bg" and "fg" in Bash.
Copyright (C) 1987-2009 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -52,7 +52,7 @@ $END
#include "bashgetopt.h"
#if defined (JOB_CONTROL)
static int fg_bg __P((WORD_LIST *, int));
static int fg_bg PARAMS((WORD_LIST *, int));
/* How to bring a job into the foreground. */
int
+2 -2
View File
@@ -1,6 +1,6 @@
/* gen-helpfiles - create files containing builtin help text */
/* Copyright (C) 2012 Free Software Foundation, Inc.
/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -98,7 +98,7 @@ char *helpfile_directory;
/* Forward declarations. */
int write_helpfiles __P((struct builtin *));
int write_helpfiles PARAMS((struct builtin *));
/* For each file mentioned on the command line, process it and
write the information to STRUCTFILE and EXTERNFILE, while
+7 -7
View File
@@ -1,6 +1,6 @@
/* getopt.h - declarations for getopt. */
/* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2008,2009 Free Software Foundation, Inc.
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -59,7 +59,7 @@ extern int sh_optopt;
/* Set to 1 when an unrecognized option is encountered. */
extern int sh_badopt;
extern int sh_getopt __P((int, char *const *, const char *));
extern int sh_getopt PARAMS((int, char *const *, const char *));
typedef struct sh_getopt_state
{
@@ -71,12 +71,12 @@ typedef struct sh_getopt_state
int gs_flags;
} sh_getopt_state_t;
extern void sh_getopt_restore_state __P((char **));
extern void sh_getopt_restore_state PARAMS((char **));
extern sh_getopt_state_t *sh_getopt_alloc_istate __P((void));
extern void sh_getopt_dispose_istate __P((sh_getopt_state_t *));
extern sh_getopt_state_t *sh_getopt_alloc_istate PARAMS((void));
extern void sh_getopt_dispose_istate PARAMS((sh_getopt_state_t *));
extern sh_getopt_state_t *sh_getopt_save_istate __P((void));
extern void sh_getopt_restore_istate __P((sh_getopt_state_t *));
extern sh_getopt_state_t *sh_getopt_save_istate PARAMS((void));
extern void sh_getopt_restore_istate PARAMS((sh_getopt_state_t *));
#endif /* _SH_GETOPT_H */
+6 -6
View File
@@ -1,7 +1,7 @@
This file is hash.def, from which is created hash.c.
It implements the builtin "hash" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -70,11 +70,11 @@ $END
extern int dot_found_in_search;
static int add_hashed_command __P((char *, int));
static int print_hash_info __P((BUCKET_CONTENTS *));
static int print_portable_hash_info __P((BUCKET_CONTENTS *));
static int print_hashed_commands __P((int));
static int list_hashed_filename_targets __P((WORD_LIST *, int));
static int add_hashed_command PARAMS((char *, int));
static int print_hash_info PARAMS((BUCKET_CONTENTS *));
static int print_portable_hash_info PARAMS((BUCKET_CONTENTS *));
static int print_hashed_commands PARAMS((int));
static int list_hashed_filename_targets PARAMS((WORD_LIST *, int));
/* Print statistics on the current state of hashed commands. If LIST is
not empty, then rehash (or hash in the first place) the specified
+6 -6
View File
@@ -1,7 +1,7 @@
This file is help.def, from which is created help.c.
It implements the builtin "help" in Bash.
Copyright (C) 1987-2019 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -79,11 +79,11 @@ extern int errno;
extern const char * const bash_copyright;
extern const char * const bash_license;
static void show_builtin_command_help __P((void));
static int open_helpfile __P((char *));
static void show_desc __P((char *, int));
static void show_manpage __P((char *, int));
static void show_longdoc __P((int));
static void show_builtin_command_help PARAMS((void));
static int open_helpfile PARAMS((char *));
static void show_desc PARAMS((char *, int));
static void show_manpage PARAMS((char *, int));
static void show_longdoc PARAMS((int));
/* Print out a list of the known functions in the shell, and what they do.
If LIST is supplied, print out the list which matches for each pattern
+5 -5
View File
@@ -1,7 +1,7 @@
This file is history.def, from which is created history.c.
It implements the builtin "history" in Bash.
Copyright (C) 1987-2018 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -86,10 +86,10 @@ $END
extern int errno;
#endif
static char *histtime __P((HIST_ENTRY *, const char *));
static int display_history __P((WORD_LIST *));
static void push_history __P((WORD_LIST *));
static int expand_and_print_history __P((WORD_LIST *));
static char *histtime PARAMS((HIST_ENTRY *, const char *));
static int display_history PARAMS((WORD_LIST *));
static void push_history PARAMS((WORD_LIST *));
static int expand_and_print_history PARAMS((WORD_LIST *));
#define AFLAG 0x01
#define RFLAG 0x02
+2 -2
View File
@@ -1,7 +1,7 @@
This file is jobs.def, from which is created jobs.c.
It implements the builtins "jobs" and "disown" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -68,7 +68,7 @@ $END
#define JSTATE_RUNNING 0x1
#define JSTATE_STOPPED 0x2
static int execute_list_with_replacements __P((WORD_LIST *));
static int execute_list_with_replacements PARAMS((WORD_LIST *));
/* The `jobs' command. Prints outs a list of active jobs. If the
argument `-l' is given, then the process id's are printed also.
+2 -2
View File
@@ -1,7 +1,7 @@
This file is kill.def, from which is created kill.c.
It implements the builtin "kill" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -70,7 +70,7 @@ $END
extern int errno;
#endif /* !errno */
static void kill_error __P((pid_t, int));
static void kill_error PARAMS((pid_t, int));
#if !defined (CONTINUE_AFTER_KILL_ERROR)
# define CONTINUE_OR_FAIL return (EXECUTION_FAILURE)
+2 -2
View File
@@ -2,7 +2,7 @@ This file is mapfile.def, from which is created mapfile.c.
It implements the builtin "mapfile" in Bash.
Copyright (C) 2005-2006 Rocky Bernstein for Free Software Foundation, Inc.
Copyright (C) 2008-2016 Free Software Foundation, Inc.
Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -91,7 +91,7 @@ extern int errno;
#if defined (ARRAY_VARS)
static int run_callback __P((const char *, unsigned int, const char *));
static int run_callback PARAMS((const char *, unsigned int, const char *));
#define DEFAULT_ARRAY_NAME "MAPFILE"
#define DEFAULT_VARIABLE_NAME "MAPLINE" /* not used right now */
+11 -11
View File
@@ -1,7 +1,7 @@
/* mkbuiltins.c - Create builtins.c, builtext.h, and builtdoc.c from
a single source file called builtins.def. */
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -439,7 +439,7 @@ array_free (array)
/* The definition of a function. */
typedef int Function ();
typedef int mk_handler_func_t __P((char *, DEF_FILE *, char *));
typedef int mk_handler_func_t PARAMS((char *, DEF_FILE *, char *));
/* Structure handles processor directives. */
typedef struct {
@@ -447,14 +447,14 @@ typedef struct {
mk_handler_func_t *function;
} HANDLER_ENTRY;
extern int builtin_handler __P((char *, DEF_FILE *, char *));
extern int function_handler __P((char *, DEF_FILE *, char *));
extern int short_doc_handler __P((char *, DEF_FILE *, char *));
extern int comment_handler __P((char *, DEF_FILE *, char *));
extern int depends_on_handler __P((char *, DEF_FILE *, char *));
extern int produces_handler __P((char *, DEF_FILE *, char *));
extern int end_handler __P((char *, DEF_FILE *, char *));
extern int docname_handler __P((char *, DEF_FILE *, char *));
extern int builtin_handler PARAMS((char *, DEF_FILE *, char *));
extern int function_handler PARAMS((char *, DEF_FILE *, char *));
extern int short_doc_handler PARAMS((char *, DEF_FILE *, char *));
extern int comment_handler PARAMS((char *, DEF_FILE *, char *));
extern int depends_on_handler PARAMS((char *, DEF_FILE *, char *));
extern int produces_handler PARAMS((char *, DEF_FILE *, char *));
extern int end_handler PARAMS((char *, DEF_FILE *, char *));
extern int docname_handler PARAMS((char *, DEF_FILE *, char *));
HANDLER_ENTRY handlers[] = {
{ "BUILTIN", builtin_handler },
@@ -1233,7 +1233,7 @@ write_builtins (defs, structfile, externfile)
if (externfile)
{
if (builtin->function)
fprintf (externfile, "extern int %s __P((WORD_LIST *));\n",
fprintf (externfile, "extern int %s PARAMS((WORD_LIST *));\n",
builtin->function);
fprintf (externfile, "extern char * const %s_doc[];\n",
+17 -17
View File
@@ -1,7 +1,7 @@
This file is printf.def, from which is created printf.c.
It implements the builtin "printf" in Bash.
Copyright (C) 1997-2017 Free Software Foundation, Inc.
Copyright (C) 1997-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -187,25 +187,25 @@ extern int errno;
extern time_t shell_start_time;
#if !HAVE_ASPRINTF
extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
extern int asprintf PARAMS((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
#endif
#if !HAVE_VSNPRINTF
extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
extern int vsnprintf PARAMS((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
#endif
static void printf_erange __P((char *));
static int printstr __P((char *, char *, int, int, int));
static int tescape __P((char *, char *, int *, int *));
static char *bexpand __P((char *, int, int *, int *));
static char *vbadd __P((char *, int));
static int vbprintf __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
static char *mklong __P((char *, char *, size_t));
static int getchr __P((void));
static char *getstr __P((void));
static int getint __P((void));
static intmax_t getintmax __P((void));
static uintmax_t getuintmax __P((void));
static void printf_erange PARAMS((char *));
static int printstr PARAMS((char *, char *, int, int, int));
static int tescape PARAMS((char *, char *, int *, int *));
static char *bexpand PARAMS((char *, int, int *, int *));
static char *vbadd PARAMS((char *, int));
static int vbprintf PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
static char *mklong PARAMS((char *, char *, size_t));
static int getchr PARAMS((void));
static char *getstr PARAMS((void));
static int getint PARAMS((void));
static intmax_t getintmax PARAMS((void));
static uintmax_t getuintmax PARAMS((void));
#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && !defined(STRTOLD_BROKEN)
typedef long double floatmax_t;
@@ -216,9 +216,9 @@ typedef double floatmax_t;
# define FLOATMAX_CONV ""
# define strtofltmax strtod
#endif
static floatmax_t getfloatmax __P((void));
static floatmax_t getfloatmax PARAMS((void));
static intmax_t asciicode __P((void));
static intmax_t asciicode PARAMS((void));
static WORD_LIST *garglist, *orig_arglist;
static int retval;
+7 -7
View File
@@ -1,7 +1,7 @@
This file is pushd.def, from which is created pushd.c. It implements the
builtins "pushd", "popd", and "dirs" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -157,12 +157,12 @@ static int directory_list_size;
/* Offset to the end of the list. */
static int directory_list_offset;
static void pushd_error __P((int, char *));
static void clear_directory_stack __P((void));
static int cd_to_string __P((char *));
static int change_to_temp __P((char *));
static void add_dirstack_element __P((char *));
static int get_dirstack_index __P((intmax_t, int, int *));
static void pushd_error PARAMS((int, char *));
static void clear_directory_stack PARAMS((void));
static int cd_to_string PARAMS((char *));
static int change_to_temp PARAMS((char *));
static void add_dirstack_element PARAMS((char *));
static int get_dirstack_index PARAMS((intmax_t, int, int *));
#define NOCD 0x01
#define ROTATE 0x02
+11 -11
View File
@@ -1,7 +1,7 @@
This file is read.def, from which is created read.c.
It implements the builtin "read" in Bash.
Copyright (C) 1987-2019 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -119,20 +119,20 @@ struct ttsave
};
#if defined (READLINE)
static void reset_attempted_completion_function __P((char *));
static int set_itext __P((void));
static char *edit_line __P((char *, char *));
static void set_eol_delim __P((int));
static void reset_eol_delim __P((char *));
static void reset_attempted_completion_function PARAMS((char *));
static int set_itext PARAMS((void));
static char *edit_line PARAMS((char *, char *));
static void set_eol_delim PARAMS((int));
static void reset_eol_delim PARAMS((char *));
#endif
static SHELL_VAR *bind_read_variable __P((char *, char *));
static SHELL_VAR *bind_read_variable PARAMS((char *, char *));
#if defined (HANDLE_MULTIBYTE)
static int read_mbchar __P((int, char *, int, int, int));
static int read_mbchar PARAMS((int, char *, int, int, int));
#endif
static void ttyrestore __P((struct ttsave *));
static void ttyrestore PARAMS((struct ttsave *));
static sighandler sigalrm __P((int));
static void reset_alarm __P((void));
static sighandler sigalrm PARAMS((int));
static void reset_alarm PARAMS((void));
/* Try this to see what the rest of the shell can do with the information. */
procenv_t alrmbuf;
+11 -11
View File
@@ -1,7 +1,7 @@
This file is set.def, from which is created set.c.
It implements the "set" and "unset" builtins in Bash.
Copyright (C) 1987-2018 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -151,24 +151,24 @@ Exit Status:
Returns success unless an invalid option is given.
$END
typedef int setopt_set_func_t __P((int, char *));
typedef int setopt_get_func_t __P((char *));
typedef int setopt_set_func_t PARAMS((int, char *));
typedef int setopt_get_func_t PARAMS((char *));
static int find_minus_o_option __P((char *));
static int find_minus_o_option PARAMS((char *));
static void print_minus_o_option __P((char *, int, int));
static void print_all_shell_variables __P((void));
static void print_minus_o_option PARAMS((char *, int, int));
static void print_all_shell_variables PARAMS((void));
static int set_ignoreeof __P((int, char *));
static int set_posix_mode __P((int, char *));
static int set_ignoreeof PARAMS((int, char *));
static int set_posix_mode PARAMS((int, char *));
#if defined (READLINE)
static int set_edit_mode __P((int, char *));
static int get_edit_mode __P((char *));
static int set_edit_mode PARAMS((int, char *));
static int get_edit_mode PARAMS((char *));
#endif
#if defined (HISTORY)
static int bash_set_history __P((int, char *));
static int bash_set_history PARAMS((int, char *));
#endif
static const char * const on = "on";
+2 -2
View File
@@ -1,7 +1,7 @@
This file is setattr.def, from which is created setattr.c.
It implements the builtins "export" and "readonly", in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -42,7 +42,7 @@ $PRODUCES setattr.c
extern sh_builtin_func_t *this_shell_builtin;
#ifdef ARRAY_VARS
extern int declare_builtin __P((WORD_LIST *));
extern int declare_builtin PARAMS((WORD_LIST *));
#endif
#define READONLY_OR_EXPORT \
+17 -17
View File
@@ -105,7 +105,7 @@ extern int force_fignore;
extern int dircomplete_spelling, dircomplete_expand;
extern int complete_fullquote;
extern int enable_hostname_completion __P((int));
extern int enable_hostname_completion PARAMS((int));
#endif
#if defined (PROGRAMMABLE_COMPLETION)
@@ -126,21 +126,21 @@ extern int array_expand_once;
extern int syslog_history;
#endif
static void shopt_error __P((char *));
static void shopt_error PARAMS((char *));
static int set_shellopts_after_change __P((char *, int));
static int set_compatibility_level __P((char *, int));
static int set_shellopts_after_change PARAMS((char *, int));
static int set_compatibility_level PARAMS((char *, int));
#if defined (RESTRICTED_SHELL)
static int set_restricted_shell __P((char *, int));
static int set_restricted_shell PARAMS((char *, int));
#endif
#if defined (READLINE)
static int shopt_enable_hostname_completion __P((char *, int));
static int shopt_set_complete_direxpand __P((char *, int));
static int shopt_enable_hostname_completion PARAMS((char *, int));
static int shopt_set_complete_direxpand PARAMS((char *, int));
#endif
static int shopt_set_debug_mode __P((char *, int));
static int shopt_set_debug_mode PARAMS((char *, int));
static int shopt_login_shell;
static int shopt_compat31;
@@ -151,7 +151,7 @@ static int shopt_compat42;
static int shopt_compat43;
static int shopt_compat44;
typedef int shopt_set_func_t __P((char *, int));
typedef int shopt_set_func_t PARAMS((char *, int));
/* If you add a new variable name here, make sure to set the default value
appropriately in reset_shopt_options. */
@@ -255,14 +255,14 @@ static struct {
static const char * const on = "on";
static const char * const off = "off";
static int find_shopt __P((char *));
static int toggle_shopts __P((int, WORD_LIST *, int));
static void print_shopt __P((char *, int, int));
static int list_shopts __P((WORD_LIST *, int));
static int list_some_shopts __P((int, int));
static int list_shopt_o_options __P((WORD_LIST *, int));
static int list_some_o_options __P((int, int));
static int set_shopt_o_options __P((int, WORD_LIST *, int));
static int find_shopt PARAMS((char *));
static int toggle_shopts PARAMS((int, WORD_LIST *, int));
static void print_shopt PARAMS((char *, int, int));
static int list_shopts PARAMS((WORD_LIST *, int));
static int list_some_shopts PARAMS((int, int));
static int list_shopt_o_options PARAMS((WORD_LIST *, int));
static int list_some_o_options PARAMS((int, int));
static int set_shopt_o_options PARAMS((int, WORD_LIST *, int));
#define SFLAG 0x01
#define UFLAG 0x02
+2 -2
View File
@@ -1,7 +1,7 @@
This file is source.def, from which is created source.c.
It implements the builtins "." and "source" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -80,7 +80,7 @@ $END
extern int errno;
#endif /* !errno */
static void maybe_pop_dollar_vars __P((void));
static void maybe_pop_dollar_vars PARAMS((void));
/* If non-zero, `.' uses $PATH to look up the script to be sourced. */
int source_uses_path = 1;
+2 -2
View File
@@ -1,7 +1,7 @@
This file is suspend.def, from which is created suspend.c.
It implements the builtin "suspend" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -54,7 +54,7 @@ $END
#include "common.h"
#include "bashgetopt.h"
static sighandler suspend_continue __P((int));
static sighandler suspend_continue PARAMS((int));
static SigHandler *old_cont;
#if 0
+2 -2
View File
@@ -75,8 +75,8 @@ $END
#include "common.h"
#include "bashgetopt.h"
static void showtrap __P((int, int));
static int display_traps __P((WORD_LIST *, int));
static void showtrap PARAMS((int, int));
static int display_traps PARAMS((WORD_LIST *, int));
/* The trap command:
+2 -2
View File
@@ -1,7 +1,7 @@
This file is type.def, from which is created type.c.
It implements the builtin "type" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -76,7 +76,7 @@ $END
#include "common.h"
#include "bashgetopt.h"
extern int find_reserved_word __P((char *));
extern int find_reserved_word PARAMS((char *));
/* For each word in LIST, find out what the shell is going to do with
it as a simple command. i.e., which file would this shell use to
+12 -12
View File
@@ -1,7 +1,7 @@
This file is ulimit.def, from which is created ulimit.c.
It implements the builtin "ulimit" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -204,22 +204,22 @@ extern int errno;
#define BLOCKSIZE(x) (((x) == POSIXBLK) ? (posixly_correct ? 512 : 1024) : (x))
static int _findlim __P((int));
static int _findlim PARAMS((int));
static int ulimit_internal __P((int, char *, int, int));
static int ulimit_internal PARAMS((int, char *, int, int));
static int get_limit __P((int, RLIMTYPE *, RLIMTYPE *));
static int set_limit __P((int, RLIMTYPE, int));
static int get_limit PARAMS((int, RLIMTYPE *, RLIMTYPE *));
static int set_limit PARAMS((int, RLIMTYPE, int));
static void printone __P((int, RLIMTYPE, int));
static void print_all_limits __P((int));
static void printone PARAMS((int, RLIMTYPE, int));
static void print_all_limits PARAMS((int));
static int set_all_limits __P((int, RLIMTYPE));
static int set_all_limits PARAMS((int, RLIMTYPE));
static int filesize __P((RLIMTYPE *));
static int pipesize __P((RLIMTYPE *));
static int getmaxuprc __P((RLIMTYPE *));
static int getmaxvm __P((RLIMTYPE *, RLIMTYPE *));
static int filesize PARAMS((RLIMTYPE *));
static int pipesize PARAMS((RLIMTYPE *));
static int getmaxuprc PARAMS((RLIMTYPE *));
static int getmaxvm PARAMS((RLIMTYPE *, RLIMTYPE *));
typedef struct {
int option; /* The ulimit option for this limit. */
+3 -3
View File
@@ -1,7 +1,7 @@
This file is umask.def, from which is created umask.c.
It implements the builtin "umask" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -67,8 +67,8 @@ $END
/* */
/* **************************************************************** */
static void print_symbolic_umask __P((mode_t));
static int symbolic_umask __P((WORD_LIST *));
static void print_symbolic_umask PARAMS((mode_t));
static int symbolic_umask PARAMS((WORD_LIST *));
/* Set or display the mask used by the system when creating files. Flag
of -S means display the umask in a symbolic mode. */
+8 -8
View File
@@ -1,7 +1,7 @@
/* command.h -- The structures used internally to represent commands, and
the extern declarations of the functions used to create them. */
/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -395,13 +395,13 @@ extern Coproc sh_coproc;
/* Forward declarations of functions declared in copy_cmd.c. */
extern FUNCTION_DEF *copy_function_def_contents __P((FUNCTION_DEF *, FUNCTION_DEF *));
extern FUNCTION_DEF *copy_function_def __P((FUNCTION_DEF *));
extern FUNCTION_DEF *copy_function_def_contents PARAMS((FUNCTION_DEF *, FUNCTION_DEF *));
extern FUNCTION_DEF *copy_function_def PARAMS((FUNCTION_DEF *));
extern WORD_DESC *copy_word __P((WORD_DESC *));
extern WORD_LIST *copy_word_list __P((WORD_LIST *));
extern REDIRECT *copy_redirect __P((REDIRECT *));
extern REDIRECT *copy_redirects __P((REDIRECT *));
extern COMMAND *copy_command __P((COMMAND *));
extern WORD_DESC *copy_word PARAMS((WORD_DESC *));
extern WORD_LIST *copy_word_list PARAMS((WORD_LIST *));
extern REDIRECT *copy_redirect PARAMS((REDIRECT *));
extern REDIRECT *copy_redirects PARAMS((REDIRECT *));
extern COMMAND *copy_command PARAMS((COMMAND *));
#endif /* _COMMAND_H_ */
+14 -14
View File
@@ -2,7 +2,7 @@
primarily for making function definitions, but I'm not sure
that anyone else will need it. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -32,25 +32,25 @@
#include "shell.h"
static PATTERN_LIST *copy_case_clause __P((PATTERN_LIST *));
static PATTERN_LIST *copy_case_clauses __P((PATTERN_LIST *));
static FOR_COM *copy_for_command __P((FOR_COM *));
static PATTERN_LIST *copy_case_clause PARAMS((PATTERN_LIST *));
static PATTERN_LIST *copy_case_clauses PARAMS((PATTERN_LIST *));
static FOR_COM *copy_for_command PARAMS((FOR_COM *));
#if defined (ARITH_FOR_COMMAND)
static ARITH_FOR_COM *copy_arith_for_command __P((ARITH_FOR_COM *));
static ARITH_FOR_COM *copy_arith_for_command PARAMS((ARITH_FOR_COM *));
#endif
static GROUP_COM *copy_group_command __P((GROUP_COM *));
static SUBSHELL_COM *copy_subshell_command __P((SUBSHELL_COM *));
static COPROC_COM *copy_coproc_command __P((COPROC_COM *));
static CASE_COM *copy_case_command __P((CASE_COM *));
static WHILE_COM *copy_while_command __P((WHILE_COM *));
static IF_COM *copy_if_command __P((IF_COM *));
static GROUP_COM *copy_group_command PARAMS((GROUP_COM *));
static SUBSHELL_COM *copy_subshell_command PARAMS((SUBSHELL_COM *));
static COPROC_COM *copy_coproc_command PARAMS((COPROC_COM *));
static CASE_COM *copy_case_command PARAMS((CASE_COM *));
static WHILE_COM *copy_while_command PARAMS((WHILE_COM *));
static IF_COM *copy_if_command PARAMS((IF_COM *));
#if defined (DPAREN_ARITHMETIC)
static ARITH_COM *copy_arith_command __P((ARITH_COM *));
static ARITH_COM *copy_arith_command PARAMS((ARITH_COM *));
#endif
#if defined (COND_COMMAND)
static COND_COM *copy_cond_command __P((COND_COM *));
static COND_COM *copy_cond_command PARAMS((COND_COM *));
#endif
static SIMPLE_COM *copy_simple_command __P((SIMPLE_COM *));
static SIMPLE_COM *copy_simple_command PARAMS((SIMPLE_COM *));
WORD_DESC *
copy_word (w)
+10 -10
View File
@@ -1,6 +1,6 @@
/* dispose_cmd.h -- Functions appearing in dispose_cmd.c. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -23,18 +23,18 @@
#include "stdc.h"
extern void dispose_command __P((COMMAND *));
extern void dispose_word_desc __P((WORD_DESC *));
extern void dispose_word __P((WORD_DESC *));
extern void dispose_words __P((WORD_LIST *));
extern void dispose_word_array __P((char **));
extern void dispose_redirects __P((REDIRECT *));
extern void dispose_command PARAMS((COMMAND *));
extern void dispose_word_desc PARAMS((WORD_DESC *));
extern void dispose_word PARAMS((WORD_DESC *));
extern void dispose_words PARAMS((WORD_LIST *));
extern void dispose_word_array PARAMS((char **));
extern void dispose_redirects PARAMS((REDIRECT *));
#if defined (COND_COMMAND)
extern void dispose_cond_node __P((COND_COM *));
extern void dispose_cond_node PARAMS((COND_COM *));
#endif
extern void dispose_function_def_contents __P((FUNCTION_DEF *));
extern void dispose_function_def __P((FUNCTION_DEF *));
extern void dispose_function_def_contents PARAMS((FUNCTION_DEF *));
extern void dispose_function_def PARAMS((FUNCTION_DEF *));
#endif /* !_DISPOSE_CMD_H_ */
+4 -4
View File
@@ -1,6 +1,6 @@
/* error.c -- Functions for handling errors. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -52,18 +52,18 @@ extern int errno;
# include "bashhist.h"
#endif
extern int executing_line_number __P((void));
extern int executing_line_number PARAMS((void));
#if defined (JOB_CONTROL)
extern pid_t shell_pgrp;
extern int give_terminal_to __P((pid_t, int));
extern int give_terminal_to PARAMS((pid_t, int));
#endif /* JOB_CONTROL */
#if defined (ARRAY_VARS)
extern const char * const bash_badsub_errmsg;
#endif
static void error_prolog __P((int));
static void error_prolog PARAMS((int));
/* The current maintainer of the shell. You change this in the
Makefile. */
+19 -19
View File
@@ -1,6 +1,6 @@
/* error.h -- External declarations of functions appearing in error.c. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -24,50 +24,50 @@
#include "stdc.h"
/* Get the name of the shell or shell script for an error message. */
extern char *get_name_for_error __P((void));
extern char *get_name_for_error PARAMS((void));
/* Report an error having to do with FILENAME. */
extern void file_error __P((const char *));
extern void file_error PARAMS((const char *));
/* Report a programmer's error, and abort. Pass REASON, and ARG1 ... ARG5. */
extern void programming_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void programming_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* General error reporting. Pass FORMAT and ARG1 ... ARG5. */
extern void report_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void report_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Error messages for parts of the parser that don't call report_syntax_error */
extern void parser_error __P((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
extern void parser_error PARAMS((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
/* Report an unrecoverable error and exit. Pass FORMAT and ARG1 ... ARG5. */
extern void fatal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void fatal_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Report a system error, like BSD warn(3). */
extern void sys_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void sys_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Report an internal error. */
extern void internal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void internal_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Report an internal warning. */
extern void internal_warning __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void internal_warning PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Report an internal informational notice. */
extern void internal_inform __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void internal_inform PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
/* Debugging functions, not enabled in released version. */
extern char *strescape __P((const char *));
extern void itrace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
extern void trace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
extern char *strescape PARAMS((const char *));
extern void itrace PARAMS((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
extern void trace PARAMS((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
/* Report an error having to do with command parsing or execution. */
extern void command_error __P((const char *, int, int, int));
extern void command_error PARAMS((const char *, int, int, int));
extern char *command_errstr __P((int));
extern char *command_errstr PARAMS((int));
/* Specific error message functions that eventually call report_error or
internal_error. */
extern void err_badarraysub __P((const char *));
extern void err_unboundvar __P((const char *));
extern void err_readonly __P((const char *));
extern void err_badarraysub PARAMS((const char *));
extern void err_unboundvar PARAMS((const char *));
extern void err_readonly PARAMS((const char *));
#endif /* !_ERROR_H_ */
+3 -3
View File
@@ -1,6 +1,6 @@
/* eval.c -- reading and evaluating commands. */
/* Copyright (C) 1996-2011 Free Software Foundation, Inc.
/* Copyright (C) 1996-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -48,8 +48,8 @@
# include "bashhist.h"
#endif
static void send_pwd_to_eterm __P((void));
static sighandler alrm_catcher __P((int));
static void send_pwd_to_eterm PARAMS((void));
static sighandler alrm_catcher PARAMS((int));
/* Read and execute commands until EOF is reached. This assumes that
the input source has already been initialized. */
+2 -2
View File
@@ -3,7 +3,7 @@
/* See Makefile for compilation details. */
/*
Copyright (C) 1999-2009 Free Software Foundation, Inc.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash.
Bash is free software: you can redistribute it and/or modify
@@ -42,7 +42,7 @@
extern int errno;
#endif
typedef int unix_link_syscall_t __P((const char *, const char *));
typedef int unix_link_syscall_t PARAMS((const char *, const char *));
#define LN_SYMLINK 0x01
#define LN_UNLINK 0x02
+3 -3
View File
@@ -1,5 +1,5 @@
/* seq - print sequence of numbers to standard output.
Copyright (C) 2018 Free Software Foundation, Inc.
Copyright (C) 2018-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,8 +49,8 @@ typedef double floatmax_t;
# define FLOATMAX_FMT "%g"
# define FLOATMAX_WFMT "%0.f"
#endif
static floatmax_t getfloatmax __P((const char *));
static char *genformat __P((floatmax_t, floatmax_t, floatmax_t));
static floatmax_t getfloatmax PARAMS((const char *));
static char *genformat PARAMS((floatmax_t, floatmax_t, floatmax_t));
#define MAX(a, b) (((a) < (b))? (b) : (a))
+6 -6
View File
@@ -52,13 +52,13 @@ extern int errno;
#endif
/* Static functions defined and used in this file. */
static char *_find_user_command_internal __P((const char *, int));
static char *find_user_command_internal __P((const char *, int));
static char *find_user_command_in_path __P((const char *, char *, int));
static char *find_in_path_element __P((const char *, char *, int, int, struct stat *));
static char *find_absolute_program __P((const char *, int));
static char *_find_user_command_internal PARAMS((const char *, int));
static char *find_user_command_internal PARAMS((const char *, int));
static char *find_user_command_in_path PARAMS((const char *, char *, int));
static char *find_in_path_element PARAMS((const char *, char *, int, int, struct stat *));
static char *find_absolute_program PARAMS((const char *, int));
static char *get_next_path_element __P((char *, int *));
static char *get_next_path_element PARAMS((char *, int *));
/* The file name which we would try to execute, except that it isn't
possible to execute it. This is the first file that matches the
+2 -2
View File
@@ -1,7 +1,7 @@
/* flags.c -- Everything about flags except the `set' command. That
is in builtins.c */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -33,7 +33,7 @@
#endif
#if defined (JOB_CONTROL)
extern int set_job_control __P((int));
extern int set_job_control PARAMS((int));
#endif
/* **************************************************************** */
+8 -8
View File
@@ -1,7 +1,7 @@
/* flags.h -- a list of all the flags that the shell knows about. You add
a flag to this program by adding the name here, and in flags.c. */
/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -71,15 +71,15 @@ extern int restricted;
extern int restricted_shell;
#endif /* RESTRICTED_SHELL */
extern int *find_flag __P((int));
extern int change_flag __P((int, int));
extern char *which_set_flags __P((void));
extern void reset_shell_flags __P((void));
extern int *find_flag PARAMS((int));
extern int change_flag PARAMS((int, int));
extern char *which_set_flags PARAMS((void));
extern void reset_shell_flags PARAMS((void));
extern char *get_current_flags __P((void));
extern void set_current_flags __P((const char *));
extern char *get_current_flags PARAMS((void));
extern void set_current_flags PARAMS((const char *));
extern void initialize_flags __P((void));
extern void initialize_flags PARAMS((void));
/* A macro for efficiency. */
#define change_flag_char(flag, on_or_off) change_flag (flag, on_or_off)
+5 -5
View File
@@ -1,6 +1,6 @@
/* general.c -- Stuff that is used by all files. */
/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -62,9 +62,9 @@ extern int errno;
# include <sys/cygwin.h>
#endif
static char *bash_special_tilde_expansions __P((char *));
static int unquoted_tilde_word __P((const char *));
static void initialize_group_array __P((void));
static char *bash_special_tilde_expansions PARAMS((char *));
static int unquoted_tilde_word PARAMS((const char *));
static void initialize_group_array PARAMS((void));
/* A standard error message to use when getcwd() returns NULL. */
const char * const bash_getcwd_errstr = N_("getcwd: cannot access parent directories");
@@ -1039,7 +1039,7 @@ extract_colon_unit (string, p_index)
/* **************************************************************** */
#if defined (PUSHD_AND_POPD)
extern char *get_dirstack_from_string __P((char *));
extern char *get_dirstack_from_string PARAMS((char *));
#endif
static char **bash_tilde_prefixes;
+2 -2
View File
@@ -1,7 +1,7 @@
/* hashcmd.c - functions for managing a hash table mapping command names to
full pathnames. */
/* Copyright (C) 1997-2009 Free Software Foundation, Inc.
/* Copyright (C) 1997-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -37,7 +37,7 @@
HASH_TABLE *hashed_filenames = (HASH_TABLE *)NULL;
static void phash_freedata __P((PTR_T));
static void phash_freedata PARAMS((PTR_T));
void
phash_create ()
+21 -21
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1999 Free Software Foundation, Inc. */
/* Copyright (C) 1999-2020 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 __P((int, TTYSTRUCT *));
extern int ttsetattr __P((int, TTYSTRUCT *));
extern int ttgetattr PARAMS((int, TTYSTRUCT *));
extern int ttsetattr PARAMS((int, TTYSTRUCT *));
/* Save and restore the terminal's attributes from static storage. */
extern void ttsave __P((void));
extern void ttrestore __P((void));
extern void ttsave PARAMS((void));
extern void ttrestore PARAMS((void));
/* Return the attributes corresponding to the file descriptor (0 or 1)
passed as an argument. */
extern TTYSTRUCT *ttattr __P((int));
extern TTYSTRUCT *ttattr PARAMS((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 __P((TTYSTRUCT *));
extern int tt_setnoecho __P((TTYSTRUCT *));
extern int tt_seteightbit __P((TTYSTRUCT *));
extern int tt_setnocanon __P((TTYSTRUCT *));
extern int tt_setcbreak __P((TTYSTRUCT *));
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 *));
/* 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 __P((TTYSTRUCT *));
/* These functions work with a given file descriptor and set terminal
attributes */
extern int ttfd_onechar __P((int, TTYSTRUCT *));
extern int ttfd_noecho __P((int, TTYSTRUCT *));
extern int ttfd_eightbit __P((int, TTYSTRUCT *));
extern int ttfd_nocanon __P((int, TTYSTRUCT *));
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_cbreak __P((int, TTYSTRUCT *));
extern int ttfd_cbreak PARAMS((int, TTYSTRUCT *));
/* These functions work with fd 0 and the TTYSTRUCT saved with ttsave () */
extern int ttonechar __P((void));
extern int ttnoecho __P((void));
extern int tteightbit __P((void));
extern int ttnocanon __P((void));
extern int ttonechar PARAMS((void));
extern int ttnoecho PARAMS((void));
extern int tteightbit PARAMS((void));
extern int ttnocanon PARAMS((void));
extern int ttcbreak __P((void));
extern int ttcbreak PARAMS((void));
#endif
+1 -11
View File
@@ -26,18 +26,8 @@
/* A function can be defined using prototypes and compile on both ANSI C
and traditional C compilers with something like this:
extern char *func __P((char *, char *, int)); */
extern char *func PARAMS((char *, char *, int)); */
#if !defined (__P)
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
# define __P(protos) protos
# else
# define __P(protos) ()
# 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
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1996, 2008,2009 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 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 __P((struct tms *buffer));
extern clock_t times PARAMS((struct tms *buffer));
#endif /* !HAVE_SYS_TIMES_H */
#endif /* _BASH_SYSTIMES_H */
+2 -2
View File
@@ -1,6 +1,6 @@
/* input.c -- functions to perform buffered input with synchronization. */
/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -57,7 +57,7 @@ extern int errno;
# define X_EWOULDBLOCK -99
#endif
extern void termsig_handler __P((int));
extern void termsig_handler PARAMS((int));
/* Functions to handle reading input on systems that don't restart read(2)
if a signal is received. */
+18 -18
View File
@@ -1,6 +1,6 @@
/* glob.c -- file-name wildcard pattern matching for Bash.
Copyright (C) 1985-2019 Free Software Foundation, Inc.
Copyright (C) 1985-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -84,11 +84,11 @@ struct globval
char *name;
};
extern void throw_to_top_level __P((void));
extern int sh_eaccess __P((const char *, int));
extern char *sh_makepath __P((const char *, const char *, int));
extern int signal_is_pending __P((int));
extern void run_pending_traps __P((void));
extern void throw_to_top_level PARAMS((void));
extern int sh_eaccess PARAMS((const char *, int));
extern char *sh_makepath PARAMS((const char *, const char *, int));
extern int signal_is_pending PARAMS((int));
extern void run_pending_traps PARAMS((void));
extern int extended_glob;
@@ -111,29 +111,29 @@ char *glob_error_return;
static struct globval finddirs_error_return;
/* Some forward declarations. */
static int skipname __P((char *, char *, int));
static int skipname PARAMS((char *, char *, int));
#if HANDLE_MULTIBYTE
static int mbskipname __P((char *, char *, int));
static int mbskipname PARAMS((char *, char *, int));
#endif
void udequote_pathname __P((char *));
void udequote_pathname PARAMS((char *));
#if HANDLE_MULTIBYTE
void wcdequote_pathname __P((wchar_t *));
static void wdequote_pathname __P((char *));
void wcdequote_pathname PARAMS((wchar_t *));
static void wdequote_pathname PARAMS((char *));
#else
# define dequote_pathname udequote_pathname
#endif
static void dequote_pathname __P((char *));
static int glob_testdir __P((char *, int));
static char **glob_dir_to_array __P((char *, char **, int));
static void dequote_pathname PARAMS((char *));
static int glob_testdir PARAMS((char *, int));
static char **glob_dir_to_array PARAMS((char *, char **, int));
/* Make sure these names continue to agree with what's in smatch.c */
extern char *glob_patscan __P((char *, char *, int));
extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int));
extern char *glob_patscan PARAMS((char *, char *, int));
extern wchar_t *glob_patscan_wc PARAMS((wchar_t *, wchar_t *, int));
/* And this from gmisc.c/gm_loop.c */
extern int wextglob_pattern_p __P((wchar_t *));
extern int wextglob_pattern_p PARAMS((wchar_t *));
extern char *glob_dirscan __P((char *, int));
extern char *glob_dirscan PARAMS((char *, int));
/* Compile `glob_loop.c' for single-byte characters. */
#define GCHAR unsigned char
+5 -5
View File
@@ -1,5 +1,5 @@
/* File-name wildcard pattern matching for GNU.
Copyright (C) 1985, 1988, 1989, 2008,2009 Free Software Foundation, Inc.
Copyright (C) 1985-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -33,11 +33,11 @@
#define GX_RECURSE 0x800 /* internal -- glob_filename called recursively */
#define GX_SYMLINK 0x1000 /* internal -- symlink to a directory */
extern int glob_pattern_p __P((const char *));
extern char **glob_vector __P((char *, char *, int));
extern char **glob_filename __P((char *, int));
extern int glob_pattern_p PARAMS((const char *));
extern char **glob_vector PARAMS((char *, char *, int));
extern char **glob_filename PARAMS((char *, int));
extern int extglob_pattern_p __P((const char *));
extern int extglob_pattern_p PARAMS((const char *));
extern char *glob_error_return;
extern int noglob_dot_filenames;
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -16,7 +16,7 @@
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
static int INTERNAL_GLOB_PATTERN_P __P((const GCHAR *));
static int INTERNAL_GLOB_PATTERN_P PARAMS((const GCHAR *));
/* Return nonzero if PATTERN has any special globbing chars in it.
Compiled twice, once each for single-byte and multibyte characters. */
+2 -2
View File
@@ -1,6 +1,6 @@
/* gmisc.c -- miscellaneous pattern matching utility functions for Bash.
Copyright (C) 2010-2017 Free Software Foundation, Inc.
Copyright (C) 2010-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -38,7 +38,7 @@
#include "glob.h"
/* Make sure these names continue to agree with what's in smatch.c */
extern char *glob_patscan __P((char *, char *, int));
extern char *glob_patscan PARAMS((char *, char *, int));
/* Compile `gm_loop.c' for single-byte characters. */
#define CHAR char
+8 -8
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -22,16 +22,16 @@ struct STRUCT
CHAR *string;
};
int FCT __P((CHAR *, CHAR *, int));
int FCT PARAMS((CHAR *, CHAR *, int));
static int GMATCH __P((CHAR *, CHAR *, CHAR *, CHAR *, struct STRUCT *, int));
static CHAR *PARSE_COLLSYM __P((CHAR *, INT *));
static CHAR *BRACKMATCH __P((CHAR *, U_CHAR, int));
static int EXTMATCH __P((INT, CHAR *, CHAR *, CHAR *, CHAR *, int));
static int GMATCH PARAMS((CHAR *, CHAR *, CHAR *, CHAR *, struct STRUCT *, int));
static CHAR *PARSE_COLLSYM PARAMS((CHAR *, INT *));
static CHAR *BRACKMATCH PARAMS((CHAR *, U_CHAR, int));
static int EXTMATCH PARAMS((INT, CHAR *, CHAR *, CHAR *, CHAR *, int));
extern void DEQUOTE_PATHNAME __P((CHAR *));
extern void DEQUOTE_PATHNAME PARAMS((CHAR *));
/*static*/ CHAR *PATSCAN __P((CHAR *, CHAR *, INT));
/*static*/ CHAR *PATSCAN PARAMS((CHAR *, CHAR *, INT));
int
FCT (pattern, string, flags)
+2 -2
View File
@@ -1,7 +1,7 @@
/* strmatch.c -- ksh-like extended pattern matching for the shell and filename
globbing. */
/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -287,7 +287,7 @@ is_cclass (c, name)
# define STREQ(s1, s2) ((wcscmp (s1, s2) == 0))
# define STREQN(a, b, n) ((a)[0] == (b)[0] && wcsncmp(a, b, n) == 0)
extern char *mbsmbchar __P((const char *));
extern char *mbsmbchar PARAMS((const char *));
#if FNMATCH_EQUIV_FALLBACK
/* We don't include <fnmatch.h> in order to avoid namespace collisions; the
+3 -3
View File
@@ -1,7 +1,7 @@
/* strmatch.c -- ksh-like extended pattern matching for the shell and filename
globbing. */
/* Copyright (C) 1991-2002 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -24,9 +24,9 @@
#include "stdc.h"
#include "strmatch.h"
extern int xstrmatch __P((char *, char *, int));
extern int xstrmatch PARAMS((char *, char *, int));
#if defined (HANDLE_MULTIBYTE)
extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
extern int internal_wstrmatch PARAMS((wchar_t *, wchar_t *, int));
#endif
int
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2004 Free Software Foundation, Inc.
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -55,10 +55,10 @@
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int strmatch __P((char *, char *, int));
extern int strmatch PARAMS((char *, char *, int));
#if HANDLE_MULTIBYTE
extern int wcsmatch __P((wchar_t *, wchar_t *, int));
extern int wcsmatch PARAMS((wchar_t *, wchar_t *, int));
#endif
#endif /* _STRMATCH_H */
+2 -2
View File
@@ -1,6 +1,6 @@
/* xmbsrtowcs.c -- replacement function for mbsrtowcs */
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -47,7 +47,7 @@ extern int errno;
#endif
#if ! HAVE_STRCHRNUL
extern char *strchrnul __P((const char *, int));
extern char *strchrnul PARAMS((const char *, int));
#endif
/* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>.
+6 -6
View File
@@ -1,6 +1,6 @@
/* imalloc.h -- internal malloc definitions shared by source files. */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -67,11 +67,11 @@
# endif /* HAVE_BCOPY */
#endif /* !__GNUC__ */
#if !defined (__P)
#if !defined (PARAMS)
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
# define __P(protos) protos
# define PARAMS(protos) protos
# else
# define __P(protos) ()
# define PARAMS(protos) ()
# endif
#endif
@@ -167,7 +167,7 @@ do { \
#include <signal.h>
extern void _malloc_block_signals __P((sigset_t *, sigset_t *));
extern void _malloc_unblock_signals __P((sigset_t *, sigset_t *));
extern void _malloc_block_signals PARAMS((sigset_t *, sigset_t *));
extern void _malloc_unblock_signals PARAMS((sigset_t *, sigset_t *));
#endif /* _IMALLOC_H */
+5 -5
View File
@@ -1,6 +1,6 @@
/* mstats.h - definitions for malloc statistics */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -104,10 +104,10 @@ struct bucket_stats {
int nmmap; /* currently unused */
};
extern struct bucket_stats malloc_bucket_stats __P((int));
extern struct _malstats malloc_stats __P((void));
extern void print_malloc_stats __P((char *));
extern void trace_malloc_stats __P((char *, char *));
extern struct bucket_stats malloc_bucket_stats PARAMS((int));
extern struct _malstats malloc_stats PARAMS((void));
extern void print_malloc_stats PARAMS((char *));
extern void trace_malloc_stats PARAMS((char *, char *));
#endif /* MALLOC_STATS */
+18 -18
View File
@@ -1,6 +1,6 @@
/* Functions (currently) for use by the shell to do malloc debugging and
tracking. */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -21,11 +21,11 @@
#ifndef _SH_MALLOC_H
#define _SH_MALLOC_H
#ifndef __P
#ifndef PARAMS
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
# define __P(protos) protos
# define PARAMS(protos) protos
# else
# define __P(protos) ()
# define PARAMS(protos) ()
# endif
#endif
@@ -41,30 +41,30 @@
#endif /* PTR_T */
extern PTR_T sh_malloc __P((size_t, const char *, int));
extern PTR_T sh_realloc __P((PTR_T, size_t, const char *, int));
extern void sh_free __P((PTR_T, const char *, int));
extern PTR_T sh_malloc PARAMS((size_t, const char *, int));
extern PTR_T sh_realloc PARAMS((PTR_T, size_t, const char *, int));
extern void sh_free PARAMS((PTR_T, const char *, int));
extern PTR_T sh_memalign __P((size_t, size_t, const char *, int));
extern PTR_T sh_memalign PARAMS((size_t, size_t, const char *, int));
extern PTR_T sh_calloc __P((size_t, size_t, const char *, int));
extern void sh_cfree __P((PTR_T, const char *, int));
extern PTR_T sh_calloc PARAMS((size_t, size_t, const char *, int));
extern void sh_cfree PARAMS((PTR_T, const char *, int));
extern PTR_T sh_valloc __P((size_t, const char *, int));
extern PTR_T sh_valloc PARAMS((size_t, const char *, int));
/* trace.c */
extern int malloc_set_trace __P((int));
extern int malloc_set_trace PARAMS((int));
extern void malloc_set_tracefp (); /* full prototype requires stdio.h */
extern void malloc_set_tracefn __P((char *, char *));
extern void malloc_set_tracefn PARAMS((char *, char *));
/* table.c */
extern void mregister_dump_table __P((void));
extern void mregister_table_init __P((void));
extern int malloc_set_register __P((int));
extern void mregister_dump_table PARAMS((void));
extern void mregister_table_init PARAMS((void));
extern int malloc_set_register PARAMS((int));
/* stats.c */
extern void print_malloc_stats __P((char *));
extern void print_malloc_stats PARAMS((char *));
extern void fprint_malloc_stats (); /* full prototype requires stdio.h */
extern void trace_malloc_stats __P((char *, char *));
extern void trace_malloc_stats PARAMS((char *, char *));
#endif
+3 -3
View File
@@ -1,6 +1,6 @@
/* stats.c - malloc statistics */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -34,13 +34,13 @@
#include "mstats.h"
extern int malloc_free_blocks __P((int));
extern int malloc_free_blocks PARAMS((int));
extern int malloc_mmap_threshold;
extern struct _malstats _mstats;
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
struct bucket_stats
malloc_bucket_stats (size)
+3 -3
View File
@@ -1,6 +1,6 @@
/* table.c - bookkeeping functions for allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -30,14 +30,14 @@
#ifdef SHELL
extern int interrupt_immediately, running_trap;
extern int signal_is_trapped __P((int));
extern int signal_is_trapped PARAMS((int));
#endif
extern int malloc_register;
#ifdef MALLOC_REGISTER
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
#define FIND_ALLOC 0x01 /* find slot for new allocation */
#define FIND_EXIST 0x02 /* find slot for existing entry for free() or search */
+10 -10
View File
@@ -1,6 +1,6 @@
/* table.h - definitions for tables for keeping track of allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -57,12 +57,12 @@ typedef struct mr_table {
#define REG_TABLE_SIZE 8192
extern mr_table_t *mr_table_entry __P((PTR_T));
extern void mregister_alloc __P((const char *, PTR_T, size_t, const char *, int));
extern void mregister_free __P((PTR_T, int, const char *, int));
extern mr_table_t *mr_table_entry PARAMS((PTR_T));
extern void mregister_alloc PARAMS((const char *, PTR_T, size_t, const char *, int));
extern void mregister_free PARAMS((PTR_T, int, const char *, int));
extern void mregister_describe_mem ();
extern void mregister_dump_table __P((void));
extern void mregister_table_init __P((void));
extern void mregister_dump_table PARAMS((void));
extern void mregister_table_init PARAMS((void));
typedef struct ma_table {
const char *file;
@@ -70,10 +70,10 @@ typedef struct ma_table {
int nalloc;
} ma_table_t;
extern void mlocation_register_alloc __P((const char *, int));
extern void mlocation_table_init __P((void));
extern void mlocation_dump_table __P((void));
extern void mlocation_write_table __P((void));
extern void mlocation_register_alloc PARAMS((const char *, int));
extern void mlocation_table_init PARAMS((void));
extern void mlocation_dump_table PARAMS((void));
extern void mlocation_write_table PARAMS((void));
/* NOTE: HASH_MIX taken from dmalloc (http://dmalloc.com) */
+2 -2
View File
@@ -1,6 +1,6 @@
/* trace.c - tracing functions for malloc */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -35,7 +35,7 @@ static int _mtrace_verbose = 0;
#ifdef MALLOC_TRACE
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
FILE *_mtrace_fp = NULL;
extern char _malloc_trace_buckets[];
+2 -2
View File
@@ -1,6 +1,6 @@
/* watch.h - definitions for tables for keeping track of allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -34,7 +34,7 @@
extern int _malloc_nwatch;
extern void _malloc_ckwatch __P((PTR_T, const char *, int, int, unsigned long));
extern void _malloc_ckwatch PARAMS((PTR_T, const char *, int, int, unsigned long));
#endif /* MALLOC_WATCH */
+2 -2
View File
@@ -1,6 +1,6 @@
/* casemod.c -- functions to change case of strings */
/* Copyright (C) 2008,2009,2015 Free Software Foundation, Inc.
/* Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -67,7 +67,7 @@
#define CASE_USEWORDS 0x1000 /* modify behavior to act on words in passed string */
extern char *substring __P((char *, int, int));
extern char *substring PARAMS((char *, int, int));
#ifndef UCHAR_MAX
# define UCHAR_MAX TYPE_MAXIMUM(unsigned char)
+4 -4
View File
@@ -1,6 +1,6 @@
/* eaccess.c - eaccess replacement for the shell, plus other access functions. */
/* Copyright (C) 2006-2010 Free Software Foundation, Inc.
/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -52,10 +52,10 @@ extern int errno;
#define F_OK 0
#endif /* R_OK */
static int path_is_devfd __P((const char *));
static int sh_stataccess __P((const char *, int));
static int path_is_devfd PARAMS((const char *));
static int sh_stataccess PARAMS((const char *, int));
#if HAVE_DECL_SETREGID
static int sh_euidaccess __P((const char *, int));
static int sh_euidaccess PARAMS((const char *, int));
#endif
static int
+6 -6
View File
@@ -1,6 +1,6 @@
/* fnxform - use iconv(3) to transform strings to and from "filename" format */
/* Copyright (C) 2009-2010 Free Software Foundation, Inc.
/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -35,9 +35,9 @@
#endif
#if defined (HAVE_LOCALE_CHARSET)
extern const char *locale_charset __P((void));
extern const char *locale_charset PARAMS((void));
#else
extern char *get_locale_var __P((char *));
extern char *get_locale_var PARAMS((char *));
#endif
#if defined (HAVE_ICONV)
@@ -49,9 +49,9 @@ static iconv_t conv_tofs = (iconv_t)-1;
static char *outbuf = 0;
static size_t outlen = 0;
static char *curencoding __P((void));
static void init_tofs __P((void));
static void init_fromfs __P((void));
static char *curencoding PARAMS((void));
static void init_tofs PARAMS((void));
static void init_fromfs PARAMS((void));
static char *
curencoding ()
+2 -2
View File
@@ -1,6 +1,6 @@
/* fpurge - Flushing buffers of a FILE stream. */
/* Copyright (C) 2007-2010 Free Software Foundation, Inc.
/* Copyright (C) 2007-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -29,7 +29,7 @@
#if HAVE_FPURGE
# define fpurge _bash_fpurge
#endif
extern int fpurge __P((FILE *stream));
extern int fpurge PARAMS((FILE *stream));
#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */
# include <stdio_ext.h>
+2 -2
View File
@@ -1,6 +1,6 @@
/* makepath.c - glue PATH and DIR together into a full pathname. */
/* Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -45,7 +45,7 @@
# define MP_IGNDOT 0x08
#endif
extern char *get_working_directory __P((char *));
extern char *get_working_directory PARAMS((char *));
static char *nullpath = "";
+9 -9
View File
@@ -1,6 +1,6 @@
/* mktime - convert struct tm to a time_t value */
/* Copyright (C) 1993-2002 Free Software Foundation, Inc.
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Contributed by Paul Eggert (eggert@twinsun.com).
@@ -56,13 +56,13 @@
#define mktime my_mktime
#endif /* DEBUG_MKTIME */
#ifndef __P
#ifndef PARAMS
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#define __P(args) args
#define PARAMS(args) args
#else
#define __P(args) ()
#define PARAMS(args) ()
#endif /* GCC. */
#endif /* Not __P. */
#endif /* Not PARAMS. */
#ifndef CHAR_BIT
#define CHAR_BIT 8
@@ -117,13 +117,13 @@ const unsigned short int __mon_yday[2][13] =
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
};
static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *));
time_t __mktime_internal __P ((struct tm *,
static time_t ydhms_tm_diff PARAMS ((int, int, int, int, int, const struct tm *));
time_t __mktime_internal PARAMS ((struct tm *,
struct tm *(*) (const time_t *, struct tm *),
time_t *));
static struct tm *my_localtime_r __P ((const time_t *, struct tm *));
static struct tm *my_localtime_r PARAMS ((const time_t *, struct tm *));
static struct tm *
my_localtime_r (t, tp)
const time_t *t;
@@ -193,7 +193,7 @@ mktime (tp)
time_t
__mktime_internal (tp, convert, offset)
struct tm *tp;
struct tm *(*convert) __P ((const time_t *, struct tm *));
struct tm *(*convert) PARAMS ((const time_t *, struct tm *));
time_t *offset;
{
time_t t, dt, t0;
+7 -7
View File
@@ -5,7 +5,7 @@
* chet@ins.CWRU.Edu
*/
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -63,18 +63,18 @@ extern int errno;
#endif
#if !defined (HAVE_INET_ATON)
extern int inet_aton __P((const char *, struct in_addr *));
extern int inet_aton PARAMS((const char *, struct in_addr *));
#endif
#ifndef HAVE_GETADDRINFO
static int _getaddr __P((char *, struct in_addr *));
static int _getserv __P((char *, int, unsigned short *));
static int _netopen4 __P((char *, char *, int));
static int _getaddr PARAMS((char *, struct in_addr *));
static int _getserv PARAMS((char *, int, unsigned short *));
static int _netopen4 PARAMS((char *, char *, int));
#else /* HAVE_GETADDRINFO */
static int _netopen6 __P((char *, char *, int));
static int _netopen6 PARAMS((char *, char *, int));
#endif
static int _netopen __P((char *, char *, int));
static int _netopen PARAMS((char *, char *, int));
#ifndef HAVE_GETADDRINFO
/* Stuff the internet address corresponding to HOST into AP, in network
+2 -2
View File
@@ -1,6 +1,6 @@
/* pathphys.c -- return pathname with all symlinks expanded. */
/* Copyright (C) 2000 Free Software Foundation, Inc.
/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -46,7 +46,7 @@
extern int errno;
#endif /* !errno */
extern char *get_working_directory __P((char *));
extern char *get_working_directory PARAMS((char *));
static int
_path_readlink (path, buf, bufsiz)
+3 -3
View File
@@ -1,6 +1,6 @@
/* shquote - functions to quote and dequote strings */
/* Copyright (C) 1999-2019 Free Software Foundation, Inc.
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -36,8 +36,8 @@
#include "shmbchar.h"
#include "shmbutil.h"
extern char *ansic_quote __P((char *, int, int *));
extern int ansic_shouldquote __P((const char *));
extern char *ansic_quote PARAMS((char *, int, int *));
extern int ansic_shouldquote PARAMS((const char *));
/* Default set of characters that should be backslash-quoted in strings */
static const char bstab[256] =
+21 -21
View File
@@ -9,7 +9,7 @@
Unix snprintf implementation.
derived from inetutils/libinetutils/snprintf.c Version 1.1
Copyright (C) 2001,2006,2010,2012 Free Software Foundation, Inc.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -129,8 +129,8 @@
# define FL_ADDBASE 0x02 /* add base# prefix to converted value */
# define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */
# define FL_UNSIGNED 0x08 /* don't add any sign */
extern char *fmtulong __P((unsigned long int, int, char *, size_t, int));
extern char *fmtullong __P((unsigned long long int, int, char *, size_t, int));
extern char *fmtulong PARAMS((unsigned long int, int, char *, size_t, int));
extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int));
#endif
#ifndef FREE
@@ -271,38 +271,38 @@ struct DATA
/* the floating point stuff */
#ifdef FLOATING_POINT
static double pow_10 __P((int));
static int log_10 __P((double));
static double integral __P((double, double *));
static char *numtoa __P((double, int, int, char **));
static double pow_10 PARAMS((int));
static int log_10 PARAMS((double));
static double integral PARAMS((double, double *));
static char *numtoa PARAMS((double, int, int, char **));
#endif
static void init_data __P((struct DATA *, char *, size_t, const char *, int));
static void init_conv_flag __P((struct DATA *));
static void init_data PARAMS((struct DATA *, char *, size_t, const char *, int));
static void init_conv_flag PARAMS((struct DATA *));
/* for the format */
#ifdef FLOATING_POINT
static void floating __P((struct DATA *, double));
static void exponent __P((struct DATA *, double));
static void floating PARAMS((struct DATA *, double));
static void exponent PARAMS((struct DATA *, double));
#endif
static void number __P((struct DATA *, unsigned long, int));
static void number PARAMS((struct DATA *, unsigned long, int));
#ifdef HAVE_LONG_LONG
static void lnumber __P((struct DATA *, unsigned long long, int));
static void lnumber PARAMS((struct DATA *, unsigned long long, int));
#endif
static void pointer __P((struct DATA *, unsigned long));
static void strings __P((struct DATA *, char *));
static void pointer PARAMS((struct DATA *, unsigned long));
static void strings PARAMS((struct DATA *, char *));
#ifdef FLOATING_POINT
# define FALLBACK_FMTSIZE 32
# define FALLBACK_BASE 4096
# define LFALLBACK_BASE 5120
# ifdef HAVE_LONG_DOUBLE
static void ldfallback __P((struct DATA *, const char *, const char *, long double));
static void ldfallback PARAMS((struct DATA *, const char *, const char *, long double));
# endif
static void dfallback __P((struct DATA *, const char *, const char *, double));
static void dfallback PARAMS((struct DATA *, const char *, const char *, double));
#endif
static char *groupnum __P((char *));
static char *groupnum PARAMS((char *));
#if defined (HAVE_LONG_DOUBLE)
# define LONGDOUBLE long double
@@ -332,9 +332,9 @@ static char *groupnum __P((char *));
#ifdef DRIVER
static void memory_error_and_abort ();
static void *xmalloc __P((size_t));
static void *xrealloc __P((void *, size_t));
static void xfree __P((void *));
static void *xmalloc PARAMS((size_t));
static void *xrealloc PARAMS((void *, size_t));
static void xfree PARAMS((void *));
#else
# include <xmalloc.h>
#endif
+3 -3
View File
@@ -1,6 +1,6 @@
/* spell.c -- spelling correction for pathnames. */
/* Copyright (C) 2000 Free Software Foundation, Inc.
/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -40,8 +40,8 @@
#include <maxpath.h>
#include <stdc.h>
static int mindist __P((char *, char *, char *));
static int spdist __P((char *, char *));
static int mindist PARAMS((char *, char *, char *));
static int spdist PARAMS((char *, char *));
/*
* `spname' and its helpers are inspired by the code in "The UNIX
+3 -3
View File
@@ -1,6 +1,6 @@
/* strtoimax - convert string representation of a number into an intmax_t value. */
/* Copyright 1999-2009 Free Software Foundation, Inc.
/* Copyright 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -45,14 +45,14 @@
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOL
extern long strtol __P((const char *, char **, int));
extern long strtol PARAMS((const char *, char **, int));
#endif
#ifndef HAVE_DECL_STRTOLL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG
extern long long strtoll __P((const char *, char **, int));
extern long long strtoll PARAMS((const char *, char **, int));
#endif
#ifdef strtoimax
+3 -3
View File
@@ -1,6 +1,6 @@
/* strtoumax - convert string representation of a number into an uintmax_t value. */
/* Copyright 1999-2009 Free Software Foundation, Inc.
/* Copyright 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -45,14 +45,14 @@
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOUL
extern unsigned long strtoul __P((const char *, char **, int));
extern unsigned long strtoul PARAMS((const char *, char **, int));
#endif
#ifndef HAVE_DECL_STRTOULL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG
extern unsigned long long strtoull __P((const char *, char **, int));
extern unsigned long long strtoull PARAMS((const char *, char **, int));
#endif
#ifdef strtoumax
+2 -2
View File
@@ -1,6 +1,6 @@
/* times.c - times(3) library function */
/* Copyright (C) 1999 Free Software Foundation, Inc.
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -30,7 +30,7 @@
# include <sys/resource.h>
#endif /* HAVE_SYS_RESOURCE_H && HAVE_GETRUSAGE */
extern long get_clk_tck __P((void));
extern long get_clk_tck PARAMS((void));
#define CONVTCK(r) (r.tv_sec * clk_tck + r.tv_usec / (1000000 / clk_tck))
+3 -3
View File
@@ -2,7 +2,7 @@
* tmpfile.c - functions to create and safely open temp files for the shell.
*/
/* Copyright (C) 2000-2019 Free Software Foundation, Inc.
/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -54,8 +54,8 @@ extern int errno;
extern pid_t dollar_dollar_pid;
static char *get_sys_tmpdir __P((void));
static char *get_tmpdir __P((int));
static char *get_sys_tmpdir PARAMS((void));
static char *get_tmpdir PARAMS((int));
static char *sys_tmpdir = (char *)NULL;
static int ntmpfiles;
+3 -3
View File
@@ -1,6 +1,6 @@
/* unicode.c - functions to convert unicode characters */
/* Copyright (C) 2010-2019 Free Software Foundation, Inc.
/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -50,9 +50,9 @@
#endif /* !STREQ */
#if defined (HAVE_LOCALE_CHARSET)
extern const char *locale_charset __P((void));
extern const char *locale_charset PARAMS((void));
#else
extern char *get_locale_var __P((char *));
extern char *get_locale_var PARAMS((char *));
#endif
extern int locale_utf8locale;
+3 -3
View File
@@ -1,6 +1,6 @@
/* winsize.c - handle window size changes and information. */
/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
/* Copyright (C) 2005-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -68,9 +68,9 @@ extern int errno;
extern int shell_tty;
#if defined (READLINE)
extern void rl_set_screen_size __P((int, int));
extern void rl_set_screen_size PARAMS((int, int));
#endif
extern void sh_set_lines_and_columns __P((int, int));
extern void sh_set_lines_and_columns PARAMS((int, int));
void
get_new_window_size (from_sig, rp, cp)
+3 -3
View File
@@ -1,6 +1,6 @@
/* zcatfd - copy contents of file descriptor to another */
/* Copyright (C) 2002 Free Software Foundation, Inc.
/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -34,8 +34,8 @@
extern int errno;
#endif
extern ssize_t zread __P((int, char *, size_t));
extern int zwrite __P((int, char *, ssize_t));
extern ssize_t zread PARAMS((int, char *, size_t));
extern int zwrite PARAMS((int, char *, ssize_t));
/* Dump contents of file descriptor FD to OFD. FN is the filename for
error messages (not used right now). */
+7 -7
View File
@@ -1,7 +1,7 @@
/* zgetline - read a line of input from a specified file descriptor and return
a pointer to a newly-allocated buffer containing the data. */
/* Copyright (C) 2008,2009 Free Software Foundation, Inc.
/* Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -34,13 +34,13 @@
extern int errno;
#endif
extern ssize_t zread __P((int, char *, size_t));
extern ssize_t zreadc __P((int, char *));
extern ssize_t zreadintr __P((int, char *, size_t));
extern ssize_t zreadcintr __P((int, char *));
extern ssize_t zread PARAMS((int, char *, size_t));
extern ssize_t zreadc PARAMS((int, char *));
extern ssize_t zreadintr PARAMS((int, char *, size_t));
extern ssize_t zreadcintr PARAMS((int, char *));
typedef ssize_t breadfunc_t __P((int, char *, size_t));
typedef ssize_t creadfunc_t __P((int, char *));
typedef ssize_t breadfunc_t PARAMS((int, char *, size_t));
typedef ssize_t creadfunc_t PARAMS((int, char *));
/* Initial memory allocation for automatic growing buffer in zreadlinec */
#define GET_LINE_INITIAL_ALLOCATION 16
+2 -2
View File
@@ -1,6 +1,6 @@
/* zmapfd - read contents of file descriptor into a newly-allocated buffer */
/* Copyright (C) 2006 Free Software Foundation, Inc.
/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -36,7 +36,7 @@
extern int errno;
#endif
extern ssize_t zread __P((int, char *, size_t));
extern ssize_t zread PARAMS((int, char *, size_t));
/* Dump contents of file descriptor FD to *OSTR. FN is the filename for
error messages (not used right now). */
+9 -9
View File
@@ -1,6 +1,6 @@
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */
/* Copyright (C) 1988-2017 Free Software Foundation, Inc.
/* Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -57,10 +57,10 @@ static void *xmalloc (), *xrealloc ();
#if !defined (HAVE_GETPW_DECLS)
# if defined (HAVE_GETPWUID)
extern struct passwd *getpwuid PARAMS((uid_t));
extern struct passwd *getpwuid (uid_t);
# endif
# if defined (HAVE_GETPWNAM)
extern struct passwd *getpwnam PARAMS((const char *));
extern struct passwd *getpwnam (const char *);
# endif
#endif /* !HAVE_GETPW_DECLS */
@@ -79,8 +79,8 @@ extern struct passwd *getpwnam PARAMS((const char *));
/* If being compiled as part of bash, these will be satisfied from
variables.o. If being compiled as part of readline, they will
be satisfied from shell.o. */
extern char *sh_get_home_dir PARAMS((void));
extern char *sh_get_env_value PARAMS((const char *));
extern char *sh_get_home_dir (void);
extern char *sh_get_env_value (const char *);
/* The default value of tilde_additional_prefixes. This is set to
whitespace preceding a tilde so that simple programs which do not
@@ -116,10 +116,10 @@ char **tilde_additional_prefixes = (char **)default_prefixes;
`:' and `=~'. */
char **tilde_additional_suffixes = (char **)default_suffixes;
static int tilde_find_prefix PARAMS((const char *, int *));
static int tilde_find_suffix PARAMS((const char *));
static char *isolate_tilde_prefix PARAMS((const char *, int *));
static char *glue_prefix_and_suffix PARAMS((char *, const char *, int));
static int tilde_find_prefix (const char *, int *);
static int tilde_find_suffix (const char *);
static char *isolate_tilde_prefix (const char *, int *);
static char *glue_prefix_and_suffix (char *, const char *, int);
/* Find the start of a tilde expansion in STRING, and return the index of
the tilde which starts the expansion. Place the length of the text
+12 -12
View File
@@ -1,6 +1,6 @@
/* mailcheck.c -- The check is in the mail... */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -43,7 +43,7 @@
extern time_t shell_start_time;
extern int mailstat __P((const char *, struct stat *));
extern int mailstat PARAMS((const char *, struct stat *));
typedef struct _fileinfo {
char *name;
@@ -66,19 +66,19 @@ static time_t last_time_mail_checked = 0;
/* Non-zero means warn if a mail file has been read since last checked. */
int mail_warning;
static int find_mail_file __P((char *));
static void init_mail_file __P((int));
static void update_mail_file __P((int));
static int add_mail_file __P((char *, char *));
static int find_mail_file PARAMS((char *));
static void init_mail_file PARAMS((int));
static void update_mail_file PARAMS((int));
static int add_mail_file PARAMS((char *, char *));
static FILEINFO *alloc_mail_file __P((char *, char *));
static void dispose_mail_file __P((FILEINFO *));
static FILEINFO *alloc_mail_file PARAMS((char *, char *));
static void dispose_mail_file PARAMS((FILEINFO *));
static int file_mod_date_changed __P((int));
static int file_access_date_changed __P((int));
static int file_has_grown __P((int));
static int file_mod_date_changed PARAMS((int));
static int file_access_date_changed PARAMS((int));
static int file_has_grown PARAMS((int));
static char *parse_mailpath_spec __P((char *));
static char *parse_mailpath_spec PARAMS((char *));
/* Returns non-zero if it is time to check mail. */
int
+9 -9
View File
@@ -1,6 +1,6 @@
/* mailcheck.h -- variables and function declarations for mail checking. */
/* Copyright (C) 1987,1991,2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -22,13 +22,13 @@
#define _MAILCHECK_H_
/* Functions from mailcheck.c */
extern int time_to_check_mail __P((void));
extern void reset_mail_timer __P((void));
extern void reset_mail_files __P((void));
extern void free_mail_files __P((void));
extern char *make_default_mailpath __P((void));
extern void remember_mail_dates __P((void));
extern void init_mail_dates __P((void));
extern void check_mail __P((void));
extern int time_to_check_mail PARAMS((void));
extern void reset_mail_timer PARAMS((void));
extern void reset_mail_files PARAMS((void));
extern void free_mail_files PARAMS((void));
extern char *make_default_mailpath PARAMS((void));
extern void remember_mail_dates PARAMS((void));
extern void init_mail_dates PARAMS((void));
extern void check_mail PARAMS((void));
#endif /* _MAILCHECK_H */
+4 -4
View File
@@ -1,7 +1,7 @@
/* make_cmd.c -- Functions for making instances of the various
parser constructs. */
/* Copyright (C) 1989-2019 Free Software Foundation, Inc.
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -55,11 +55,11 @@ sh_obj_cache_t wlcache = {0, 0, 0};
#define WDCACHESIZE 128
#define WLCACHESIZE 128
static COMMAND *make_for_or_select __P((enum command_type, WORD_DESC *, WORD_LIST *, COMMAND *, int));
static COMMAND *make_for_or_select PARAMS((enum command_type, WORD_DESC *, WORD_LIST *, COMMAND *, int));
#if defined (ARITH_FOR_COMMAND)
static WORD_LIST *make_arith_for_expr __P((char *));
static WORD_LIST *make_arith_for_expr PARAMS((char *));
#endif
static COMMAND *make_until_or_while __P((enum command_type, COMMAND *, COMMAND *));
static COMMAND *make_until_or_while PARAMS((enum command_type, COMMAND *, COMMAND *));
void
cmd_init ()
+31 -31
View File
@@ -1,6 +1,6 @@
/* make_cmd.h -- Declarations of functions found in make_cmd.c */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2009,2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -25,48 +25,48 @@
extern int here_doc_first_line;
extern void cmd_init __P((void));
extern void cmd_init PARAMS((void));
extern WORD_DESC *alloc_word_desc __P((void));
extern WORD_DESC *make_bare_word __P((const char *));
extern WORD_DESC *make_word_flags __P((WORD_DESC *, const char *));
extern WORD_DESC *make_word __P((const char *));
extern WORD_DESC *make_word_from_token __P((int));
extern WORD_DESC *alloc_word_desc PARAMS((void));
extern WORD_DESC *make_bare_word PARAMS((const char *));
extern WORD_DESC *make_word_flags PARAMS((WORD_DESC *, const char *));
extern WORD_DESC *make_word PARAMS((const char *));
extern WORD_DESC *make_word_from_token PARAMS((int));
extern WORD_LIST *make_word_list __P((WORD_DESC *, WORD_LIST *));
extern WORD_LIST *make_word_list PARAMS((WORD_DESC *, WORD_LIST *));
#define add_string_to_list(s, l) make_word_list (make_word(s), (l))
extern COMMAND *make_command __P((enum command_type, SIMPLE_COM *));
extern COMMAND *command_connect __P((COMMAND *, COMMAND *, int));
extern COMMAND *make_for_command __P((WORD_DESC *, WORD_LIST *, COMMAND *, int));
extern COMMAND *make_group_command __P((COMMAND *));
extern COMMAND *make_case_command __P((WORD_DESC *, PATTERN_LIST *, int));
extern PATTERN_LIST *make_pattern_list __P((WORD_LIST *, COMMAND *));
extern COMMAND *make_if_command __P((COMMAND *, COMMAND *, COMMAND *));
extern COMMAND *make_while_command __P((COMMAND *, COMMAND *));
extern COMMAND *make_until_command __P((COMMAND *, COMMAND *));
extern COMMAND *make_bare_simple_command __P((void));
extern COMMAND *make_simple_command __P((ELEMENT, COMMAND *));
extern void make_here_document __P((REDIRECT *, int));
extern REDIRECT *make_redirection __P((REDIRECTEE, enum r_instruction, REDIRECTEE, int));
extern COMMAND *make_function_def __P((WORD_DESC *, COMMAND *, int, int));
extern COMMAND *clean_simple_command __P((COMMAND *));
extern COMMAND *make_command PARAMS((enum command_type, SIMPLE_COM *));
extern COMMAND *command_connect PARAMS((COMMAND *, COMMAND *, int));
extern COMMAND *make_for_command PARAMS((WORD_DESC *, WORD_LIST *, COMMAND *, int));
extern COMMAND *make_group_command PARAMS((COMMAND *));
extern COMMAND *make_case_command PARAMS((WORD_DESC *, PATTERN_LIST *, int));
extern PATTERN_LIST *make_pattern_list PARAMS((WORD_LIST *, COMMAND *));
extern COMMAND *make_if_command PARAMS((COMMAND *, COMMAND *, COMMAND *));
extern COMMAND *make_while_command PARAMS((COMMAND *, COMMAND *));
extern COMMAND *make_until_command PARAMS((COMMAND *, COMMAND *));
extern COMMAND *make_bare_simple_command PARAMS((void));
extern COMMAND *make_simple_command PARAMS((ELEMENT, COMMAND *));
extern void make_here_document PARAMS((REDIRECT *, int));
extern REDIRECT *make_redirection PARAMS((REDIRECTEE, enum r_instruction, REDIRECTEE, int));
extern COMMAND *make_function_def PARAMS((WORD_DESC *, COMMAND *, int, int));
extern COMMAND *clean_simple_command PARAMS((COMMAND *));
extern COMMAND *make_arith_command __P((WORD_LIST *));
extern COMMAND *make_arith_command PARAMS((WORD_LIST *));
extern COMMAND *make_select_command __P((WORD_DESC *, WORD_LIST *, COMMAND *, int));
extern COMMAND *make_select_command PARAMS((WORD_DESC *, WORD_LIST *, COMMAND *, int));
#if defined (COND_COMMAND)
extern COND_COM *make_cond_node __P((int, WORD_DESC *, COND_COM *, COND_COM *));
extern COMMAND *make_cond_command __P((COND_COM *));
extern COND_COM *make_cond_node PARAMS((int, WORD_DESC *, COND_COM *, COND_COM *));
extern COMMAND *make_cond_command PARAMS((COND_COM *));
#endif
extern COMMAND *make_arith_for_command __P((WORD_LIST *, COMMAND *, int));
extern COMMAND *make_arith_for_command PARAMS((WORD_LIST *, COMMAND *, int));
extern COMMAND *make_subshell_command __P((COMMAND *));
extern COMMAND *make_coproc_command __P((char *, COMMAND *));
extern COMMAND *make_subshell_command PARAMS((COMMAND *));
extern COMMAND *make_coproc_command PARAMS((char *, COMMAND *));
extern COMMAND *connect_async_list __P((COMMAND *, COMMAND *, int));
extern COMMAND *connect_async_list PARAMS((COMMAND *, COMMAND *, int));
#endif /* !_MAKE_CMD_H */

Some files were not shown because too many files have changed in this diff Show More