]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
first set of ANSI C changes: remove PARAMS
authorChet Ramey <chet.ramey@case.edu>
Tue, 3 Jan 2023 15:01:11 +0000 (10:01 -0500)
committerChet Ramey <chet.ramey@case.edu>
Tue, 3 Jan 2023 15:01:11 +0000 (10:01 -0500)
232 files changed:
CWRU/CWRU.chlog
alias.h
array.h
array2.c
arrayfunc.h
assoc.h
bashhist.h
bashline.h
bracecomp.c
builtins/alias.def
builtins/bashgetopt.c
builtins/bashgetopt.h
builtins/bind.def
builtins/break.def
builtins/cd.def
builtins/command.def
builtins/common.c
builtins/common.h
builtins/complete.def
builtins/declare.def
builtins/enable.def
builtins/evalfile.c
builtins/evalstring.c
builtins/exit.def
builtins/fc.def
builtins/fg_bg.def
builtins/gen-helpfiles.c
builtins/getopt.c
builtins/getopt.h
builtins/getopts.def
builtins/hash.def
builtins/help.def
builtins/history.def
builtins/jobs.def
builtins/kill.def
builtins/mapfile.def
builtins/mkbuiltins.c
builtins/printf.def
builtins/psize-posix.c
builtins/psize.c
builtins/pushd.def
builtins/read.def
builtins/set.def
builtins/shopt.def
builtins/source.def
builtins/suspend.def
builtins/trap.def
builtins/type.def
builtins/ulimit.def
builtins/umask.def
builtins/wait.def
command.h
copy_cmd.c
dispose_cmd.c
dispose_cmd.h
error.h
examples/loadables/accept.c
examples/loadables/asort.c
examples/loadables/basename.c
examples/loadables/bcat.c
examples/loadables/cat.c
examples/loadables/csv.c
examples/loadables/cut.c
examples/loadables/dirname.c
examples/loadables/dsv.c
examples/loadables/fdflags.c
examples/loadables/finfo.c
examples/loadables/head.c
examples/loadables/hello.c
examples/loadables/id.c
examples/loadables/lcut.c
examples/loadables/ln.c
examples/loadables/logname.c
examples/loadables/mkdir.c
examples/loadables/mkfifo.c
examples/loadables/mktemp.c
examples/loadables/mypid.c
examples/loadables/necho.c
examples/loadables/pathchk.c
examples/loadables/print.c
examples/loadables/printenv.c
examples/loadables/push.c
examples/loadables/realpath.c
examples/loadables/rm.c
examples/loadables/rmdir.c
examples/loadables/seq.c
examples/loadables/setpgid.c
examples/loadables/sleep.c
examples/loadables/stat.c
examples/loadables/strftime.c
examples/loadables/sync.c
examples/loadables/tee.c
examples/loadables/template.c
examples/loadables/truefalse.c
examples/loadables/tty.c
examples/loadables/uname.c
examples/loadables/unlink.c
examples/loadables/whoami.c
execute_cmd.h
externs.h
findcmd.h
flags.h
general.h
hashcmd.h
hashlib.h
input.h
jobs.h
lib/glob/glob.c
lib/glob/glob.h
lib/glob/glob_loop.c
lib/glob/gmisc.c
lib/glob/sm_loop.c
lib/glob/smatch.c
lib/glob/strmatch.c
lib/glob/strmatch.h
lib/glob/xmbsrtowcs.c
lib/intl/bindtextdom.c
lib/intl/dcigettext.c
lib/intl/eval-plural.h
lib/intl/finddomain.c
lib/intl/gettextP.h
lib/intl/hash-string.h
lib/intl/l10nflist.c
lib/intl/loadinfo.h
lib/intl/loadmsgcat.c
lib/intl/localealias.c
lib/intl/plural-exp.c
lib/intl/plural-exp.h
lib/intl/plural.c
lib/intl/plural.y
lib/malloc/alloca.c
lib/malloc/imalloc.h
lib/malloc/malloc.c
lib/malloc/mstats.h
lib/malloc/shmalloc.h
lib/malloc/stats.c
lib/malloc/table.c
lib/malloc/table.h
lib/malloc/trace.c
lib/malloc/watch.c
lib/malloc/watch.h
lib/malloc/xmalloc.c
lib/readline/tcap.h
lib/sh/casemod.c
lib/sh/clktck.c
lib/sh/clock.c
lib/sh/dprintf.c
lib/sh/eaccess.c
lib/sh/fmtulong.c
lib/sh/fnxform.c
lib/sh/fpurge.c
lib/sh/getcwd.c
lib/sh/getenv.c
lib/sh/gettimeofday.c
lib/sh/inet_aton.c
lib/sh/input_avail.c
lib/sh/itos.c
lib/sh/mailstat.c
lib/sh/makepath.c
lib/sh/mbscasecmp.c
lib/sh/mbschr.c
lib/sh/mbscmp.c
lib/sh/mktime.c
lib/sh/netconn.c
lib/sh/netopen.c
lib/sh/oslib.c
lib/sh/pathcanon.c
lib/sh/pathphys.c
lib/sh/random.c
lib/sh/rename.c
lib/sh/setlinebuf.c
lib/sh/shmatch.c
lib/sh/shmbchar.c
lib/sh/shquote.c
lib/sh/shtty.c
lib/sh/snprintf.c
lib/sh/spell.c
lib/sh/strcasecmp.c
lib/sh/strcasestr.c
lib/sh/strchrnul.c
lib/sh/strdup.c
lib/sh/strerror.c
lib/sh/stringlist.c
lib/sh/stringvec.c
lib/sh/strnlen.c
lib/sh/strpbrk.c
lib/sh/strstr.c
lib/sh/strtod.c
lib/sh/strtoimax.c
lib/sh/strtol.c
lib/sh/strtoumax.c
lib/sh/strtrans.c
lib/sh/strvis.c
lib/sh/times.c
lib/sh/timeval.c
lib/sh/tmpfile.c
lib/sh/uconvert.c
lib/sh/ufuncs.c
lib/sh/unicode.c
lib/sh/utf8.c
lib/sh/vprint.c
lib/sh/wcsdup.c
lib/sh/wcsnwidth.c
lib/sh/wcswidth.c
lib/sh/winsize.c
lib/sh/zcatfd.c
lib/sh/zgetline.c
lib/sh/zmapfd.c
lib/sh/zread.c
lib/sh/zwrite.c
list.c
mailcheck.h
make_cmd.h
mksyntax.c
pathexp.h
pcomplete.h
redir.h
shell.h
sig.h
siglist.h
subst.h
support/bashversion.c
support/mksignames.c
support/mkversion.sh
test.h
trap.h
unwind_prot.h
variables.h
version.c
version2.c
xmalloc.c
xmalloc.h

index efc6c1a5278ffc9e8908d1b2169a8321653a5d0d..58357c85b4c5342f13ae2ea55a7a5f81f26ec791 100644 (file)
@@ -4792,3 +4792,75 @@ doc/{bash.1,bashref.texi},builtins/printf.def
        - specify the valid format characters as a subset of what printf(3)
          specifies, note that the %n format specifier takes a variable name
          as an argument. Suggestion from Emanuele Torre <torreemanuele6@gmail.com>
+
+                                  12/28
+                                  -----
+{xmalloc,variables,unwind_prot,trap,test,subst,sig,siglist,shell,redir,
+pcomplete,pathexp,make_cmd,mailcheck,jobs,input,hashcmd,hashlib,general,
+flags,findcmd,externs,execute_cmd,error,dispose_cmd,command,bashline,
+bashhist,assoc,arrayfunc,array,alias}.h
+{version,version2}.c
+       - PARAMS: remove for ANSI C-ification
+
+builtins/{getopt,common,bashgetopt}.h
+builtins/{mkbuiltins,gen-helpfiles,psize,psize-posix}.c
+builtins/{evalstring,bashgetopt,common,evalfile,getopt}.c
+builtins{alias,bind,break,cd,command,complete,declare,enable,exit,fc,
+fg_bg,getopts,hash,help,history,jobs,kill,mapfile,printf,pushd,read,set,
+shopt,source,suspend,trap,type,ulimit,umask,wait}.def
+       - PARAMS: remove for ANSI C-ification
+
+lib/malloc/{watch,table,shmalloc,mstats,imalloc}.h
+lib/malloc/{malloc,stats,table,trace}.c
+       - PARAMS: remove for ANSI C-ification
+
+lib/glob/{glob,strmatch}.h
+lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
+       - PARAMS: remove for ANSI C-ification
+
+lib/intl/{eval-plural,plural-exp,loadinfo,hash-string,gettextP}.h,
+lib/intl{plural.y,plural.c},
+lib/intl/{finddomain,bindtextdom,dcigettext,l10nflist,loadmsgcat,localealias,plural-exp}.c 
+       - PARAMS: remove for ANSI C-ification
+       - STATIC -> static
+       - internal_function -> inline
+
+lib/sh/{casemod,clock,eaccess,fnxform,fpurge,makepath,mktime,netopen,pathphys,random,shquote,snprintf,spell,strtod,strtoimax,strtoumax,times,timeval,tmpfile,unicode,winsize,zcatfd,zgetline,zmapfd}.c
+       - PARAMS: remove for ANSI C-ification
+
+support/{bashversion.c,mkversion.sh,mksignames.c}
+       - PARAMS: remove for ANSI C-ification
+
+lib/sh/{clock,strchrnul,getcwd,times,rename,inet_aton,strdup,strerror,strnlen
+strpbrk,strtod,strtoimax,strtol,strtoumax,wcsdup,wcsnwidth,wcswidth,strcasecmp,
+strcasestr}.c
+       - C89-style function declarations
+
+lib/malloc/{alloca,malloc,stats,table,trace,xmalloc}.c
+       - C89-style function declarations
+
+                                  12/29
+                                  -----
+lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
+       - C89-style function declarations
+
+lib/sh/{zcatfd,zgetline,zmapfd,zread,zwrite,winsize,vprint,uconvert,ufuncs,
+unicode,utf8}.c
+lib/sh/{stringlist,stringvec,strtrans,strvis,timeval,tmpfile}.c
+lib/sh/{setlinebuf,shmatch,shmbchar,shquote,shtty,snprintf,spell}.c
+lib/sh/{random,pathcanon,pathphys,oslib,netconn,netopen}.c
+lib/sh/{mailstat,makepath,mbscasecmp,mbschr,mbscmp,mktime}.c
+lib/sh/{input_avail,itos,getenv,fmtulong,fnxform,eaccess,dprintf,casemod,clktck}.c
+       - C89-style function declarations
+
+examples/loadables/{accept,asort,basename,bcat,cat,csv,cut,dirname,dsv}.c
+examples/loadables/{fdflags,finfo,head,hello,id,lcut,ln}.c
+examples/loadables/{mkdir,mkfifo,mktemp,mypid,necho,pathchk}.c
+examples/loadables/{print,printenv,push,realpath,rm,rmdir,seq}.c
+examples/loadables/{setpgid,stat,strftime,sync,tee,template,truefalse,tty}.c
+examples/loadables/{uname,unlink,whoami}.c
+       - C89-style function declarations
+
+xmalloc.c, array2.c, list.c, dispose_cmd.c, copy_cmd.c, bracecomp.c, mksyntax.c
+       - PARAMS: remove for ANSI C-ification
+       - C89-style function declarations
diff --git a/alias.h b/alias.h
index 4e2d67c0fc738bf73adef563b1a054c00fe3d33f..1f5ec708af917e9a770eda5b805d6fff4c40e179 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -1,6 +1,6 @@
 /* alias.h -- structure definitions. */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2022 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 PARAMS((void));
+extern void initialize_aliases (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 PARAMS((char *));
+extern alias_t *find_alias (char *);
 
 /* Return the value of the alias for NAME, or NULL if there is none. */
-extern char *get_alias_value PARAMS((char *));
+extern char *get_alias_value (char *);
 
 /* Make a new alias from NAME and VALUE.  If NAME can be found,
    then replace its value. */
-extern void add_alias PARAMS((char *, char *));
+extern void add_alias (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 PARAMS((char *));
+extern int remove_alias (char *);
 
 /* Remove all aliases. */
-extern void delete_all_aliases PARAMS((void));
+extern void delete_all_aliases (void);
 
 /* Return an array of all defined aliases. */
-extern alias_t **all_aliases PARAMS((void));
+extern alias_t **all_aliases (void);
 
 /* Expand a single word for aliases. */
-extern char *alias_expand_word PARAMS((char *));
+extern char *alias_expand_word (char *);
 
 /* Return a new line, with any aliases expanded. */
-extern char *alias_expand PARAMS((char *));
+extern char *alias_expand (char *);
 
 /* Helper definition for the parser */
-extern void clear_string_list_expander PARAMS((alias_t *));
+extern void clear_string_list_expander (alias_t *);
 
 #endif /* _ALIAS_H_ */
diff --git a/array.h b/array.h
index 4214e8b414933d5b4fd950f5bedd9d75486a8645..47712e88ad24174f5bde0550eb3f8b5942a69013 100644 (file)
--- a/array.h
+++ b/array.h
@@ -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-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -50,70 +50,70 @@ typedef struct array_element {
 
 #define ARRAY_DEFAULT_SIZE     1024
 
-typedef int sh_ae_map_func_t PARAMS((ARRAY_ELEMENT *, void *));
+typedef int sh_ae_map_func_t (ARRAY_ELEMENT *, void *);
 
 /* Basic operations on entire arrays */
 #ifdef ALT_ARRAY_IMPLEMENTATION
-extern void   array_alloc PARAMS((ARRAY *, arrayind_t));
-extern void   array_resize PARAMS((ARRAY *, arrayind_t));
-extern void   array_expand PARAMS((ARRAY *, arrayind_t));
-extern void   array_dispose_elements PARAMS((ARRAY_ELEMENT **));
+extern void   array_alloc (ARRAY *, arrayind_t);
+extern void   array_resize (ARRAY *, arrayind_t);
+extern void   array_expand (ARRAY *, arrayind_t);
+extern void   array_dispose_elements (ARRAY_ELEMENT **);
 #endif
-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_create (void);
+extern void    array_flush (ARRAY *);
+extern void    array_dispose (ARRAY *);
+extern ARRAY   *array_copy (ARRAY *);
 #ifndef ALT_ARRAY_IMPLEMENTATION
-extern ARRAY   *array_slice PARAMS((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *));
+extern ARRAY   *array_slice (ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *);
 #else
-extern ARRAY   *array_slice PARAMS((ARRAY *, arrayind_t, arrayind_t));
+extern ARRAY   *array_slice (ARRAY *, arrayind_t, arrayind_t);
 #endif
 
-extern void    array_walk PARAMS((ARRAY   *, sh_ae_map_func_t *, void *));
+extern void    array_walk (ARRAY   *, sh_ae_map_func_t *, void *);
 
 #ifndef ALT_ARRAY_IMPLEMENTATION
-extern ARRAY_ELEMENT *array_shift PARAMS((ARRAY *, int, int));
+extern ARRAY_ELEMENT *array_shift (ARRAY *, int, int);
 #else
-extern ARRAY_ELEMENT **array_shift PARAMS((ARRAY *, int, int));
+extern ARRAY_ELEMENT **array_shift (ARRAY *, int, int);
 #endif
-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 int     array_rshift (ARRAY *, int, char *);
+extern ARRAY_ELEMENT *array_unshift_element (ARRAY *);
+extern int     array_shift_element (ARRAY *, char *);
 
-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 ARRAY   *array_quote (ARRAY *);
+extern ARRAY   *array_quote_escapes (ARRAY *);
+extern ARRAY   *array_dequote (ARRAY *);
+extern ARRAY   *array_dequote_escapes (ARRAY *);
+extern ARRAY   *array_remove_quoted_nulls (ARRAY *);
 
-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));
+extern char    *array_subrange (ARRAY *, arrayind_t, arrayind_t, int, int, int);
+extern char    *array_patsub (ARRAY *, char *, char *, int);
+extern char    *array_modcase (ARRAY *, char *, int, int);
 
 /* Basic operations on array elements. */
-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 ARRAY_ELEMENT *array_create_element (arrayind_t, char *);
+extern ARRAY_ELEMENT *array_copy_element (ARRAY_ELEMENT *);
+extern void    array_dispose_element (ARRAY_ELEMENT *);
 
-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));
+extern int     array_insert (ARRAY *, arrayind_t, char *);
+extern ARRAY_ELEMENT *array_remove (ARRAY *, arrayind_t);
+extern char    *array_reference (ARRAY *, arrayind_t);
 
 /* Converting to and from arrays */
-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 WORD_LIST *array_to_kvpair_list PARAMS((ARRAY *));
+extern WORD_LIST *array_to_word_list (ARRAY *);
+extern ARRAY *array_from_word_list (WORD_LIST *);
+extern WORD_LIST *array_keys_to_word_list (ARRAY *);
+extern WORD_LIST *array_to_kvpair_list (ARRAY *);
 
-extern ARRAY *array_assign_list PARAMS((ARRAY *, WORD_LIST *));
+extern ARRAY *array_assign_list (ARRAY *, WORD_LIST *);
 
-extern char **array_to_argv PARAMS((ARRAY *, int *));
-extern ARRAY *array_from_argv PARAMS((ARRAY *, char **, int));
+extern char **array_to_argv (ARRAY *, int *);
+extern ARRAY *array_from_argv (ARRAY *, char **, int);
 
-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 *));
+extern char *array_to_kvpair (ARRAY *, int);
+extern char *array_to_assign (ARRAY *, int);
+extern char *array_to_string (ARRAY *, char *, int);
+extern ARRAY *array_from_string (char *, char *);
 
 /* Flags for array_shift */
 #define AS_DISPOSE     0x01
@@ -137,8 +137,8 @@ extern ARRAY *array_from_string PARAMS((char *, char *));
 #define element_forw(ae)       ((ae)->next)
 #define element_back(ae)       ((ae)->prev)
 #else
-extern arrayind_t element_forw PARAMS((ARRAY *, arrayind_t));
-extern arrayind_t element_back PARAMS((ARRAY *, arrayind_t));
+extern arrayind_t element_forw (ARRAY *, arrayind_t);
+extern arrayind_t element_back (ARRAY *, arrayind_t);
 #endif
 
 
@@ -177,6 +177,6 @@ extern arrayind_t element_back PARAMS((ARRAY *, arrayind_t));
 #define ALL_ELEMENT_SUB(c)     ((c) == '@' || (c) == '*')
 
 /* In eval.c, but uses ARRAY * */
-extern int execute_array_command PARAMS((ARRAY *, void *));
+extern int execute_array_command (ARRAY *, void *);
 
 #endif /* _ARRAY_H_ */
index fa8be00d678555b7263a229425d72ff275da3f3b..2988f3b173c31e3993603423a78da0392cf10bc2 100644 (file)
--- a/array2.c
+++ b/array2.c
@@ -9,7 +9,7 @@
  * chet@ins.cwru.edu
  */
 
-/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2021,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #define ARRAY_MAX_DOUBLE       16777216
 
-static ARRAY_ELEMENT **array_copy_elements PARAMS((ARRAY *));
-static char *array_to_string_internal PARAMS((ARRAY *, arrayind_t, arrayind_t, char *, int));
+static ARRAY_ELEMENT **array_copy_elements (ARRAY *);
+static char *array_to_string_internal (ARRAY *, arrayind_t, arrayind_t, char *, int);
 
 static char *spacesep = " ";
 
 void
-array_alloc (a, n)
-ARRAY  *a;
-arrayind_t n;
+array_alloc (ARRAY *a, arrayind_t n)
 {
        arrayind_t i;
 
@@ -68,9 +66,7 @@ arrayind_t n;
 }
 
 void
-array_resize (a, n)
-ARRAY  *a;
-arrayind_t n;
+array_resize (ARRAY *a, arrayind_t n)
 {
        ARRAY_ELEMENT **e, *ae;
        arrayind_t i, nsize;
@@ -90,9 +86,7 @@ arrayind_t n;
 }
 
 void
-array_expand (a, n)
-ARRAY  *a;
-arrayind_t     n;
+array_expand (ARRAY *a, arrayind_t n)
 {
        arrayind_t nsize;
 
@@ -107,7 +101,7 @@ arrayind_t  n;
 }
        
 ARRAY *
-array_create()
+array_create(void)
 {
        ARRAY   *r;
 
@@ -120,8 +114,7 @@ array_create()
 }
 
 void
-array_flush (a)
-ARRAY  *a;
+array_flush (ARRAY *a)
 {
        int r;
 
@@ -141,8 +134,7 @@ ARRAY       *a;
 }
 
 void
-array_dispose_elements(elist)
-ARRAY_ELEMENT  **elist;
+array_dispose_elements(ARRAY_ELEMENT **elist)
 {
        arrayind_t i;
 
@@ -154,8 +146,7 @@ ARRAY_ELEMENT       **elist;
 }
 
 void
-array_dispose(a)
-ARRAY  *a;
+array_dispose(ARRAY *a)
 {
        if (a == 0)
                return;
@@ -165,8 +156,7 @@ ARRAY       *a;
 }
 
 static ARRAY_ELEMENT **
-array_copy_elements (a)
-ARRAY  *a;
+array_copy_elements (ARRAY *a)
 {
        ARRAY_ELEMENT **ret;
        arrayind_t i;
@@ -180,8 +170,7 @@ ARRAY       *a;
 }
 
 ARRAY *
-array_copy(a)
-ARRAY  *a;
+array_copy(ARRAY *a)
 {
        ARRAY *a1;
 
@@ -203,9 +192,7 @@ ARRAY       *a;
  * S to E, inclusive. The callers do the bounds checking.
  */
 ARRAY *
-array_slice(array, s, e)
-ARRAY          *array;
-arrayind_t     s, e;
+array_slice(ARRAY *array, arrayind_t s, arrayind_t e)
 {
        ARRAY   *a;
        ARRAY_ELEMENT *p, *n;
@@ -239,10 +226,7 @@ arrayind_t s, e;
  * element as the argument.
  */
 void
-array_walk(a, func, udata)
-ARRAY  *a;
-sh_ae_map_func_t *func;
-void   *udata;
+array_walk(ARRAY *a, sh_ae_map_func_t *func, void *udata)
 {
        arrayind_t i;
        register ARRAY_ELEMENT *ae;
@@ -266,9 +250,7 @@ void        *udata;
  * returns NULL.
  */
 ARRAY_ELEMENT **
-array_shift(a, n, flags)
-ARRAY  *a;
-int    n, flags;
+array_shift(ARRAY *a, int n, int flags)
 {
        ARRAY_ELEMENT **r, *ae;
        register arrayind_t ni, ri;
@@ -354,10 +336,7 @@ if (j < n)
  * shift.
  */
 int
-array_rshift (a, n, s)
-ARRAY  *a;
-int    n;
-char   *s;
+array_rshift (ARRAY *a, int n, char *s)
 {
        register ARRAY_ELEMENT  *ae, *new;
        arrayind_t ni, nsize;
@@ -399,8 +378,7 @@ char        *s;
 }
 
 ARRAY_ELEMENT *
-array_unshift_element(a)
-ARRAY  *a;
+array_unshift_element(ARRAY *a)
 {
        ARRAY_ELEMENT **r, *ret;
        
@@ -411,16 +389,13 @@ ARRAY     *a;
 }
 
 int
-array_shift_element(a, v)
-ARRAY  *a;
-char   *v;
+array_shift_element(ARRAY *a, char *v)
 {
        return (array_rshift (a, 1, v));
 }
 
 ARRAY *
-array_quote(array)
-ARRAY  *array;
+array_quote(ARRAY *array)
 {
        register arrayind_t i;
        ARRAY_ELEMENT   *a;
@@ -439,8 +414,7 @@ ARRAY       *array;
 }
 
 ARRAY *
-array_quote_escapes(array)
-ARRAY  *array;
+array_quote_escapes(ARRAY *array)
 {
        register arrayind_t i;
        ARRAY_ELEMENT   *a;
@@ -459,8 +433,7 @@ ARRAY       *array;
 }
 
 ARRAY *
-array_dequote(array)
-ARRAY  *array;
+array_dequote(ARRAY *array)
 {
        register arrayind_t i;
        ARRAY_ELEMENT   *a;
@@ -480,8 +453,7 @@ ARRAY       *array;
 }
 
 ARRAY *
-array_dequote_escapes(array)
-ARRAY  *array;
+array_dequote_escapes(ARRAY *array)
 {
        register arrayind_t i;
        ARRAY_ELEMENT   *a;
@@ -500,8 +472,7 @@ ARRAY       *array;
 }
 
 ARRAY *
-array_remove_quoted_nulls(array)
-ARRAY  *array;
+array_remove_quoted_nulls(ARRAY *array)
 {
        register arrayind_t i;
        ARRAY_ELEMENT   *a;
@@ -522,10 +493,7 @@ ARRAY      *array;
  * Since arrays are sparse, unset array elements are not counted.
  */
 char *
-array_subrange (a, start, nelem, starsub, quoted, pflags)
-ARRAY  *a;
-arrayind_t     start, nelem;
-int    starsub, quoted, pflags;
+array_subrange (ARRAY *a, arrayind_t start, arrayind_t nelem, int starsub, int quoted, int pflags)
 {
        ARRAY           *a2;
        arrayind_t      s, e;
@@ -568,10 +536,7 @@ int        starsub, quoted, pflags;
 }
 
 char *
-array_patsub (a, pat, rep, mflags)
-ARRAY  *a;
-char   *pat, *rep;
-int    mflags;
+array_patsub (ARRAY *a, char *pat, char *rep, int mflags)
 {
        char    *t;
        int     pchar, qflags, pflags;
@@ -601,11 +566,7 @@ int        mflags;
 }
 
 char *
-array_modcase (a, pat, modop, mflags)
-ARRAY  *a;
-char   *pat;
-int    modop;
-int    mflags;
+array_modcase (ARRAY *a, char *pat, int modop, int mflags)
 {
        char    *t;
        int     pchar, qflags, pflags;
@@ -639,9 +600,7 @@ int mflags;
  * VALUE.
  */
 ARRAY_ELEMENT *
-array_create_element(indx, value)
-arrayind_t     indx;
-char   *value;
+array_create_element(arrayind_t indx, char *value)
 {
        ARRAY_ELEMENT *r;
 
@@ -652,16 +611,14 @@ char      *value;
 }
 
 ARRAY_ELEMENT *
-array_copy_element(ae)
-ARRAY_ELEMENT  *ae;
+array_copy_element(ARRAY_ELEMENT *ae)
 {
        return(ae ? array_create_element(element_index(ae), element_value(ae))
                  : (ARRAY_ELEMENT *) NULL);
 }
 
 void
-array_dispose_element(ae)
-ARRAY_ELEMENT  *ae;
+array_dispose_element(ARRAY_ELEMENT *ae)
 {
        if (ae) {
                FREE(ae->value);
@@ -673,10 +630,7 @@ ARRAY_ELEMENT      *ae;
  * Add a new element with index I and value V to array A (a[i] = v).
  */
 int
-array_insert(a, i, v)
-ARRAY  *a;
-arrayind_t     i;
-char   *v;
+array_insert(ARRAY *a, arrayind_t i, char *v)
 {
        register ARRAY_ELEMENT *new, *old;
        arrayind_t nsize;
@@ -709,9 +663,7 @@ char        *v;
  * caller can dispose of it.
  */
 ARRAY_ELEMENT *
-array_remove(a, i)
-ARRAY  *a;
-arrayind_t     i;
+array_remove(ARRAY *a, arrayind_t i)
 {
        register ARRAY_ELEMENT *ae;
        arrayind_t ind;
@@ -746,9 +698,7 @@ arrayind_t  i;
  * Return the value of a[i].
  */
 char *
-array_reference(a, i)
-ARRAY  *a;
-arrayind_t     i;
+array_reference(ARRAY *a, arrayind_t i)
 {
        register ARRAY_ELEMENT *ae;
 
@@ -765,8 +715,7 @@ arrayind_t  i;
    by the rest of the code. */
 
 WORD_LIST *
-array_to_word_list(a)
-ARRAY  *a;
+array_to_word_list(ARRAY *a)
 {
        register arrayind_t i;
        WORD_LIST       *list;
@@ -785,8 +734,7 @@ ARRAY       *a;
 }
 
 ARRAY *
-array_from_word_list (list)
-WORD_LIST      *list;
+array_from_word_list (WORD_LIST *list)
 {
        ARRAY   *a;
 
@@ -797,8 +745,7 @@ WORD_LIST   *list;
 }
 
 WORD_LIST *
-array_keys_to_word_list(a)
-ARRAY  *a;
+array_keys_to_word_list(ARRAY *a)
 {
        arrayind_t      ind;
        WORD_LIST       *list;
@@ -819,8 +766,7 @@ ARRAY       *a;
 }
 
 WORD_LIST *
-array_to_kvpair_list(a)
-ARRAY  *a;
+array_to_kvpair_list (ARRAY *a)
 {
        arrayind_t      ind;
        WORD_LIST       *list;
@@ -856,9 +802,7 @@ WORD_LIST   *list;
 }
 
 char **
-array_to_argv (a, countp)
-ARRAY  *a;
-int    *countp;
+array_to_argv (ARRAY *a, int *countp)
 {
        char            **ret, *t;
        int             i;
@@ -883,10 +827,7 @@ int        *countp;
 }
 
 ARRAY *
-array_from_argv(a, vec, count)
-ARRAY  *a;
-char   **vec;
-int    count;
+array_from_argv(ARRAY *a, char **vec, int count)
 {
        arrayind_t      i;
        char    *t;
@@ -935,9 +876,7 @@ int count;
  * Return the next non-null array element after A[IND]
  */
 arrayind_t
-element_forw(a, ind)
-ARRAY  *a;
-arrayind_t ind;
+element_forw(ARRAY *a, arrayind_t ind)
 {
        register arrayind_t     i;
 
@@ -953,9 +892,7 @@ arrayind_t ind;
  * Return the previous non-null array element before A[IND]
  */
 arrayind_t
-element_back (a, ind)
-ARRAY  *a;
-arrayind_t ind;
+element_back (ARRAY *a, arrayind_t ind)
 {
        register arrayind_t     i;
 
@@ -972,11 +909,7 @@ arrayind_t ind;
  * to END, separated by SEP.
  */
 static char *
-array_to_string_internal (a, start, end, sep, quoted)
-ARRAY  *a;
-arrayind_t     start, end;
-char   *sep;
-int    quoted;
+array_to_string_internal (ARRAY *a, arrayind_t start, arrayind_t end, char *sep, int quoted)
 {
        arrayind_t i;
        char    *result, *t;
@@ -1014,9 +947,7 @@ int        quoted;
 }
 
 char *
-array_to_kvpair (a, quoted)
-ARRAY  *a;
-int    quoted;
+array_to_kvpair (ARRAY *a, int quoted)
 {
        arrayind_t      ind;
        char    *result, *valstr, *is;
@@ -1071,9 +1002,7 @@ int       quoted;
 }
 
 char *
-array_to_assign (a, quoted)
-ARRAY  *a;
-int    quoted;
+array_to_assign (ARRAY *a, int quoted)
 {
        arrayind_t      ind;
        char    *result, *valstr, *is;
@@ -1128,10 +1057,7 @@ int      quoted;
 }
 
 char *
-array_to_string (a, sep, quoted)
-ARRAY  *a;
-char   *sep;
-int    quoted;
+array_to_string (ARRAY *a, char *sep, int quoted)
 {
        if (a == 0)
                return((char *)NULL);
@@ -1145,8 +1071,7 @@ int       quoted;
  * Return an array consisting of elements in S, separated by SEP
  */
 ARRAY *
-array_from_string(s, sep)
-char   *s, *sep;
+array_from_string(char *s, char *sep)
 {
        ARRAY   *a;
        WORD_LIST *w;
@@ -1169,8 +1094,7 @@ char      *s, *sep;
 int interrupt_immediately = 0;
 
 int
-signal_is_trapped(s)
-int    s;
+signal_is_trapped(int s)
 {
        return 0;
 }
@@ -1190,8 +1114,7 @@ programming_error(const char *s, ...)
 }
 
 WORD_DESC *
-make_bare_word (s)
-const char     *s;
+make_bare_word (const char *s)
 {
        WORD_DESC *w;
 
@@ -1202,9 +1125,7 @@ const char        *s;
 }
 
 WORD_LIST *
-make_word_list(x, l)
-WORD_DESC      *x;
-WORD_LIST      *l;
+make_word_list(WORD_DESC *x, WORD_LIST *l)
 {
        WORD_LIST *w;
 
@@ -1215,9 +1136,7 @@ WORD_LIST *l;
 }
 
 WORD_LIST *
-list_string(s, t, i)
-char   *s, *t;
-int    i;
+list_string(char *s, char *t, int i)
 {
        char    *r, *a;
        WORD_LIST       *wl;
@@ -1235,8 +1154,7 @@ int       i;
 }
 
 GENERIC_LIST *
-list_reverse (list)
-GENERIC_LIST   *list;
+list_reverse (GENERIC_LIST *list)
 {
        register GENERIC_LIST *next, *prev;
 
@@ -1250,22 +1168,18 @@ GENERIC_LIST    *list;
 }
 
 char *
-pat_subst(s, t, u, i)
-char   *s, *t, *u;
-int    i;
+pat_subst(char *s, char *t, char *u, int i)
 {
        return ((char *)NULL);
 }
 
 char *
-quote_string(s)
-char   *s;
+quote_string(char *s)
 {
        return savestring(s);
 }
 
-print_element(ae)
-ARRAY_ELEMENT  *ae;
+print_element(ARRAY_ELEMENT *ae)
 {
        char    lbuf[INT_STRLEN_BOUND (intmax_t) + 1];
 
@@ -1274,14 +1188,13 @@ ARRAY_ELEMENT   *ae;
                element_value(ae));
 }
 
-print_array(a)
-ARRAY  *a;
+print_array(ARRAY *a)
 {
        printf("\n");
        array_walk(a, print_element, (void *)NULL);
 }
 
-main()
+main(int c, char **v)
 {
        ARRAY   *a, *new_a, *copy_of_a;
        ARRAY_ELEMENT   *ae, *aew;
index 69112b579cd23a22f1b93233178235841eb19a76..9d9052ffa7b18b1c38a420d75301e82639123880 100644 (file)
@@ -1,6 +1,6 @@
 /* arrayfunc.h -- declarations for miscellaneous array functions in arrayfunc.c */
 
-/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -73,49 +73,49 @@ extern int array_expand_once;
 #define VA_ONEWORD     0x002
 #define VA_ALLOWALL    0x004   /* allow @ to mean all elements of the array */
 
-extern SHELL_VAR *convert_var_to_array PARAMS((SHELL_VAR *));
-extern SHELL_VAR *convert_var_to_assoc PARAMS((SHELL_VAR *));
+extern SHELL_VAR *convert_var_to_array (SHELL_VAR *);
+extern SHELL_VAR *convert_var_to_assoc (SHELL_VAR *);
 
-extern char *make_array_variable_value PARAMS((SHELL_VAR *, arrayind_t, char *, char *, int));
+extern char *make_array_variable_value (SHELL_VAR *, arrayind_t, char *, char *, int);
 
-extern SHELL_VAR *bind_array_variable PARAMS((char *, arrayind_t, char *, int));
-extern SHELL_VAR *bind_array_element PARAMS((SHELL_VAR *, arrayind_t, char *, int));
-extern SHELL_VAR *assign_array_element PARAMS((char *, char *, int, array_eltstate_t *));
+extern SHELL_VAR *bind_array_variable (char *, arrayind_t, char *, int);
+extern SHELL_VAR *bind_array_element (SHELL_VAR *, arrayind_t, char *, int);
+extern SHELL_VAR *assign_array_element (char *, char *, int, array_eltstate_t *);
 
-extern SHELL_VAR *bind_assoc_variable PARAMS((SHELL_VAR *, char *, char *, char *, int));
+extern SHELL_VAR *bind_assoc_variable (SHELL_VAR *, char *, char *, char *, int);
 
-extern SHELL_VAR *find_or_make_array_variable PARAMS((char *, int));
+extern SHELL_VAR *find_or_make_array_variable (char *, int);
 
-extern SHELL_VAR *assign_array_from_string  PARAMS((char *, char *, int));
-extern SHELL_VAR *assign_array_var_from_word_list PARAMS((SHELL_VAR *, WORD_LIST *, int));
+extern SHELL_VAR *assign_array_from_string  (char *, char *, int);
+extern SHELL_VAR *assign_array_var_from_word_list (SHELL_VAR *, WORD_LIST *, int);
 
-extern WORD_LIST *expand_compound_array_assignment PARAMS((SHELL_VAR *, char *, int));
-extern void assign_compound_array_list PARAMS((SHELL_VAR *, WORD_LIST *, int));
-extern SHELL_VAR *assign_array_var_from_string PARAMS((SHELL_VAR *, char *, int));
+extern WORD_LIST *expand_compound_array_assignment (SHELL_VAR *, char *, int);
+extern void assign_compound_array_list (SHELL_VAR *, WORD_LIST *, int);
+extern SHELL_VAR *assign_array_var_from_string (SHELL_VAR *, char *, int);
 
-extern char *expand_and_quote_assoc_word PARAMS((char *, int));
-extern void quote_compound_array_list PARAMS((WORD_LIST *, int));
+extern char *expand_and_quote_assoc_word (char *, int);
+extern void quote_compound_array_list (WORD_LIST *, int);
 
-extern int kvpair_assignment_p PARAMS((WORD_LIST *));
-extern char *expand_and_quote_kvpair_word PARAMS((char *));
+extern int kvpair_assignment_p (WORD_LIST *);
+extern char *expand_and_quote_kvpair_word (char *);
 
-extern int unbind_array_element PARAMS((SHELL_VAR *, char *, int));
-extern int skipsubscript PARAMS((const char *, int, int));
+extern int unbind_array_element (SHELL_VAR *, char *, int);
+extern int skipsubscript (const char *, int, int);
 
-extern void print_array_assignment PARAMS((SHELL_VAR *, int));
-extern void print_assoc_assignment PARAMS((SHELL_VAR *, int));
+extern void print_array_assignment (SHELL_VAR *, int);
+extern void print_assoc_assignment (SHELL_VAR *, int);
 
-extern arrayind_t array_expand_index PARAMS((SHELL_VAR *, char *, int, int));
-extern int valid_array_reference PARAMS((const char *, int));
-extern int tokenize_array_reference PARAMS((char *, int, char **));
+extern arrayind_t array_expand_index (SHELL_VAR *, char *, int, int);
+extern int valid_array_reference (const char *, int);
+extern int tokenize_array_reference (char *, int, char **);
 
-extern char *array_value PARAMS((const char *, int, int, array_eltstate_t *));
-extern char *get_array_value PARAMS((const char *, int, array_eltstate_t *));
+extern char *array_value (const char *, int, int, array_eltstate_t *);
+extern char *get_array_value (const char *, int, array_eltstate_t *);
 
-extern char *array_keys PARAMS((char *, int, int));
+extern char *array_keys (char *, int, int);
 
-extern char *array_variable_name PARAMS((const char *, int, char **, int *));
-extern SHELL_VAR *array_variable_part PARAMS((const char *, int, char **, int *));
+extern char *array_variable_name (const char *, int, char **, int *);
+extern SHELL_VAR *array_variable_part (const char *, int, char **, int *);
 
 extern void init_eltstate (array_eltstate_t *);
 extern void flush_eltstate (array_eltstate_t *);
diff --git a/assoc.h b/assoc.h
index 664d13740b84652546817bfcc76a1a6fdd4300a6..403e68dfc3c8ffa4ef8fcb5f34a4503e49d466cb 100644 (file)
--- a/assoc.h
+++ b/assoc.h
 
 #define assoc_walk(h, f)       (hash_walk((h), (f))
 
-extern void assoc_dispose PARAMS((HASH_TABLE *));
-extern void assoc_flush PARAMS((HASH_TABLE *));
+extern void assoc_dispose (HASH_TABLE *);
+extern void assoc_flush (HASH_TABLE *);
 
-extern int assoc_insert PARAMS((HASH_TABLE *, char *, char *));
-extern PTR_T assoc_replace PARAMS((HASH_TABLE *, char *, char *));
-extern void assoc_remove PARAMS((HASH_TABLE *, char *));
+extern int assoc_insert (HASH_TABLE *, char *, char *);
+extern PTR_T assoc_replace (HASH_TABLE *, char *, char *);
+extern void assoc_remove (HASH_TABLE *, char *);
 
-extern char *assoc_reference PARAMS((HASH_TABLE *, char *));
+extern char *assoc_reference (HASH_TABLE *, char *);
 
-extern char *assoc_subrange PARAMS((HASH_TABLE *, arrayind_t, arrayind_t, int, int, int));
-extern char *assoc_patsub PARAMS((HASH_TABLE *, char *, char *, int));
-extern char *assoc_modcase PARAMS((HASH_TABLE *, char *, int, int));
+extern char *assoc_subrange (HASH_TABLE *, arrayind_t, arrayind_t, int, int, int);
+extern char *assoc_patsub (HASH_TABLE *, char *, char *, int);
+extern char *assoc_modcase (HASH_TABLE *, char *, int, int);
 
-extern HASH_TABLE *assoc_quote PARAMS((HASH_TABLE *));
-extern HASH_TABLE *assoc_quote_escapes PARAMS((HASH_TABLE *));
-extern HASH_TABLE *assoc_dequote PARAMS((HASH_TABLE *));
-extern HASH_TABLE *assoc_dequote_escapes PARAMS((HASH_TABLE *));
-extern HASH_TABLE *assoc_remove_quoted_nulls PARAMS((HASH_TABLE *));
+extern HASH_TABLE *assoc_quote (HASH_TABLE *);
+extern HASH_TABLE *assoc_quote_escapes (HASH_TABLE *);
+extern HASH_TABLE *assoc_dequote (HASH_TABLE *);
+extern HASH_TABLE *assoc_dequote_escapes (HASH_TABLE *);
+extern HASH_TABLE *assoc_remove_quoted_nulls (HASH_TABLE *);
 
-extern char *assoc_to_kvpair PARAMS((HASH_TABLE *, int));
-extern char *assoc_to_assign PARAMS((HASH_TABLE *, int));
+extern char *assoc_to_kvpair (HASH_TABLE *, int);
+extern char *assoc_to_assign (HASH_TABLE *, int);
 
-extern WORD_LIST *assoc_to_word_list PARAMS((HASH_TABLE *));
-extern WORD_LIST *assoc_keys_to_word_list PARAMS((HASH_TABLE *));
-extern WORD_LIST *assoc_to_kvpair_list PARAMS((HASH_TABLE *));
+extern WORD_LIST *assoc_to_word_list (HASH_TABLE *);
+extern WORD_LIST *assoc_keys_to_word_list (HASH_TABLE *);
+extern WORD_LIST *assoc_to_kvpair_list (HASH_TABLE *);
 
-extern char *assoc_to_string PARAMS((HASH_TABLE *, char *, int));
+extern char *assoc_to_string (HASH_TABLE *, char *, int);
 #endif /* _ASSOC_H_ */
index 615f5d25692bd5569eeadfa7f494164687668b81..4ce049cf389105ae3b363cdf92dce570861c343b 100644 (file)
@@ -1,6 +1,6 @@
 /* bashhist.h -- interface to the bash history functions in bashhist.c. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation,  Inc.
+/* Copyright (C) 1993-2022 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 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 PARAMS((char *));
-
-extern char *last_history_line PARAMS((void));
+extern void bash_initialize_history (void);
+extern void bash_history_reinit (int);
+extern void bash_history_disable (void);
+extern void bash_history_enable (void);
+extern void bash_clear_history (void);
+extern int bash_delete_histent (int);
+extern int bash_delete_history_range (int, int);
+extern int bash_delete_last_history (void);
+extern void load_history (void);
+extern void save_history (void);
+extern int maybe_append_history (char *);
+extern int maybe_save_shell_history (void);
+extern char *pre_process_line (char *, int, int);
+extern void maybe_add_history (char *);
+extern void bash_add_history (char *);
+extern int check_add_history (char *, int);
+extern int history_number (void);
+
+extern void setup_history_ignore (char *);
+
+extern char *last_history_line (void);
 
 #endif /* _BASHHIST_H_ */
index d40228e29f1aebc1d1d8b47e1b18808fa5d26b0e..b728233ea6b6580c81259126a69766eb81da9b93 100644 (file)
@@ -1,6 +1,6 @@
 /* bashline.h -- interface to the bash readline functions in bashline.c. */
 
-/* Copyright (C) 1993-2019 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -35,35 +35,35 @@ extern int dircomplete_expand;
 extern int dircomplete_expand_relpath;
 extern int complete_fullquote;
 
-extern void posix_readline_initialize PARAMS((int));
-extern void reset_completer_word_break_chars PARAMS((void));
-extern int enable_hostname_completion PARAMS((int));
-extern void initialize_readline PARAMS((void));
-extern void bashline_reset PARAMS((void));
-extern void bashline_reinitialize PARAMS((void));
-extern int bash_re_edit PARAMS((char *));
+extern void posix_readline_initialize (int);
+extern void reset_completer_word_break_chars (void);
+extern int enable_hostname_completion (int);
+extern void initialize_readline (void);
+extern void bashline_reset (void);
+extern void bashline_reinitialize (void);
+extern int bash_re_edit (char *);
 
-extern void bashline_set_event_hook PARAMS((void));
-extern void bashline_reset_event_hook PARAMS((void));
+extern void bashline_set_event_hook (void);
+extern void bashline_reset_event_hook (void);
 
-extern int bind_keyseq_to_unix_command PARAMS((char *));
-extern int bash_execute_unix_command PARAMS((int, int));
-extern int print_unix_command_map PARAMS((void));
-extern int unbind_unix_command PARAMS((char *));
+extern int bind_keyseq_to_unix_command (char *);
+extern int bash_execute_unix_command (int, int);
+extern int print_unix_command_map (void);
+extern int unbind_unix_command (char *);
 
-extern char **bash_default_completion PARAMS((const char *, int, int, int, int));
+extern char **bash_default_completion (const char *, int, int, int, int);
 
-extern void set_directory_hook PARAMS((void));
+extern void set_directory_hook (void);
 
 /* Used by programmable completion code. */
-extern char *command_word_completion_function PARAMS((const char *, int));
-extern char *bash_groupname_completion_function PARAMS((const char *, int));
-extern char *bash_servicename_completion_function PARAMS((const char *, int));
+extern char *command_word_completion_function (const char *, int);
+extern char *bash_groupname_completion_function (const char *, int);
+extern char *bash_servicename_completion_function (const char *, int);
 
-extern char **get_hostname_list PARAMS((void));
-extern void clear_hostname_list PARAMS((void));
+extern char **get_hostname_list (void);
+extern void clear_hostname_list (void);
 
-extern char **bash_directory_completion_matches PARAMS((const char *));
-extern char *bash_dequote_text PARAMS((const char *));
+extern char **bash_directory_completion_matches (const char *);
+extern char *bash_dequote_text (const char *);
 
 #endif /* _BASHLINE_H_ */
index 2ea8ba971aad9409d48c15ec90f3745a71692cfd..110bb078356e146543db31193ec2845ce087922c 100644 (file)
@@ -4,7 +4,7 @@
 
 /* Original version by tromey@cns.caltech.edu,  Fri Feb  7 1992. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #include "shell.h"
 #include <readline/readline.h>
 
-static int _strcompare PARAMS((char **, char **));
+static int _strcompare (const char **, const char **);
 
 /* Find greatest common prefix of two strings. */
 static int
-string_gcd (s1, s2)
-     char *s1, *s2;
+string_gcd (char *s1, char *s2)
 {
   register int i;
 
@@ -63,9 +62,7 @@ string_gcd (s1, s2)
 }
 
 static char *
-really_munge_braces (array, real_start, real_end, gcd_zero)
-     char **array;
-     int real_start, real_end, gcd_zero;
+really_munge_braces (char **array, int real_start, int real_end, int gcd_zero)
 {
   int start, end, gcd;
   char *result, *subterm, *x;
@@ -150,8 +147,7 @@ really_munge_braces (array, real_start, real_end, gcd_zero)
 }
 
 static int
-_strcompare (s1, s2)
-     char **s1, **s2;
+_strcompare (const char **s1, const char **s2)
 {
   int result;
 
@@ -163,8 +159,7 @@ _strcompare (s1, s2)
 }
 
 static int
-hack_braces_completion (names)
-     char **names;
+hack_braces_completion (char **names)
 {
   register int i;
   char *temp;
@@ -187,8 +182,7 @@ hack_braces_completion (names)
 /* We handle quoting ourselves within hack_braces_completion, so we turn off
    rl_filename_quoting_desired and rl_filename_quoting_function. */
 int
-bash_brace_completion (count, ignore)
-     int count, ignore;
+bash_brace_completion (int count, int ignore)
 {
   rl_compignore_func_t *orig_ignore_func;
   rl_compentry_func_t *orig_entry_func;
index 0ab906964687aee01701813c8ba4a01a25ce3472..b21005e60c6f6c86f93e410af342a9264ba2ce75 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((alias_t *, int));
+static void print_alias (alias_t *, int);
 
 /* Hack the alias command in a Korn shell way. */
 int
index d40ffa23aaef90d34e9f50bf1d7cead3fec743c3..26b2c4b812ee7a59ec459a0c1e56a2635f9fa979 100644 (file)
@@ -1,6 +1,6 @@
 /* bashgetopt.c -- `getopt' for use by the builtins. */
 
-/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -48,9 +48,7 @@ WORD_LIST     *lcurrent = (WORD_LIST *)NULL;
 WORD_LIST      *loptend;       /* Points to the first non-option argument in the list */
 
 int
-internal_getopt(list, opts)
-WORD_LIST      *list;
-char           *opts;
+internal_getopt(WORD_LIST *list, char *opts)
 {
        register int c;
        register char *cp;
@@ -187,7 +185,7 @@ char                *opts;
  */
 
 void
-reset_internal_getopt ()
+reset_internal_getopt (void)
 {
        lhead = lcurrent = loptend = (WORD_LIST *)NULL;
        sp = 1;
index 79be3431503a64577bed7c8da28b07eb8ae3fa55..4f58b4ba5205d9ef71955b580bad4a4b00ca0c39 100644 (file)
@@ -1,6 +1,6 @@
 /* bashgetopt.h -- extern declarations for stuff defined in bashgetopt.c. */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -37,7 +37,7 @@ extern int list_opttype;
 extern WORD_LIST *lcurrent;
 extern WORD_LIST *loptend;
 
-extern int internal_getopt PARAMS((WORD_LIST *, char *));
-extern void reset_internal_getopt PARAMS((void));
+extern int internal_getopt (WORD_LIST *, char *);
+extern void reset_internal_getopt (void);
 
 #endif /* !__BASH_GETOPT_H */
index 53a65ac7c7b967d74f5860b77e12c142178f7821..c6c360460ac084b64d965a6464a69fa6eeb5e947 100644 (file)
@@ -1,7 +1,7 @@
 This file is bind.def, from which is created bind.c.
 It implements the builtin "bind" in Bash.
 
-Copyright (C) 1987-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -86,9 +86,9 @@ extern int errno;
 #include "bashgetopt.h"
 #include "common.h"
 
-static int query_bindings PARAMS((char *));
-static int unbind_command PARAMS((char *));
-static int unbind_keyseq PARAMS((char *));
+static int query_bindings (char *);
+static int unbind_command (char *);
+static int unbind_keyseq (char *);
 
 #define BIND_RETURN(x)  do { return_code = x; goto bind_exit; } while (0)
 
index b73ed5e5bdf1097d2427cb05192b02a905847c5f..ee593b502dd2e27a0e96bdab3663e2b4bf3add9e 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((void));
+static int check_loop_level (void);
 
 /* The depth of while's and until's. */
 int loop_level = 0;
index b87c5d9d258b82d95db9ea39d3afe5e3b66c5ff1..ba18f158e627ce982d43fbb580f12c601b5ab786 100644 (file)
@@ -56,13 +56,13 @@ extern int errno;
 
 extern const char * const bash_getcwd_errstr;
 
-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 bindpwd (int);
+static int setpwd (char *);
+static char *resetpwd (char *);
+static int change_to_directory (char *, int, int);
 
-static int cdxattr PARAMS((char *, char **));
-static void resetxattr PARAMS((void));
+static int cdxattr (char *, char **);
+static void resetxattr (void);
 
 /* Change this to 1 to get cd spelling correction by default. */
 int cdspelling = 0;
index 3efdbe6bcb434ac7679ec0674ea2e579015e533c..818556e66ad27ca6ae526b69d2ef62e65d00e67a 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((int, char *, size_t));
+extern size_t confstr (int, char *, size_t);
 #endif
 
 /* Run the commands mentioned in LIST without paying attention to shell
index 954eeabeac1ea3ece0523ad348a6f0f030d6216d..92ddfd40ca825e307b2ef9d18b24a703e6ecfe15 100644 (file)
@@ -1,6 +1,6 @@
 /* common.c - utility functions for all builtins */
 
-/* Copyright (C) 1987-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -85,7 +85,7 @@ sh_builtin_func_t *this_shell_builtin = (sh_builtin_func_t *)NULL;
    shell. */
 
 static void
-builtin_error_prolog ()
+builtin_error_prolog (void)
 {
   char *name;
 
@@ -142,7 +142,7 @@ builtin_warning (format, va_alist)
 
 /* Print a usage summary for the currently-executing builtin command. */
 void
-builtin_usage ()
+builtin_usage (void)
 {
   if (this_command_name && *this_command_name)
     fprintf (stderr, _("%s: usage: "), this_command_name);
@@ -153,8 +153,7 @@ builtin_usage ()
 /* Return if LIST is NULL else barf and jump to top_level.  Used by some
    builtins that do not accept arguments. */
 void
-no_args (list)
-     WORD_LIST *list;
+no_args (WORD_LIST *list)
 {
   if (list)
     {
@@ -167,8 +166,7 @@ no_args (list)
 /* Check that no options were given to the currently-executing builtin,
    and return 0 if there were options. */
 int
-no_options (list)
-     WORD_LIST *list;
+no_options (WORD_LIST *list)
 {
   int opt;
 
@@ -187,22 +185,19 @@ no_options (list)
 }
 
 void
-sh_needarg (s)
-     char *s;
+sh_needarg (char *s)
 {
   builtin_error (_("%s: option requires an argument"), s);
 }
 
 void
-sh_neednumarg (s)
-     char *s;
+sh_neednumarg (char *s)
 {
   builtin_error (_("%s: numeric argument required"), s);
 }
 
 void
-sh_notfound (s)
-     char *s;
+sh_notfound (char *s)
 {
   builtin_error (_("%s: not found"), s);
 }
@@ -210,29 +205,25 @@ sh_notfound (s)
 /* Function called when one of the builtin commands detects an invalid
    option. */
 void
-sh_invalidopt (s)
-     char *s;
+sh_invalidopt (char *s)
 {
   builtin_error (_("%s: invalid option"), s);
 }
 
 void
-sh_invalidoptname (s)
-     char *s;
+sh_invalidoptname (char *s)
 {
   builtin_error (_("%s: invalid option name"), s);
 }
 
 void
-sh_invalidid (s)
-     char *s;
+sh_invalidid (char *s)
 {
   builtin_error (_("`%s': not a valid identifier"), s);
 }
 
 void
-sh_invalidnum (s)
-     char *s;
+sh_invalidnum (char *s)
 {
   char *msg;
 
@@ -246,36 +237,31 @@ sh_invalidnum (s)
 }
 
 void
-sh_invalidsig (s)
-     char *s;
+sh_invalidsig (char *s)
 {
   builtin_error (_("%s: invalid signal specification"), s);
 }
 
 void
-sh_badpid (s)
-     char *s;
+sh_badpid (char *s)
 {
   builtin_error (_("`%s': not a pid or valid job spec"), s);
 }
 
 void
-sh_readonly (s)
-     const char *s;
+sh_readonly (const char *s)
 {
   builtin_error (_("%s: readonly variable"), s);
 }
 
 void
-sh_noassign (s)
-     const char *s;
+sh_noassign (const char *s)
 {
   internal_error (_("%s: cannot assign"), s);  /* XXX */
 }
 
 void
-sh_erange (s, desc)
-     char *s, *desc;
+sh_erange (char *s, char *desc)
 {
   if (s)
     builtin_error (_("%s: %s out of range"), s, desc ? desc : _("argument"));
@@ -285,15 +271,13 @@ sh_erange (s, desc)
 
 #if defined (JOB_CONTROL)
 void
-sh_badjob (s)
-     char *s;
+sh_badjob (char *s)
 {
   builtin_error (_("%s: no such job"), s);
 }
 
 void
-sh_nojobs (s)
-     char *s;
+sh_nojobs (char *s)
 {
   if (s)
     builtin_error (_("%s: no job control"), s);
@@ -304,8 +288,7 @@ sh_nojobs (s)
 
 #if defined (RESTRICTED_SHELL)
 void
-sh_restricted (s)
-     char *s;
+sh_restricted (char *s)
 {
   if (s)
     builtin_error (_("%s: restricted"), s);
@@ -315,14 +298,13 @@ sh_restricted (s)
 #endif
 
 void
-sh_notbuiltin (s)
-     char *s;
+sh_notbuiltin (char *s)
 {
   builtin_error (_("%s: not a shell builtin"), s);
 }
 
 void
-sh_wrerror ()
+sh_wrerror (void)
 {
 #if defined (DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS) && defined (EPIPE)
   if (errno != EPIPE)
@@ -331,8 +313,7 @@ sh_wrerror ()
 }
 
 void
-sh_ttyerror (set)
-     int set;
+sh_ttyerror (int set)
 {
   if (set)
     builtin_error (_("error setting terminal attributes: %s"), strerror (errno));
@@ -341,8 +322,7 @@ sh_ttyerror (set)
 }
 
 int
-sh_chkwrite (s)
-     int s;
+sh_chkwrite (int s)
 {
   QUIT;
   fflush (stdout);
@@ -367,9 +347,7 @@ sh_chkwrite (s)
    in the list in *IP, if IP is non-null.  A convenience function for
    loadable builtins; also used by `test'. */
 char **
-make_builtin_argv (list, ip)
-     WORD_LIST *list;
-     int *ip;
+make_builtin_argv (WORD_LIST *list, int *ip)
 {
   char **argv;
 
@@ -383,9 +361,7 @@ make_builtin_argv (list, ip)
    only discard the ones that are to be replaced.  Set POSPARAM_COUNT
    to the number of args assigned (length of LIST). */
 void
-remember_args (list, destructive)
-     WORD_LIST *list;
-     int destructive;
+remember_args (WORD_LIST *list, int destructive)
 {
   register int i;
 
@@ -423,8 +399,7 @@ remember_args (list, destructive)
 }
 
 void
-shift_args (times)
-     int times;
+shift_args (int times)
 {
   WORD_LIST *temp;
   int count;
@@ -456,7 +431,7 @@ shift_args (times)
 }
 
 int
-number_of_args ()
+number_of_args (void)
 {
 #if 0
   register WORD_LIST *list;
@@ -479,19 +454,19 @@ static int changed_dollar_vars;
 /* Have the dollar variables been reset to new values since we last
    checked? */
 int
-dollar_vars_changed ()
+dollar_vars_changed (void)
 {
   return (changed_dollar_vars);
 }
 
 void
-set_dollar_vars_unchanged ()
+set_dollar_vars_unchanged (void)
 {
   changed_dollar_vars = 0;
 }
 
 void
-set_dollar_vars_changed ()
+set_dollar_vars_changed (void)
 {
   if (variable_context)
     changed_dollar_vars |= ARGS_FUNC;
@@ -515,10 +490,7 @@ set_dollar_vars_changed ()
    current command; if FATAL is 0, return an indication of an invalid
    number by setting *NUMOK == 0 and return -1. */
 int
-get_numeric_arg (list, fatal, count)
-     WORD_LIST *list;
-     int fatal;
-     intmax_t *count;
+get_numeric_arg (WORD_LIST *list, int fatal, intmax_t *count)
 {
   char *arg;
 
@@ -552,8 +524,7 @@ get_numeric_arg (list, fatal, count)
 
 /* Get an eight-bit status value from LIST */
 int
-get_exitstat (list)
-     WORD_LIST *list;
+get_exitstat (WORD_LIST *list)
 {
   int status;
   intmax_t sval;
@@ -593,8 +564,7 @@ get_exitstat (list)
 /* Return the octal number parsed from STRING, or -1 to indicate
    that the string contained a bad number. */
 int
-read_octal (string)
-     char *string;
+read_octal (char *string)
 {
   int result, digits;
 
@@ -624,8 +594,7 @@ read_octal (string)
 char *the_current_working_directory = (char *)NULL;
 
 char *
-get_working_directory (for_whom)
-     char *for_whom;
+get_working_directory (char *for_whom)
 {
   if (no_symbolic_links)
     {
@@ -654,8 +623,7 @@ get_working_directory (for_whom)
 
 /* Make NAME our internal idea of the current working directory. */
 void
-set_working_directory (name)
-     char *name;
+set_working_directory (char *name)
 {
   FREE (the_current_working_directory);
   the_current_working_directory = savestring (name);
@@ -669,9 +637,7 @@ set_working_directory (name)
 
 #if defined (JOB_CONTROL)
 int
-get_job_by_name (name, flags)
-     const char *name;
-     int flags;
+get_job_by_name (const char *name, int flags)
 {
   register int i, wl, cl, match, job;
   register PROCESS *p;
@@ -724,8 +690,7 @@ get_job_by_name (name, flags)
 
 /* Return the job spec found in LIST. */
 int
-get_job_spec (list)
-     WORD_LIST *list;
+get_job_spec (WORD_LIST *list)
 {
   register char *word;
   int job, jflags;
@@ -773,9 +738,7 @@ get_job_spec (list)
  * NOTE:  `kill' calls this function with forcecols == 0
  */
 int
-display_signal_list (list, forcecols)
-     WORD_LIST *list;
-     int forcecols;
+display_signal_list (WORD_LIST *list, int forcecols)
 {
   register int i, column;
   char *name;
@@ -878,9 +841,7 @@ display_signal_list (list, forcecols)
    Return the address of the builtin.
    DISABLED_OKAY means find it even if the builtin is disabled. */
 struct builtin *
-builtin_address_internal (name, disabled_okay)
-     char *name;
-     int disabled_okay;
+builtin_address_internal (const char *name, int disabled_okay)
 {
   int hi, lo, mid, j;
 
@@ -918,8 +879,7 @@ builtin_address_internal (name, disabled_okay)
 
 /* Return the pointer to the function implementing builtin command NAME. */
 sh_builtin_func_t *
-find_shell_builtin (name)
-     char *name;
+find_shell_builtin (const char *name)
 {
   current_builtin = builtin_address_internal (name, 0);
   return (current_builtin ? current_builtin->function : (sh_builtin_func_t *)NULL);
@@ -927,8 +887,7 @@ find_shell_builtin (name)
 
 /* Return the address of builtin with NAME, whether it is enabled or not. */
 sh_builtin_func_t *
-builtin_address (name)
-     char *name;
+builtin_address (const char *name)
 {
   current_builtin = builtin_address_internal (name, 1);
   return (current_builtin ? current_builtin->function : (sh_builtin_func_t *)NULL);
@@ -937,8 +896,7 @@ builtin_address (name)
 /* Return the function implementing the builtin NAME, but only if it is a
    POSIX.2 special builtin. */
 sh_builtin_func_t *
-find_special_builtin (name)
-     char *name;
+find_special_builtin (const char *name)
 {
   current_builtin = builtin_address_internal (name, 0);
   return ((current_builtin && (current_builtin->flags & SPECIAL_BUILTIN)) ?
@@ -947,8 +905,7 @@ find_special_builtin (name)
 }
 
 static int
-shell_builtin_compare (sbp1, sbp2)
-     struct builtin *sbp1, *sbp2;
+shell_builtin_compare (struct builtin *sbp1, struct builtin *sbp2)
 {
   int result;
 
@@ -961,7 +918,7 @@ shell_builtin_compare (sbp1, sbp2)
 /* Sort the table of shell builtins so that the binary search will work
    in find_shell_builtin. */
 void
-initialize_shell_builtins ()
+initialize_shell_builtins (void)
 {
   qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin),
     (QSFUNC *)shell_builtin_compare);
@@ -969,7 +926,7 @@ initialize_shell_builtins ()
 
 #if !defined (HELP_BUILTIN)
 void
-builtin_help ()
+builtin_help (void)
 {
   printf ("%s: %s\n", this_command_name, _("help not available in this version"));
 }
@@ -983,10 +940,7 @@ builtin_help ()
 
 /* Assign NAME=VALUE, passing FLAGS to the assignment functions. */
 SHELL_VAR *
-builtin_bind_variable (name, value, flags)
-     char *name;
-     char *value;
-     int flags;
+builtin_bind_variable (char *name, char *value, int flags)
 {
   SHELL_VAR *v;
   int vflags, bindflags;
@@ -1016,10 +970,7 @@ builtin_bind_variable (name, value, flags)
 }
 
 SHELL_VAR *
-builtin_bind_var_to_int (name, val, flags)
-     char *name;
-     intmax_t val;
-     int flags;
+builtin_bind_var_to_int (char *name, intmax_t val, int flags)
 {
   SHELL_VAR *v;
 
@@ -1029,9 +980,7 @@ builtin_bind_var_to_int (name, val, flags)
 
 #if defined (ARRAY_VARS)
 SHELL_VAR *
-builtin_find_indexed_array (array_name, flags)
-     char *array_name;
-     int flags;
+builtin_find_indexed_array (char *array_name, int flags)
 {
   SHELL_VAR *entry;
 
@@ -1064,8 +1013,7 @@ builtin_find_indexed_array (array_name, flags)
 /* Like check_unbind_variable, but for use by builtins (only matters for
    error messages). */
 int
-builtin_unbind_variable (vname)
-     const char *vname;
+builtin_unbind_variable (const char *vname)
 {
   SHELL_VAR *v;
 
@@ -1084,9 +1032,7 @@ builtin_unbind_variable (vname)
 }
 
 int
-builtin_arrayref_flags (w, baseflags)
-     WORD_DESC *w;
-     int baseflags;
+builtin_arrayref_flags (WORD_DESC *w, int baseflags)
 {
   char *t;
   int vflags;
@@ -1117,8 +1063,7 @@ builtin_arrayref_flags (w, baseflags)
 
 #if defined (ARRAY_VARS)
 int
-set_expand_once (nval, uwp)
-     int nval, uwp;
+set_expand_once (int nval, int uwp)
 {
   int oa;
 
index a170f8fcff1fb6d96c58790216b0df1eb012bf40..72586d8ed73feaf8df100f755c42e2f90f0345ba 100644 (file)
@@ -81,163 +81,163 @@ do { \
 #define MAX_ATTRIBUTES         16
 
 /* Functions from common.c */
-extern void builtin_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
-extern void builtin_warning PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
-extern void builtin_usage PARAMS((void));
-extern void no_args PARAMS((WORD_LIST *));
-extern int no_options PARAMS((WORD_LIST *));
+extern void builtin_error (const char *, ...)  __attribute__((__format__ (printf, 1, 2)));
+extern void builtin_warning (const char *, ...)  __attribute__((__format__ (printf, 1, 2)));
+extern void builtin_usage (void);
+extern void no_args (WORD_LIST *);
+extern int no_options (WORD_LIST *);
 
 /* common error message functions */
-extern void sh_needarg PARAMS((char *));
-extern void sh_neednumarg PARAMS((char *));
-extern void sh_notfound PARAMS((char *));
-extern void sh_invalidopt PARAMS((char *));
-extern void sh_invalidoptname PARAMS((char *));
-extern void sh_invalidid PARAMS((char *));
-extern void sh_invalidnum PARAMS((char *));
-extern void sh_invalidsig PARAMS((char *));
-extern void sh_readonly PARAMS((const char *));
-extern void sh_noassign PARAMS((const char *));
-extern void sh_erange PARAMS((char *, char *));
-extern void sh_badpid PARAMS((char *));
-extern void sh_badjob PARAMS((char *));
-extern void sh_nojobs PARAMS((char *));
-extern void sh_restricted PARAMS((char *));
-extern void sh_notbuiltin PARAMS((char *));
-extern void sh_wrerror PARAMS((void));
-extern void sh_ttyerror PARAMS((int));
-extern int sh_chkwrite PARAMS((int));
-
-extern char **make_builtin_argv PARAMS((WORD_LIST *, int *));
-extern void remember_args PARAMS((WORD_LIST *, int));
-extern void shift_args PARAMS((int));
-extern int number_of_args PARAMS((void));
-
-extern int dollar_vars_changed PARAMS((void));
-extern void set_dollar_vars_unchanged PARAMS((void));
-extern void set_dollar_vars_changed PARAMS((void));
-
-extern int get_numeric_arg PARAMS((WORD_LIST *, int, intmax_t *));
-extern int get_exitstat PARAMS((WORD_LIST *));
-extern int read_octal PARAMS((char *));
+extern void sh_needarg (char *);
+extern void sh_neednumarg (char *);
+extern void sh_notfound (char *);
+extern void sh_invalidopt (char *);
+extern void sh_invalidoptname (char *);
+extern void sh_invalidid (char *);
+extern void sh_invalidnum (char *);
+extern void sh_invalidsig (char *);
+extern void sh_readonly (const char *);
+extern void sh_noassign (const char *);
+extern void sh_erange (char *, char *);
+extern void sh_badpid (char *);
+extern void sh_badjob (char *);
+extern void sh_nojobs (char *);
+extern void sh_restricted (char *);
+extern void sh_notbuiltin (char *);
+extern void sh_wrerror (void);
+extern void sh_ttyerror (int);
+extern int sh_chkwrite (int);
+
+extern char **make_builtin_argv (WORD_LIST *, int *);
+extern void remember_args (WORD_LIST *, int);
+extern void shift_args (int);
+extern int number_of_args (void);
+
+extern int dollar_vars_changed (void);
+extern void set_dollar_vars_unchanged (void);
+extern void set_dollar_vars_changed (void);
+
+extern int get_numeric_arg (WORD_LIST *, int, intmax_t *);
+extern int get_exitstat (WORD_LIST *);
+extern int read_octal (char *);
 
 /* Keeps track of the current working directory. */
 extern char *the_current_working_directory;
-extern char *get_working_directory PARAMS((char *));
-extern void set_working_directory PARAMS((char *));
+extern char *get_working_directory (char *);
+extern void set_working_directory (char *);
 
 #if defined (JOB_CONTROL)
-extern int get_job_by_name PARAMS((const char *, int));
-extern int get_job_spec PARAMS((WORD_LIST *));
+extern int get_job_by_name (const char *, int);
+extern int get_job_spec (WORD_LIST *);
 #endif
-extern int display_signal_list PARAMS((WORD_LIST *, int));
+extern int display_signal_list (WORD_LIST *, int);
 
 /* It's OK to declare a function as returning a Function * without
    providing a definition of what a `Function' is. */
-extern struct builtin *builtin_address_internal PARAMS((char *, int));
-extern sh_builtin_func_t *find_shell_builtin PARAMS((char *));
-extern sh_builtin_func_t *builtin_address PARAMS((char *));
-extern sh_builtin_func_t *find_special_builtin PARAMS((char *));
-extern void initialize_shell_builtins PARAMS((void));
+extern struct builtin *builtin_address_internal (const char *, int);
+extern sh_builtin_func_t *find_shell_builtin (const char *);
+extern sh_builtin_func_t *builtin_address (const char *);
+extern sh_builtin_func_t *find_special_builtin (const char *);
+extern void initialize_shell_builtins (void);
 
 #if defined (ARRAY_VARS)
-extern int set_expand_once PARAMS((int, int));
+extern int set_expand_once (int, int);
 #endif
 
 /* Functions from exit.def */
-extern void bash_logout PARAMS((void));
+extern void bash_logout (void);
 
 /* Functions from getopts.def */
-extern void getopts_reset PARAMS((int));
+extern void getopts_reset (int);
 
 /* Functions from help.def */
-extern void builtin_help PARAMS((void));
+extern void builtin_help (void);
 
 /* Functions from read.def */
-extern void read_tty_cleanup PARAMS((void));
-extern int read_tty_modified PARAMS((void));
+extern void read_tty_cleanup (void);
+extern int read_tty_modified (void);
 
-extern int read_builtin_timeout PARAMS((int));
-extern void check_read_timeout PARAMS((void));
+extern int read_builtin_timeout (int);
+extern void check_read_timeout (void);
 
 /* Functions from set.def */
-extern int minus_o_option_value PARAMS((char *));
-extern void list_minus_o_opts PARAMS((int, int));
-extern char **get_minus_o_opts PARAMS((void));
-extern int set_minus_o_option PARAMS((int, char *));
+extern int minus_o_option_value (char *);
+extern void list_minus_o_opts (int, int);
+extern char **get_minus_o_opts (void);
+extern int set_minus_o_option (int, char *);
 
-extern void set_shellopts PARAMS((void));
-extern void parse_shellopts PARAMS((char *));
-extern void initialize_shell_options PARAMS((int));
+extern void set_shellopts (void);
+extern void parse_shellopts (char *);
+extern void initialize_shell_options (int);
 
-extern void reset_shell_options PARAMS((void));
+extern void reset_shell_options (void);
 
-extern char *get_current_options PARAMS((void));
-extern void set_current_options PARAMS((const char *));
+extern char *get_current_options (void);
+extern void set_current_options (const char *);
 
 /* Functions from shopt.def */
-extern void reset_shopt_options PARAMS((void));
-extern char **get_shopt_options PARAMS((void));
+extern void reset_shopt_options (void);
+extern char **get_shopt_options (void);
 
-extern int shopt_setopt PARAMS((char *, int));
-extern int shopt_listopt PARAMS((char *, int));
+extern int shopt_setopt (char *, int);
+extern int shopt_listopt (char *, int);
 
-extern int set_login_shell PARAMS((char *, int));
+extern int set_login_shell (char *, int);
 
-extern void set_bashopts PARAMS((void));
-extern void parse_bashopts PARAMS((char *));
-extern void initialize_bashopts PARAMS((int));
+extern void set_bashopts (void);
+extern void parse_bashopts (char *);
+extern void initialize_bashopts (int);
 
-extern void set_compatibility_opts PARAMS((void));
+extern void set_compatibility_opts (void);
 
 /* Functions from type.def */
-extern int describe_command PARAMS((char *, int));
+extern int describe_command (char *, int);
 
 /* Functions from setattr.def */
-extern int set_or_show_attributes PARAMS((WORD_LIST *, int, int));
-extern int show_all_var_attributes PARAMS((int, int));
-extern int show_local_var_attributes PARAMS((int, int));
-extern int show_var_attributes PARAMS((SHELL_VAR *, int, int));
-extern int show_name_attributes PARAMS((char *, int));
-extern int show_localname_attributes PARAMS((char *, int));
-extern int show_func_attributes PARAMS((char *, int));
-extern void set_var_attribute PARAMS((char *, int, int));
-extern int var_attribute_string PARAMS((SHELL_VAR *, int, char *));
+extern int set_or_show_attributes (WORD_LIST *, int, int);
+extern int show_all_var_attributes (int, int);
+extern int show_local_var_attributes (int, int);
+extern int show_var_attributes (SHELL_VAR *, int, int);
+extern int show_name_attributes (char *, int);
+extern int show_localname_attributes (char *, int);
+extern int show_func_attributes (char *, int);
+extern void set_var_attribute (char *, int, int);
+extern int var_attribute_string (SHELL_VAR *, int, char *);
 
 /* Functions from pushd.def */
-extern char *get_dirstack_from_string PARAMS((char *));
-extern char *get_dirstack_element PARAMS((intmax_t, int));
-extern void set_dirstack_element PARAMS((intmax_t, int, char *));
-extern WORD_LIST *get_directory_stack PARAMS((int));
+extern char *get_dirstack_from_string (char *);
+extern char *get_dirstack_element (intmax_t, int);
+extern void set_dirstack_element (intmax_t, int, char *);
+extern WORD_LIST *get_directory_stack (int);
 
 /* Functions from evalstring.c */
-extern int parse_and_execute PARAMS((char *, const char *, int));
-extern int evalstring PARAMS((char *, const char *, int));
-extern void parse_and_execute_cleanup PARAMS((int));
-extern int parse_string PARAMS((char *, const char *, int, COMMAND **, char **));
-extern int should_suppress_fork PARAMS((COMMAND *));
-extern int can_optimize_connection PARAMS((COMMAND *));
-extern int can_optimize_cat_file PARAMS((COMMAND *));
-extern void optimize_connection_fork PARAMS((COMMAND *));
-extern void optimize_subshell_command PARAMS((COMMAND *));
-extern void optimize_shell_function PARAMS((COMMAND *));
+extern int parse_and_execute (char *, const char *, int);
+extern int evalstring (char *, const char *, int);
+extern void parse_and_execute_cleanup (int);
+extern int parse_string (char *, const char *, int, COMMAND **, char **);
+extern int should_suppress_fork (COMMAND *);
+extern int can_optimize_connection (COMMAND *);
+extern int can_optimize_cat_file (COMMAND *);
+extern void optimize_connection_fork (COMMAND *);
+extern void optimize_subshell_command (COMMAND *);
+extern void optimize_shell_function (COMMAND *);
 
 /* Functions from evalfile.c */
-extern int maybe_execute_file PARAMS((const char *, int));
-extern int force_execute_file PARAMS((const char *, int));
-extern int source_file PARAMS((const char *, int));
-extern int fc_execute_file PARAMS((const char *));
+extern int maybe_execute_file (const char *, int);
+extern int force_execute_file (const char *, int);
+extern int source_file (const char *, int);
+extern int fc_execute_file (const char *);
 
 /* variables from common.c */
 extern sh_builtin_func_t *this_shell_builtin;
 extern sh_builtin_func_t *last_shell_builtin;
 
-extern SHELL_VAR *builtin_bind_variable PARAMS((char *, char *, int));
-extern SHELL_VAR *builtin_bind_var_to_int PARAMS((char *, intmax_t, int));
-extern int builtin_unbind_variable PARAMS((const char *));
+extern SHELL_VAR *builtin_bind_variable (char *, char *, int);
+extern SHELL_VAR *builtin_bind_var_to_int (char *, intmax_t, int);
+extern int builtin_unbind_variable (const char *);
 
-extern SHELL_VAR *builtin_find_indexed_array PARAMS((char *, int));
-extern int builtin_arrayref_flags PARAMS((WORD_DESC *, int));
+extern SHELL_VAR *builtin_find_indexed_array (char *, int);
+extern int builtin_arrayref_flags (WORD_DESC *, int);
 
 /* variables from evalfile.c */
 extern int sourcelevel;
index 6d600efb5f4cdfba911b0e3a39680b35e04bb21e..e060243bb875072649f290f1ed0d19a94baa75d6 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -84,23 +84,23 @@ struct _optflags {
   int Iflag;
 };
 
-static int find_compact PARAMS((char *));
-static int find_compopt PARAMS((char *));
+static int find_compact (char *);
+static int find_compopt (char *);
 
-static int build_actions PARAMS((WORD_LIST *, struct _optflags *, unsigned long *, unsigned long *));
+static int build_actions (WORD_LIST *, struct _optflags *, unsigned long *, unsigned long *);
 
-static int remove_cmd_completions PARAMS((WORD_LIST *));
+static int remove_cmd_completions (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 int print_one_completion (char *, COMPSPEC *);
+static int print_compitem (BUCKET_CONTENTS *);
+static void print_compopts (const char *, COMPSPEC *, int);
+static void print_all_completions (void);
+static int print_cmd_completions (WORD_LIST *);
 
-static void print_compoptions PARAMS((unsigned long, int));
-static void print_compactions PARAMS((unsigned long));
-static void print_arg PARAMS((const char *, const char *, int));
-static void print_cmd_name PARAMS((const char *));
+static void print_compoptions (unsigned long, int);
+static void print_compactions (unsigned long);
+static void print_arg (const char *, const char *, int);
+static void print_cmd_name (const char *);
 
 static char *Garg, *Warg, *Parg, *Sarg, *Xarg, *Farg, *Carg;
 
index 9a914f77aad54d4d8d92280280ba706802f2bc66..ac9a3b5dda062fe0694bfffd008311dc33b956b3 100644 (file)
@@ -1,7 +1,7 @@
 This file is declare.def, from which is created declare.c.
 It implements the builtins "declare" and "local" in Bash.
 
-Copyright (C) 1987-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -91,11 +91,11 @@ $END
 #include "builtext.h"
 #include "bashgetopt.h"
 
-static SHELL_VAR *declare_find_variable PARAMS((const char *, int, int));
-static char *declare_build_newname PARAMS((char *, char *, int, char *, int));
-static char *declare_transform_name PARAMS((char *, int, int));
+static SHELL_VAR *declare_find_variable (const char *, int, int);
+static char *declare_build_newname (char *, char *, int, char *, int);
+static char *declare_transform_name (char *, int, int);
 
-static int declare_internal PARAMS((register WORD_LIST *, int));
+static int declare_internal (register WORD_LIST *, int);
 
 /* Declare or change variable attributes. */
 int
index 27d341a6f8c616caba033efc27a33fc72cd7e071..f3b8ec03cf224fef9fa25c29b16c272599efd8dd 100644 (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-2021 Free Software Foundation, Inc. 
+Copyright (C) 1987-2022 Free Software Foundation, Inc. 
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -85,13 +85,13 @@ $END
 #define SFLAG  0x20
 
 #if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
-static int dyn_load_builtin PARAMS((WORD_LIST *, int, char *));
+static int dyn_load_builtin (WORD_LIST *, int, char *);
 #endif
 
 #if defined (HAVE_DLCLOSE)
-static int dyn_unload_builtin PARAMS((char *));
-static void delete_builtin PARAMS((struct builtin *));
-static int local_dlclose PARAMS((void *));
+static int dyn_unload_builtin (char *);
+static void delete_builtin (struct builtin *);
+static int local_dlclose (void *);
 #endif
 
 #define STRUCT_SUFFIX  "_struct"
@@ -99,8 +99,8 @@ static int local_dlclose PARAMS((void *));
 #define LOAD_SUFFIX    "_builtin_load"
 #define UNLOAD_SUFFIX  "_builtin_unload"
 
-static void list_some_builtins PARAMS((int));
-static int enable_shell_command PARAMS((char *, int));
+static void list_some_builtins (int);
+static int enable_shell_command (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
index 8f0e670a576cefe2376343311e4723aa3a80b5a1..071947a574799254508a19007975d6a819fb1dc7 100644 (file)
@@ -73,9 +73,7 @@ extern int errno;
 int sourcelevel = 0;
 
 static int
-_evalfile (filename, flags)
-     const char *filename;
-     int flags;
+_evalfile (const char *filename, int flags)
 {
   volatile int old_interactive;
   procenv_t old_return_catch;
@@ -316,9 +314,7 @@ file_error_and_exit:
 }
 
 int
-maybe_execute_file (fname, force_noninteractive)
-     const char *fname;
-     int force_noninteractive;
+maybe_execute_file (const char *fname, int force_noninteractive)
 {
   char *filename;
   int result, flags;
@@ -333,9 +329,7 @@ maybe_execute_file (fname, force_noninteractive)
 }
 
 int
-force_execute_file (fname, force_noninteractive)
-     const char *fname;
-     int force_noninteractive;
+force_execute_file (const char *fname, int force_noninteractive)
 {
   char *filename;
   int result, flags;
@@ -351,8 +345,7 @@ force_execute_file (fname, force_noninteractive)
 
 #if defined (HISTORY)
 int
-fc_execute_file (filename)
-     const char *filename;
+fc_execute_file (const char *filename)
 {
   int flags;
 
@@ -365,9 +358,7 @@ fc_execute_file (filename)
 #endif /* HISTORY */
 
 int
-source_file (filename, sflags)
-     const char *filename;
-     int sflags;
+source_file (const char *filename, int sflags)
 {
   int flags, rval;
 
index 6f752eda7aff3494b00d1405c7ca801855e4ecf4..29ee1dfe3212577bd41fb9d91a15ff2e5c6b8fa6 100644 (file)
@@ -63,7 +63,7 @@ extern int errno;
 
 int parse_and_execute_level = 0;
 
-static int cat_file PARAMS((REDIRECT *));
+static int cat_file (REDIRECT *);
 
 #define PE_TAG "parse_and_execute top"
 #define PS_TAG "parse_string top"
index 9c85bc582726e4f9976a0e39912a0a14ee3a160c..eca5d82e81747f439f98fe25890bdd6468f1e814 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((WORD_LIST *));
+static int exit_or_logout (WORD_LIST *);
 static int sourced_logout;
 
 int
index 9b8a997de34cbed40abf43b8539452779b66e991..5070be86d51f977d2a8f0c17a99db07f6b24c354 100644 (file)
@@ -1,7 +1,7 @@
 This file is fc.def, from which is created fc.c.
 It implements the builtin "fc" in Bash.
 
-Copyright (C) 1987-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -94,9 +94,9 @@ extern int errno;
 #define HN_LISTING     0x01
 #define HN_FIRST       0x02
 
-extern int unlink PARAMS((const char *));
+extern int unlink (const char *);
 
-extern FILE *sh_mktmpfp PARAMS((char *, int, char **));
+extern FILE *sh_mktmpfp (char *, int, char **);
 
 extern int suppress_debug_trap_verbose;
 
@@ -154,14 +154,14 @@ typedef struct repl {
                } \
        } while (0)
 
-static char *fc_dosubs PARAMS((char *, REPL *));
-static char *fc_gethist PARAMS((char *, HIST_ENTRY **, int));
-static int fc_gethnum PARAMS((char *, HIST_ENTRY **, int));
-static int fc_number PARAMS((WORD_LIST *));
-static void fc_replhist PARAMS((char *));
+static char *fc_dosubs (char *, REPL *);
+static char *fc_gethist (char *, HIST_ENTRY **, int);
+static int fc_gethnum (char *, HIST_ENTRY **, int);
+static int fc_number (WORD_LIST *);
+static void fc_replhist (char *);
 #ifdef INCLUDE_UNUSED
-static char *fc_readline PARAMS((FILE *));
-static void fc_addhist PARAMS((char *));
+static char *fc_readline (FILE *);
+static void fc_addhist (char *);
 #endif
 
 static void
index 0fb53223d447cbc93328337ec5b4e8809c2d4e7d..2b62c351016158c527eb7b6562103c4d98437623 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((WORD_LIST *, int));
+static int fg_bg (WORD_LIST *, int);
 
 /* How to bring a job into the foreground. */
 int
index d27d306b1a76567a9d59733b703f7c7a95bc258b..f6a8039db0ac1dc44b5bec786a5b535075ed601c 100644 (file)
@@ -1,6 +1,6 @@
 /* gen-helpfiles - create files containing builtin help text */
 
-/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -99,7 +99,7 @@ char *helpfile_directory;
 
 /* Forward declarations. */
 
-int write_helpfiles PARAMS((struct builtin *));
+int write_helpfiles (struct builtin *);
 
 /* For each file mentioned on the command line, process it and
    write the information to STRUCTFILE and EXTERNFILE, while
index 9529bc37d97c33e17a203fc2d3ab9f2cd97b1052..d911877ec2d2f1d1a6ee651f29694a021a9bbd81 100644 (file)
@@ -1,6 +1,6 @@
 /* getopt.c - getopt for Bash.  Used by the getopt builtin. */
 
-/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -111,10 +111,7 @@ int sh_badopt = 0;
 #define NEEDARG(x) fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], x)
 
 int
-sh_getopt (argc, argv, optstring)
-     int argc;
-     char *const *argv;
-     const char *optstring;
+sh_getopt (int argc, char *const *argv, const char *optstring)
 {
   char c, *temp;
 
@@ -216,8 +213,7 @@ sh_getopt (argc, argv, optstring)
 }
 
 void
-sh_getopt_restore_state (argv)
-     char **argv;
+sh_getopt_restore_state (char **argv)
 {
   if (nextchar)
     nextchar = argv[sh_curopt] + sh_charindex;
@@ -233,14 +229,13 @@ sh_getopt_alloc_istate ()
 }
 
 void
-sh_getopt_dispose_istate (gs)
-     sh_getopt_state_t *gs;
+sh_getopt_dispose_istate (sh_getopt_state_t *gs)
 {
   free (gs);
 }
 
 sh_getopt_state_t *
-sh_getopt_save_istate ()
+sh_getopt_save_istate (void)
 {
   sh_getopt_state_t *ret;
 
@@ -257,8 +252,7 @@ sh_getopt_save_istate ()
 }
 
 void
-sh_getopt_restore_istate (state)
-     sh_getopt_state_t *state;
+sh_getopt_restore_istate (sh_getopt_state_t *state)
 {
   sh_optarg = state->gs_optarg;
   sh_optind = state->gs_optind;
@@ -271,8 +265,7 @@ sh_getopt_restore_istate (state)
 
 #if 0
 void
-sh_getopt_debug_restore_state (argv)
-     char **argv;
+sh_getopt_debug_restore_state (char **argv)
 {
   if (nextchar && nextchar != argv[sh_curopt] + sh_charindex)
     {
@@ -288,9 +281,7 @@ sh_getopt_debug_restore_state (argv)
    the above definition of `sh_getopt'.  */
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
   int c;
   int digit_sh_optind = 0;
index fd978597594e7c08bceda2219d67223855fe6379..a17bc0ba9b94cac6161fc19081383b30bb81ecf4 100644 (file)
@@ -1,6 +1,6 @@
 /* getopt.h - declarations for getopt. */
 
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2022 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 PARAMS((int, char *const *, const char *));
+extern int sh_getopt (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 PARAMS((char **));
+extern void sh_getopt_restore_state (char **);
 
-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_alloc_istate (void);
+extern void sh_getopt_dispose_istate (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 *));
+extern sh_getopt_state_t *sh_getopt_save_istate (void);
+extern void sh_getopt_restore_istate (sh_getopt_state_t *);
 
 #endif /* _SH_GETOPT_H */
index 4c39c474cca04c679f93ff143d51fef6eea14300..fc4142b092e87ad01674fd37d3c9e2b7efdf98d5 100644 (file)
@@ -1,7 +1,7 @@
 This file is getopts.def, from which is created getopts.c.
 It implements the builtin "getopts" in Bash.
 
-Copyright (C) 1987-2019 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -86,9 +86,9 @@ $END
 #define G_INVALID_OPT  -2
 #define G_ARG_MISSING  -3
 
-static int getopts_unbind_variable PARAMS((char *));
-static int getopts_bind_variable PARAMS((char *, char *));
-static int dogetopts PARAMS((int, char **));
+static int getopts_unbind_variable (char *);
+static int getopts_bind_variable (char *, char *);
+static int dogetopts (int, char **);
 
 /* getopts_reset is magic code for when OPTIND is reset.  N is the
    value that has just been assigned to OPTIND. */
index 03ae5474d378c189bc2d4c50cb994d7b0a769fa8..323b8a6576ea60f591439322328163fd2bf46976 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 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));
+static int add_hashed_command (char *, int);
+static int print_hash_info (BUCKET_CONTENTS *);
+static int print_portable_hash_info (BUCKET_CONTENTS *);
+static int print_hashed_commands (int);
+static int list_hashed_filename_targets (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
index 346d93fe8e139be04b3aef75535c1f2215cc75da..cda8f0adae87cb507906bfbc1eaae267294f1772 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 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));
+static void show_builtin_command_help (void);
+static int open_helpfile (char *);
+static void show_desc (char *, int);
+static void show_manpage (char *, int);
+static void show_longdoc (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
index 6918d8a42cec5730284da1ad8210818ecf404fc6..b10d0f481698a63a47dba792d55d34de4c87c78d 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 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 *));
+static char *histtime (HIST_ENTRY *, const char *);
+static int display_history (WORD_LIST *);
+static void push_history (WORD_LIST *);
+static int expand_and_print_history (WORD_LIST *);
 
 #define AFLAG  0x01
 #define RFLAG  0x02
index e2f2ff797b1b43050288062c82138288b1054a62..e0cee07d1da4755092075676650d774422db9a74 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((WORD_LIST *));
+static int execute_list_with_replacements (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.
index c655092e7be3e418d12a252f99317bb17372223d..c8938714ca08c03489ba4bdab55dfc550a0479e9 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((pid_t, int));
+static void kill_error (pid_t, int);
 
 #if !defined (CONTINUE_AFTER_KILL_ERROR)
 #  define CONTINUE_OR_FAIL return (EXECUTION_FAILURE)
index 4ddd723382bd8b985518a99b1093e9f516165d1c..5f112b0a9ce6eeb64d61f6863202240fa7c4885d 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 2008-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -92,7 +92,7 @@ extern int errno;
 
 #if defined (ARRAY_VARS)
 
-static int run_callback PARAMS((const char *, unsigned int, const char *));
+static int run_callback (const char *, unsigned int, const char *);
 
 #define DEFAULT_ARRAY_NAME     "MAPFILE"
 #define DEFAULT_VARIABLE_NAME  "MAPLINE"       /* not used right now */
index f505ebde17e5aab626095e1af250e93a2f80076c..15e1ed4d778f67e4a476a635c87856802c407a40 100644 (file)
@@ -462,7 +462,7 @@ array_free (array)
 
 /* The definition of a function. */
 typedef int Function ();
-typedef int mk_handler_func_t PARAMS((char *, DEF_FILE *, char *));
+typedef int mk_handler_func_t (char *, DEF_FILE *, char *);
 
 /* Structure handles processor directives. */
 typedef struct {
@@ -470,14 +470,14 @@ typedef struct {
   mk_handler_func_t *function;
 } HANDLER_ENTRY;
 
-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 *));
+extern int builtin_handler (char *, DEF_FILE *, char *);
+extern int function_handler (char *, DEF_FILE *, char *);
+extern int short_doc_handler (char *, DEF_FILE *, char *);
+extern int comment_handler (char *, DEF_FILE *, char *);
+extern int depends_on_handler (char *, DEF_FILE *, char *);
+extern int produces_handler (char *, DEF_FILE *, char *);
+extern int end_handler (char *, DEF_FILE *, char *);
+extern int docname_handler (char *, DEF_FILE *, char *);
 
 HANDLER_ENTRY handlers[] = {
   { "BUILTIN", builtin_handler },
@@ -1258,7 +1258,7 @@ write_builtins (defs, structfile, externfile)
              if (externfile)
                {
                  if (builtin->function)
-                   fprintf (externfile, "extern int %s PARAMS((WORD_LIST *));\n",
+                   fprintf (externfile, "extern int %s (WORD_LIST *);\n",
                             builtin->function);
 
                  fprintf (externfile, "extern char * const %s_doc[];\n",
index 67e984869fc1d1a6adfcf40a47957dc59b4071ba..f9b9f5b4035036e52f3814f1e805f5eeb7c7556d 100644 (file)
@@ -193,25 +193,25 @@ extern int errno;
 extern time_t shell_start_time;
 
 #if !HAVE_ASPRINTF
-extern int asprintf PARAMS((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
+extern int asprintf (char **, const char *, ...) __attribute__((__format__ (printf, 2, 3)));
 #endif
 
 #if !HAVE_VSNPRINTF
-extern int vsnprintf PARAMS((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
+extern int vsnprintf (char *, size_t, const char *, va_list) __attribute__((__format__ (printf, 3, 0)));
 #endif
 
-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));
+static void printf_erange (char *);
+static int printstr (char *, char *, int, int, int);
+static int tescape (char *, char *, int *, int *);
+static char *bexpand (char *, int, int *, int *);
+static char *vbadd (char *, int);
+static int vbprintf (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
+static char *mklong (char *, char *, size_t);
+static int getchr (void);
+static char *getstr (void);
+static int  getint (void);
+static intmax_t getintmax (void);
+static uintmax_t getuintmax (void);
 
 #if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && !defined(STRTOLD_BROKEN)
 typedef long double floatmax_t;
@@ -224,10 +224,10 @@ typedef double floatmax_t;
 #  define FLOATMAX_CONV        ""
 #  define strtofltmax  strtod
 #endif
-static double getdouble PARAMS((void));
-static floatmax_t getfloatmax PARAMS((void));
+static double getdouble (void);
+static floatmax_t getfloatmax (void);
 
-static intmax_t asciicode PARAMS((void));
+static intmax_t asciicode (void);
 
 static WORD_LIST *garglist, *orig_arglist;
 static int retval;
index e5840e43724bc58b30dcbbe97ea409187070e98c..13abe2ca9ea0e1a13c083220714b70f141695fd5 100644 (file)
@@ -1,6 +1,6 @@
 /* psize-posix - display the pipe size on a Posix system. */
 
-/* Copyright 2008,2009 Free Software Foundation, Inc.
+/* Copyright 2008,2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-main(c, v)
-int    c;
-char   **v;
+main(int c, char **v)
 {
        char    *p;
        long    l;
index 30881fb3f6b3c83045f714857787eb8d75d9a7b9..d499a1de6465921646374c692cfb3853e08a2b38 100644 (file)
@@ -1,6 +1,6 @@
 /* psize.c - Find pipe size. */
 
-/* Copyright (C) 1987, 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1987, 1991, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -48,17 +48,14 @@ extern int errno;
 int nw;
 
 sighandler
-sigpipe (sig)
-     int sig;
+sigpipe (int sig)
 {
   fprintf (stderr, "%d\n", nw);
   exit (0);
 }
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
   char buf[128];
   register int i;
index 829f827d5dc7c3d2e2cd7852e6e0b5224b9f6d49..96fcffd503c3b85d0e55475621204f2bc14284f6 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 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 *));
+static void pushd_error (int, char *);
+static void clear_directory_stack (void);
+static int cd_to_string (char *);
+static int change_to_temp (char *);
+static void add_dirstack_element (char *);
+static int get_dirstack_index (intmax_t, int, int *);
 
 #define NOCD           0x01
 #define ROTATE         0x02
index 833c73bdacf61ba3d0496f6c31637d881879cb92..81542ec7e796492a59fb30400a3574c686b43e44 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -121,21 +121,21 @@ struct ttsave
 };
 
 #if defined (READLINE)
-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 *));
-static void set_readline_timeout PARAMS((sh_timer *t, time_t, long));
+static void reset_attempted_completion_function (char *);
+static int set_itext (void);
+static char *edit_line (char *, char *);
+static void set_eol_delim (int);
+static void reset_eol_delim (char *);
+static void set_readline_timeout (sh_timer *t, time_t, long);
 #endif
-static SHELL_VAR *bind_read_variable PARAMS((char *, char *, int));
+static SHELL_VAR *bind_read_variable (char *, char *, int);
 #if defined (HANDLE_MULTIBYTE)
-static int read_mbchar PARAMS((int, char *, int, int, int));
+static int read_mbchar (int, char *, int, int, int);
 #endif
-static void ttyrestore PARAMS((struct ttsave *));
+static void ttyrestore (struct ttsave *);
 
-static sighandler sigalrm PARAMS((int));
-static void reset_timeout PARAMS((void));
+static sighandler sigalrm (int);
+static void reset_timeout (void);
 
 /* Try this to see what the rest of the shell can do with the information. */
 sh_timer *read_timeout;
index c0d63c5b4667c126b1c812f38ed55243eddd0ba0..236d734570f1a8eb4a9afc7f5bfb56e32c0a69e8 100644 (file)
@@ -151,24 +151,24 @@ Exit Status:
 Returns success unless an invalid option is given.
 $END
 
-typedef int setopt_set_func_t PARAMS((int, char *));
-typedef int setopt_get_func_t PARAMS((char *));
+typedef int setopt_set_func_t (int, char *);
+typedef int setopt_get_func_t (char *);
 
-static int find_minus_o_option PARAMS((char *));
+static int find_minus_o_option (char *);
 
-static void print_minus_o_option PARAMS((char *, int, int));
-static void print_all_shell_variables PARAMS((void));
+static void print_minus_o_option (char *, int, int);
+static void print_all_shell_variables (void);
 
-static int set_ignoreeof PARAMS((int, char *));
-static int set_posix_mode PARAMS((int, char *));
+static int set_ignoreeof (int, char *);
+static int set_posix_mode (int, char *);
 
 #if defined (READLINE)
-static int set_edit_mode PARAMS((int, char *));
-static int get_edit_mode PARAMS((char *));
+static int set_edit_mode (int, char *);
+static int get_edit_mode (char *);
 #endif
 
 #if defined (HISTORY)
-static int bash_set_history PARAMS((int, char *));
+static int bash_set_history (int, char *);
 #endif
 
 static const char * const on = "on";
index 0c9de8e66f5783a3b401433527d30512042d160f..7c08ad9f7c6a74c7a6bd768bddd1832b641a895f 100644 (file)
@@ -109,7 +109,7 @@ extern int force_fignore;
 extern int dircomplete_spelling, dircomplete_expand;
 extern int complete_fullquote;
 
-extern int enable_hostname_completion PARAMS((int));
+extern int enable_hostname_completion (int);
 #endif
 
 #if defined (PROGRAMMABLE_COMPLETION)
@@ -131,33 +131,33 @@ int expand_once_flag;
 extern int syslog_history;
 #endif
 
-static void shopt_error PARAMS((char *));
+static void shopt_error (char *);
 
-static int set_shellopts_after_change PARAMS((char *, int));
-static int set_compatibility_level PARAMS((char *, int));
+static int set_shellopts_after_change (char *, int);
+static int set_compatibility_level (char *, int);
 
 #if defined (RESTRICTED_SHELL)
-static int set_restricted_shell PARAMS((char *, int));
+static int set_restricted_shell (char *, int);
 #endif
 
 #if defined (READLINE)
-static int shopt_enable_hostname_completion PARAMS((char *, int));
-static int shopt_set_complete_direxpand PARAMS((char *, int));
+static int shopt_enable_hostname_completion (char *, int);
+static int shopt_set_complete_direxpand (char *, int);
 #endif
 
 #if defined (ARRAY_VARS)
-static int set_assoc_expand PARAMS((char *, int));
+static int set_assoc_expand (char *, int);
 #endif
 
 #if defined (EXTENDED_GLOB)
 int extglob_flag = EXTGLOB_DEFAULT;
-static int shopt_set_extglob PARAMS((char *, int));
+static int shopt_set_extglob (char *, int);
 #endif
 
 int expaliases_flag = 0;
-static int shopt_set_expaliases PARAMS((char *, int));
+static int shopt_set_expaliases (char *, int);
 
-static int shopt_set_debug_mode PARAMS((char *, int));
+static int shopt_set_debug_mode (char *, int);
 
 static int shopt_login_shell;
 static int shopt_compat31;
@@ -168,7 +168,7 @@ static int shopt_compat42;
 static int shopt_compat43;
 static int shopt_compat44;
 
-typedef int shopt_set_func_t PARAMS((char *, int));
+typedef int shopt_set_func_t (char *, int);
 
 /* If you add a new variable name here, make sure to set the default value
    appropriately in reset_shopt_options. */
@@ -276,14 +276,14 @@ static struct {
 static const char * const on = "on";
 static const char * const off = "off";
 
-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));
+static int find_shopt (char *);
+static int toggle_shopts (int, WORD_LIST *, int);
+static void print_shopt (char *, int, int);
+static int list_shopts (WORD_LIST *, int);
+static int list_some_shopts (int, int);
+static int list_shopt_o_options (WORD_LIST *, int);
+static int list_some_o_options (int, int);
+static int set_shopt_o_options (int, WORD_LIST *, int);
 
 #define SFLAG  0x01
 #define UFLAG  0x02
index 5b2f994db414d08a87cc64e5e0f706f4ee9e3d48..205abf53166ce1faa0615edf01c1c1f5911f03c9 100644 (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-2020 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((void));
+static void maybe_pop_dollar_vars (void);
 
 /* If non-zero, `.' uses $PATH to look up the script to be sourced. */
 int source_uses_path = 1;
index 4f3a56c9c93b76b409ce0a3d9a6388ba11635a86..1d60ef90bb8f7e3fe76ef61f9899b87d669e0da4 100644 (file)
@@ -56,7 +56,7 @@ $END
 #include "common.h"
 #include "bashgetopt.h"
 
-static sighandler suspend_continue PARAMS((int));
+static sighandler suspend_continue (int);
 
 static SigHandler *old_cont;
 #if 0
index 5604c56cb9b70829bba0836170a6b6eb787c0b5b..80d05973c109161a3f498da016906a6426c06ef0 100644 (file)
@@ -1,7 +1,7 @@
 This file is trap.def, from which is created trap.c.
 It implements the builtin "trap" in Bash.
 
-Copyright (C) 1987-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -79,8 +79,8 @@ $END
 #include "common.h"
 #include "bashgetopt.h"
 
-static void showtrap PARAMS((int, int));
-static int display_traps PARAMS((WORD_LIST *, int));
+static void showtrap (int, int);
+static int display_traps (WORD_LIST *, int);
 
 /* The trap command:
 
index a030edd655988909d61e0a232476af4d40ccfd36..004a18e207807b7329e243adf56be500de137220 100644 (file)
@@ -76,7 +76,7 @@ $END
 #include "common.h"
 #include "bashgetopt.h"
 
-extern int find_reserved_word PARAMS((char *));
+extern int find_reserved_word (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
index fd9f7a3df8ea594b4f695ed196de1219db97bd37..0b0e17791a1744c91ff88ab621c0d6a0bab61954 100644 (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-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 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 PARAMS((int));
+static int _findlim (int);
 
-static int ulimit_internal PARAMS((int, char *, int, int));
+static int ulimit_internal (int, char *, int, int);
 
-static int get_limit PARAMS((int, RLIMTYPE *, RLIMTYPE *));
-static int set_limit PARAMS((int, RLIMTYPE, int));
+static int get_limit (int, RLIMTYPE *, RLIMTYPE *);
+static int set_limit (int, RLIMTYPE, int);
 
-static void printone PARAMS((int, RLIMTYPE, int));
-static void print_all_limits PARAMS((int));
+static void printone (int, RLIMTYPE, int);
+static void print_all_limits (int);
 
-static int set_all_limits PARAMS((int, RLIMTYPE));
+static int set_all_limits (int, RLIMTYPE);
 
-static int filesize PARAMS((RLIMTYPE *));
-static int pipesize PARAMS((RLIMTYPE *));
-static int getmaxuprc PARAMS((RLIMTYPE *));
-static int getmaxvm PARAMS((RLIMTYPE *, RLIMTYPE *));
+static int filesize (RLIMTYPE *);
+static int pipesize (RLIMTYPE *);
+static int getmaxuprc (RLIMTYPE *);
+static int getmaxvm (RLIMTYPE *, RLIMTYPE *);
 
 typedef struct {
   int  option;                 /* The ulimit option for this limit. */
index 2a6ae40580b1529a6c02c3cd5d30e8b8b2949cf4..f22bb7173788592ed03184a4005a13993f904f69 100644 (file)
@@ -67,8 +67,8 @@ $END
 /*                                                                  */
 /* **************************************************************** */
 
-static void print_symbolic_umask PARAMS((mode_t));
-static int symbolic_umask PARAMS((WORD_LIST *));
+static void print_symbolic_umask (mode_t);
+static int symbolic_umask (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. */
index 1a49430a39e17791e68474948572495cc982b82b..f29db2a714764880281a21aff95257a85a495439 100644 (file)
@@ -1,7 +1,7 @@
 This file is wait.def, from which is created wait.c.
 It implements the builtin "wait" in Bash.
 
-Copyright (C) 1987-2021 Free Software Foundation, Inc.
+Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -90,8 +90,8 @@ extern int wait_signal_received;
 procenv_t wait_intr_buf;
 int wait_intr_flag;
 
-static int set_waitlist PARAMS((WORD_LIST *));
-static void unset_waitlist PARAMS((void));
+static int set_waitlist (WORD_LIST *);
+static void unset_waitlist (void);
 
 /* Wait for the pid in LIST to stop or die.  If no arguments are given, then
    wait for all of the active background processes of the shell and return
index 6230354ba1cc92b327555fc47664079d94cfa5c4..025a18c41660de9b90bfbbceef5c6fc1a063f9cc 100644 (file)
--- a/command.h
+++ b/command.h
@@ -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-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -398,13 +398,13 @@ extern Coproc sh_coproc;
 
 /* Forward declarations of functions declared in copy_cmd.c. */
 
-extern FUNCTION_DEF *copy_function_def_contents PARAMS((FUNCTION_DEF *, FUNCTION_DEF *));
-extern FUNCTION_DEF *copy_function_def PARAMS((FUNCTION_DEF *));
+extern FUNCTION_DEF *copy_function_def_contents (FUNCTION_DEF *, FUNCTION_DEF *);
+extern FUNCTION_DEF *copy_function_def (FUNCTION_DEF *);
 
-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 *));
+extern WORD_DESC *copy_word (WORD_DESC *);
+extern WORD_LIST *copy_word_list (WORD_LIST *);
+extern REDIRECT *copy_redirect (REDIRECT *);
+extern REDIRECT *copy_redirects (REDIRECT *);
+extern COMMAND *copy_command (COMMAND *);
 
 #endif /* _COMMAND_H_ */
index 758ff238a111a8db9ab3ffe902c0eabd11c72766..6426c016ff838813316cb41a0f4b69353dcda472 100644 (file)
@@ -2,7 +2,7 @@
    primarily for making function definitions, but I'm not sure
    that anyone else will need it.  */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #include "shell.h"
 
-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 *));
+static PATTERN_LIST *copy_case_clause (PATTERN_LIST *);
+static PATTERN_LIST *copy_case_clauses (PATTERN_LIST *);
+static FOR_COM *copy_for_command (FOR_COM *);
 #if defined (ARITH_FOR_COMMAND)
-static ARITH_FOR_COM *copy_arith_for_command PARAMS((ARITH_FOR_COM *));
+static ARITH_FOR_COM *copy_arith_for_command (ARITH_FOR_COM *);
 #endif
-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 *));
+static GROUP_COM *copy_group_command (GROUP_COM *);
+static SUBSHELL_COM *copy_subshell_command (SUBSHELL_COM *);
+static COPROC_COM *copy_coproc_command (COPROC_COM *);
+static CASE_COM *copy_case_command (CASE_COM *);
+static WHILE_COM *copy_while_command (WHILE_COM *);
+static IF_COM *copy_if_command (IF_COM *);
 #if defined (DPAREN_ARITHMETIC)
-static ARITH_COM *copy_arith_command PARAMS((ARITH_COM *));
+static ARITH_COM *copy_arith_command (ARITH_COM *);
 #endif
 #if defined (COND_COMMAND)
-static COND_COM *copy_cond_command PARAMS((COND_COM *));
+static COND_COM *copy_cond_command (COND_COM *);
 #endif
-static SIMPLE_COM *copy_simple_command PARAMS((SIMPLE_COM *));
+static SIMPLE_COM *copy_simple_command (SIMPLE_COM *);
 
 WORD_DESC *
-copy_word (w)
-     WORD_DESC *w;
+copy_word (WORD_DESC *w)
 {
   WORD_DESC *new_word;
 
@@ -66,8 +65,7 @@ copy_word (w)
 /* Copy the chain of words in LIST.  Return a pointer to
    the new chain. */
 WORD_LIST *
-copy_word_list (list)
-     WORD_LIST *list;
+copy_word_list (WORD_LIST *list)
 {
   WORD_LIST *new_list, *tl;
 
@@ -86,8 +84,7 @@ copy_word_list (list)
 }
 
 static PATTERN_LIST *
-copy_case_clause (clause)
-     PATTERN_LIST *clause;
+copy_case_clause (PATTERN_LIST *clause)
 {
   PATTERN_LIST *new_clause;
 
@@ -99,8 +96,7 @@ copy_case_clause (clause)
 }
 
 static PATTERN_LIST *
-copy_case_clauses (clauses)
-     PATTERN_LIST *clauses;
+copy_case_clauses (PATTERN_LIST *clauses)
 {
   PATTERN_LIST *new_list, *new_clause;
 
@@ -115,17 +111,12 @@ copy_case_clauses (clauses)
 
 /* Copy a single redirect. */
 REDIRECT *
-copy_redirect (redirect)
-     REDIRECT *redirect;
+copy_redirect (REDIRECT *redirect)
 {
   REDIRECT *new_redirect;
 
   new_redirect = (REDIRECT *)xmalloc (sizeof (REDIRECT));
-#if 0
-  FASTCOPY ((char *)redirect, (char *)new_redirect, (sizeof (REDIRECT)));
-#else
   *new_redirect = *redirect;   /* let the compiler do the fast structure copy */
-#endif
 
   if (redirect->rflags & REDIR_VARASSIGN)
     new_redirect->redirector.filename = copy_word (redirect->redirector.filename);
@@ -162,8 +153,7 @@ copy_redirect (redirect)
 }
 
 REDIRECT *
-copy_redirects (list)
-     REDIRECT *list;
+copy_redirects (REDIRECT *list)
 {
   REDIRECT *new_list, *temp;
 
@@ -177,8 +167,7 @@ copy_redirects (list)
 }
 
 static FOR_COM *
-copy_for_command (com)
-     FOR_COM *com;
+copy_for_command (FOR_COM *com)
 {
   FOR_COM *new_for;
 
@@ -193,8 +182,7 @@ copy_for_command (com)
 
 #if defined (ARITH_FOR_COMMAND)
 static ARITH_FOR_COM *
-copy_arith_for_command (com)
-     ARITH_FOR_COM *com;
+copy_arith_for_command (ARITH_FOR_COM *com)
 {
   ARITH_FOR_COM *new_arith_for;
 
@@ -210,8 +198,7 @@ copy_arith_for_command (com)
 #endif /* ARITH_FOR_COMMAND */
 
 static GROUP_COM *
-copy_group_command (com)
-     GROUP_COM *com;
+copy_group_command (GROUP_COM *com)
 {
   GROUP_COM *new_group;
 
@@ -221,8 +208,7 @@ copy_group_command (com)
 }
 
 static SUBSHELL_COM *
-copy_subshell_command (com)
-     SUBSHELL_COM *com;
+copy_subshell_command (SUBSHELL_COM *com)
 {
   SUBSHELL_COM *new_subshell;
 
@@ -234,8 +220,7 @@ copy_subshell_command (com)
 }
 
 static COPROC_COM *
-copy_coproc_command (com)
-     COPROC_COM *com;
+copy_coproc_command (COPROC_COM *com)
 {
   COPROC_COM *new_coproc;
 
@@ -247,8 +232,7 @@ copy_coproc_command (com)
 }
 
 static CASE_COM *
-copy_case_command (com)
-     CASE_COM *com;
+copy_case_command (CASE_COM *com)
 {
   CASE_COM *new_case;
 
@@ -261,8 +245,7 @@ copy_case_command (com)
 }
 
 static WHILE_COM *
-copy_while_command (com)
-     WHILE_COM *com;
+copy_while_command (WHILE_COM *com)
 {
   WHILE_COM *new_while;
 
@@ -274,8 +257,7 @@ copy_while_command (com)
 }
 
 static IF_COM *
-copy_if_command (com)
-     IF_COM *com;
+copy_if_command (IF_COM *com)
 {
   IF_COM *new_if;
 
@@ -289,8 +271,7 @@ copy_if_command (com)
 
 #if defined (DPAREN_ARITHMETIC)
 static ARITH_COM *
-copy_arith_command (com)
-     ARITH_COM *com;
+copy_arith_command (ARITH_COM *com)
 {
   ARITH_COM *new_arith;
 
@@ -305,8 +286,7 @@ copy_arith_command (com)
 
 #if defined (COND_COMMAND)
 static COND_COM *
-copy_cond_command (com)
-     COND_COM *com;
+copy_cond_command (COND_COM *com)
 {
   COND_COM *new_cond;
 
@@ -323,8 +303,7 @@ copy_cond_command (com)
 #endif
 
 static SIMPLE_COM *
-copy_simple_command (com)
-     SIMPLE_COM *com;
+copy_simple_command (SIMPLE_COM *com)
 {
   SIMPLE_COM *new_simple;
 
@@ -337,8 +316,7 @@ copy_simple_command (com)
 }
 
 FUNCTION_DEF *
-copy_function_def_contents (old, new_def)
-     FUNCTION_DEF *old, *new_def;
+copy_function_def_contents (FUNCTION_DEF *old, FUNCTION_DEF *new_def)
 {
   new_def->name = copy_word (old->name);
   new_def->command = old->command ? copy_command (old->command) : old->command;
@@ -349,8 +327,7 @@ copy_function_def_contents (old, new_def)
 }
 
 FUNCTION_DEF *
-copy_function_def (com)
-     FUNCTION_DEF *com;
+copy_function_def (FUNCTION_DEF *com)
 {
   FUNCTION_DEF *new_def;
 
@@ -363,8 +340,7 @@ copy_function_def (com)
    copy.  Don't you forget to dispose_command () on this pointer
    later! */
 COMMAND *
-copy_command (command)
-     COMMAND *command;
+copy_command (COMMAND *command)
 {
   COMMAND *new_command;
 
index c624605b5080a5ee144fe2747d72b7a3f5a59139..a79201abef628b9cb7f427e75fa04cb244adac3b 100644 (file)
@@ -1,6 +1,6 @@
 /* dispose_command.c -- dispose of a COMMAND structure. */
 
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -33,8 +33,7 @@ extern sh_obj_cache_t wdcache, wlcache;
 
 /* Dispose of the command structure passed. */
 void
-dispose_command (command)
-     COMMAND *command;
+dispose_command (COMMAND *command)
 {
   if (command == 0)
     return;
@@ -208,8 +207,7 @@ dispose_command (command)
 #if defined (COND_COMMAND)
 /* How to free a node in a conditional command. */
 void
-dispose_cond_node (cond)
-     COND_COM *cond;
+dispose_cond_node (COND_COM *cond)
 {
   if (cond)
     {
@@ -225,8 +223,7 @@ dispose_cond_node (cond)
 #endif /* COND_COMMAND */
 
 void
-dispose_function_def_contents (c)
-     FUNCTION_DEF *c;
+dispose_function_def_contents (FUNCTION_DEF *c)
 {
   dispose_word (c->name);
   dispose_command (c->command);
@@ -234,8 +231,7 @@ dispose_function_def_contents (c)
 }
 
 void
-dispose_function_def (c)
-     FUNCTION_DEF *c;
+dispose_function_def (FUNCTION_DEF *c)
 {
   dispose_function_def_contents (c);
   free (c);
@@ -243,8 +239,7 @@ dispose_function_def (c)
 
 /* How to free a WORD_DESC. */
 void
-dispose_word (w)
-     WORD_DESC *w;
+dispose_word (WORD_DESC *w)
 {
   FREE (w->word);
   ocache_free (wdcache, WORD_DESC, w);
@@ -252,8 +247,7 @@ dispose_word (w)
 
 /* Free a WORD_DESC, but not the word contained within. */
 void
-dispose_word_desc (w)
-     WORD_DESC *w;
+dispose_word_desc (WORD_DESC *w)
 {
   w->word = 0;
   ocache_free (wdcache, WORD_DESC, w);
@@ -261,8 +255,7 @@ dispose_word_desc (w)
 
 /* How to get rid of a linked list of words.  A WORD_LIST. */
 void
-dispose_words (list)
-     WORD_LIST *list;
+dispose_words (WORD_LIST *list)
 {
   WORD_LIST *t;
 
@@ -283,8 +276,7 @@ dispose_words (list)
 /* How to dispose of an array of pointers to char.  This is identical to
    free_array in stringlib.c. */
 void
-dispose_word_array (array)
-     char **array;
+dispose_word_array (char **array)
 {
   register int count;
 
@@ -300,8 +292,7 @@ dispose_word_array (array)
 
 /* How to dispose of an list of redirections.  A REDIRECT. */
 void
-dispose_redirects (list)
-     REDIRECT *list;
+dispose_redirects (REDIRECT *list)
 {
   register REDIRECT *t;
 
index 6095d44a4161de881e10bf1f4fa85d3c3f4b6c6b..0e6eabc92399ee99f996b04d276f41b448d2a1b2 100644 (file)
@@ -1,6 +1,6 @@
 /* dispose_cmd.h -- Functions appearing in dispose_cmd.c. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #include "stdc.h"
 
-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 *));
+extern void dispose_command (COMMAND *);
+extern void dispose_word_desc (WORD_DESC *);
+extern void dispose_word (WORD_DESC *);
+extern void dispose_words (WORD_LIST *);
+extern void dispose_word_array (char **);
+extern void dispose_redirects (REDIRECT *);
 
 #if defined (COND_COMMAND)
-extern void dispose_cond_node PARAMS((COND_COM *));
+extern void dispose_cond_node (COND_COM *);
 #endif
 
-extern void dispose_function_def_contents PARAMS((FUNCTION_DEF *));
-extern void dispose_function_def PARAMS((FUNCTION_DEF *));
+extern void dispose_function_def_contents (FUNCTION_DEF *);
+extern void dispose_function_def (FUNCTION_DEF *);
 
 #endif /* !_DISPOSE_CMD_H_ */
diff --git a/error.h b/error.h
index 785c1deb5a9f80ab39eee3d5d02aea3af4eb6293..9a3127726ed3f19a78f0d4f6db1871c4753ba898 100644 (file)
--- a/error.h
+++ b/error.h
@@ -1,6 +1,6 @@
 /* error.h -- External declarations of functions appearing in error.c. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #include "stdc.h"
 
 /* Get the name of the shell or shell script for an error message. */
-extern char *get_name_for_error PARAMS((void));
+extern char *get_name_for_error (void);
 
 /* Report an error having to do with FILENAME. */
-extern void file_error PARAMS((const char *));
+extern void file_error (const char *);
 
 /* Report a programmer's error, and abort.  Pass REASON, and ARG1 ... ARG5. */
-extern void programming_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void programming_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* General error reporting.  Pass FORMAT and ARG1 ... ARG5. */
-extern void report_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void report_error (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 PARAMS((int, const char *, ...))  __attribute__((__format__ (printf, 2, 3)));
+extern void parser_error (int, const char *, ...) __attribute__((__format__ (printf, 2, 3)));
 
 /* Report an unrecoverable error and exit.  Pass FORMAT and ARG1 ... ARG5. */
-extern void fatal_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void fatal_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* Report a system error, like BSD warn(3). */
-extern void sys_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void sys_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* Report an internal error. */
-extern void internal_error PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void internal_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* Report an internal warning. */
-extern void internal_warning PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void internal_warning (const char *, ...)  __attribute__((__format__ (printf, 1, 2)));
 
 /* Report an internal warning for debugging purposes. */
-extern void internal_debug PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void internal_debug (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* Report an internal informational notice. */
-extern void internal_inform PARAMS((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
+extern void internal_inform (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
 
 /* Debugging functions, not enabled in released version. */
-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)));
+extern char *strescape (const char *);
+extern void itrace (const char *, ...) __attribute__ ((__format__ (printf, 1, 2)));
+extern void trace (const char *, ...) __attribute__ ((__format__ (printf, 1, 2)));
 
 /* Report an error having to do with command parsing or execution. */
-extern void command_error PARAMS((const char *, int, int, int));
+extern void command_error (const char *, int, int, int);
 
-extern char *command_errstr PARAMS((int));
+extern char *command_errstr (int);
 
 /* Specific error message functions that eventually call report_error or
    internal_error. */
 
-extern void err_badarraysub PARAMS((const char *));
-extern void err_unboundvar PARAMS((const char *));
-extern void err_readonly PARAMS((const char *));
+extern void err_badarraysub (const char *);
+extern void err_unboundvar (const char *);
+extern void err_readonly (const char *);
 
 #ifdef DEBUG
 #  define INTERNAL_DEBUG(x)    internal_debug x
index ff98423dd0b256a79cd6d033abb381705daac868..dbe47615291bf3f495f6c19fae48d5115901061d 100644 (file)
@@ -1,7 +1,7 @@
 /* accept - listen for and accept a remote network connection on a given port */
 
 /*
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -42,8 +42,7 @@
 static int accept_bind_variable (char *, int);
 
 int
-accept_builtin (list)
-     WORD_LIST *list;
+accept_builtin (WORD_LIST *list)
 {
   SHELL_VAR *v;
   intmax_t iport;
@@ -194,9 +193,7 @@ accept_builtin (list)
 }
 
 static int
-accept_bind_variable (varname, intval)
-     char *varname;
-     int intval;
+accept_bind_variable (char *varname, int intval)
 {
   SHELL_VAR *v;
   char ibuf[INT_STRLEN_BOUND (int) + 1], *p;
index e847ef8680c3c1fee0eedfb25a547d697cc5d40e..6570c9afa3d6243a5f631bda1625404d56fc8a4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    Bash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -36,7 +36,8 @@ static int reverse_flag;
 static int numeric_flag;
 
 static int
-compare(const void *p1, const void *p2) {
+compare(const void *p1, const void *p2)
+{
     const sort_element e1 = *(sort_element *) p1;
     const sort_element e2 = *(sort_element *) p2;
 
@@ -55,7 +56,8 @@ compare(const void *p1, const void *p2) {
 }
 
 static int
-sort_index(SHELL_VAR *dest, SHELL_VAR *source) {
+sort_index(SHELL_VAR *dest, SHELL_VAR *source)
+{
     HASH_TABLE *hash;
     BUCKET_CONTENTS *bucket;
     sort_element *sa;
@@ -125,7 +127,8 @@ sort_index(SHELL_VAR *dest, SHELL_VAR *source) {
 }
 
 static int
-sort_inplace(SHELL_VAR *var) {
+sort_inplace(SHELL_VAR *var)
+{
     size_t i, n;
     ARRAY *a;
     ARRAY_ELEMENT *ae;
@@ -174,7 +177,8 @@ sort_inplace(SHELL_VAR *var) {
 }
 
 int
-asort_builtin(WORD_LIST *list) {
+asort_builtin(WORD_LIST *list)
+{
     SHELL_VAR *var, *var2;
     char *word;
     int opt, ret;
index 29dd1a6db68ef833fabf68a04227861de5b93bf4..432d2922b72154811a440a0cb5237ab5efc4692f 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -33,8 +33,7 @@
 #include "bashgetopt.h"
 
 int
-basename_builtin (list)
-     WORD_LIST *list;
+basename_builtin (WORD_LIST *list)
 {
   int slen, sufflen, off;
   char *string, *suffix, *fn;
index cc7c073fd51fd8b2283ac90f605957f335e933fc..3876ddabbdaef50fc17f58deb227b35ed9d1450d 100644 (file)
 extern int errno;
 #endif
 
-extern char *strerror ();
-extern char **make_builtin_argv ();
+extern char *strerror (int);
+extern char **make_builtin_argv (WORD_LIST *, int *);
 
 static int
-fcopy(fd, fn)
-int    fd;
-char   *fn;
+fcopy(int fd, char *fn)
 {
        char    buf[4096], *s;
        int     n, w, e;
@@ -70,9 +68,7 @@ char  *fn;
 }
 
 int
-cat_main (argc, argv)
-int    argc;
-char   **argv;
+cat_main (int argc, char **argv)
 {
        int     i, fd, r;
        char    *s;
@@ -105,8 +101,7 @@ char        **argv;
 }
 
 int
-cat_builtin(list)
-WORD_LIST *list;
+cat_builtin(WORD_LIST *list)
 {
        char    **v;
        int     c, r;
index 71685f33b5df7051817dd2017e999c5210ce40a0..b476a0ee52488ca0bb37ba6b155456fb3ed1f706 100644 (file)
 extern int errno;
 #endif
 
-extern char *strerror ();
-extern char **make_builtin_argv ();
+extern char *strerror (int);
+extern char **make_builtin_argv (WORD_LIST *, int *);
 
 static int
-fcopy(fd, fn)
-int    fd;
-char   *fn;
+fcopy(int fd, char *fn)
 {
        char    buf[4096], *s;
        int     n, w, e;
@@ -70,9 +68,7 @@ char  *fn;
 }
 
 int
-cat_main (argc, argv)
-int    argc;
-char   **argv;
+cat_main (int argc, char **argv)
 {
        int     i, fd, r;
        char    *s;
@@ -105,8 +101,7 @@ char        **argv;
 }
 
 int
-cat_builtin(list)
-WORD_LIST *list;
+cat_builtin(WORD_LIST *list)
 {
        char    **v;
        int     c, r;
index 75b37725733ee63ba61f019a104bf17aed9e9b98..9e7d1026a64dc43bd7b186b6d904520255cb4953 100644 (file)
@@ -2,7 +2,7 @@
         fields */
 
 /*
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    Bash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -39,9 +39,7 @@
    element of array variable CSV, starting at index 0. The format of LINE is
    as described in RFC 4180. */
 static int
-csvsplit (csv, line, dstring)
-     SHELL_VAR *csv;
-     char *line, *dstring;
+csvsplit (SHELL_VAR *csv, char *line, char *dstring)
 {
   arrayind_t ind;
   char *field, *prev, *buf, *xbuf;
@@ -103,8 +101,7 @@ csvsplit (csv, line, dstring)
 }
 
 int
-csv_builtin (list)
-     WORD_LIST *list;
+csv_builtin (WORD_LIST *list)
 {
   int opt, rval;
   char *array_name, *csvstring;
@@ -174,16 +171,14 @@ csv_builtin (list)
 /* Called when builtin is enabled and loaded from the shared object.  If this
    function returns 0, the load fails. */
 int
-csv_builtin_load (name)
-     char *name;
+csv_builtin_load (char *name)
 {
   return (1);
 }
 
 /* Called when builtin is disabled. */
 void
-csv_builtin_unload (name)
-     char *name;
+csv_builtin_unload (char *name)
 {
 }
 
index 48f80047d1f5e66e1439f864909421e422a0d02f..ee51d9b9d66021f7357c8ae4bf2cc7d7db654c5b 100644 (file)
@@ -2,7 +2,7 @@
              or print them to the standard output */
 
 /*
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    Bash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -61,8 +61,7 @@ struct cutop
 };
 
 static int
-poscmp (a, b)
-     void *a, *b;
+poscmp (const void *a, const void *b)
 {
   struct cutpos *p1, *p2;
 
@@ -72,9 +71,7 @@ poscmp (a, b)
 }
 
 static int
-getlist (arg, opp)
-     char *arg;
-     struct cutpos **opp;
+getlist (char *arg, struct cutpos **opp)
 {
   char *ntok, *ltok, *larg;
   int s, e;
@@ -146,10 +143,7 @@ getlist (arg, opp)
 }
 
 static int
-cutbytes (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutbytes (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap;
@@ -197,10 +191,7 @@ cutbytes (v, line, ops)
 }
 
 static int
-cutchars (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutchars (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap;
@@ -272,10 +263,7 @@ cutchars (v, line, ops)
    bitmap approach as cut{bytes,chars} and assign them to the array variable
    V or print them on stdout. This function obeys SFLAG. */
 static int
-cutfields (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutfields (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap, *field, **fields, delim[2];
@@ -362,10 +350,7 @@ cutfields (v, line, ops)
 }
 
 static int
-cutline (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutline (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   int rval;
 
@@ -380,10 +365,7 @@ cutline (v, line, ops)
 }
 
 static int
-cutfile (v, list, ops)
-     SHELL_VAR *v;
-     WORD_LIST *list;
-     struct cutop *ops;
+cutfile (SHELL_VAR *v, WORD_LIST *list, struct cutop *ops)
 {
   int fd, unbuffered_read;
   char *line, *b;
@@ -437,9 +419,7 @@ cutfile (v, list, ops)
 #define OPTSET(x)           ((cutflags & (x)) ? 1 : 0)
 
 static int
-cut_internal (which, list)
-     int which;                                /* not used yet */
-     WORD_LIST *list;
+cut_internal (int which, WORD_LIST *list)
 {
   int opt, rval, cutflags, delim, npos;
   char *array_name, *cutstring, *list_arg;
@@ -566,15 +546,13 @@ cut_internal (which, list)
 }
 
 int
-lcut_builtin (list)
-     WORD_LIST *list;
+lcut_builtin (WORD_LIST *list)
 {
   return (cut_internal (0, list));
 }
 
 int
-cut_builtin (list)
-     WORD_LIST *list;
+cut_builtin (WORD_LIST *list)
 {
   return (cut_internal (1, list));
 }
index d802ca77c116464c71661a83e380e21bba1e7157..bc69ed8b7c92955623030163e05d8b5fc0bb8de8 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -33,8 +33,7 @@
 #include "bashgetopt.h"
 
 int
-dirname_builtin (list)
-     WORD_LIST *list;
+dirname_builtin (WORD_LIST *list)
 {
   int slen;
   char *string;
index 70e59cbc6d06b02575c75de403c61790a5f33b2c..9a0a56c4925a50d235b95c08c35e5fae68226bf8 100644 (file)
    null fields. If you want to preserve the quote characters in the generated
    fields, pass F_PRESERVE; by default, this removes them. */
 static int
-dsvsplit (dsv, line, dstring, flags)
-     SHELL_VAR *dsv;
-     char *line, *dstring;
-     int flags;
+dsvsplit (SHELL_VAR *dsv, char *line, char *dstring, int flags)
 {
   arrayind_t ind;
   char *field, *prev, *buf, *xbuf;
@@ -163,8 +160,7 @@ dsvsplit (dsv, line, dstring, flags)
 }
 
 int
-dsv_builtin (list)
-     WORD_LIST *list;
+dsv_builtin (WORD_LIST *list)
 {
   int opt, rval, flags;
   char *array_name, *dsvstring, *delims;
@@ -249,16 +245,14 @@ dsv_builtin (list)
 /* Called when builtin is enabled and loaded from the shared object.  If this
    function returns 0, the load fails. */
 int
-dsv_builtin_load (name)
-     char *name;
+dsv_builtin_load (char *name)
 {
   return (1);
 }
 
 /* Called when builtin is disabled. */
 void
-dsv_builtin_unload (name)
-     char *name;
+dsv_builtin_unload (char *name)
 {
 }
 
index 9f2d089f9512e0cf114f9b9afc53d3c99c0d310a..48a1417f6ca0ce3dee5dce7868abf38b6e6773a1 100644 (file)
@@ -120,7 +120,7 @@ extern int errno;
 
 /* FIX THIS */
 static int
-getallflags ()
+getallflags (void)
 {
   int i, allflags;
   
@@ -257,7 +257,7 @@ setone(int fd, char *v, int verbose)
 }
 
 static int
-getmaxfd ()
+getmaxfd (void)
 {
   int maxfd, ignore;
 
index 6115103fc63e618c4ac8a8c4086287569e4c8b8e..6491ef0ed2ab236fe241badd15d3c7088e42425c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
 extern int     errno;
 #endif
 
-extern char    **make_builtin_argv ();
+extern char    **make_builtin_argv (WORD_LIST *, int *);
 
-static void    perms();
-static int     printst();
-static int     printsome();
-static void    printmode();
-static int     printfinfo();
-static int     finfo_main();
+static int     octal(char *);
+static struct stat *getstat(char *);
+static int     printinfo(char *);
+static int     getperm(int);
+
+static void    perms(int);
+static int     printst(struct stat *);
+static int     printsome(char *, int);
+static void    printmode(int);
+static int     printfinfo(char *);
+static int     finfo_main(int, char **);
 
 extern int     sh_optind;
 extern char    *sh_optarg;
index f9f022a6082b4cf4f51bb8e7b60a169fa5831522..9a4b97def3645b9a163e0373b5f21ca4c84c78e4 100644 (file)
@@ -46,8 +46,7 @@ extern int errno;
 #endif
 
 static void
-munge_list (list)
-     WORD_LIST *list;
+munge_list (WORD_LIST *list)
 {
   WORD_LIST *l, *nl;
   WORD_DESC *wd;
@@ -69,9 +68,7 @@ munge_list (list)
 }
 
 static int
-file_head (fp, cnt)
-     FILE *fp;
-     int cnt;
+file_head (FILE *fp, int cnt)
 {
   int ch;
 
@@ -94,8 +91,7 @@ file_head (fp, cnt)
 }
 
 int
-head_builtin (list)
-     WORD_LIST *list;
+head_builtin (WORD_LIST *list)
 {
   int nline, opt, rval;
   WORD_LIST *l;
index b09362bf31b1737bdf2ca8800b8d1bc4dccd9c3a..786e4cd8dc54a20074ddad7158446bf26e2f313c 100644 (file)
@@ -4,7 +4,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -48,8 +48,7 @@
    A builtin command returns EXECUTION_SUCCESS for success and
    EXECUTION_FAILURE to indicate failure. */
 int
-hello_builtin (list)
-     WORD_LIST *list;
+hello_builtin (WORD_LIST *list)
 {
   printf("hello world\n");
   fflush (stdout);
@@ -57,8 +56,7 @@ hello_builtin (list)
 }
 
 int
-hello_builtin_load (s)
-     char *s;
+hello_builtin_load (char *s)
 {
   printf ("hello builtin loaded\n");
   fflush (stdout);
@@ -66,8 +64,7 @@ hello_builtin_load (s)
 }
 
 void
-hello_builtin_unload (s)
-     char *s;
+hello_builtin_unload (char *s)
 {
   printf ("hello builtin unloaded\n");
   fflush (stdout);
index f857b54752a7e4c7516a0a891aad3c72bf23f9de..f46f75cebeb870776594723ab1e26405b87f2345 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -66,16 +66,15 @@ static gid_t rgid, egid;
 
 static char *id_user;
 
-static int inituser ();
+static int inituser (char *);
 
-static int id_pruser ();
-static int id_prgrp ();
-static int id_prgroups ();
-static int id_prall ();
+static int id_pruser (int);
+static int id_prgrp (int);
+static int id_prgroups (char *);
+static int id_prall (char *);
 
 int
-id_builtin (list)
-     WORD_LIST *list;
+id_builtin (WORD_LIST *list)
 {
   int opt;
   char *user;
@@ -134,8 +133,7 @@ id_builtin (list)
 }
 
 static int
-inituser (uname)
-     char *uname;
+inituser (char *uname)
 {
   struct passwd *pwd;
 
@@ -162,8 +160,7 @@ inituser (uname)
 
 /* Print the name or value of user ID UID. */
 static int
-id_pruser (uid)
-     int uid;
+id_pruser (int uid)
 {
   struct passwd *pwd = NULL;
   int r;
@@ -186,8 +183,7 @@ id_pruser (uid)
 /* Print the name or value of group ID GID. */
 
 static int
-id_prgrp (gid)
-     int gid;
+id_prgrp (int gid)
 {
   struct group *grp = NULL;
   int r;
@@ -209,8 +205,7 @@ id_prgrp (gid)
 }
 
 static int
-id_prgroups (uname)
-     char *uname;
+id_prgroups (char *uname)
 {
   int *glist, ng, i, r;
 
@@ -243,8 +238,7 @@ id_prgroups (uname)
 }
 
 static int
-id_prall (uname)
-     char *uname;
+id_prall (char *uname)
 {
   int r, i, ng, *glist;
   struct passwd *pwd;
index 18d5f375de64990467cc8ec01ab03fd1b331ba94..ffeae77ba9c44d6baee0b8241c264a8abe3c193b 100644 (file)
@@ -2,7 +2,7 @@
          print them to the standard output */
 
 /*
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    Bash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -59,8 +59,7 @@ struct cutop
 };
 
 static int
-poscmp (a, b)
-     void *a, *b;
+poscmp (const void *a, const void *b)
 {
   struct cutpos *p1, *p2;
 
@@ -70,9 +69,7 @@ poscmp (a, b)
 }
 
 static int
-getlist (arg, opp)
-     char *arg;
-     struct cutpos **opp;
+getlist (char *arg, struct cutpos **opp)
 {
   char *ntok, *ltok, *larg;
   int s, e;
@@ -144,10 +141,7 @@ getlist (arg, opp)
 }
 
 static int
-cutbytes (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutbytes (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap;
@@ -195,10 +189,7 @@ cutbytes (v, line, ops)
 }
 
 static int
-cutchars (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutchars (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap;
@@ -270,10 +261,7 @@ cutchars (v, line, ops)
    bitmap approach as cut{bytes,chars} and assign them to the array variable
    V or print them on stdout. This function obeys SFLAG. */
 static int
-cutfields (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutfields (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   arrayind_t ind;
   char *buf, *bmap, *field, **fields, delim[2];
@@ -360,10 +348,7 @@ cutfields (v, line, ops)
 }
 
 static int
-cutline (v, line, ops)
-     SHELL_VAR *v;
-     char *line;
-     struct cutop *ops;
+cutline (SHELL_VAR *v, char *line, struct cutop *ops)
 {
   int rval;
 
@@ -378,19 +363,14 @@ cutline (v, line, ops)
 }
 
 static int
-cutfile (v, list, ops)
-     SHELL_VAR *v;
-     WORD_LIST *list;
-     struct cutop *ops;
+cutfile (SHELL_VAR *v, WORD_LIST *list, struct cutop *ops)
 {
 }
 
 #define OPTSET(x)           ((cutflags & (x)) ? 1 : 0)
 
 static int
-cut_internal (which, list)
-     int which;                                /* not used yet */
-     WORD_LIST *list;
+cut_internal (int which, WORD_LIST *list)
 {
   int opt, rval, cutflags, delim, npos;
   char *array_name, *cutstring, *list_arg;
@@ -512,8 +492,7 @@ cut_internal (which, list)
 }
 
 int
-lcut_builtin (list)
-     WORD_LIST *list;
+lcut_builtin (WORD_LIST *list)
 {
   return (cut_internal (0, list));
 }
index 874e9db886f8c717ee63bfeda3008f21eaad063c..c0905d6ae5218816f8b48e64d2a209dec203fb97 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
 extern int errno;
 #endif
 
-typedef int unix_link_syscall_t PARAMS((const char *, const char *));
+typedef int unix_link_syscall_t (const char *, const char *);
 
 #define LN_SYMLINK 0x01
 #define LN_UNLINK  0x02
 #define LN_NOFOLLOW 0x04
 
 static unix_link_syscall_t *linkfn;
-static int dolink ();
+
+static char *mkdirpath (char *, char *);
+static int dolink (char *, char *, int);
 
 int
-ln_builtin (list)
-     WORD_LIST *list;
+ln_builtin (WORD_LIST *list)
 {
   int rval, opt, flags;
   WORD_LIST *l;
@@ -125,8 +126,7 @@ ln_builtin (list)
 }
 
 static char *
-mkdirpath (dir, file)
-     char *dir, *file;
+mkdirpath (char *dir, char *file)
 {
   int dlen, flen;
   char *ret;
@@ -152,9 +152,7 @@ mkdirpath (dir, file)
 #endif
 
 static int
-dolink (src, dst, flags)
-     char *src, *dst;
-     int flags;
+dolink (char *src, char *dst, int flags)
 {
   struct stat ssb, dsb;
   int exists;
index 27e6591be98f281eec691d19ae0fae210063fb7a..ab4eb18113a1d29443aec56b6387af7983b77a8b 100644 (file)
@@ -1,7 +1,7 @@
 /* logname - print login name of current user */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -36,8 +36,7 @@ extern int errno;
 #endif
 
 int
-logname_builtin (list)
-     WORD_LIST *list;
+logname_builtin (WORD_LIST *list)
 {
   char *np;
 
index a5b49309e3d57bf2af1c7552a1344b59a314d1f8..b0df8f0d66a183668872b72c0ae18d48b5280fc8 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -42,15 +42,14 @@ extern int errno;
 
 #define ISOCTAL(c)     ((c) >= '0' && (c) <= '7')
 
-extern int parse_symbolic_mode ();
+extern int parse_symbolic_mode (char *, mode_t);
 
-static int make_path ();
+static int make_path (char *, int, int, int);
 
 static int original_umask;
 
 int
-mkdir_builtin (list)
-     WORD_LIST *list;
+mkdir_builtin (WORD_LIST *list)
 {
   int opt, pflag, mflag, omode, rval, nmode, parent_mode;
   char *mode;
@@ -134,10 +133,7 @@ mkdir_builtin (list)
    this changes the process's umask; make sure that all paths leading to a
    return reset it to ORIGINAL_UMASK */
 static int
-make_path (path, user_mode, nmode, parent_mode)
-     char *path;
-     int user_mode;
-     int nmode, parent_mode;
+make_path (char *path, int user_mode, int nmode, int parent_mode)
 {
   int oumask;
   struct stat sb;
index 2bc4e98ac017ad220c7ff4b7fd8fda91238d74e9..c01bfe6d388d1b396735c221629f60aa3a17be55 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -42,13 +42,12 @@ extern int errno;
 
 #define ISOCTAL(c)     ((c) >= '0' && (c) <= '7')
 
-extern int parse_symbolic_mode ();
+extern int parse_symbolic_mode (char *, mode_t);
 
 static int original_umask;
 
 int
-mkfifo_builtin (list)
-     WORD_LIST *list;
+mkfifo_builtin (WORD_LIST *list)
 {
   int opt, mflag, omode, rval, nmode, basemode;
   char *mode;
index 1f7c9ad39a59148651dc3e75a1d1aeee7941ec57..1cd8113d019e14873134af8e8944da77b661cbed 100644 (file)
@@ -1,7 +1,7 @@
 /* mktemp - create temporary file or directory */
 
 /*
-   Copyright (C) 2019 Free Software Foundation, Inc.
+   Copyright (C) 2019,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -32,8 +32,7 @@
 #define DEFAULT_PREFIX "shtmp"
 
 int
-mktemp_builtin (list)
-     WORD_LIST *list;
+mktemp_builtin (WORD_LIST *list)
 {
   WORD_LIST *l;
   int rval, opt, fd, mflags, base_mflags;
index fc1b267afe54128f1808ba4efee7eccfbc15ea92..dcbc84a00e77fa2c98e6a0fd427422a5d0d73c1b 100644 (file)
   while (0)
 
 static SHELL_VAR *
-assign_mypid (
-     SHELL_VAR *self,
-     char *value,
-     arrayind_t unused,
-     char *key )
+assign_mypid (SHELL_VAR *self, char *value, arrayind_t unused, char *key)
 {
   return (self);
 }
index dd2092b07e0951e33052cad58c60429d78a0bf9b..463866741fb1f8188ba31d93e30502349a2f5fbb 100644 (file)
@@ -4,7 +4,7 @@
    existing builtin. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -26,8 +26,7 @@
 #include "shell.h"
 
 int
-necho_builtin (list)
-WORD_LIST *list;
+necho_builtin (WORD_LIST *list)
 {
        print_word_list (list, " ");
        printf("\n");
index c1151db4260a8347c76dbfbb0de28d939d3878c2..174ba97699bdfe1e2a6fe98455b0042642bcd87d 100644 (file)
@@ -23,7 +23,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -94,9 +94,9 @@ extern int errno;
 #  define NAME_MAX_FOR(p)      NAME_MAX
 #endif
 
-extern char *strerror ();
+extern char *strerror (int);
 
-static int validate_path ();
+static int validate_path (char *, int);
 
 int
 pathchk_builtin (list)
@@ -185,8 +185,7 @@ static char const portable_chars[256] =
 /* If PATH contains only portable characters, return 1, else 0.  */
 
 static int
-portable_chars_only (path)
-     const char *path;
+portable_chars_only (const char *path)
 {
   const char *p;
 
@@ -206,9 +205,7 @@ portable_chars_only (path)
 #else
 # define SAFE_STAT(name, buf) safe_stat (name, buf)
 static inline int
-safe_stat (name, buf)
-     const char *name;
-     struct stat *buf;
+safe_stat (const char *name, struct stat *buf)
 {
   int ret;
 
@@ -224,8 +221,7 @@ safe_stat (name, buf)
    2 if it doesn't exist.  */
 
 static int
-dir_ok (path)
-     const char *path;
+dir_ok (const char *path)
 {
   struct stat stats;
 
@@ -255,8 +251,7 @@ dir_ok (path)
 }
 
 static char *
-xstrdup (s)
-     char *s;
+xstrdup (char *s)
 {
   return (savestring (s));
 }
@@ -276,9 +271,7 @@ xstrdup (s)
    Return 0 if all of these tests are successful, 1 if any fail. */
 
 static int
-validate_path (path, portability)
-     char *path;
-     int portability;
+validate_path (char *path, int portability)
 {
   int path_max;
   int last_elem;               /* Nonzero if checking last element of path. */
index d6c590352bda8f2bfb7bbe840ccc146d8dd4aa31..9b2f622858717681dc7f80f6c9134dc788366f39 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -42,8 +42,8 @@
 extern int errno;
 #endif
 
-int print_builtin ();
-static int printargs ();
+int print_builtin (WORD_LIST *);
+static int printargs (WORD_LIST *, FILE *);
 
 static FILE *ofp;
 
@@ -72,8 +72,7 @@ struct builtin print_struct = {
 #endif
 
 int
-print_builtin (list)
-     WORD_LIST *list;
+print_builtin (WORD_LIST *list)
 {
   int c, r, nflag, raw, ofd, sflag;
   intmax_t lfd;
@@ -170,9 +169,7 @@ opt_end:
 }
 
 static int
-printargs (list, ofp)
-     WORD_LIST *list;
-     FILE *ofp;
+printargs (WORD_LIST *list, FILE *ofp)
 {
   WORD_LIST *l;
   char *ostr;
index 8c7f72019941aa268dd9dcc4da1f28ccd770aa72..97ae5e6d60279031790d8a62dfc53acfb99e2c1d 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -34,8 +34,7 @@
 extern char **export_env;
 
 int
-printenv_builtin (list) 
-     WORD_LIST *list;
+printenv_builtin (WORD_LIST *list)
 {
   register char **envp;
   int opt;
index b27455b454bbe7a49f44e30ba613ca8aa2c94a2e..a1e7850056bc5ce62f2b0780fd23f32937b83c84 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 /*
-   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -39,8 +39,7 @@ extern pid_t dollar_dollar_pid;
 extern int last_command_exit_value;
 
 int
-push_builtin (list)
-     WORD_LIST *list;
+push_builtin (WORD_LIST *list)
 {
   pid_t pid;
   int xstatus, opt;
index ef836713827ee0787a809e21f44aa1f9889a40a3..0ce7a69c28a43ef6ddaeb83eeb6c7364bb5c8f89 100644 (file)
@@ -61,7 +61,7 @@
 extern int     errno;
 #endif
 
-extern char    *sh_realpath();
+extern char    *sh_realpath(const char *, char *);
 
 int
 realpath_builtin(WORD_LIST *list)
index d8d1522b81fa205ae6f1c1eb9fedbca724ae9677..02e74e745fb46949aa27c4e703d2ef519f6f72b5 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 2016 Free Software Foundation, Inc.
+   Copyright (C) 2016,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -114,8 +114,7 @@ rm_file(const char *fname)
 }
 
 int
-rm_builtin (list)
-     WORD_LIST *list;
+rm_builtin (WORD_LIST *list)
 {
   const char *name;
   WORD_LIST *l;
index 001c2bd9b303801f70a7766f7424d9fd5ab60b71..5a284448f7f12e67a398e087122fdbd120805321 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -33,8 +33,7 @@ extern int errno;
 #endif
 
 int
-rmdir_builtin (list)
-     WORD_LIST *list;
+rmdir_builtin (WORD_LIST *list)
 {
   int rval;
   WORD_LIST *l;
index f8eec5bbae65587560ea0a7aa57e75c31bdc8cdb..2a2be827109ed62d4ea77d26614f975de43dec09 100644 (file)
@@ -1,5 +1,5 @@
 /* seq - print sequence of numbers to standard output.
-   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+   Copyright (C) 2018-2022 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
@@ -61,8 +61,8 @@ typedef double floatmax_t;
 #  define FLOATMAX_FMT "%g"
 #  define FLOATMAX_WFMT "%0.f"
 #endif
-static floatmax_t getfloatmax PARAMS((const char *));
-static char *genformat PARAMS((floatmax_t, floatmax_t, floatmax_t));
+static floatmax_t getfloatmax (const char *);
+static char *genformat (floatmax_t, floatmax_t, floatmax_t);
 
 #define MAX(a, b) (((a) < (b))? (b) : (a))
 
@@ -81,8 +81,7 @@ static char decimal_point;
 
 /* Pretty much the same as the version in builtins/printf.def */
 static floatmax_t
-getfloatmax (arg)
-     const char *arg;
+getfloatmax (const char *arg)
 {
   floatmax_t ret;
   char *ep;
@@ -181,8 +180,7 @@ long_double_format (char const *fmt)
 
 /* Return the number of digits following the decimal point in NUMBUF */
 static int
-getprec (numbuf)
-     const char *numbuf;
+getprec (const char *numbuf)
 {
   int p;
   char *dp;
@@ -196,8 +194,7 @@ getprec (numbuf)
 
 /* Return the default format given FIRST, INCR, and LAST.  */
 static char *
-genformat (first, incr, last)
-       floatmax_t first, incr, last;
+genformat (floatmax_t first, floatmax_t incr, floatmax_t last)
 {
   static char buf[6 + 2 * INT_STRLEN_BOUND (int)];
   int wfirst, wlast, width;
@@ -242,9 +239,7 @@ genformat (first, incr, last)
 }
 
 int
-print_fltseq (fmt, first, last, incr)
-     const char *fmt;
-     floatmax_t first, last, incr;
+print_fltseq (const char *fmt, floatmax_t first, floatmax_t last, floatmax_t incr)
 {
   int n;
   floatmax_t next;
@@ -270,8 +265,7 @@ print_fltseq (fmt, first, last, incr)
 
 /* must be <= INT_STRLEN_BOUND(intmax_t) */
 int
-width_needed (num)
-     intmax_t num;
+width_needed (intmax_t num)
 {
   int ret;
 
@@ -285,8 +279,7 @@ width_needed (num)
 }
 
 int
-print_intseq (ifirst, ilast, iincr)
-     intmax_t ifirst, ilast, iincr;
+print_intseq (intmax_t ifirst, intmax_t ilast, intmax_t iincr)
 {
   char intwfmt[6 + INT_STRLEN_BOUND(int) + sizeof (PRIdMAX)];
   const char *s;
@@ -323,8 +316,7 @@ print_intseq (ifirst, ilast, iincr)
 }
 
 int
-seq_builtin (list)
-     WORD_LIST *list;
+seq_builtin (WORD_LIST *list)
 {
   floatmax_t first, last, incr;
   intmax_t ifirst, ilast, iincr;
index e56fd51ed3d34166f0a6db179b52ff3e6b1f4457..64ee4d5b812cd78cca78c033203830d4ae78bea6 100644 (file)
@@ -4,6 +4,8 @@
 
    Originally contributed by Jason Vas Dias <jason.vas.dias@gmail.com>
    
+   Copyright (C) 2018-2022 Free Software Foundation, Inc.
+
    Bash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
@@ -42,8 +44,7 @@
 #endif
 
 int
-setpgid_builtin (list)
-      WORD_LIST *list;
+setpgid_builtin (WORD_LIST *list)
 {
   register WORD_LIST *wl;
   intmax_t pid_arg, pgid_arg;
index e7a2831544d28806d1b94f1d65bead82898eb5d0..4cf398750b093f626305609cd73d08db5b60c35a 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /*
-   Copyright (C) 1999-2021 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
index 1e60e7b6d005e5c65317cc2294432855fd5b09c6..3ca1a5897a8214f412b186783c2d7d03f0f5ac39 100644 (file)
@@ -80,10 +80,7 @@ static char *arraysubs[] =
 static char *stattime (time_t, const char *);
 
 static int
-getstat (fname, flags, sp)
-     const char *fname;
-     int flags;
-     struct stat *sp;
+getstat (const char *fname, int flags, struct stat *sp)
 {
   intmax_t lfd;
   int fd, r;
@@ -109,9 +106,7 @@ getstat (fname, flags, sp)
 }
 
 static char *
-statlink (fname, sp)
-     char *fname;
-     struct stat *sp;
+statlink (char *fname, struct stat *sp)
 {
 #if defined (HAVE_READLINK)
   char linkbuf[PATH_MAX];
@@ -128,8 +123,7 @@ statlink (fname, sp)
 }
 
 static char *
-octalperms (m)
-     int m;
+octalperms (int m)
 {
   int operms;
   char *ret;
@@ -170,8 +164,7 @@ octalperms (m)
 }
 
 static char *
-statperms (m)
-     int m;
+statperms (int m)
 {
   char ubits[4], gbits[4], obits[4];   /* u=rwx,g=rwx,o=rwx */
   int i;
@@ -217,8 +210,7 @@ statperms (m)
 }
 
 static char *
-statmode(mode)
-     int mode;
+statmode(int mode)
 {
   char *modestr, *m;
 
@@ -260,9 +252,7 @@ statmode(mode)
 }
 
 static char *
-stattime (t, timefmt)
-     time_t t;
-     const char *timefmt;
+stattime (time_t t, const char *timefmt)
 {
   char *tbuf, *ret;
   const char *fmt;
@@ -282,12 +272,7 @@ stattime (t, timefmt)
 }
 
 static char *
-statval (which, fname, flags, fmt, sp)
-     int which;
-     char *fname;
-     int flags;
-     char *fmt;
-     struct stat *sp;
+statval (int which, char *fname, int flags, char *fmt, struct stat *sp)
 {
   int temp;
 
@@ -332,13 +317,7 @@ statval (which, fname, flags, fmt, sp)
 }
 
 static int
-loadstat (vname, var, fname, flags, fmt, sp)
-     char *vname;
-     SHELL_VAR *var;
-     char *fname;
-     int flags;
-     char *fmt;
-     struct stat *sp;
+loadstat (char *vname, SHELL_VAR *var, char *fname, int flags, char *fmt, struct stat *sp)
 {
   int i;
   char *key, *value;
@@ -354,8 +333,7 @@ loadstat (vname, var, fname, flags, fmt, sp)
 }
 
 int
-stat_builtin (list)
-     WORD_LIST *list;
+stat_builtin (WORD_LIST *list)
 {
   int opt, flags;
   char *aname, *fname, *timefmt;
index f4e194e6ba471c21ba289ed9a3c2cbb2101ca01f..e6c8141eba1e4a3ce01d0781afc0934d8b371918 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -37,8 +37,7 @@
 #include "bashgetopt.h"
 
 int
-strftime_builtin (list)
-     WORD_LIST *list;
+strftime_builtin (WORD_LIST *list)
 {
   char *format, *tbuf;
   size_t tbsize, tsize;
index 1eb5497689d686d80db50c0660a91b8c5730da20..e8463877d536d47a07dae9c79c1d786b8f7fd195 100644 (file)
@@ -1,7 +1,7 @@
 /* sync - sync the disks by forcing pending filesystem writes to complete */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -36,8 +36,7 @@ extern int errno;
 #endif
 
 int
-sync_builtin (list)
-     WORD_LIST *list;
+sync_builtin (WORD_LIST *list)
 {
   int fd, status;
   WORD_LIST *l;
index 0365aa9a49b3e454459c307754838967516ad0ed..9f26b2d44e92765333a14d336e5d7d4f942919a2 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2021 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -61,8 +61,7 @@ extern int interrupt_immediately;
 extern char *strerror ();
 
 int
-tee_builtin (list)
-     WORD_LIST *list;
+tee_builtin (WORD_LIST *list)
 {
   int opt, append, nointr, rval, fd, fflags;
   int n, nr, nw;
index 094b80ce93ce9e79b06cdaad19dc9273774682b5..ca9e16f97f387760a37b889900629fab78d7b51c 100644 (file)
 extern int errno;
 #endif
 
-extern char *strerror ();
+extern char *strerror (int);
 
 int
-template_builtin (list)
-     WORD_LIST *list;
+template_builtin (WORD_LIST *list)
 {
   int opt, rval;
 
@@ -45,16 +44,14 @@ template_builtin (list)
 /* Called when `template' is enabled and loaded from the shared object.  If this
    function returns 0, the load fails. */
 int
-template_builtin_load (name)
-     char *name;
+template_builtin_load (char *name)
 {
   return (1);
 }
 
 /* Called when `template' is disabled. */
 void
-template_builtin_unload (name)
-     char *name;
+template_builtin_unload (char *name)
 {
 }
 
index e011fa1f955c97e8f7443bb1b1fae3572eaaf5cc..c29c0b33495ac7aa1cc0629e5c345fc0fa79e43c 100644 (file)
@@ -1,7 +1,7 @@
 /* true and false builtins */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
 #include "common.h"
 
 int
-true_builtin (list)
-     WORD_LIST *list;
+true_builtin (WORD_LIST *list)
 {
   return EXECUTION_SUCCESS;
 }
 
 int
-false_builtin (list)
-     WORD_LIST *list;
+false_builtin (WORD_LIST *list)
 {
   return EXECUTION_FAILURE;
 }
index 381df2578c754e31d9b8e3ef091396b59e6f2eb2..b717766a1732a0384e7e43d6a2f545218fe12948 100644 (file)
@@ -3,7 +3,7 @@
 /* See Makefile for compilation details. */
 
 /*
-   Copyright (C) 1999-2021 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -31,8 +31,7 @@
 extern char *ttyname ();
 
 int
-tty_builtin (list)
-     WORD_LIST *list;
+tty_builtin (WORD_LIST *list)
 {
   int opt, sflag;
   char *t;
index 106a1c8db5c1d59765a85b69aa2af301ea144808..81ea2b0ef3eaf68a61a6bb97da5262a01fd4a84b 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -59,13 +59,12 @@ struct utsname {
 extern int errno;
 #endif
 
-static void uprint();
+static void uprint(int, char *);
 
 static int uname_flags;
 
 int
-uname_builtin (list)
-     WORD_LIST *list;
+uname_builtin (WORD_LIST *list)
 {
   int opt, r;
   struct utsname uninfo;
@@ -134,9 +133,7 @@ uname_builtin (list)
 }
 
 static void
-uprint (flag, info)
-     int flag;
-     char *info;
+uprint (int flag, char *info)
 {
   if (uname_flags & flag)
     {
index ff2a78a03fb7fb7e18e2617b1bace7bf4ed5e413..8431b61bbcda61ccb3eea367e72852d551e0f05d 100644 (file)
@@ -4,7 +4,7 @@
    fsck clean up the file system. */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -39,8 +39,7 @@ extern int errno;
 #endif
 
 int
-unlink_builtin (list)
-     WORD_LIST *list;
+unlink_builtin (WORD_LIST *list)
 {
   if (list == 0)
     {
index 3e7e36e4bad97093a040544240286968b67cb798..7e11ba2ef9e010948388916fe54f9f188d3e81bc 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /*
-   Copyright (C) 1999-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
    Bash is free software: you can redistribute it and/or modify
@@ -29,8 +29,7 @@
 #include "common.h"
 
 int
-whoami_builtin (list)
-     WORD_LIST *list;
+whoami_builtin (WORD_LIST *list)
 {
   int opt;
 
index d1545f0dd42a0ab3c34d7bc5ce86c57c3b356c2a..8152a4a8fd4523fdca6516d446820b48c6b6719b 100644 (file)
@@ -1,6 +1,6 @@
 /* execute_cmd.h - functions from execute_cmd.c. */
 
-/* Copyright (C) 1993-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2017,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -70,55 +70,55 @@ extern SHELL_VAR *this_shell_function;
 
 /* Functions declared in execute_cmd.c, used by many other files */
 
-extern struct fd_bitmap *new_fd_bitmap PARAMS((int));
-extern void dispose_fd_bitmap PARAMS((struct fd_bitmap *));
-extern void close_fd_bitmap PARAMS((struct fd_bitmap *));
-extern int executing_line_number PARAMS((void));
-extern int execute_command PARAMS((COMMAND *));
-extern int execute_command_internal PARAMS((COMMAND *, int, int, int, struct fd_bitmap *));
-extern int shell_execve PARAMS((char *, char **, char **));
-extern void setup_async_signals PARAMS((void));
-extern void async_redirect_stdin PARAMS((void));
+extern struct fd_bitmap *new_fd_bitmap (int);
+extern void dispose_fd_bitmap (struct fd_bitmap *);
+extern void close_fd_bitmap (struct fd_bitmap *);
+extern int executing_line_number (void);
+extern int execute_command (COMMAND *);
+extern int execute_command_internal (COMMAND *, int, int, int, struct fd_bitmap *);
+extern int shell_execve (char *, char **, char **);
+extern void setup_async_signals (void);
+extern void async_redirect_stdin (void);
 
-extern void undo_partial_redirects PARAMS((void));
-extern void dispose_partial_redirects PARAMS((void));
-extern void dispose_exec_redirects PARAMS((void));
+extern void undo_partial_redirects (void);
+extern void dispose_partial_redirects (void);
+extern void dispose_exec_redirects (void);
 
-extern int execute_shell_function PARAMS((SHELL_VAR *, WORD_LIST *));
+extern int execute_shell_function (SHELL_VAR *, WORD_LIST *);
 
-extern struct coproc *getcoprocbypid PARAMS((pid_t));
-extern struct coproc *getcoprocbyname PARAMS((const char *));
+extern struct coproc *getcoprocbypid (pid_t);
+extern struct coproc *getcoprocbyname (const char *);
 
-extern void coproc_init PARAMS((struct coproc *));
-extern struct coproc *coproc_alloc PARAMS((char *, pid_t));
-extern void coproc_dispose PARAMS((struct coproc *));
-extern void coproc_flush PARAMS((void));
-extern void coproc_close PARAMS((struct coproc *));
-extern void coproc_closeall PARAMS((void));
-extern void coproc_reap PARAMS((void));
-extern pid_t coproc_active PARAMS((void));
+extern void coproc_init (struct coproc *);
+extern struct coproc *coproc_alloc (char *, pid_t);
+extern void coproc_dispose (struct coproc *);
+extern void coproc_flush (void);
+extern void coproc_close (struct coproc *);
+extern void coproc_closeall (void);
+extern void coproc_reap (void);
+extern pid_t coproc_active (void);
 
-extern void coproc_rclose PARAMS((struct coproc *, int));
-extern void coproc_wclose PARAMS((struct coproc *, int));
-extern void coproc_fdclose PARAMS((struct coproc *, int));
+extern void coproc_rclose (struct coproc *, int);
+extern void coproc_wclose (struct coproc *, int);
+extern void coproc_fdclose (struct coproc *, int);
 
-extern void coproc_checkfd PARAMS((struct coproc *, int));
-extern void coproc_fdchk PARAMS((int));
+extern void coproc_checkfd (struct coproc *, int);
+extern void coproc_fdchk (int);
 
-extern void coproc_pidchk PARAMS((pid_t, int));
+extern void coproc_pidchk (pid_t, int);
 
-extern void coproc_fdsave PARAMS((struct coproc *));
-extern void coproc_fdrestore PARAMS((struct coproc *));
+extern void coproc_fdsave (struct coproc *);
+extern void coproc_fdrestore (struct coproc *);
 
-extern void coproc_setvars PARAMS((struct coproc *));
-extern void coproc_unsetvars PARAMS((struct coproc *));
+extern void coproc_setvars (struct coproc *);
+extern void coproc_unsetvars (struct coproc *);
 
 #if defined (PROCESS_SUBSTITUTION)
-extern void close_all_files PARAMS((void));
+extern void close_all_files (void);
 #endif
 
 #if defined (ARRAY_VARS)
-extern void restore_funcarray_state PARAMS((struct func_array_state *));
+extern void restore_funcarray_state (struct func_array_state *);
 #endif
 
 #endif /* _EXECUTE_CMD_H_ */
index 931dba9cd3c317199115c093e08c21f14960cc9d..bac4708002419d499f90bbccb92df9703c77b658 100644 (file)
--- a/externs.h
+++ b/externs.h
@@ -1,7 +1,7 @@
 /* externs.h -- extern function declarations which do not appear in their
    own header file. */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 /* Functions from expr.c. */
 #define EXP_EXPANDED   0x01
 
-extern intmax_t evalexp PARAMS((char *, int, int *));
+extern intmax_t evalexp (char *, int, int *);
 
 /* Functions from print_cmd.c. */
 #define FUNC_MULTILINE 0x01
 #define FUNC_EXTERNAL  0x02
 
-extern char *make_command_string PARAMS((COMMAND *));
-extern char *print_comsub PARAMS((COMMAND *));
-extern char *named_function_string PARAMS((char *, COMMAND *, int));
+extern char *make_command_string (COMMAND *);
+extern char *print_comsub (COMMAND *);
+extern char *named_function_string (char *, COMMAND *, int);
 
-extern void print_command PARAMS((COMMAND *));
-extern void print_simple_command PARAMS((SIMPLE_COM *));
-extern void print_word_list PARAMS((WORD_LIST *, char *));
+extern void print_command (COMMAND *);
+extern void print_simple_command (SIMPLE_COM *);
+extern void print_word_list (WORD_LIST *, char *);
 
 /* debugger support */
-extern void print_for_command_head PARAMS((FOR_COM *));
+extern void print_for_command_head (FOR_COM *);
 #if defined (SELECT_COMMAND)
-extern void print_select_command_head PARAMS((SELECT_COM *));
+extern void print_select_command_head (SELECT_COM *);
 #endif
-extern void print_case_command_head PARAMS((CASE_COM *));
+extern void print_case_command_head (CASE_COM *);
 #if defined (DPAREN_ARITHMETIC)
-extern void print_arith_command PARAMS((WORD_LIST *));
+extern void print_arith_command (WORD_LIST *);
 #endif
 #if defined (COND_COMMAND)
-extern void print_cond_command PARAMS((COND_COM *));
+extern void print_cond_command (COND_COM *);
 #endif
 
 /* set -x support */
-extern void xtrace_init PARAMS((void));
+extern void xtrace_init (void);
 #ifdef NEED_XTRACE_SET_DECL
-extern void xtrace_set PARAMS((int, FILE *));
-#endif
-extern void xtrace_fdchk PARAMS((int));
-extern void xtrace_reset PARAMS((void));
-extern char *indirection_level_string PARAMS((void));
-extern void xtrace_print_assignment PARAMS((char *, char *, int, int));
-extern void xtrace_print_word_list PARAMS((WORD_LIST *, int));
-extern void xtrace_print_for_command_head PARAMS((FOR_COM *));
+extern void xtrace_set (int, FILE *);
+#endif
+extern void xtrace_fdchk (int);
+extern void xtrace_reset (void);
+extern char *indirection_level_string (void);
+extern void xtrace_print_assignment (char *, char *, int, int);
+extern void xtrace_print_word_list (WORD_LIST *, int);
+extern void xtrace_print_for_command_head (FOR_COM *);
 #if defined (SELECT_COMMAND)
-extern void xtrace_print_select_command_head PARAMS((SELECT_COM *));
+extern void xtrace_print_select_command_head (SELECT_COM *);
 #endif
-extern void xtrace_print_case_command_head PARAMS((CASE_COM *));
+extern void xtrace_print_case_command_head (CASE_COM *);
 #if defined (DPAREN_ARITHMETIC)
-extern void xtrace_print_arith_cmd PARAMS((WORD_LIST *));
+extern void xtrace_print_arith_cmd (WORD_LIST *);
 #endif
 #if defined (COND_COMMAND)
-extern void xtrace_print_cond_term PARAMS((int, int, WORD_DESC *, char *, char *));
+extern void xtrace_print_cond_term (int, int, WORD_DESC *, char *, char *);
 #endif
 
 /* Functions from shell.c. */
-extern void exit_shell PARAMS((int)) __attribute__((__noreturn__));
-extern void sh_exit PARAMS((int)) __attribute__((__noreturn__));
-extern void subshell_exit PARAMS((int)) __attribute__((__noreturn__));
-extern void set_exit_status PARAMS((int));
-extern void disable_priv_mode PARAMS((void));
-extern void unbind_args PARAMS((void));
+extern void exit_shell (int) __attribute__((__noreturn__));
+extern void sh_exit (int) __attribute__((__noreturn__));
+extern void subshell_exit (int) __attribute__((__noreturn__));
+extern void set_exit_status (int);
+extern void disable_priv_mode (void);
+extern void unbind_args (void);
 
 #if defined (RESTRICTED_SHELL)
-extern int shell_is_restricted PARAMS((char *));
-extern int maybe_make_restricted PARAMS((char *));
+extern int shell_is_restricted (char *);
+extern int maybe_make_restricted (char *);
 #endif
 
-extern void unset_bash_input PARAMS((int));
-extern void get_current_user_info PARAMS((void));
+extern void unset_bash_input (int);
+extern void get_current_user_info (void);
 
 /* Functions from eval.c. */
-extern int reader_loop PARAMS((void));
-extern int pretty_print_loop PARAMS((void));
-extern int parse_command PARAMS((void));
-extern int read_command PARAMS((void));
+extern int reader_loop (void);
+extern int pretty_print_loop (void);
+extern int parse_command (void);
+extern int read_command (void);
 
 /* Functions from braces.c. */
 #if defined (BRACE_EXPANSION)
-extern char **brace_expand PARAMS((char *));
+extern char **brace_expand (char *);
 #endif
 
 /* Miscellaneous functions from parse.y */
-extern int yyparse PARAMS((void));
-extern int return_EOF PARAMS((void));
-extern void push_token PARAMS((int));
-extern char *xparse_dolparen PARAMS((char *, char *, int *, int));
-extern COMMAND *parse_string_to_command PARAMS((char *, int));
-extern void reset_parser PARAMS((void));
-extern void reset_readahead_token PARAMS((void));
-extern WORD_LIST *parse_string_to_word_list PARAMS((char *, int, const char *));
+extern int yyparse (void);
+extern int return_EOF (void);
+extern void push_token (int);
+extern char *xparse_dolparen (char *, char *, int *, int);
+extern COMMAND *parse_string_to_command (char *, int);
+extern void reset_parser (void);
+extern void reset_readahead_token (void);
+extern WORD_LIST *parse_string_to_word_list (char *, int, const char *);
 
-extern int parser_will_prompt PARAMS((void));
-extern int parser_in_command_position PARAMS((void));
+extern int parser_will_prompt (void);
+extern int parser_in_command_position (void);
 
-extern void free_pushed_string_input PARAMS((void));
+extern void free_pushed_string_input (void);
 
-extern int parser_expanding_alias PARAMS((void));
-extern void parser_save_alias PARAMS((void));
-extern void parser_restore_alias PARAMS((void));
+extern int parser_expanding_alias (void);
+extern void parser_save_alias (void);
+extern void parser_restore_alias (void);
 
-extern void clear_shell_input_line PARAMS((void));
+extern void clear_shell_input_line (void);
 
-extern char *decode_prompt_string PARAMS((char *));
+extern char *decode_prompt_string (char *);
 
-extern int get_current_prompt_level PARAMS((void));
-extern void set_current_prompt_level PARAMS((int));
+extern int get_current_prompt_level (void);
+extern void set_current_prompt_level (int);
 
 #if defined (HISTORY)
-extern char *history_delimiting_chars PARAMS((const char *));
+extern char *history_delimiting_chars (const char *);
 #endif
 
 /* Declarations for functions defined in locale.c */
-extern void set_default_locale PARAMS((void));
-extern void set_default_locale_vars PARAMS((void));
-extern int set_locale_var PARAMS((char *, char *));
-extern int set_lang PARAMS((char *, char *));
-extern void set_default_lang PARAMS((void));
-extern char *get_locale_var PARAMS((char *));
-extern char *localetrans PARAMS((char *, int, int *));
-extern char *mk_msgstr PARAMS((char *, int *));
-extern char *locale_expand PARAMS((char *, int, int, int, int *));
+extern void set_default_locale (void);
+extern void set_default_locale_vars (void);
+extern int set_locale_var (char *, char *);
+extern int set_lang (char *, char *);
+extern void set_default_lang (void);
+extern char *get_locale_var (char *);
+extern char *localetrans (char *, int, int *);
+extern char *mk_msgstr (char *, int *);
+extern char *locale_expand (char *, int, int, int, int *);
 #ifndef locale_decpoint
-extern int locale_decpoint PARAMS((void));
+extern int locale_decpoint (void);
 #endif
 
 /* Declarations for functions defined in list.c. */
-extern void list_walk PARAMS((GENERIC_LIST *, sh_glist_func_t *));
-extern void wlist_walk PARAMS((WORD_LIST *, sh_icpfunc_t *));
+extern void list_walk (GENERIC_LIST *, sh_glist_func_t *);
+extern void wlist_walk (WORD_LIST *, sh_icpfunc_t *);
+/* type punning used to pass arbitrary list types to list_reverse, et al so
+   there are no prototypes. */
 extern GENERIC_LIST *list_reverse ();
 extern int list_length ();
 extern GENERIC_LIST *list_append ();
-extern GENERIC_LIST *list_remove ();
+extern GENERIC_LIST *list_remove ();   /* unused */
 
 /* Declarations for functions defined in stringlib.c */
-extern int find_string_in_alist PARAMS((char *, STRING_INT_ALIST *, int));
-extern char *find_token_in_alist PARAMS((int, STRING_INT_ALIST *, int));
-extern int find_index_in_alist PARAMS((char *, STRING_INT_ALIST *, int));
+extern int find_string_in_alist (char *, STRING_INT_ALIST *, int);
+extern char *find_token_in_alist (int, STRING_INT_ALIST *, int);
+extern int find_index_in_alist (char *, STRING_INT_ALIST *, int);
 
-extern char *substring PARAMS((const char *, int, int));
-extern char *strsub PARAMS((char *, char *, char *, int));
-extern char *strcreplace PARAMS((char *, int, const char *, int));
-extern void strip_leading PARAMS((char *));
-extern void strip_trailing PARAMS((char *, int, int));
-extern void xbcopy PARAMS((char *, char *, int));
+extern char *substring (const char *, int, int);
+extern char *strsub (char *, char *, char *, int);
+extern char *strcreplace (char *, int, const char *, int);
+extern void strip_leading (char *);
+extern void strip_trailing (char *, int, int);
+extern void xbcopy (char *, char *, int);
 
 /* Functions from version.c. */
-extern char *shell_version_string PARAMS((void));
-extern void show_shell_version PARAMS((int));
+extern char *shell_version_string (void);
+extern void show_shell_version (int);
 
 /* Functions from the bash library, lib/sh/libsh.a.  These should really
    go into a separate include file. */
 
 /* declarations for functions defined in lib/sh/casemod.c */
-extern char *sh_modcase PARAMS((const char *, char *, int));
+extern char *sh_modcase (const char *, char *, int);
 
 /* Defines for flags argument to sh_modcase.  These need to agree with what's
    in lib/sh/casemode.c */
@@ -193,15 +195,17 @@ extern char *sh_modcase PARAMS((const char *, char *, int));
 #define CASE_USEWORDS  0x1000
 
 /* declarations for functions defined in lib/sh/clktck.c */
-extern long get_clk_tck PARAMS((void));
+extern long get_clk_tck (void);
 
 /* declarations for functions defined in lib/sh/clock.c */
+/* No prototypes so we don't have to have clock_t defined when this file
+   is included. */
 extern void clock_t_to_secs ();
 extern void print_clock_t ();
 
 /* Declarations for functions defined in lib/sh/dprintf.c */
 #if !defined (HAVE_DPRINTF)
-extern void dprintf PARAMS((int, const char *, ...))  __attribute__((__format__ (printf, 2, 3)));
+extern void dprintf (int, const char *, ...))  __attribute__((__format__ (printf, 2, 3));
 #endif
 
 /* Declarations for functions defined in lib/sh/fmtulong.c */
@@ -210,19 +214,19 @@ extern void dprintf PARAMS((int, const char *, ...))  __attribute__((__format__
 #define FL_HEXUPPER   0x04    /* use uppercase when converting to hex */
 #define FL_UNSIGNED   0x08    /* don't add any sign */
 
-extern char *fmtulong PARAMS((unsigned long int, int, char *, size_t, int));
+extern char *fmtulong (unsigned long int, int, char *, size_t, int);
 
 /* Declarations for functions defined in lib/sh/fmtulong.c */
 #if defined (HAVE_LONG_LONG_INT)
-extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int));
+extern char *fmtullong (unsigned long long int, int, char *, size_t, int);
 #endif
 
 /* Declarations for functions defined in lib/sh/fmtumax.c */
-extern char *fmtumax PARAMS((uintmax_t, int, char *, size_t, int));
+extern char *fmtumax (uintmax_t, int, char *, size_t, int);
 
 /* Declarations for functions defined in lib/sh/fnxform.c */
-extern char *fnx_fromfs PARAMS((char *, size_t));
-extern char *fnx_tofs PARAMS((char *, size_t));
+extern char *fnx_fromfs (char *, size_t);
+extern char *fnx_tofs (char *, size_t);
 
 /* Declarations for functions defined in lib/sh/fpurge.c */
 
@@ -232,25 +236,25 @@ extern char *fnx_tofs PARAMS((char *, size_t));
 #if HAVE_FPURGE
 #  define fpurge _bash_fpurge
 #endif
-extern int fpurge PARAMS((FILE *stream));
+extern int fpurge (FILE *stream);
 
 #endif /* HAVE_DECL_FPURGE */
 #endif /* NEED_FPURGE_DECL */
 
 /* Declarations for functions defined in lib/sh/getcwd.c */
 #if !defined (HAVE_GETCWD)
-extern char *getcwd PARAMS((char *, size_t));
+extern char *getcwd (char *, size_t);
 #endif
 
 /* Declarations for functions defined in lib/sh/input_avail.c */
-extern int input_avail PARAMS((int));
+extern int input_avail (int);
 
 /* Declarations for functions defined in lib/sh/itos.c */
-extern char *inttostr PARAMS((intmax_t, char *, size_t));
-extern char *itos PARAMS((intmax_t));
-extern char *mitos PARAMS((intmax_t));
-extern char *uinttostr PARAMS((uintmax_t, char *, size_t));
-extern char *uitos PARAMS((uintmax_t));
+extern char *inttostr (intmax_t, char *, size_t);
+extern char *itos (intmax_t);
+extern char *mitos (intmax_t);
+extern char *uinttostr (uintmax_t, char *, size_t);
+extern char *uitos (uintmax_t);
 
 /* declarations for functions defined in lib/sh/makepath.c */
 #define MP_DOTILDE     0x01
@@ -258,45 +262,45 @@ extern char *uitos PARAMS((uintmax_t));
 #define MP_RMDOT       0x04
 #define MP_IGNDOT      0x08
 
-extern char *sh_makepath PARAMS((const char *, const char *, int));
+extern char *sh_makepath (const char *, const char *, int);
 
 /* declarations for functions defined in lib/sh/mbscasecmp.c */
 #if !defined (HAVE_MBSCASECMP)
-extern char *mbscasecmp PARAMS((const char *, const char *));
+extern char *mbscasecmp (const char *, const char *);
 #endif
 
 /* declarations for functions defined in lib/sh/mbschr.c */
 #if !defined (HAVE_MBSCHR)
-extern char *mbschr PARAMS((const char *, int));
+extern char *mbschr (const char *, int);
 #endif
 
 /* declarations for functions defined in lib/sh/mbscmp.c */
 #if !defined (HAVE_MBSCMP)
-extern char *mbscmp PARAMS((const char *, const char *));
+extern char *mbscmp (const char *, const char *);
 #endif
 
 /* declarations for functions defined in lib/sh/netconn.c */
-extern int isnetconn PARAMS((int));
+extern int isnetconn (int);
 
 /* declarations for functions defined in lib/sh/netopen.c */
-extern int netopen PARAMS((char *));
+extern int netopen (char *);
 
 /* Declarations for  functions defined in lib/sh/oslib.c */
 
 #if !defined (HAVE_DUP2) || defined (DUP2_BROKEN)
-extern int dup2 PARAMS((int, int));
+extern int dup2 (int, int);
 #endif
 
 #if !defined (HAVE_GETDTABLESIZE)
-extern int getdtablesize PARAMS((void));
+extern int getdtablesize (void);
 #endif /* !HAVE_GETDTABLESIZE */
 
 #if !defined (HAVE_GETHOSTNAME)
-extern int gethostname PARAMS((char *, int));
+extern int gethostname (char *, int);
 #endif /* !HAVE_GETHOSTNAME */
 
-extern int getmaxgroups PARAMS((void));
-extern long getmaxchild PARAMS((void));
+extern int getmaxgroups (void);
+extern long getmaxchild (void);
 
 /* declarations for functions defined in lib/sh/pathcanon.c */
 #define PATH_CHECKDOTDOT       0x0001
@@ -304,78 +308,78 @@ extern long getmaxchild PARAMS((void));
 #define PATH_HARDPATH          0x0004
 #define PATH_NOALLOC           0x0008
 
-extern char *sh_canonpath PARAMS((char *, int));
+extern char *sh_canonpath (char *, int);
 
 /* declarations for functions defined in lib/sh/pathphys.c */
-extern char *sh_physpath PARAMS((char *, int));
-extern char *sh_realpath PARAMS((const char *, char *));
+extern char *sh_physpath (char *, int);
+extern char *sh_realpath (const char *, char *);
 
 /* declarations for functions defined in lib/sh/random.c */
-extern int brand PARAMS((void));
-extern void sbrand PARAMS((unsigned long));            /* set bash random number generator. */
-extern void seedrand PARAMS((void));                   /* seed generator randomly */
-extern void seedrand32 PARAMS((void));
-extern u_bits32_t get_urandom32 PARAMS((void));
+extern int brand (void);
+extern void sbrand (unsigned long);            /* set bash random number generator. */
+extern void seedrand (void);                   /* seed generator randomly */
+extern void seedrand32 (void);
+extern u_bits32_t get_urandom32 (void);
 
 /* declarations for functions defined in lib/sh/setlinebuf.c */
 #ifdef NEED_SH_SETLINEBUF_DECL
-extern int sh_setlinebuf PARAMS((FILE *));
+extern int sh_setlinebuf (FILE *);
 #endif
 
 /* declarations for functions defined in lib/sh/shaccess.c */
-extern int sh_eaccess PARAMS((const char *, int));
+extern int sh_eaccess (const char *, int);
 
 /* declarations for functions defined in lib/sh/shmatch.c */
-extern int sh_regmatch PARAMS((const char *, const char *, int));
+extern int sh_regmatch (const char *, const char *, int);
 
 /* defines for flags argument to sh_regmatch. */
 #define SHMAT_SUBEXP           0x001   /* save subexpressions in SH_REMATCH */
 #define SHMAT_PWARN            0x002   /* print a warning message on invalid regexp */
 
 /* declarations for functions defined in lib/sh/shmbchar.c */
-extern size_t mbstrlen PARAMS((const char *));
-extern char *mbsmbchar PARAMS((const char *));
-extern int sh_mbsnlen PARAMS((const char *, size_t, int));
+extern size_t mbstrlen (const char *);
+extern char *mbsmbchar (const char *);
+extern int sh_mbsnlen (const char *, size_t, int);
 
 /* declarations for functions defined in lib/sh/shquote.c */
-extern char *sh_single_quote PARAMS((const char *));
-extern char *sh_double_quote PARAMS((const char *));
-extern char *sh_mkdoublequoted PARAMS((const char *, int, int));
-extern char *sh_un_double_quote PARAMS((char *));
-extern char *sh_backslash_quote PARAMS((char *, const char *, int));
-extern char *sh_backslash_quote_for_double_quotes PARAMS((char *, int));
-extern char *sh_quote_reusable PARAMS((char *, int));
-extern int sh_contains_shell_metas PARAMS((const char *));
-extern int sh_contains_quotes PARAMS((const char *));
+extern char *sh_single_quote (const char *);
+extern char *sh_double_quote (const char *);
+extern char *sh_mkdoublequoted (const char *, int, int);
+extern char *sh_un_double_quote (char *);
+extern char *sh_backslash_quote (char *, const char *, int);
+extern char *sh_backslash_quote_for_double_quotes (char *, int);
+extern char *sh_quote_reusable (char *, int);
+extern int sh_contains_shell_metas (const char *);
+extern int sh_contains_quotes (const char *);
 
 /* declarations for functions defined in lib/sh/spell.c */
-extern int spname PARAMS((char *, char *));
-extern char *dirspell PARAMS((char *));
+extern int spname (char *, char *);
+extern char *dirspell (char *);
 
 /* declarations for functions defined in lib/sh/strcasecmp.c */
 #if !defined (HAVE_STRCASECMP)
-extern int strncasecmp PARAMS((const char *, const char *, size_t));
-extern int strcasecmp PARAMS((const char *, const char *));
+extern int strncasecmp (const char *, const char *, size_t);
+extern int strcasecmp (const char *, const char *);
 #endif /* HAVE_STRCASECMP */
 
 /* declarations for functions defined in lib/sh/strcasestr.c */
 #if ! HAVE_STRCASESTR
-extern char *strcasestr PARAMS((const char *, const char *));
+extern char *strcasestr (const char *, const char *);
 #endif
 
 /* declarations for functions defined in lib/sh/strchrnul.c */
 #if ! HAVE_STRCHRNUL
-extern char *strchrnul PARAMS((const char *, int));
+extern char *strchrnul (const char *, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strerror.c */
 #if !defined (HAVE_STRERROR) && !defined (strerror)
-extern char *strerror PARAMS((int));
+extern char *strerror (int);
 #endif
 
 /* declarations for functions defined in lib/sh/strftime.c */
 #if !defined (HAVE_STRFTIME) && defined (NEED_STRFTIME_DECL)
-extern size_t strftime PARAMS((char *, size_t, const char *, const struct tm *));
+extern size_t strftime (char *, size_t, const char *, const struct tm *);
 #endif
 
 /* declarations for functions and structures defined in lib/sh/stringlist.c */
@@ -387,94 +391,94 @@ typedef struct _list_of_strings {
   int list_len;
 } STRINGLIST;
 
-typedef int sh_strlist_map_func_t PARAMS((char *));
-
-extern STRINGLIST *strlist_create PARAMS((int));
-extern STRINGLIST *strlist_resize PARAMS((STRINGLIST *, int));
-extern void strlist_flush PARAMS((STRINGLIST *));
-extern void strlist_dispose PARAMS((STRINGLIST *));
-extern int strlist_remove PARAMS((STRINGLIST *, char *));
-extern STRINGLIST *strlist_copy PARAMS((STRINGLIST *));
-extern STRINGLIST *strlist_merge PARAMS((STRINGLIST *, STRINGLIST *));
-extern STRINGLIST *strlist_append PARAMS((STRINGLIST *, STRINGLIST *));
-extern STRINGLIST *strlist_prefix_suffix PARAMS((STRINGLIST *, char *, char *));
-extern void strlist_print PARAMS((STRINGLIST *, char *));
-extern void strlist_walk PARAMS((STRINGLIST *, sh_strlist_map_func_t *));
-extern void strlist_sort PARAMS((STRINGLIST *));
+typedef int sh_strlist_map_func_t (char *);
+
+extern STRINGLIST *strlist_create (int);
+extern STRINGLIST *strlist_resize (STRINGLIST *, int);
+extern void strlist_flush (STRINGLIST *);
+extern void strlist_dispose (STRINGLIST *);
+extern int strlist_remove (STRINGLIST *, char *);
+extern STRINGLIST *strlist_copy (STRINGLIST *);
+extern STRINGLIST *strlist_merge (STRINGLIST *, STRINGLIST *);
+extern STRINGLIST *strlist_append (STRINGLIST *, STRINGLIST *);
+extern STRINGLIST *strlist_prefix_suffix (STRINGLIST *, char *, char *);
+extern void strlist_print (STRINGLIST *, char *);
+extern void strlist_walk (STRINGLIST *, sh_strlist_map_func_t *);
+extern void strlist_sort (STRINGLIST *);
 
 /* declarations for functions defined in lib/sh/stringvec.c */
 
-extern char **strvec_create PARAMS((int));
-extern char **strvec_resize PARAMS((char **, int));
-extern char **strvec_mcreate PARAMS((int));
-extern char **strvec_mresize PARAMS((char **, int));
-extern void strvec_flush PARAMS((char **));
-extern void strvec_dispose PARAMS((char **));
-extern int strvec_remove PARAMS((char **, char *));
-extern int strvec_len PARAMS((char **));
-extern int strvec_search PARAMS((char **, char *));
-extern char **strvec_copy PARAMS((char **));
-extern int strvec_posixcmp PARAMS((char **, char **));
-extern int strvec_strcmp PARAMS((char **, char **));
-extern void strvec_sort PARAMS((char **, int));
-
-extern char **strvec_from_word_list PARAMS((WORD_LIST *, int, int, int *));
-extern WORD_LIST *strvec_to_word_list PARAMS((char **, int, int));
+extern char **strvec_create (int);
+extern char **strvec_resize (char **, int);
+extern char **strvec_mcreate (int);
+extern char **strvec_mresize (char **, int);
+extern void strvec_flush (char **);
+extern void strvec_dispose (char **);
+extern int strvec_remove (char **, char *);
+extern int strvec_len (char **);
+extern int strvec_search (char **, char *);
+extern char **strvec_copy (char **);
+extern int strvec_posixcmp (char **, char **);
+extern int strvec_strcmp (char **, char **);
+extern void strvec_sort (char **, int);
+
+extern char **strvec_from_word_list (WORD_LIST *, int, int, int *);
+extern WORD_LIST *strvec_to_word_list (char **, int, int);
 
 /* declarations for functions defined in lib/sh/strnlen.c */
 #if !defined (HAVE_STRNLEN)
-extern size_t strnlen PARAMS((const char *, size_t));
+extern size_t strnlen (const char *, size_t);
 #endif
 
 /* declarations for functions defined in lib/sh/strpbrk.c */
 #if !defined (HAVE_STRPBRK)
-extern char *strpbrk PARAMS((const char *, const char *));
+extern char *strpbrk (const char *, const char *);
 #endif
 
 /* declarations for functions defined in lib/sh/strtod.c */
 #if !defined (HAVE_STRTOD)
-extern double strtod PARAMS((const char *, char **));
+extern double strtod (const char *, char **);
 #endif
 
 /* declarations for functions defined in lib/sh/strtol.c */
 #if !HAVE_DECL_STRTOL
-extern long strtol PARAMS((const char *, char **, int));
+extern long strtol (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strtoll.c */
 #if defined (HAVE_LONG_LONG_INT) && !HAVE_DECL_STRTOLL
-extern long long strtoll PARAMS((const char *, char **, int));
+extern long long strtoll (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strtoul.c */
 #if !HAVE_DECL_STRTOUL
-extern unsigned long strtoul PARAMS((const char *, char **, int));
+extern unsigned long strtoul (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strtoull.c */
 #if defined (HAVE_UNSIGNED_LONG_LONG_INT) && !HAVE_DECL_STRTOULL
-extern unsigned long long strtoull PARAMS((const char *, char **, int));
+extern unsigned long long strtoull (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strimax.c */
 #if !HAVE_DECL_STRTOIMAX
-extern intmax_t strtoimax PARAMS((const char *, char **, int));
+extern intmax_t strtoimax (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strumax.c */
 #if !HAVE_DECL_STRTOUMAX
-extern uintmax_t strtoumax PARAMS((const char *, char **, int));
+extern uintmax_t strtoumax (const char *, char **, int);
 #endif
 
 /* declarations for functions defined in lib/sh/strtrans.c */
-extern char *ansicstr PARAMS((char *, int, int, int *, int *));
-extern char *ansic_quote PARAMS((char *, int, int *));
-extern int ansic_shouldquote PARAMS((const char *));
-extern char *ansiexpand PARAMS((char *, int, int, int *));
+extern char *ansicstr (char *, int, int, int *, int *);
+extern char *ansic_quote (char *, int, int *);
+extern int ansic_shouldquote (const char *);
+extern char *ansiexpand (char *, int, int, int *);
 
 /* declarations for functions defined in lib/sh/strvis.c */
-extern int sh_charvis PARAMS((const char *, size_t *, size_t, char *, size_t *));
-extern char *sh_strvis PARAMS((const char *));
+extern int sh_charvis (const char *, size_t *, size_t, char *, size_t *);
+extern char *sh_strvis (const char *);
 
 /* declarations for functions defined in lib/sh/timeval.c.  No prototypes
    so we don't have to count on having a definition of struct timeval in
@@ -488,67 +492,67 @@ extern void print_timeval ();
 #define MT_USERANDOM           0x0004
 #define MT_TEMPLATE            0x0008
 
-extern char *sh_mktmpname PARAMS((char *, int));
-extern int sh_mktmpfd PARAMS((char *, int, char **));
-/* extern FILE *sh_mktmpfp PARAMS((char *, int, char **)); */
-extern char *sh_mktmpdir PARAMS((char *, int));
+extern char *sh_mktmpname (char *, int);
+extern int sh_mktmpfd (char *, int, char **);
+/* extern FILE *sh_mktmpfp (char *, int, char **); */
+extern char *sh_mktmpdir (char *, int);
 
 /* declarations for functions defined in lib/sh/uconvert.c */
-extern int uconvert PARAMS((char *, long *, long *, char **));
+extern int uconvert (char *, long *, long *, char **);
 
 /* declarations for functions defined in lib/sh/ufuncs.c */
-extern unsigned int falarm PARAMS((unsigned int, unsigned int));
-extern unsigned int fsleep PARAMS((unsigned int, unsigned int));
+extern unsigned int falarm (unsigned int, unsigned int);
+extern unsigned int fsleep (unsigned int, unsigned int);
 
 /* declarations for functions defined in lib/sh/unicode.c */
-extern int u32cconv PARAMS((unsigned long, char *));
-extern void u32reset PARAMS((void));
+extern int u32cconv (unsigned long, char *);
+extern void u32reset (void);
 
 /* declarations for functions defined in lib/sh/utf8.c */
-extern char *utf8_mbschr PARAMS((const char *, int));
-extern int utf8_mbscmp PARAMS((const char *, const char *));
-extern char *utf8_mbsmbchar PARAMS((const char *));
-extern int utf8_mbsnlen PARAMS((const char *, size_t, int));
-extern int utf8_mblen PARAMS((const char *, size_t));
-extern size_t utf8_mbstrlen PARAMS((const char *));
+extern char *utf8_mbschr (const char *, int);
+extern int utf8_mbscmp (const char *, const char *);
+extern char *utf8_mbsmbchar (const char *);
+extern int utf8_mbsnlen (const char *, size_t, int);
+extern int utf8_mblen (const char *, size_t);
+extern size_t utf8_mbstrlen (const char *);
 
 /* declarations for functions defined in lib/sh/wcsnwidth.c */
 #if defined (HANDLE_MULTIBYTE)
-extern int wcsnwidth PARAMS((const wchar_t *, size_t, int));
+extern int wcsnwidth (const wchar_t *, size_t, int);
 #endif
 
 /* declarations for functions defined in lib/sh/winsize.c */
-extern void get_new_window_size PARAMS((int, int *, int *));
+extern void get_new_window_size (int, int *, int *);
 
 /* declarations for functions defined in lib/sh/zcatfd.c */
-extern int zcatfd PARAMS((int, int, char *));
+extern int zcatfd (int, int, char *);
 
 /* declarations for functions defined in lib/sh/zgetline.c */
-extern ssize_t zgetline PARAMS((int, char **, size_t *, int, int));
+extern ssize_t zgetline (int, char **, size_t *, int, int);
 
 /* declarations for functions defined in lib/sh/zmapfd.c */
-extern int zmapfd PARAMS((int, char **, char *));
+extern int zmapfd (int, char **, char *);
 
 /* declarations for functions defined in lib/sh/zread.c */
-extern ssize_t zread PARAMS((int, char *, size_t));
-extern ssize_t zreadretry PARAMS((int, char *, size_t));
-extern ssize_t zreadintr PARAMS((int, char *, size_t));
-extern ssize_t zreadc PARAMS((int, char *));
-extern ssize_t zreadcintr PARAMS((int, char *));
-extern ssize_t zreadn PARAMS((int, char *, size_t));
-extern void zreset PARAMS((void));
-extern void zsyncfd PARAMS((int));
+extern ssize_t zread (int, char *, size_t);
+extern ssize_t zreadretry (int, char *, size_t);
+extern ssize_t zreadintr (int, char *, size_t);
+extern ssize_t zreadc (int, char *);
+extern ssize_t zreadcintr (int, char *);
+extern ssize_t zreadn (int, char *, size_t);
+extern void zreset (void);
+extern void zsyncfd (int);
 
 /* declarations for functions defined in lib/sh/zwrite.c */
-extern int zwrite PARAMS((int, char *, size_t));
+extern int zwrite (int, char *, size_t);
 
 /* declarations for functions defined in lib/glob/gmisc.c */
-extern int match_pattern_char PARAMS((char *, char *, int));
-extern int umatchlen PARAMS((char *, size_t));
+extern int match_pattern_char (char *, char *, int);
+extern int umatchlen (char *, size_t);
 
 #if defined (HANDLE_MULTIBYTE)
-extern int match_pattern_wchar PARAMS((wchar_t *, wchar_t *, int));
-extern int wmatchlen PARAMS((wchar_t *, size_t));
+extern int match_pattern_wchar (wchar_t *, wchar_t *, int);
+extern int wmatchlen (wchar_t *, size_t);
 #endif
 
 #endif /* _EXTERNS_H_ */
index bf457814e24f4899f7666b95381086f735ff2292..cc4070b4222e925bf23ea395282059b6d2aa2ea6 100644 (file)
--- a/findcmd.h
+++ b/findcmd.h
@@ -1,6 +1,6 @@
 /* findcmd.h - functions from findcmd.c. */
 
-/* Copyright (C) 1997-2015,2020 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2015,2020-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #define CMDSRCH_STDPATH                0x02
 #define CMDSRCH_TEMPENV                0x04
 
-extern int file_status PARAMS((const char *));
-extern int executable_file PARAMS((const char *));
-extern int is_directory PARAMS((const char *));
-extern int executable_or_directory PARAMS((const char *));
-extern char *find_user_command PARAMS((const char *));
-extern char *find_in_path PARAMS((const char *, char *, int));
-extern char *find_path_file PARAMS((const char *));
-extern char *search_for_command PARAMS((const char *, int));
-extern char *user_command_matches PARAMS((const char *, int, int));
-extern void setup_exec_ignore PARAMS((char *));
+extern int file_status (const char *);
+extern int executable_file (const char *);
+extern int is_directory (const char *);
+extern int executable_or_directory (const char *);
+extern char *find_user_command (const char *);
+extern char *find_in_path (const char *, char *, int);
+extern char *find_path_file (const char *);
+extern char *search_for_command (const char *, int);
+extern char *user_command_matches (const char *, int, int);
+extern void setup_exec_ignore (char *);
 
 extern int dot_found_in_search;
 
diff --git a/flags.h b/flags.h
index a3b5daa94f638cb7f297584bb9b4c8d77a75478f..66da650307fb1aec0f7d8cd34d4b3bba15f3009f 100644 (file)
--- a/flags.h
+++ b/flags.h
@@ -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-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 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 PARAMS((int));
-extern int change_flag PARAMS((int, int));
-extern char *which_set_flags PARAMS((void));
-extern void reset_shell_flags PARAMS((void));
+extern int *find_flag (int);
+extern int change_flag (int, int);
+extern char *which_set_flags (void);
+extern void reset_shell_flags (void);
 
-extern char *get_current_flags PARAMS((void));
-extern void set_current_flags PARAMS((const char *));
+extern char *get_current_flags (void);
+extern void set_current_flags (const char *);
 
-extern void initialize_flags PARAMS((void));
+extern void initialize_flags (void);
 
 /* A macro for efficiency. */
 #define change_flag_char(flag, on_or_off)  change_flag (flag, on_or_off)
index 8064c50eb51edcafdc7af705b76494589ecd007f..c6d000afc45c03bb325f839e7717822e27b10dc2 100644 (file)
--- a/general.h
+++ b/general.h
@@ -1,6 +1,6 @@
 /* general.h -- defines that everybody likes to use. */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 /* Hardly used anymore */
 #define pointer_to_int(x)      (int)((char *)x - (char *)0)
 
-#if defined (alpha) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__)
-extern char *strchr (), *strrchr ();
-#endif
-
 #if !defined (strcpy) && (defined (HAVE_DECL_STRCPY) && !HAVE_DECL_STRCPY)
-extern char *strcpy PARAMS((char *, const char *));
+extern char *strcpy (char *, const char *);
 #endif
 
 #if !defined (savestring)
@@ -205,43 +201,44 @@ typedef char **CPPFunction ();            /* no longer used */
 /* Shell function typedefs with prototypes */
 /* `Generic' function pointer typedefs */
 
-typedef int sh_intfunc_t PARAMS((int));
-typedef int sh_ivoidfunc_t PARAMS((void));
-typedef int sh_icpfunc_t PARAMS((char *));
-typedef int sh_icppfunc_t PARAMS((char **));
-typedef int sh_iptrfunc_t PARAMS((PTR_T));
+typedef int sh_intfunc_t (int);
+typedef int sh_ivoidfunc_t (void);
+typedef int sh_icpfunc_t (char *);
+typedef int sh_icppfunc_t (char **);
+typedef int sh_iptrfunc_t (PTR_T);
 
-typedef void sh_voidfunc_t PARAMS((void));
-typedef void sh_vintfunc_t PARAMS((int));
-typedef void sh_vcpfunc_t PARAMS((char *));
-typedef void sh_vcppfunc_t PARAMS((char **));
-typedef void sh_vptrfunc_t PARAMS((PTR_T));
+typedef void sh_voidfunc_t (void);
+typedef void sh_vintfunc_t (int);
+typedef void sh_vcpfunc_t (char *);
+typedef void sh_vcppfunc_t (char **);
+typedef void sh_vptrfunc_t (PTR_T);
 
-typedef int sh_wdesc_func_t PARAMS((WORD_DESC *));
-typedef int sh_wlist_func_t PARAMS((WORD_LIST *));
+typedef int sh_wdesc_func_t (WORD_DESC *);
+typedef int sh_wlist_func_t (WORD_LIST *);
 
-typedef int sh_glist_func_t PARAMS((GENERIC_LIST *));
+typedef int sh_glist_func_t (GENERIC_LIST *);
+typedef int sh_gcp_func_t (GENERIC_LIST *, char *);
 
-typedef char *sh_string_func_t PARAMS((char *));       /* like savestring, et al. */
+typedef char *sh_string_func_t (char *);       /* like savestring, et al. */
 
-typedef int sh_msg_func_t PARAMS((const char *, ...)); /* printf(3)-like */
-typedef void sh_vmsg_func_t PARAMS((const char *, ...));       /* printf(3)-like */
+typedef int sh_msg_func_t (const char *, ...); /* printf(3)-like */
+typedef void sh_vmsg_func_t (const char *, ...);       /* printf(3)-like */
 
 /* Specific function pointer typedefs.  Most of these could be done
    with #defines. */
-typedef void sh_sv_func_t PARAMS((char *));    /* sh_vcpfunc_t */
-typedef void sh_free_func_t PARAMS((PTR_T));   /* sh_vptrfunc_t */
-typedef void sh_resetsig_func_t PARAMS((int)); /* sh_vintfunc_t */
+typedef void sh_sv_func_t (char *);    /* sh_vcpfunc_t */
+typedef void sh_free_func_t (PTR_T);   /* sh_vptrfunc_t */
+typedef void sh_resetsig_func_t (int); /* sh_vintfunc_t */
 
-typedef int sh_ignore_func_t PARAMS((const char *));   /* sh_icpfunc_t */
+typedef int sh_ignore_func_t (const char *);   /* sh_icpfunc_t */
 
-typedef int sh_assign_func_t PARAMS((const char *));
-typedef int sh_wassign_func_t PARAMS((WORD_DESC *, int));
+typedef int sh_assign_func_t (const char *);
+typedef int sh_wassign_func_t (WORD_DESC *, int);
 
-typedef int sh_load_func_t PARAMS((char *));
-typedef void sh_unload_func_t PARAMS((char *));
+typedef int sh_load_func_t (char *);
+typedef void sh_unload_func_t (char *);
 
-typedef int sh_builtin_func_t PARAMS((WORD_LIST *)); /* sh_wlist_func_t */
+typedef int sh_builtin_func_t (WORD_LIST *); /* sh_wlist_func_t */
 
 #endif /* SH_FUNCTION_TYPEDEF */
 
@@ -296,77 +293,77 @@ typedef int QSFUNC ();
 
 #if 0
 /* Declarations for functions defined in xmalloc.c */
-extern PTR_T xmalloc PARAMS((size_t));
-extern PTR_T xrealloc PARAMS((void *, size_t));
-extern void xfree PARAMS((void *));
+extern PTR_T xmalloc (size_t);
+extern PTR_T xrealloc (void *, size_t);
+extern void xfree (void *);
 #endif
 
 /* Declarations for functions defined in general.c */
-extern void posix_initialize PARAMS((int));
+extern void posix_initialize (int);
 
-extern int num_posix_options PARAMS((void));
-extern char *get_posix_options PARAMS((char *));
-extern void set_posix_options PARAMS((const char *));
+extern int num_posix_options (void);
+extern char *get_posix_options (char *);
+extern void set_posix_options (const char *);
 
-extern void save_posix_options PARAMS((void));
+extern void save_posix_options (void);
 
 #if defined (RLIMTYPE)
-extern RLIMTYPE string_to_rlimtype PARAMS((char *));
-extern void print_rlimtype PARAMS((RLIMTYPE, int));
+extern RLIMTYPE string_to_rlimtype (char *);
+extern void print_rlimtype (RLIMTYPE, int);
 #endif
 
-extern int all_digits PARAMS((const char *));
-extern int legal_number PARAMS((const char *, intmax_t *));
-extern int legal_identifier PARAMS((const char *));
-extern int importable_function_name PARAMS((const char *, size_t));
-extern int exportable_function_name PARAMS((const char *));
-extern int check_identifier PARAMS((WORD_DESC *, int));
-extern int valid_nameref_value PARAMS((const char *, int));
-extern int check_selfref PARAMS((const char *, char *, int));
-extern int legal_alias_name PARAMS((const char *, int));
-extern int line_isblank PARAMS((const char *));
-extern int assignment PARAMS((const char *, int));
-
-extern int sh_unset_nodelay_mode PARAMS((int));
-extern int sh_setclexec PARAMS((int));
-extern int sh_validfd PARAMS((int));
-extern int fd_ispipe PARAMS((int));
-extern void check_dev_tty PARAMS((void));
-extern int move_to_high_fd PARAMS((int, int, int));
-extern int check_binary_file PARAMS((const char *, int));
+extern int all_digits (const char *);
+extern int legal_number (const char *, intmax_t *);
+extern int legal_identifier (const char *);
+extern int importable_function_name (const char *, size_t);
+extern int exportable_function_name (const char *);
+extern int check_identifier (WORD_DESC *, int);
+extern int valid_nameref_value (const char *, int);
+extern int check_selfref (const char *, char *, int);
+extern int legal_alias_name (const char *, int);
+extern int line_isblank (const char *);
+extern int assignment (const char *, int);
+
+extern int sh_unset_nodelay_mode (int);
+extern int sh_setclexec (int);
+extern int sh_validfd (int);
+extern int fd_ispipe (int);
+extern void check_dev_tty (void);
+extern int move_to_high_fd (int, int, int);
+extern int check_binary_file (const char *, int);
 
 #ifdef _POSIXSTAT_H_
-extern int same_file PARAMS((const char *, const char *, struct stat *, struct stat *));
+extern int same_file (const char *, const char *, struct stat *, struct stat *);
 #endif
 
-extern int sh_openpipe PARAMS((int *));
-extern int sh_closepipe PARAMS((int *));
+extern int sh_openpipe (int *);
+extern int sh_closepipe (int *);
 
-extern int file_exists PARAMS((const char *));
-extern int file_isdir PARAMS((const char  *));
-extern int file_iswdir PARAMS((const char  *));
-extern int path_dot_or_dotdot PARAMS((const char *));
-extern int absolute_pathname PARAMS((const char *));
-extern int absolute_program PARAMS((const char *));
+extern int file_exists (const char *);
+extern int file_isdir (const char  *);
+extern int file_iswdir (const char  *);
+extern int path_dot_or_dotdot (const char *);
+extern int absolute_pathname (const char *);
+extern int absolute_program (const char *);
 
-extern char *make_absolute PARAMS((const char *, const char *));
-extern char *base_pathname PARAMS((char *));
-extern char *full_pathname PARAMS((char *));
-extern char *polite_directory_format PARAMS((char *));
-extern char *trim_pathname PARAMS((char *, int));
-extern char *printable_filename PARAMS((char *, int));
+extern char *make_absolute (const char *, const char *);
+extern char *base_pathname (char *);
+extern char *full_pathname (char *);
+extern char *polite_directory_format (char *);
+extern char *trim_pathname (char *, int);
+extern char *printable_filename (char *, int);
 
-extern char *extract_colon_unit PARAMS((char *, int *));
+extern char *extract_colon_unit (char *, int *);
 
-extern void tilde_initialize PARAMS((void));
-extern char *bash_tilde_find_word PARAMS((const char *, int, int *));
-extern char *bash_tilde_expand PARAMS((const char *, int));
+extern void tilde_initialize (void);
+extern char *bash_tilde_find_word (const char *, int, int *);
+extern char *bash_tilde_expand (const char *, int);
 
-extern int group_member PARAMS((gid_t));
-extern char **get_group_list PARAMS((int *));
-extern int *get_group_array PARAMS((int *));
+extern int group_member (gid_t);
+extern char **get_group_list (int *);
+extern int *get_group_array (int *);
 
-extern char *conf_standard_path PARAMS((void));
-extern int default_columns PARAMS((void));
+extern char *conf_standard_path (void);
+extern int default_columns (void);
 
 #endif /* _GENERAL_H_ */
index 2459f200414c45499311556853dcfdc29afd994e..9b9e882a1b7610bb5695e1160957dfd9e4f60a29 100644 (file)
--- a/hashcmd.h
+++ b/hashcmd.h
@@ -1,6 +1,6 @@
 /* hashcmd.h - Common defines for hashing filenames. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -35,9 +35,9 @@ typedef struct _pathdata {
 
 #define pathdata(x) ((PATH_DATA *)(x)->data)
 
-extern void phash_create PARAMS((void));
-extern void phash_flush PARAMS((void));
+extern void phash_create (void);
+extern void phash_flush (void);
 
-extern void phash_insert PARAMS((char *, char *, int, int));
-extern int phash_remove PARAMS((const char *));
-extern char *phash_search PARAMS((const char *));
+extern void phash_insert (char *, char *, int, int);
+extern int phash_remove (const char *);
+extern char *phash_search (const char *);
index cf2de9884006aba08e82fb126d18e2e2d47b2f3e..623ad0aa53ccee32d972a64ebb9d2560d3dd24a8 100644 (file)
--- a/hashlib.h
+++ b/hashlib.h
@@ -1,6 +1,6 @@
 /* hashlib.h -- the data structures used in hashing in Bash. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -45,26 +45,26 @@ typedef struct hash_table {
   int nentries;                        /* How many entries does this table have. */
 } HASH_TABLE;
 
-typedef int hash_wfunc PARAMS((BUCKET_CONTENTS *));
+typedef int hash_wfunc (BUCKET_CONTENTS *);
 
 /* Operations on tables as a whole */
-extern HASH_TABLE *hash_create PARAMS((int));
-extern HASH_TABLE *hash_copy PARAMS((HASH_TABLE *, sh_string_func_t *));
-extern void hash_flush PARAMS((HASH_TABLE *, sh_free_func_t *));
-extern void hash_dispose PARAMS((HASH_TABLE *));
-extern void hash_walk PARAMS((HASH_TABLE *, hash_wfunc *));
+extern HASH_TABLE *hash_create (int);
+extern HASH_TABLE *hash_copy (HASH_TABLE *, sh_string_func_t *);
+extern void hash_flush (HASH_TABLE *, sh_free_func_t *);
+extern void hash_dispose (HASH_TABLE *);
+extern void hash_walk (HASH_TABLE *, hash_wfunc *);
 
 /* Operations to extract information from or pieces of tables */
-extern int hash_bucket PARAMS((const char *, HASH_TABLE *));
-extern int hash_size PARAMS((HASH_TABLE *));
+extern int hash_bucket (const char *, HASH_TABLE *);
+extern int hash_size (HASH_TABLE *);
 
 /* Operations on hash table entries */
-extern BUCKET_CONTENTS *hash_search PARAMS((const char *, HASH_TABLE *, int));
-extern BUCKET_CONTENTS *hash_insert PARAMS((char *, HASH_TABLE *, int));
-extern BUCKET_CONTENTS *hash_remove PARAMS((const char *, HASH_TABLE *, int));
+extern BUCKET_CONTENTS *hash_search (const char *, HASH_TABLE *, int);
+extern BUCKET_CONTENTS *hash_insert (char *, HASH_TABLE *, int);
+extern BUCKET_CONTENTS *hash_remove (const char *, HASH_TABLE *, int);
 
 /* Miscellaneous */
-extern unsigned int hash_string PARAMS((const char *));
+extern unsigned int hash_string (const char *);
 
 /* Redefine the function as a macro for speed. */
 #define hash_items(bucket, table) \
diff --git a/input.h b/input.h
index cb3eee4252f5e224e1b5754bc366cfbe1543cf55..5e9d92754442ce254fa9cb002a7d8e20c5f1f0cf 100644 (file)
--- a/input.h
+++ b/input.h
@@ -1,6 +1,6 @@
 /* input.h -- Structures and unions used for reading input. */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -32,8 +32,8 @@ typedef char *CPFunction ();          /* no longer used */
 typedef char **CPPFunction ();         /* no longer used */
 #endif /* _FUNCTION_DEF */
 
-typedef int sh_cget_func_t PARAMS((void));             /* sh_ivoidfunc_t */
-typedef int sh_cunget_func_t PARAMS((int));    /* sh_intfunc_t */
+typedef int sh_cget_func_t (void);     /* sh_ivoidfunc_t */
+typedef int sh_cunget_func_t (int);    /* sh_intfunc_t */
 
 enum stream_type {st_none, st_stdin, st_stream, st_string, st_bstream};
 
@@ -92,44 +92,44 @@ extern BASH_INPUT bash_input;
 
 /* Functions from parse.y whose use directly or indirectly depends on the
    definitions in this file. */
-extern void initialize_bash_input PARAMS((void));
-extern void init_yy_io PARAMS((sh_cget_func_t *, sh_cunget_func_t *, enum stream_type, const char *, INPUT_STREAM));
-extern char *yy_input_name PARAMS((void));
-extern void with_input_from_stdin PARAMS((void));
-extern void with_input_from_string PARAMS((char *, const char *));
-extern void with_input_from_stream PARAMS((FILE *, const char *));
-extern void push_stream PARAMS((int));
-extern void pop_stream PARAMS((void));
-extern int stream_on_stack PARAMS((enum stream_type));
-extern char *read_secondary_line PARAMS((int));
-extern int find_reserved_word PARAMS((char *));
-extern void gather_here_documents PARAMS((void));
-extern void execute_variable_command PARAMS((char *, char *));
-
-extern int *save_token_state PARAMS((void));
-extern void restore_token_state PARAMS((int *));
+extern void initialize_bash_input (void);
+extern void init_yy_io (sh_cget_func_t *, sh_cunget_func_t *, enum stream_type, const char *, INPUT_STREAM);
+extern char *yy_input_name (void);
+extern void with_input_from_stdin (void);
+extern void with_input_from_string (char *, const char *);
+extern void with_input_from_stream (FILE *, const char *);
+extern void push_stream (int);
+extern void pop_stream (void);
+extern int stream_on_stack (enum stream_type);
+extern char *read_secondary_line (int);
+extern int find_reserved_word (char *);
+extern void gather_here_documents (void);
+extern void execute_variable_command (char *, char *);
+
+extern int *save_token_state (void);
+extern void restore_token_state (int *);
 
 /* Functions from input.c */
-extern int getc_with_restart PARAMS((FILE *));
-extern int ungetc_with_restart PARAMS((int, FILE *));
+extern int getc_with_restart (FILE *);
+extern int ungetc_with_restart (int, FILE *);
 
 #if defined (BUFFERED_INPUT)
 /* Functions from input.c. */
-extern int fd_is_bash_input PARAMS((int));
-extern int set_bash_input_fd PARAMS((int));
-extern int save_bash_input PARAMS((int, int));
-extern int check_bash_input PARAMS((int));
-extern int duplicate_buffered_stream PARAMS((int, int));
-extern BUFFERED_STREAM *fd_to_buffered_stream PARAMS((int));
-extern BUFFERED_STREAM *set_buffered_stream PARAMS((int, BUFFERED_STREAM *));
-extern BUFFERED_STREAM *open_buffered_stream PARAMS((char *));
-extern void free_buffered_stream PARAMS((BUFFERED_STREAM *));
-extern int close_buffered_stream PARAMS((BUFFERED_STREAM *));
-extern int close_buffered_fd PARAMS((int));
-extern int sync_buffered_stream PARAMS((int));
-extern int buffered_getchar PARAMS((void));
-extern int buffered_ungetchar PARAMS((int));
-extern void with_input_from_buffered_stream PARAMS((int, char *));
+extern int fd_is_bash_input (int);
+extern int set_bash_input_fd (int);
+extern int save_bash_input (int, int);
+extern int check_bash_input (int);
+extern int duplicate_buffered_stream (int, int);
+extern BUFFERED_STREAM *fd_to_buffered_stream (int);
+extern BUFFERED_STREAM *set_buffered_stream (int, BUFFERED_STREAM *);
+extern BUFFERED_STREAM *open_buffered_stream (char *);
+extern void free_buffered_stream (BUFFERED_STREAM *);
+extern int close_buffered_stream (BUFFERED_STREAM *);
+extern int close_buffered_fd (int);
+extern int sync_buffered_stream (int);
+extern int buffered_getchar (void);
+extern int buffered_ungetchar (int);
+extern void with_input_from_buffered_stream (int, char *);
 #endif /* BUFFERED_INPUT */
 
 #endif /* _INPUT_H_ */
diff --git a/jobs.h b/jobs.h
index 276204f0c7f4763defe37374b2382cf95fa11426..de5a9ecf0015a8ba30c8798aaa34d5ee93ba6370 100644 (file)
--- a/jobs.h
+++ b/jobs.h
@@ -207,7 +207,7 @@ struct procchain {
 
 /* System calls. */
 #if !defined (HAVE_UNISTD_H)
-extern pid_t fork (), getpid (), getpgrp ();
+extern pid_t fork (void), getpid (void), getpgrp (void);
 #endif /* !HAVE_UNISTD_H */
 
 /* Stuff from the jobs.c file. */
@@ -224,97 +224,97 @@ extern PROCESS *last_procsub_child;
 
 extern JOB **jobs;
 
-extern void making_children PARAMS((void));
-extern void stop_making_children PARAMS((void));
-extern void cleanup_the_pipeline PARAMS((void));
-extern void discard_last_procsub_child PARAMS((void));
-extern void save_pipeline PARAMS((int));
-extern PROCESS *restore_pipeline PARAMS((int));
-extern void start_pipeline PARAMS((void));
-extern int stop_pipeline PARAMS((int, COMMAND *));
-extern int discard_pipeline PARAMS((PROCESS *));
-extern void append_process PARAMS((char *, pid_t, int, int));
-
-extern void save_proc_status PARAMS((pid_t, int));
-
-extern PROCESS *procsub_add PARAMS((PROCESS *));
-extern PROCESS *procsub_search PARAMS((pid_t));
-extern PROCESS *procsub_delete PARAMS((pid_t));
-extern int procsub_waitpid PARAMS((pid_t));
-extern void procsub_waitall PARAMS((void));
-extern void procsub_clear PARAMS((void));
-extern void procsub_prune PARAMS((void));
-
-extern void delete_job PARAMS((int, int));
-extern void nohup_job PARAMS((int));
-extern void delete_all_jobs PARAMS((int));
-extern void nohup_all_jobs PARAMS((int));
-
-extern int count_all_jobs PARAMS((void));
-
-extern void terminate_current_pipeline PARAMS((void));
-extern void terminate_stopped_jobs PARAMS((void));
-extern void hangup_all_jobs PARAMS((void));
-extern void kill_current_pipeline PARAMS((void));
+extern void making_children (void);
+extern void stop_making_children (void);
+extern void cleanup_the_pipeline (void);
+extern void discard_last_procsub_child (void);
+extern void save_pipeline (int);
+extern PROCESS *restore_pipeline (int);
+extern void start_pipeline (void);
+extern int stop_pipeline (int, COMMAND *);
+extern int discard_pipeline (PROCESS *);
+extern void append_process (char *, pid_t, int, int);
+
+extern void save_proc_status (pid_t, int);
+
+extern PROCESS *procsub_add (PROCESS *);
+extern PROCESS *procsub_search (pid_t);
+extern PROCESS *procsub_delete (pid_t);
+extern int procsub_waitpid (pid_t);
+extern void procsub_waitall (void);
+extern void procsub_clear (void);
+extern void procsub_prune (void);
+
+extern void delete_job (int, int);
+extern void nohup_job (int);
+extern void delete_all_jobs (int);
+extern void nohup_all_jobs (int);
+
+extern int count_all_jobs (void);
+
+extern void terminate_current_pipeline (void);
+extern void terminate_stopped_jobs (void);
+extern void hangup_all_jobs (void);
+extern void kill_current_pipeline (void);
 
 #if defined (__STDC__) && defined (pid_t)
-extern int get_job_by_pid PARAMS((int, int, PROCESS **));
-extern void describe_pid PARAMS((int));
+extern int get_job_by_pid (int, int, PROCESS **);
+extern void describe_pid (int);
 #else
-extern int get_job_by_pid PARAMS((pid_t, int, PROCESS **));
-extern void describe_pid PARAMS((pid_t));
+extern int get_job_by_pid (pid_t, int, PROCESS **);
+extern void describe_pid (pid_t);
 #endif
 
-extern void list_one_job PARAMS((JOB *, int, int, int));
-extern void list_all_jobs PARAMS((int));
-extern void list_stopped_jobs PARAMS((int));
-extern void list_running_jobs PARAMS((int));
+extern void list_one_job (JOB *, int, int, int);
+extern void list_all_jobs (int);
+extern void list_stopped_jobs (int);
+extern void list_running_jobs (int);
 
-extern pid_t make_child PARAMS((char *, int));
+extern pid_t make_child (char *, int);
 
-extern int get_tty_state PARAMS((void));
-extern int set_tty_state PARAMS((void));
+extern int get_tty_state (void);
+extern int set_tty_state (void);
 
-extern int job_exit_status PARAMS((int));
-extern int job_exit_signal PARAMS((int));
+extern int job_exit_status (int);
+extern int job_exit_signal (int);
 
-extern int wait_for_single_pid PARAMS((pid_t, int));
-extern int wait_for_background_pids PARAMS((struct procstat *));
-extern int wait_for PARAMS((pid_t, int));
-extern int wait_for_job PARAMS((int, int, struct procstat *));
-extern int wait_for_any_job PARAMS((int, struct procstat *));
+extern int wait_for_single_pid (pid_t, int);
+extern int wait_for_background_pids (struct procstat *);
+extern int wait_for (pid_t, int);
+extern int wait_for_job (int, int, struct procstat *);
+extern int wait_for_any_job (int, struct procstat *);
 
-extern void wait_sigint_cleanup PARAMS((void));
+extern void wait_sigint_cleanup (void);
 
-extern void notify_and_cleanup PARAMS((void));
-extern void reap_dead_jobs PARAMS((void));
-extern int start_job PARAMS((int, int));
-extern int kill_pid PARAMS((pid_t, int, int));
-extern int initialize_job_control PARAMS((int));
-extern void initialize_job_signals PARAMS((void));
-extern int give_terminal_to PARAMS((pid_t, int));
+extern void notify_and_cleanup (void);
+extern void reap_dead_jobs (void);
+extern int start_job (int, int);
+extern int kill_pid (pid_t, int, int);
+extern int initialize_job_control (int);
+extern void initialize_job_signals (void);
+extern int give_terminal_to (pid_t, int);
 
-extern void run_sigchld_trap PARAMS((int));
+extern void run_sigchld_trap (int);
 
-extern int freeze_jobs_list PARAMS((void));
-extern void unfreeze_jobs_list PARAMS((void));
-extern void set_jobs_list_frozen PARAMS((int));
-extern int set_job_control PARAMS((int));
-extern void without_job_control PARAMS((void));
-extern void end_job_control PARAMS((void));
-extern void restart_job_control PARAMS((void));
-extern void set_sigchld_handler PARAMS((void));
-extern void ignore_tty_job_signals PARAMS((void));
-extern void default_tty_job_signals PARAMS((void));
-extern void get_original_tty_job_signals PARAMS((void));
+extern int freeze_jobs_list (void);
+extern void unfreeze_jobs_list (void);
+extern void set_jobs_list_frozen (int);
+extern int set_job_control (int);
+extern void without_job_control (void);
+extern void end_job_control (void);
+extern void restart_job_control (void);
+extern void set_sigchld_handler (void);
+extern void ignore_tty_job_signals (void);
+extern void default_tty_job_signals (void);
+extern void get_original_tty_job_signals (void);
 
-extern void init_job_stats PARAMS((void));
+extern void init_job_stats (void);
 
-extern void close_pgrp_pipe PARAMS((void));
-extern void save_pgrp_pipe PARAMS((int *, int));
-extern void restore_pgrp_pipe PARAMS((int *));
+extern void close_pgrp_pipe (void);
+extern void save_pgrp_pipe (int *, int);
+extern void restore_pgrp_pipe (int *);
 
-extern void set_maxchild PARAMS((int));
+extern void set_maxchild (int);
 
 #ifdef DEBUG
 extern void debug_print_pgrps (void);
index 686d0f6b41cca5ec341b56801ea426c7d58b4ec9..eaca7783ea30c8739ecb7ce99db51dd1353d0fc3 100644 (file)
@@ -1,6 +1,6 @@
 /* glob.c -- file-name wildcard pattern matching for Bash.
 
-   Copyright (C) 1985-2021 Free Software Foundation, Inc.
+   Copyright (C) 1985-2022 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 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 void throw_to_top_level (void);
+extern int sh_eaccess (const char *, int);
+extern char *sh_makepath (const char *, const char *, int);
+extern int signal_is_pending (int);
+extern void run_pending_traps (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 PARAMS((char *, char *, int));
+static int skipname (char *, char *, int);
 #if HANDLE_MULTIBYTE
-static int mbskipname PARAMS((char *, char *, int));
+static int mbskipname (char *, char *, int);
 #endif
-void udequote_pathname PARAMS((char *));
+void udequote_pathname (char *);
 #if HANDLE_MULTIBYTE
-void wcdequote_pathname PARAMS((wchar_t *));
-static void wdequote_pathname PARAMS((char *));
-static void dequote_pathname PARAMS((char *));
+void wcdequote_pathname (wchar_t *);
+static void wdequote_pathname (char *);
+static void dequote_pathname (char *);
 #else
 #  define dequote_pathname(p) udequote_pathname(p)
 #endif
-static int glob_testdir PARAMS((char *, int));
-static char **glob_dir_to_array PARAMS((char *, char **, int));
+static int glob_testdir (char *, int);
+static char **glob_dir_to_array (char *, char **, int);
 
 /* Make sure these names continue to agree with what's in smatch.c */
-extern char *glob_patscan PARAMS((char *, char *, int, int));
-extern wchar_t *glob_patscan_wc PARAMS((wchar_t *, wchar_t *, wint_t, int));
+extern char *glob_patscan (char *, char *, int, int);
+extern wchar_t *glob_patscan_wc (wchar_t *, wchar_t *, wint_t, int);
 
 /* And this from gmisc.c/gm_loop.c */
-extern int wextglob_pattern_p PARAMS((wchar_t *));
+extern int wextglob_pattern_p (wchar_t *);
 
-extern char *glob_dirscan PARAMS((char *, int));
+extern char *glob_dirscan (char *, int);
 
 /* Compile `glob_loop.c' for single-byte characters. */
 #define GCHAR  unsigned char
@@ -158,8 +158,7 @@ extern char *glob_dirscan PARAMS((char *, int));
 /* And now a function that calls either the single-byte or multibyte version
    of internal_glob_pattern_p. */
 int
-glob_pattern_p (pattern)
-     const char *pattern;
+glob_pattern_p (const char *pattern)
 {
 #if HANDLE_MULTIBYTE
   size_t n;
@@ -196,9 +195,7 @@ glob_pattern_p (pattern)
    that the name should be skipped.  XXX - doesn't handle pattern negation,
    not sure if it should */
 static int
-extglob_skipname (pat, dname, flags)
-     char *pat, *dname;
-     int flags;
+extglob_skipname (char *pat, char *dname, int flags)
 {
   char *pp, *pe, *t, *se;
   int n, r, negate, wild, nullpat, xflags;
@@ -267,10 +264,7 @@ extglob_skipname (pat, dname, flags)
 /* Return 1 if DNAME should be skipped according to PAT.  Mostly concerned
    with matching leading `.'. */
 static int
-skipname (pat, dname, flags)
-     char *pat;
-     char *dname;
-     int flags;
+skipname (char *pat, char *dname, int flags)
 {
   int i;
 
@@ -310,9 +304,7 @@ skipname (pat, dname, flags)
 #if HANDLE_MULTIBYTE
 
 static int
-wskipname (pat, dname, flags)
-     wchar_t *pat, *dname;
-     int flags;
+wskipname (wchar_t *pat, wchar_t *dname, int flags)
 {
   int i;
 
@@ -346,9 +338,7 @@ wskipname (pat, dname, flags)
 }
 
 static int
-wextglob_skipname (pat, dname, flags)
-     wchar_t *pat, *dname;
-     int flags;
+wextglob_skipname (wchar_t *pat, wchar_t *dname, int flags)
 {
 #if EXTENDED_GLOB
   wchar_t *pp, *pe, *t, *se, n;
@@ -415,9 +405,7 @@ wextglob_skipname (pat, dname, flags)
 /* Return 1 if DNAME should be skipped according to PAT.  Handles multibyte
    characters in PAT and DNAME.  Mostly concerned with matching leading `.'. */
 static int
-mbskipname (pat, dname, flags)
-     char *pat, *dname;
-     int flags;
+mbskipname (char *pat, char *dname, int flags)
 {
   int ret, ext;
   wchar_t *pat_wc, *dn_wc;
@@ -452,8 +440,7 @@ mbskipname (pat, dname, flags)
 
 /* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */
 void
-udequote_pathname (pathname)
-     char *pathname;
+udequote_pathname (char *pathname)
 {
   register int i, j;
 
@@ -474,8 +461,7 @@ udequote_pathname (pathname)
 #if HANDLE_MULTIBYTE
 /* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */
 void
-wcdequote_pathname (wpathname)
-     wchar_t *wpathname;
+wcdequote_pathname (wchar_t *wpathname)
 {
   int i, j;
 
@@ -494,8 +480,7 @@ wcdequote_pathname (wpathname)
 }
 
 static void
-wdequote_pathname (pathname)
-     char *pathname;
+wdequote_pathname (char *pathname)
 {
   mbstate_t ps;
   size_t len, n;
@@ -538,8 +523,7 @@ wdequote_pathname (pathname)
 }
 
 static void
-dequote_pathname (pathname)
-     char *pathname;
+dequote_pathname (char *pathname)
 {
   if (MB_CUR_MAX > 1)
     wdequote_pathname (pathname);
@@ -562,9 +546,7 @@ dequote_pathname (pathname)
 
 /* Return 0 if DIR is a directory, -2 if DIR is a symlink,  -1 otherwise. */
 static int
-glob_testdir (dir, flags)
-     char *dir;
-     int flags;
+glob_testdir (char *dir, int flags)
 {
   struct stat finfo;
   int r;
@@ -596,12 +578,7 @@ glob_testdir (dir, flags)
    directories in the returned list.  These two variables exist for the
    convenience of the caller (always glob_vector). */
 static struct globval *
-finddirs (pat, sdir, flags, ep, np)
-     char *pat;
-     char *sdir;
-     int flags;
-     struct globval **ep;
-     int *np;
+finddirs (char *pat, char *sdir, int flags, struct globval **ep, int *np)
 {
   char **r, *n;
   int ndirs;
@@ -674,10 +651,7 @@ finddirs (pat, sdir, flags, ep, np)
    Look in errno for more information.  */
 
 char **
-glob_vector (pat, dir, flags)
-     char *pat;
-     char *dir;
-     int flags;
+glob_vector (char *pat, char *dir, int flags)
 {
   DIR *d;
   register struct dirent *dp;
@@ -1059,9 +1033,7 @@ glob_vector (pat, dir, flags)
    it takes care of free()ing that array.  Thus, you might think of this
    function as side-effecting ARRAY.  This should handle GX_MARKDIRS. */
 static char **
-glob_dir_to_array (dir, array, flags)
-     char *dir, **array;
-     int flags;
+glob_dir_to_array (char *dir, char **array, int flags)
 {
   register unsigned int i, l;
   int add_slash;
@@ -1148,9 +1120,7 @@ glob_dir_to_array (dir, array, flags)
    If there isn't enough memory, then return NULL.
    If a file system error occurs, return -1; `errno' has the error code.  */
 char **
-glob_filename (pathname, flags)
-     char *pathname;
-     int flags;
+glob_filename (char *pathname, int flags)
 {
   char **result, **new_result;
   unsigned int result_size;
index 47410577c2c09864aecfd76dc1dd23edb1937568..f5304e8494cf0c4ae0ef5dd995b2996f3fc50958 100644 (file)
@@ -1,5 +1,5 @@
 /* File-name wildcard pattern matching for GNU.
-   Copyright (C) 1985-2021 Free Software Foundation, Inc.
+   Copyright (C) 1985-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne-Again SHell.
 
 #define GX_SYMLINK     0x1000  /* internal -- symlink to a directory */
 #define GX_NEGATE      0x2000  /* internal -- extglob pattern being negated */
 
-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 glob_pattern_p (const char *);
+extern char **glob_vector (char *, char *, int);
+extern char **glob_filename (char *, int);
 
-extern int extglob_pattern_p PARAMS((const char *));
+extern int extglob_pattern_p (const char *);
 
 extern char *glob_error_return;
 extern int noglob_dot_filenames;
index 467e7ae3372d318a13be343fdb181f71f99ffd74..e776e79979b303d5cc237e5a8240bf3b3e0c8482 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
    along with Bash.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-static int INTERNAL_GLOB_PATTERN_P PARAMS((const GCHAR *));
+static int INTERNAL_GLOB_PATTERN_P (const GCHAR *);
 
 /* Return nonzero if PATTERN has any special globbing chars in it.
    Compiled twice, once each for single-byte and multibyte characters. */
 static int
-INTERNAL_GLOB_PATTERN_P (pattern)
-     const GCHAR *pattern;
+INTERNAL_GLOB_PATTERN_P (const GCHAR *pattern)
 {
   register const GCHAR *p;
   register GCHAR c;
index 24fdf746341bf88687a054263b72f4758a801db0..45ea4f4eaf35aaea0640bf312cfdc3aab2e08c2a 100644 (file)
@@ -1,6 +1,6 @@
 /* gmisc.c -- miscellaneous pattern matching utility functions for Bash.
 
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2022 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 PARAMS((char *, char *, int, int));
+extern char *glob_patscan (char *, char *, int, int);
 
 /* Compile `gm_loop.c' for single-byte characters. */
 #define CHAR   char
@@ -79,9 +79,7 @@ extern char *glob_patscan PARAMS((char *, char *, int, int));
    is only called when extended_glob is set, so we have to skip over extglob
    patterns x(...) */
 char *
-glob_dirscan (pat, dirsep)
-     char *pat;
-     int dirsep;
+glob_dirscan (char *pat, int dirsep)
 {
   char *p, *d, *pe, *se;
 
index f419b0365579c83eaf7db6c10bb3526dc24c86a3..61591215431987c26598b87b616fd8fbb6772fe2 100644 (file)
@@ -24,22 +24,19 @@ struct STRUCT
   CHAR *string;
 };
 
-int FCT PARAMS((CHAR *, CHAR *, int));
+int FCT (CHAR *, CHAR *, int);
 
-static int GMATCH PARAMS((CHAR *, CHAR *, CHAR *, CHAR *, struct STRUCT *, int));
-static inline CHAR *PARSE_SUBBRACKET PARAMS((CHAR *, int));
-static CHAR *BRACKMATCH PARAMS((CHAR *, U_CHAR, int));
-static int EXTMATCH PARAMS((INT, CHAR *, CHAR *, CHAR *, CHAR *, int));
+static int GMATCH (CHAR *, CHAR *, CHAR *, CHAR *, struct STRUCT *, int);
+static inline CHAR *PARSE_SUBBRACKET (CHAR *, int);
+static CHAR *BRACKMATCH (CHAR *, U_CHAR, int);
+static int EXTMATCH (INT, CHAR *, CHAR *, CHAR *, CHAR *, int);
 
-extern void DEQUOTE_PATHNAME PARAMS((CHAR *));
+extern void DEQUOTE_PATHNAME (CHAR *);
 
-/*static*/ CHAR *PATSCAN PARAMS((CHAR *, CHAR *, INT, int));
+/*static*/ CHAR *PATSCAN (CHAR *, CHAR *, INT, int);
 
 int
-FCT (pattern, string, flags)
-     CHAR *pattern;
-     CHAR *string;
-     int flags;
+FCT (CHAR *pattern, CHAR *string, int flags)
 {
   CHAR *se, *pe;
 
@@ -55,11 +52,7 @@ FCT (pattern, string, flags)
 /* Match STRING against the filename pattern PATTERN, returning zero if
    it matches, FNM_NOMATCH if not.  */
 static int
-GMATCH (string, se, pattern, pe, ends, flags)
-     CHAR *string, *se;
-     CHAR *pattern, *pe;
-     struct STRUCT *ends;
-     int flags;
+GMATCH (CHAR *string, CHAR *se, CHAR *pattern, CHAR *pe, struct STRUCT *ends, int flags)
 {
   CHAR *p, *n;         /* pattern, string */
   INT c;               /* current pattern character - XXX U_CHAR? */
@@ -387,9 +380,7 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
    P points to the character after the opening bracket. Returns NULL if the
    symbol isn't correctly terminated. */
 static inline CHAR *
-PARSE_SUBBRACKET (p, flags)
-     CHAR *p;
-     int flags;
+PARSE_SUBBRACKET (CHAR *p, int flags)
 {
   CHAR type;           /* the type of special bracket expression symbol */
 
@@ -404,14 +395,7 @@ PARSE_SUBBRACKET (p, flags)
 
 /* Use prototype definition here because of type promotion. */
 static CHAR *
-#if defined (PROTOTYPES)
 BRACKMATCH (CHAR *p, U_CHAR test, int flags)
-#else
-BRACKMATCH (p, test, flags)
-     CHAR *p;
-     U_CHAR test;
-     int flags;
-#endif
 {
   register CHAR cstart, cend, c;
   register int not;    /* Nonzero if the sense of the character class is inverted.  */
@@ -689,10 +673,7 @@ matched:
    first character after the matching DELIM or NULL if the pattern is
    empty or invalid. */
 /*static*/ CHAR *
-PATSCAN (string, end, delim, flags)
-     CHAR *string, *end;
-     INT delim;
-     int flags;
+PATSCAN (CHAR *string, CHAR *end, INT delim,  int flags)
 {
   int pnest, bnest, skip;
   CHAR *s, c, *bfirst, *t;
@@ -777,8 +758,7 @@ PATSCAN (string, end, delim, flags)
 
 /* Return 0 if dequoted pattern matches S in the current locale. */
 static int
-STRCOMPARE (p, pe, s, se)
-     CHAR *p, *pe, *s, *se;
+STRCOMPARE (CHAR *p, CHAR *pe, CHAR *s, CHAR *se)
 {
   int ret;
   CHAR c1, c2;
@@ -817,11 +797,7 @@ STRCOMPARE (p, pe, s, se)
    the first time an extended pattern specifier is encountered, so it calls
    gmatch recursively. */
 static int
-EXTMATCH (xc, s, se, p, pe, flags)
-     INT xc;           /* select which operation */
-     CHAR *s, *se;
-     CHAR *p, *pe;
-     int flags;
+EXTMATCH (INT xc, CHAR *s, CHAR *se, CHAR *p, CHAR *pe, int flags)
 {
   CHAR *prest;                 /* pointer to rest of pattern */
   CHAR *psub;                  /* pointer to sub-pattern */
index fd95e6cb7ebf379e5704d1fd565a0e79e64f44f2..eb105c05933bc63bb5decc355c6ada29cd13114a 100644 (file)
@@ -1,7 +1,7 @@
 /* strmatch.c -- ksh-like extended pattern matching for the shell and filename
                globbing. */
 
-/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
@@ -67,8 +67,7 @@ int glob_recursion_depth;
    to fnmatch to see if wide characters c1 and c2 collate as members of the
    same equivalence class. We can't really do this portably any other way */
 static int
-_fnmatch_fallback (s, p)
-     int s, p;                 /* string char, patchar */
+_fnmatch_fallback (int s, int p)
 {
   char s1[2];                  /* string */
   char s2[8];                  /* constructed pattern */
@@ -100,9 +99,7 @@ _fnmatch_fallback (s, p)
 
 /* Return 0 if C1 == C2 or collates equally if FORCECOLL is non-zero. */
 static int
-charcmp (c1, c2, forcecoll)
-     int c1, c2;
-     int forcecoll;
+charcmp (int c1, int c2, int forcecoll)
 {
   static char s1[2] = { ' ', '\0' };
   static char s2[2] = { ' ', '\0' };
@@ -125,9 +122,7 @@ charcmp (c1, c2, forcecoll)
 }
 
 static int
-rangecmp (c1, c2, forcecoll)
-     int c1, c2;
-     int forcecoll;
+rangecmp (int c1, int c2, int forcecoll)
 {
   int r;
 
@@ -145,8 +140,7 @@ rangecmp (c1, c2, forcecoll)
 #if defined (HAVE_STRCOLL)
 /* Returns 1 if chars C and EQUIV collate equally in the current locale. */
 static int
-collequiv (c, equiv)
-     int c, equiv;
+collequiv (int c, int equiv)
 {
   if (charcmp (c, equiv, 1) == 0)
     return 1;
@@ -168,9 +162,7 @@ collequiv (c, equiv)
 #include "collsyms.h"
 
 static int
-collsym (s, len)
-     CHAR *s;
-     int len;
+collsym (CHAR *s, int len)
 {
   register struct _collsym *csp;
   char *x;
@@ -208,8 +200,7 @@ static char const *const cclass_name[] =
 #define N_CHAR_CLASS (sizeof(cclass_name) / sizeof (cclass_name[0]))
 
 static enum char_class
-is_valid_cclass (name)
-     const char *name;
+is_valid_cclass (const char *name)
 {
   enum char_class ret;
   int i;
@@ -229,9 +220,7 @@ is_valid_cclass (name)
 }
 
 static int
-cclass_test (c, char_class)
-     int c;
-     enum char_class char_class;
+cclass_test (int c, enum char_class char_class)
 {
   int result;
 
@@ -288,9 +277,7 @@ cclass_test (c, char_class)
 }
        
 static int
-is_cclass (c, name)
-     int c;
-     const char *name;
+is_cclass (int c, const char *name)
 {
   enum char_class char_class;
   int result;
@@ -354,15 +341,15 @@ 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 PARAMS((const char *));
+extern char *mbsmbchar (const char *);
 
 #if FNMATCH_EQUIV_FALLBACK
 /* Construct a string w1 = "c1" and a pattern w2 = "[[=c2=]]" and pass them
    to fnmatch to see if wide characters c1 and c2 collate as members of the
-   same equivalence class. We can't really do this portably any other way */
+   same equivalence class. We can't really do this portably any other way
+   c1 == string char, c2 == patchar */   
 static int
-_fnmatch_fallback_wc (c1, c2)
-     wchar_t c1, c2;                   /* string char, patchar */
+_fnmatch_fallback_wc (wchar_t c1, wchar_t c2)
 {
   char w1[MB_LEN_MAX+1];               /* string */
   char w2[MB_LEN_MAX+8];               /* constructed pattern */
@@ -388,9 +375,7 @@ _fnmatch_fallback_wc (c1, c2)
 #endif
 
 static int
-charcmp_wc (c1, c2, forcecoll)
-     wint_t c1, c2;
-     int forcecoll;
+charcmp_wc (wint_t c1, wint_t c2, int forcecoll)
 {
   static wchar_t s1[2] = { L' ', L'\0' };
   static wchar_t s2[2] = { L' ', L'\0' };
@@ -409,9 +394,7 @@ charcmp_wc (c1, c2, forcecoll)
 }
 
 static int
-rangecmp_wc (c1, c2, forcecoll)
-     wint_t c1, c2;
-     int forcecoll;
+rangecmp_wc (wint_t c1, wint_t c2, int forcecoll)
 {
   int r;
 
@@ -426,8 +409,7 @@ rangecmp_wc (c1, c2, forcecoll)
 
 /* Returns 1 if wide chars C and EQUIV collate equally in the current locale. */
 static int
-collequiv_wc (c, equiv)
-     wint_t c, equiv;
+collequiv_wc (wint_t c, wint_t equiv)
 {
   wchar_t s, p;
 
@@ -454,9 +436,7 @@ collequiv_wc (c, equiv)
 #  include "collsyms.h"
 
 static wint_t
-collwcsym (s, len)
-     wchar_t *s;
-     int len;
+collwcsym (wchar_t *s, int len)
 {
   register struct _collwcsym *csp;
 
@@ -471,9 +451,7 @@ collwcsym (s, len)
 }
 
 static int
-is_wcclass (wc, name)
-     wint_t wc;
-     wchar_t *name;
+is_wcclass (wint_t wc, wchar_t *name)
 {
   char *mbs;
   mbstate_t state;
@@ -525,8 +503,7 @@ is_wcclass (wc, name)
    This only uses single-byte code, but is only needed to support multibyte
    locales. */
 static int
-posix_cclass_only (pattern)
-     char *pattern;
+posix_cclass_only (char *pattern)
 {
   char *p, *p1;
   char cc[16];         /* sufficient for all valid posix char class names */
@@ -599,10 +576,7 @@ posix_cclass_only (pattern)
 #endif /* HAVE_MULTIBYTE */
 
 int
-xstrmatch (pattern, string, flags)
-     char *pattern;
-     char *string;
-     int flags;
+xstrmatch (char *pattern, char *string, int flags)
 {
 #if HANDLE_MULTIBYTE
   int ret;
index 5b7b49fb26a331dfa735ef09ef5e2b3ff2babd7f..5a2c15f95fe37af8a0170ece3f9369501cd18c46 100644 (file)
@@ -1,7 +1,7 @@
 /* strmatch.c -- ksh-like extended pattern matching for the shell and filename
                globbing. */
 
-/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
 #include "stdc.h"
 #include "strmatch.h"
 
-extern int xstrmatch PARAMS((char *, char *, int));
+extern int xstrmatch (char *, char *, int);
 #if defined (HANDLE_MULTIBYTE)
-extern int internal_wstrmatch PARAMS((wchar_t *, wchar_t *, int));
+extern int internal_wstrmatch (wchar_t *, wchar_t *, int);
 #endif
 
 int
-strmatch (pattern, string, flags)
-     char *pattern;
-     char *string;
-     int flags;
+strmatch (char *pattern, char *string, int flags)
 {
   if (string == 0 || pattern == 0)
     return FNM_NOMATCH;
@@ -43,10 +40,7 @@ strmatch (pattern, string, flags)
 
 #if defined (HANDLE_MULTIBYTE)
 int
-wcsmatch (wpattern, wstring, flags)
-     wchar_t *wpattern;
-     wchar_t *wstring;
-     int flags;
+wcsmatch (wchar_t *wpattern, wchar_t *wstring, int flags)
 {
   if (wstring == 0 || wpattern == 0)
     return (FNM_NOMATCH);
index d6a6b0fb397669e165dcf1f080b960386e9d5661..8cca1bd75409f8b76a3dc707e4578d0a71cc260a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne-Again SHell.
 
 
 /* Match STRING against the filename pattern PATTERN,
    returning zero if it matches, FNM_NOMATCH if not.  */
-extern int strmatch PARAMS((char *, char *, int));
+extern int strmatch (char *, char *, int);
 
 #if HANDLE_MULTIBYTE
-extern int wcsmatch PARAMS((wchar_t *, wchar_t *, int));
+extern int wcsmatch (wchar_t *, wchar_t *, int);
 #endif
 
 #endif /* _STRMATCH_H */
index 17250c303b9c14e9e8979197e1d1bbfcef7b20af..3ae56710d036b8962af71b37866afd3420077707 100644 (file)
@@ -1,6 +1,6 @@
 /* xmbsrtowcs.c -- replacement function for mbsrtowcs */
 
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2022 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 PARAMS((const char *, int));
+extern char *strchrnul (const char *, int);
 #endif
 
 /* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>.
@@ -57,11 +57,7 @@ static mbstate_t local_state;
 static int local_state_use = 0;
 
 size_t
-xmbsrtowcs (dest, src, len, pstate)
-    wchar_t *dest;
-    const char **src;
-    size_t len;
-    mbstate_t *pstate;
+xmbsrtowcs (wchar_t *dest, const char **src, size_t len, mbstate_t *pstate)
 {
   mbstate_t *ps;
   size_t mblength, wclength, n;
@@ -139,16 +135,15 @@ xmbsrtowcs (dest, src, len, pstate)
 }
 
 #if HAVE_MBSNRTOWCS
-/* Convert a multibyte string to a wide character string. Memory for the
-   new wide character string is obtained with malloc.
+/* Convert a multibyte string SRC to a wide character string and store the
+   result in *DESTP. Memory for the new wide character string is obtained
+   with malloc.
 
    Fast multiple-character version of xdupmbstowcs used when the indices are
    not required and mbsnrtowcs is available. */
 
 static size_t
-xdupmbstowcs2 (destp, src)
-    wchar_t **destp;   /* Store the pointer to the wide character string */
-    const char *src;   /* Multibyte character string */
+xdupmbstowcs2 (wchar_t **destp, const char *src)
 {
   const char *p;       /* Conversion start position of src */
   wchar_t *wsbuf;      /* Buffer for wide characters. */
@@ -258,11 +253,12 @@ xdupmbstowcs2 (destp, src)
 }
 #endif /* HAVE_MBSNRTOWCS */
 
-/* Convert a multibyte string to a wide character string. Memory for the
-   new wide character string is obtained with malloc.
+/* Convert a multibyte string SRC to a wide character string and store the
+   result in *DESTP. Memory for the new wide character string is obtained
+   with malloc.
 
    The return value is the length of the wide character string. Returns a
-   pointer to the wide character string in DESTP. If INDICESP is not NULL,
+   pointer to the wide character string in *DESTP. If INDICESP is not NULL,
    INDICESP stores the pointer to the pointer array. Each pointer is to
    the first byte of each multibyte character. Memory for the pointer array
    is obtained with malloc, too.
@@ -270,10 +266,7 @@ xdupmbstowcs2 (destp, src)
    of DESTP and INDICESP are NULL. */
 
 size_t
-xdupmbstowcs (destp, indicesp, src)
-    wchar_t **destp;   /* Store the pointer to the wide character string */
-    char ***indicesp;  /* Store the pointer to the pointer array. */
-    const char *src;   /* Multibyte character string */
+xdupmbstowcs (wchar_t **destp, char ***indicesp, const char *src)
 {
   const char *p;       /* Conversion start position of src */
   wchar_t wc;          /* Created wide character by conversion */
index ef5479e32ef1c00380ceba20532a2c07cc9c76fd..f2c1482e0230d64463ca682d54eec8b92f85e82b 100644 (file)
@@ -1,6 +1,6 @@
 /* bindtextdom.c - Implementation of the bindtextdomain(3) function */
 
-/* Copyright (C) 1995-1998, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1998, 2000, 2001, 2002, 2005-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
@@ -89,9 +89,9 @@ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
 #endif
 
 /* Prototypes for local functions.  */
-static void set_binding_values PARAMS ((const char *domainname,
+static void set_binding_values (const char *domainname,
                                        const char **dirnamep,
-                                       const char **codesetp));
+                                       const char **codesetp);
 
 /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
    to be used for the DOMAINNAME message catalog.
index c0f347e39c79db34a5ee069c889201bb50a2f388..fac428def69b1c0b16f005abccb8b177f775afa0 100644 (file)
@@ -1,6 +1,6 @@
 /* dcigettext.c - Implementation of the internal dcigettext function. */
 
-/* Copyright (C) 1995-1999, 2000-2003, 2006-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000-2003, 2006-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
@@ -157,10 +157,10 @@ char *getwd ();
 char *getcwd ();
 # endif
 # ifndef HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
+static char *stpcpy (char *dest, const char *src);
 # endif
 # ifndef HAVE_MEMPCPY
-static void *mempcpy PARAMS ((void *dest, const void *src, size_t n));
+static void *mempcpy (void *dest, const void *src, size_t n);
 # endif
 #endif
 
@@ -254,7 +254,7 @@ static void *root;
 # endif
 
 /* Function to compare two entries in the table of known translations.  */
-static int transcmp PARAMS ((const void *p1, const void *p2));
+static int transcmp (const void *p1, const void *p2);
 static int
 transcmp (p1, p2)
      const void *p1;
@@ -310,22 +310,20 @@ INTVARDEF (_nl_default_dirname)
 struct binding *_nl_domain_bindings;
 
 /* Prototypes for local functions.  */
-static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain,
+static inline char *plural_lookup (struct loaded_l10nfile *domain,
                                    unsigned long int n,
                                    const char *translation,
-                                   size_t translation_len))
-     internal_function;
-static const char *guess_category_value PARAMS ((int category,
-                                                const char *categoryname))
-     internal_function;
+                                   size_t translation_len);
+static inline const char *guess_category_value (int category,
+                                        const char *categoryname);
+
 #ifdef _LIBC
 # include "../locale/localeinfo.h"
 # define category_to_name(category)    _nl_category_names[category]
 #else
-static const char *category_to_name PARAMS ((int category)) internal_function;
+static inline const char *category_to_name (int category);
 #endif
 
-
 /* For those loosing systems which don't have `alloca' we have to add
    some additional code emulating it.  */
 #ifdef HAVE_ALLOCA
@@ -713,11 +711,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
 #ifndef _LIBC
   if (!ENABLE_SECURE)
     {
-      extern void _nl_log_untranslated PARAMS ((const char *logfilename,
+      extern void _nl_log_untranslated (const char *logfilename,
                                                const char *domainname,
                                                const char *msgid1,
                                                const char *msgid2,
-                                               int plural));
+                                               int plural);
       const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
 
       if (logfilename != NULL && logfilename[0] != '\0')
@@ -732,8 +730,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
 }
 
 
-char *
-internal_function
+inline char *
 _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
      struct loaded_l10nfile *domain_file;
      struct binding *domainbinding;
@@ -1043,8 +1040,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
 
 
 /* Look up a plural variant.  */
-static char *
-internal_function
+static inline char *
 plural_lookup (domain, n, translation, translation_len)
      struct loaded_l10nfile *domain;
      unsigned long int n;
@@ -1084,8 +1080,7 @@ plural_lookup (domain, n, translation, translation_len)
 
 #ifndef _LIBC
 /* Return string representation of locale CATEGORY.  */
-static const char *
-internal_function
+static inline const char *
 category_to_name (category)
      int category;
 {
@@ -1145,8 +1140,7 @@ category_to_name (category)
 #endif
 
 /* Guess value of current locale from value of the environment variables.  */
-static const char *
-internal_function
+static inline const char *
 guess_category_value (category, categoryname)
      int category;
      const char *categoryname;
index 3441c74e55b323cca4f9e0da6eae3ff4fdee9f16..74729576ac078fbf421ea44a7f1527ff8c76684b 100644 (file)
@@ -1,6 +1,6 @@
 /* eval-plural.c - Plural expression evaluation. */
 
-/* Copyright (C) 2000-2002, 2006-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2002, 2006-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
    along with Bash.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef STATIC
-#define STATIC static
-#endif
-
 /* Evaluate the plural expression and return an index value.  */
-STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp,
-                                             unsigned long int n))
-     internal_function;
+static inline unsigned long int plural_eval (struct expression *pexp,
+                                             unsigned long int n);
 
-STATIC
+static inline
 unsigned long int
-internal_function
 plural_eval (pexp, n)
      struct expression *pexp;
      unsigned long int n;
index 69a3586e07d4830161202c90bb1ad660f440f861..d7cae3b64bda0d55a0ce3de819df65c81490ae39 100644 (file)
@@ -1,6 +1,6 @@
 /* finddomain.c - Handle list of needed message catalogs */
 
-/* Copyright (C) 1995-1999, 2000, 2001, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000, 2001, 2005-2009, 2022 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@gnu.org>, 1995.
 
    This file is part of GNU Bash.
@@ -47,8 +47,7 @@ static struct loaded_l10nfile *_nl_loaded_domains;
 /* Return a data structure describing the message catalog described by
    the DOMAINNAME and CATEGORY parameters with respect to the currently
    established bindings.  */
-struct loaded_l10nfile *
-internal_function
+inline struct loaded_l10nfile *
 _nl_find_domain (dirname, locale, domainname, domainbinding)
      const char *dirname;
      char *locale;
index 5c137e514c0689bf9f39d56b2d3bffc7fb74dca6..bf259fa6ff03e41dbd738ce475e00ca4ace25524 100644 (file)
@@ -1,6 +1,6 @@
 /* gettextP.h - Header describing internals of libintl library. */
 
-/* Copyright (C) 1995-1999, 2000-2003, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000-2003, 2005-2009, 2022 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
    This file is part of GNU Bash.
@@ -161,64 +161,64 @@ struct binding
 extern int _nl_msg_cat_cntr;
 
 #ifndef _LIBC
-const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
+const char *_nl_locale_name (int category, const char *categoryname);
 #endif
 
-struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+struct loaded_l10nfile *_nl_find_domain (const char *__dirname,
                                                 char *__locale,
                                                 const char *__domainname,
-                                             struct binding *__domainbinding))
+                                             struct binding *__domainbinding);
      internal_function;
-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
-                             struct binding *__domainbinding))
+void _nl_load_domain (struct loaded_l10nfile *__domain,
+                             struct binding *__domainbinding);
      internal_function;
-void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
+void _nl_unload_domain (struct loaded_domain *__domain);
      internal_function;
-const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
+const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
                                          struct loaded_domain *__domain,
-                                         struct binding *__domainbinding))
+                                         struct binding *__domainbinding);
      internal_function;
-void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
+void _nl_free_domain_conv (struct loaded_domain *__domain);
      internal_function;
 
-char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+char *_nl_find_msg (struct loaded_l10nfile *domain_file,
                            struct binding *domainbinding,
-                           const char *msgid, size_t *lengthp))
+                           const char *msgid, size_t *lengthp);
      internal_function;
 
 #ifdef _LIBC
-extern char *__gettext PARAMS ((const char *__msgid));
-extern char *__dgettext PARAMS ((const char *__domainname,
-                                const char *__msgid));
-extern char *__dcgettext PARAMS ((const char *__domainname,
-                                 const char *__msgid, int __category));
-extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
-                                unsigned long int __n));
-extern char *__dngettext PARAMS ((const char *__domainname,
+extern char *__gettext (const char *__msgid);
+extern char *__dgettext (const char *__domainname,
+                                const char *__msgid);
+extern char *__dcgettext (const char *__domainname,
+                                 const char *__msgid, int __category);
+extern char *__ngettext (const char *__msgid1, const char *__msgid2,
+                                unsigned long int __n);
+extern char *__dngettext (const char *__domainname,
                                  const char *__msgid1, const char *__msgid2,
-                                 unsigned long int n));
-extern char *__dcngettext PARAMS ((const char *__domainname,
+                                 unsigned long int n);
+extern char *__dcngettext (const char *__domainname,
                                   const char *__msgid1, const char *__msgid2,
-                                  unsigned long int __n, int __category));
-extern char *__dcigettext PARAMS ((const char *__domainname,
+                                  unsigned long int __n, int __category);
+extern char *__dcigettext (const char *__domainname,
                                   const char *__msgid1, const char *__msgid2,
                                   int __plural, unsigned long int __n,
-                                  int __category));
-extern char *__textdomain PARAMS ((const char *__domainname));
-extern char *__bindtextdomain PARAMS ((const char *__domainname,
-                                      const char *__dirname));
-extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
-                                               const char *__codeset));
+                                  int __category);
+extern char *__textdomain (const char *__domainname);
+extern char *__bindtextdomain (const char *__domainname,
+                                      const char *__dirname);
+extern char *__bind_textdomain_codeset (const char *__domainname,
+                                               const char *__codeset);
 #else
 /* Declare the exported libintl_* functions, in a way that allows us to
    call them under their real name.  */
 # define _INTL_REDIRECT_MACROS
 # include "libgnuintl.h"
-extern char *libintl_dcigettext PARAMS ((const char *__domainname,
+extern char *libintl_dcigettext (const char *__domainname,
                                         const char *__msgid1,
                                         const char *__msgid2,
                                         int __plural, unsigned long int __n,
-                                        int __category));
+                                        int __category);
 #endif
 
 /* @@ begin of epilog @@ */
index b5a7d4132c45a85bea86e3e1c464d1fde4b97be1..b006d3d61789150bed6a1ce0400313296531d935 100644 (file)
@@ -1,6 +1,6 @@
 /* hash-string.h - Description of GNU message catalog format: string hashing function. */
 
-/* Copyright (C) 1995, 1997, 1998, 2000, 2001, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2001, 2005-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
 
 /* @@ end of prolog @@ */
 
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-#  define PARAMS(Args) Args
-# else
-#  define PARAMS(Args) ()
-# endif
-#endif
-
 /* We assume to have `unsigned long int' value with at least 32 bits.  */
 #define HASHWORDBITS 32
 
-
 /* Defines the so called `hashpjw' function by P.J. Weinberger
    [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
    1986, 1987 Bell Telephone Laboratories, Inc.]  */
-static unsigned long int hash_string PARAMS ((const char *__str_param));
+static unsigned long int hash_string (const char *__str_param);
 
 static inline unsigned long int
 hash_string (str_param)
index 4ce284a2b9aa10862fd33d9aba4a2c7961c2850b..c6cc4598663b3a25d6427c536ffceafcb205da48 100644 (file)
@@ -1,6 +1,6 @@
 /* l10nflist.c - make localization file list. */
 
-/* Copyright (C) 1995-1999, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000, 2001, 2002, 2005-2009, 2022 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
    This file is part of GNU Bash.
@@ -61,7 +61,7 @@
 # endif
 #else
 # ifndef HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
+static char *stpcpy (char *dest, const char *src);
 # endif
 #endif
 
@@ -87,7 +87,7 @@ static char *stpcpy PARAMS ((char *dest, const char *src));
 
 #if !defined _LIBC && !defined HAVE___ARGZ_COUNT
 /* Returns the number of strings in ARGZ.  */
-static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+static size_t argz_count__ (const char *argz, size_t len);
 
 static size_t
 argz_count__ (argz, len)
@@ -115,7 +115,7 @@ argz_count__ (argz, len)
 #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
 /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
    except the last into the character SEP.  */
-static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+static void argz_stringify__ (char *argz, size_t len, int sep);
 
 static void
 argz_stringify__ (argz, len, sep)
@@ -142,8 +142,8 @@ argz_stringify__ (argz, len, sep)
 #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
 
 #if !defined _LIBC && !defined HAVE___ARGZ_NEXT
-static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
-                                 const char *entry));
+static char *argz_next__ (char *argz, size_t argz_len,
+                                 const char *entry);
 
 static char *
 argz_next__ (argz, argz_len, entry)
@@ -170,7 +170,7 @@ argz_next__ (argz, argz_len, entry)
 
 
 /* Return number of bits set in X.  */
-static int pop PARAMS ((int x));
+static int pop (int x);
 
 static inline int
 pop (x)
index d06a2773fc72600f8c1fe62555de949e9a5ff73c..dd5a4efeac7e5fb6a9fdcd224250a0ee9ce7f079 100644 (file)
@@ -1,6 +1,6 @@
 /* loadinfo.c */
 
-/* Copyright (C) 1996-1999, 2000-2002, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999, 2000-2002, 2005-2009, 2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -92,8 +92,8 @@ struct loaded_l10nfile
    names.  Normalization allows the user to use any of the common
    names.  The return value is dynamically allocated and has to be
    freed by the caller.  */
-extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
-                                                 size_t name_len));
+extern const char *_nl_normalize_codeset (const char *codeset,
+                                                 size_t name_len);
 
 /* Lookup a locale dependent file.
    *L10NFILE_LIST denotes a pool of lookup results of locale dependent
@@ -110,19 +110,19 @@ extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
    furthermore its ->successor[] field contains a list of other lookup
    results from which this lookup result inherits.  */
 extern struct loaded_l10nfile *
-_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
                            const char *dirlist, size_t dirlist_len, int mask,
                            const char *language, const char *territory,
                            const char *codeset,
                            const char *normalized_codeset,
                            const char *modifier, const char *special,
                            const char *sponsor, const char *revision,
-                           const char *filename, int do_allocate));
+                           const char *filename, int do_allocate);
 
 /* Lookup the real locale name for a locale alias NAME, or NULL if
    NAME is not a locale alias (but possibly a real locale name).
    The return value is statically allocated and must not be freed.  */
-extern const char *_nl_expand_alias PARAMS ((const char *name));
+extern const char *_nl_expand_alias (const char *name);
 
 /* Split a locale name NAME into its pieces: language, modifier,
    territory, codeset, special, sponsor, revision.
@@ -142,18 +142,18 @@ extern const char *_nl_expand_alias PARAMS ((const char *name));
      CEN_SPONSOR                 for *SPONSOR,
      CEN_REVISION                for *REVISION.
  */
-extern int _nl_explode_name PARAMS ((char *name, const char **language,
+extern int _nl_explode_name (char *name, const char **language,
                                     const char **modifier,
                                     const char **territory,
                                     const char **codeset,
                                     const char **normalized_codeset,
                                     const char **special,
                                     const char **sponsor,
-                                    const char **revision));
+                                    const char **revision);
 
 /* Split a locale name NAME into a leading language part and all the
    rest.  Return a pointer to the first character after the language,
    i.e. to the first byte of the rest.  */
-extern char *_nl_find_language PARAMS ((const char *name));
+extern char *_nl_find_language (const char *name);
 
 #endif /* loadinfo.h */
index adbd7b4fe59f09e1b6b5feb97baf4096e0d474d9..7485e6d1901c62dfa1d52f0ab331be6d21d08328 100644 (file)
@@ -1,6 +1,6 @@
 /* loadmsgcat.c - Load needed message catalogs. */
 
-/* Copyright (C) 1995-1999, 2000-2003, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000-2003, 2005-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
@@ -495,7 +495,7 @@ char *alloca ();
 
 /* Prototypes for local functions.  Needed to ensure compiler checking of
    function argument counts despite of K&R C function definition syntax.  */
-static const char *get_sysdep_segment_value PARAMS ((const char *name));
+static const char *get_sysdep_segment_value (const char *name);
 
 
 /* We need a sign, whether a new catalog was loaded, which can be associated
@@ -762,8 +762,7 @@ get_sysdep_segment_value (name)
 
 /* Initialize the codeset dependent parts of an opened message catalog.
    Return the header entry.  */
-const char *
-internal_function
+const inline char *
 _nl_init_domain_conv (domain_file, domain, domainbinding)
      struct loaded_l10nfile *domain_file;
      struct loaded_domain *domain;
@@ -831,7 +830,7 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
                  outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
 # else
 #  if HAVE_ICONV
-                 extern const char *locale_charset PARAMS ((void));
+                 extern const char *locale_charset (void);
                  outcharset = locale_charset ();
 #  endif
 # endif
@@ -881,8 +880,7 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
 }
 
 /* Frees the codeset dependent parts of an opened message catalog.  */
-void
-internal_function
+inline void
 _nl_free_domain_conv (domain)
      struct loaded_domain *domain;
 {
@@ -902,8 +900,7 @@ _nl_free_domain_conv (domain)
 
 /* Load the message catalogs specified by FILENAME.  If it is no valid
    message catalog do nothing.  */
-void
-internal_function
+inline void
 _nl_load_domain (domain_file, domainbinding)
      struct loaded_l10nfile *domain_file;
      struct binding *domainbinding;
@@ -1311,8 +1308,7 @@ _nl_load_domain (domain_file, domainbinding)
 
 
 #ifdef _LIBC
-void
-internal_function
+inline void
 _nl_unload_domain (domain)
      struct loaded_domain *domain;
 {
index 7a730dbf3842340d57ae3f017f5da5bad6e85aaf..27a1f5c61fb516991c9d071a574a555e9889b862 100644 (file)
@@ -1,6 +1,6 @@
 /* localealias.c - Handle aliases for locale names. */
 
-/* Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2009, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
@@ -90,10 +90,6 @@ char *alloca ();
 __libc_lock_define_initialized (static, lock);
 #endif
 
-#ifndef internal_function
-# define internal_function
-#endif
-
 /* Some optimizations for glibc.  */
 #ifdef _LIBC
 # define FEOF(fp)              feof_unlocked (fp)
@@ -142,12 +138,10 @@ static size_t maxmap;
 
 
 /* Prototypes for local functions.  */
-static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
-     internal_function;
-static int extend_alias_table PARAMS ((void));
-static int alias_compare PARAMS ((const struct alias_map *map1,
-                                 const struct alias_map *map2));
-
+static inline size_t read_alias_file (const char *fname, int fname_len);
+static int extend_alias_table (void);
+static int alias_compare (const struct alias_map *map1,
+                         const struct alias_map *map2);
 
 const char *
 _nl_expand_alias (name)
@@ -174,8 +168,8 @@ _nl_expand_alias (name)
       if (nmap > 0)
        retval = (struct alias_map *) bsearch (&item, map, nmap,
                                               sizeof (struct alias_map),
-                                              (int (*) PARAMS ((const void *,
-                                                                const void *))
+                                              (int (*) (const void *,
+                                                                const void *)
                                                ) alias_compare);
       else
        retval = NULL;
@@ -215,8 +209,7 @@ _nl_expand_alias (name)
 }
 
 
-static size_t
-internal_function
+static inline size_t
 read_alias_file (fname, fname_len)
      const char *fname;
      int fname_len;
@@ -369,7 +362,7 @@ read_alias_file (fname, fname_len)
 
   if (added > 0)
     qsort (map, nmap, sizeof (struct alias_map),
-          (int (*) PARAMS ((const void *, const void *))) alias_compare);
+          (int (*) (const void *, const void *)) alias_compare);
 
   return added;
 }
index 9ed3b16ff948884b1cbbf46478072cc46dc72ca1..0580d96766439c03d46850b0faaf238fe36dfe62 100644 (file)
@@ -1,6 +1,6 @@
 /* plural-exp.c - Expression parsing for plural form selection. */
 
-/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005-2009, 2022 Free Software Foundation, Inc.`
    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
    This file is part of GNU Bash.
@@ -96,8 +96,7 @@ init_germanic_plural ()
 
 #endif
 
-void
-internal_function
+inline void
 EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp)
      const char *nullentry;
      struct expression **pluralp;
index dcb0dae0b072ce7f35e0a580c5621ede9f1dfa73..b644f63c334252a3c3a8067d8d7e2a71dd23cef8 100644 (file)
@@ -1,6 +1,6 @@
 /* plural-exp.h - defines for expression parsing and evaluation for plural form selection. */
 
-/* Copyright (C) 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2005-2009, 2022 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
    This file is part of GNU Bash.
 #ifndef _PLURAL_EXP_H
 #define _PLURAL_EXP_H
 
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-#  define PARAMS(args) args
-# else
-#  define PARAMS(args) ()
-# endif
-#endif
-
 #ifndef internal_function
 # define internal_function
 #endif
@@ -38,7 +30,6 @@
 # define attribute_hidden
 #endif
 
-
 /* This is the representation of the expressions to determine the
    plural form.  */
 struct expression
@@ -111,18 +102,18 @@ struct parse_args
 # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
 #endif
 
-extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
+extern void FREE_EXPRESSION (struct expression *exp)
      internal_function;
-extern int PLURAL_PARSE PARAMS ((void *arg));
+extern int PLURAL_PARSE (void *arg);
 extern struct expression GERMANIC_PLURAL attribute_hidden;
-extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry,
+extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
                                               struct expression **pluralp,
-                                              unsigned long int *npluralsp))
+                                              unsigned long int *npluralsp)
      internal_function;
 
 #if !defined (_LIBC) && !defined (IN_LIBINTL)
-extern unsigned long int plural_eval PARAMS ((struct expression *pexp,
-                                             unsigned long int n));
+extern unsigned long int plural_eval (struct expression *pexp,
+                                             unsigned long int n);
 #endif
 
 #endif /* _PLURAL_EXP_H */
index a0031513c7ebabbd0568c22e0fb5a43c01098940..4a8ea39ada44db659e4141dee66dd6ea615c3272 100644 (file)
@@ -1,7 +1,7 @@
 /* A Bison parser, made by GNU Bison 2.0.  */
 
 /* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash.
 
@@ -161,20 +161,20 @@ typedef union YYSTYPE {
 #line 57 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
 
 /* Prototypes for local functions.  */
-static struct expression *new_exp PARAMS ((int nargs, enum operator op,
-                                          struct expression * const *args));
-static inline struct expression *new_exp_0 PARAMS ((enum operator op));
-static inline struct expression *new_exp_1 PARAMS ((enum operator op,
-                                                  struct expression *right));
-static struct expression *new_exp_2 PARAMS ((enum operator op,
+static struct expression *new_exp (int nargs, enum operator op,
+                                          struct expression * const *args);
+static inline struct expression *new_exp_0 (enum operator op);
+static inline struct expression *new_exp_1 (enum operator op,
+                                                  struct expression *right);
+static struct expression *new_exp_2 (enum operator op,
                                             struct expression *left,
-                                            struct expression *right));
-static inline struct expression *new_exp_3 PARAMS ((enum operator op,
+                                            struct expression *right);
+static inline struct expression *new_exp_3 (enum operator op,
                                                   struct expression *bexp,
                                                   struct expression *tbranch,
-                                                  struct expression *fbranch));
-static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
-static void yyerror PARAMS ((const char *str));
+                                                  struct expression *fbranch);
+static int yylex (YYSTYPE *lval, const char **pexp);
+static void yyerror (const char *str);
 
 /* Allocation of expressions.  */
 
@@ -1498,8 +1498,7 @@ yyreturn:
 #line 231 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
 
 
-void
-internal_function
+inline void
 FREE_EXPRESSION (exp)
      struct expression *exp;
 {
index 8b8cec7e83dddd62715346dfa4fdeac6a6a889a8..96dcdc50db29b181efc786e75f23d7c4d36f5d59 100644 (file)
@@ -1,7 +1,7 @@
 %{
 /* plural.y - Expression parsing for plural form selection. */
 
-/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005-2009, 2022 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
 
    This file is part of GNU Bash.
 
 %{
 /* Prototypes for local functions.  */
-static struct expression *new_exp PARAMS ((int nargs, enum operator op,
-                                          struct expression * const *args));
-static inline struct expression *new_exp_0 PARAMS ((enum operator op));
-static inline struct expression *new_exp_1 PARAMS ((enum operator op,
-                                                  struct expression *right));
-static struct expression *new_exp_2 PARAMS ((enum operator op,
+static struct expression *new_exp (int nargs, enum operator op,
+                                          struct expression * const *args);
+static inline struct expression *new_exp_0 (enum operator op);
+static inline struct expression *new_exp_1 (enum operator op,
+                                                  struct expression *right);
+static struct expression *new_exp_2 (enum operator op,
                                             struct expression *left,
-                                            struct expression *right));
-static inline struct expression *new_exp_3 PARAMS ((enum operator op,
+                                            struct expression *right);
+static inline struct expression *new_exp_3 (enum operator op,
                                                   struct expression *bexp,
                                                   struct expression *tbranch,
-                                                  struct expression *fbranch));
-static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
-static void yyerror PARAMS ((const char *str));
+                                                  struct expression *fbranch);
+static int yylex (YYSTYPE *lval, const char **pexp);
+static void yyerror (const char *str);
 
 /* Allocation of expressions.  */
 
@@ -230,8 +230,7 @@ exp:          exp '?' exp ':' exp
 
 %%
 
-void
-internal_function
+inline void
 FREE_EXPRESSION (exp)
      struct expression *exp;
 {
index 26319c2d38cead3516c8e7ad3eca1125ec2df4b7..7627e1649a26211df6634a7795028513a55cb36e 100644 (file)
@@ -77,7 +77,7 @@ typedef char *pointer;
 
 #ifndef emacs
 #define malloc xmalloc
-extern pointer xmalloc ();
+extern pointer xmalloc (size_t);
 #endif
 
 /* Define STACK_DIRECTION if you know the direction of stack
@@ -102,7 +102,7 @@ static int stack_dir;               /* 1 or -1 once known.  */
 #define        STACK_DIR       stack_dir
 
 static void
-find_stack_direction ()
+find_stack_direction (void)
 {
   static char *addr = NULL;    /* Address of first `dummy', once known.  */
   auto char dummy;             /* To get stack address.  */
@@ -156,8 +156,7 @@ static header *last_alloca_header = NULL;   /* -> last alloca header.  */
    implementations of C, for example under Gould's UTX/32.  */
 
 pointer
-alloca (size)
-     size_t size;
+alloca (size_t size)
 {
   auto char probe;             /* Probes stack depth: */
   register char *depth = ADDRESS_FUNCTION (probe);
index bebd136434aa7c4470119315340e3efd60c4d0ba..16c0c67177dea088615e60f80c93070dabcf3f3a 100644 (file)
@@ -1,6 +1,6 @@
 /* imalloc.h -- internal malloc definitions shared by source files. */
 
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -172,7 +172,7 @@ do {                                                                        \
 
 #include <signal.h>
 
-extern void _malloc_block_signals PARAMS((sigset_t *, sigset_t *));
-extern void _malloc_unblock_signals PARAMS((sigset_t *, sigset_t *));
+extern void _malloc_block_signals (sigset_t *, sigset_t *);
+extern void _malloc_unblock_signals (sigset_t *, sigset_t *);
 
 #endif /* _IMALLOC_H */
index f61f02715da3188934602eef429cc554cc08be2a..180c3dc4b164e4f5a0f4c59167c20a56ecd8210b 100644 (file)
@@ -1,6 +1,6 @@
 /* malloc.c - dynamic memory allocation for bash. */
 
-/*  Copyright (C) 1985-2021 Free Software Foundation, Inc.
+/*  Copyright (C) 1985-2022 Free Software Foundation, Inc.
 
     This file is part of GNU Bash, the Bourne-Again SHell.
     
@@ -308,33 +308,33 @@ extern int errno;
 #endif
 
 /* Declarations for internal functions */
-static PTR_T internal_malloc PARAMS((size_t, const char *, int, int));
-static PTR_T internal_realloc PARAMS((PTR_T, size_t, const char *, int, int));
-static void internal_free PARAMS((PTR_T, const char *, int, int));
-static PTR_T internal_memalign PARAMS((size_t, size_t, const char *, int, int));
+static PTR_T internal_malloc (size_t, const char *, int, int);
+static PTR_T internal_realloc (PTR_T, size_t, const char *, int, int);
+static void internal_free (PTR_T, const char *, int, int);
+static PTR_T internal_memalign (size_t, size_t, const char *, int, int);
 #ifndef NO_CALLOC
-static PTR_T internal_calloc PARAMS((size_t, size_t, const char *, int, int));
-static void internal_cfree PARAMS((PTR_T, const char *, int, int));
+static PTR_T internal_calloc (size_t, size_t, const char *, int, int);
+static void internal_cfree (PTR_T, const char *, int, int);
 #endif
 #ifndef NO_VALLOC
-static PTR_T internal_valloc PARAMS((size_t, const char *, int, int));
+static PTR_T internal_valloc (size_t, const char *, int, int);
 #endif
-static PTR_T internal_remap PARAMS((PTR_T, size_t, int, int));
+static PTR_T internal_remap (PTR_T, size_t, int, int);
 
 #if defined (botch)
 extern void botch ();
 #else
-static void botch PARAMS((const char *, const char *, int));
+static void botch (const char *, const char *, int);
 #endif
-static void xbotch PARAMS((PTR_T, int, const char *, const char *, int));
+static void xbotch (PTR_T, int, const char *, const char *, int);
 
 #if !HAVE_DECL_SBRK
-extern char *sbrk ();
+extern char *sbrk (int);
 #endif /* !HAVE_DECL_SBRK */
 
 #ifdef SHELL
 extern int running_trap;
-extern int signal_is_trapped PARAMS((int));
+extern int signal_is_trapped (int);
 #endif
 
 #ifdef MALLOC_STATS
@@ -353,16 +353,13 @@ int malloc_mmap_threshold = MMAP_THRESHOLD;
 char _malloc_trace_buckets[NBUCKETS];
 
 /* These should really go into a header file. */
-extern void mtrace_alloc PARAMS((const char *, PTR_T, size_t, const char *, int));
-extern void mtrace_free PARAMS((PTR_T, int, const char *, int));
+extern void mtrace_alloc (const char *, PTR_T, size_t, const char *, int);
+extern void mtrace_free (PTR_T, int, const char *, int);
 #endif
 
 #if !defined (botch)
 static void
-botch (s, file, line)
-     const char *s;
-     const char *file;
-     int line;
+botch (const char *s, const char *file, int line)
 {
   fprintf (stderr, _("malloc: failed assertion: %s\n"), s);
   (void)fflush (stderr);
@@ -373,12 +370,7 @@ botch (s, file, line)
 /* print the file and line number that caused the assertion failure and
    call botch() to do whatever the application wants with the information */
 static void
-xbotch (mem, e, s, file, line)
-     PTR_T mem;
-     int e;
-     const char *s;
-     const char *file;
-     int line;
+xbotch (PTR_T mem, int e, const char *s, const char *file, int line)
 {
   fprintf (stderr, _("\r\nmalloc: %s:%d: assertion botched\r\n"),
                        file ? file : _("unknown"), line);
@@ -395,8 +387,7 @@ xbotch (mem, e, s, file, line)
    assumed to not be busy; the caller (morecore()) checks for this. 
    BUSY[NU] must be set to 1. */
 static void
-bcoalesce (nu)
-     register int nu;
+bcoalesce (register int nu)
 {
   register union mhead *mp, *mp1, *mp2;
   register int nbuck;
@@ -464,8 +455,7 @@ bcoalesce (nu)
    is assumed to be empty.  Must be called with signals blocked (e.g.,
    by morecore()).  BUSY[NU] must be set to 1. */
 static void
-bsplit (nu)
-     register int nu;
+bsplit (register int nu)
 {
   register union mhead *mp;
   int nbuck, nblks, split_max;
@@ -529,9 +519,7 @@ bsplit (nu)
 /* Take the memory block MP and add it to a chain < NU.  NU is the right bucket,
    but is busy.  This avoids memory orphaning. */
 static void
-xsplit (mp, nu)
-     union mhead *mp;
-     int nu;
+xsplit (union mhead *mp, int nu)
 {
   union mhead *nh;
   int nbuck, nblks, split_max;
@@ -570,8 +558,7 @@ xsplit (mp, nu)
 }
 
 void
-_malloc_block_signals (setp, osetp)
-     sigset_t *setp, *osetp;
+_malloc_block_signals (sigset_t *setp, sigset_t *osetp)
 {
 #ifdef HAVE_POSIX_SIGNALS
   sigfillset (setp);
@@ -585,8 +572,7 @@ _malloc_block_signals (setp, osetp)
 }
 
 void
-_malloc_unblock_signals (setp, osetp)
-     sigset_t *setp, *osetp;
+_malloc_unblock_signals (sigset_t *setp, sigset_t *osetp)
 {
 #ifdef HAVE_POSIX_SIGNALS
   sigprocmask (SIG_SETMASK, osetp, (sigset_t *)NULL);
@@ -600,10 +586,9 @@ _malloc_unblock_signals (setp, osetp)
 #if defined (USE_LESSCORE)
 /* Return some memory to the system by reducing the break.  This is only
    called with NU > pagebucket, so we're always assured of giving back
-   more than one page of memory. */  
+   more than one page of memory. NU is the size index we're discarding */ 
 static void
-lesscore (nu)                  /* give system back some memory */
-     register int nu;          /* size index we're discarding  */
+lesscore (int nu)
 {
   long siz;
 
@@ -622,8 +607,7 @@ lesscore (nu)                       /* give system back some memory */
 
 /* Ask system for more memory; add to NEXTF[NU].  BUSY[NU] must be set to 1. */  
 static void
-morecore (nu)
-     register int nu;          /* size index to get more of  */
+morecore (int nu)
 {
   register union mhead *mp;
   register int nblks;
@@ -752,13 +736,13 @@ morecore_done:
 }
 
 static void
-malloc_debug_dummy ()
+malloc_debug_dummy (void)
 {
   write (1, "malloc_debug_dummy\n", 19);
 }
 
 static int
-pagealign ()
+pagealign (void)
 {
   register int nunits;
   register union mhead *mp;
@@ -823,12 +807,10 @@ pagealign ()
 
   return 0;
 }
-    
+
+/* allocate a block of memory */    
 static PTR_T
-internal_malloc (n, file, line, flags)         /* get a block */
-     size_t n;
-     const char *file;
-     int line, flags;
+internal_malloc (size_t n, const char *file, int line, int flags)
 {
   register union mhead *p;
   register int nunits;
@@ -947,10 +929,7 @@ internal_malloc (n, file, line, flags)             /* get a block */
 }
 
 static void
-internal_free (mem, file, line, flags)
-     PTR_T mem;
-     const char *file;
-     int line, flags;
+internal_free (PTR_T mem, const char *file, int line, int flags)
 {
   register union mhead *p;
   register char *ap, *z;
@@ -1096,11 +1075,7 @@ free_return:
    new size, call mremap with the new size, and add the bookkeeping and guard
    information back in. */
 static PTR_T
-internal_remap (mem, n, nunits, flags)
-     PTR_T mem;
-     register size_t n;
-     int nunits;
-     int flags;
+internal_remap (PTR_T mem, register size_t n, int nunits, int flags)
 {
   register union mhead *p, *np;
   char *m, *z;
@@ -1143,11 +1118,7 @@ internal_remap (mem, n, nunits, flags)
 #endif
 
 static PTR_T
-internal_realloc (mem, n, file, line, flags)
-     PTR_T mem;
-     register size_t n;
-     const char *file;
-     int line, flags;
+internal_realloc (PTR_T mem, size_t n, const char *file, int line, int flags)
 {
   register union mhead *p;
   register MALLOC_SIZE_T tocopy;
@@ -1294,11 +1265,7 @@ internal_realloc (mem, n, file, line, flags)
 }
 
 static PTR_T
-internal_memalign (alignment, size, file, line, flags)
-     size_t alignment;
-     size_t size;
-     const char *file;
-     int line, flags;
+internal_memalign (size_t alignment, size_t size, const char *file, int line, int flags)
 {
   register char *ptr;
   register char *aligned;
@@ -1324,9 +1291,7 @@ internal_memalign (alignment, size, file, line, flags)
 }
 
 int
-posix_memalign (memptr, alignment, size)
-     void **memptr;
-     size_t alignment, size;
+posix_memalign (void **memptr, size_t alignment, size_t size)
 {
   void *mem;
 
@@ -1346,8 +1311,7 @@ posix_memalign (memptr, alignment, size)
 }
 
 size_t
-malloc_usable_size (mem)
-     void *mem;
+malloc_usable_size (void *mem)
 {
   register union mhead *p;
   register char *ap;
@@ -1376,10 +1340,7 @@ malloc_usable_size (mem)
 /* This runs into trouble with getpagesize on HPUX, and Multimax machines.
    Patching out seems cleaner than the ugly fix needed.  */
 static PTR_T
-internal_valloc (size, file, line, flags)
-     size_t size;
-     const char *file;
-     int line, flags;
+internal_valloc (size_t size, const char *file, int line, int flags)
 {
   return internal_memalign (getpagesize (), size, file, line, flags|MALLOC_INTERNAL);
 }
@@ -1387,10 +1348,7 @@ internal_valloc (size, file, line, flags)
 
 #ifndef NO_CALLOC
 static PTR_T
-internal_calloc (n, s, file, line, flags)
-     size_t n, s;
-     const char *file;
-     int line, flags;
+internal_calloc (size_t n, size_t s, const char *file, int line, int flags)
 {
   size_t total;
   PTR_T result;
@@ -1403,10 +1361,7 @@ internal_calloc (n, s, file, line, flags)
 }
 
 static void
-internal_cfree (p, file, line, flags)
-     PTR_T p;
-     const char *file;
-     int line, flags;
+internal_cfree (PTR_T p, const char *file, int line, int flags)
 {
   internal_free (p, file, line, flags|MALLOC_INTERNAL);
 }
@@ -1414,8 +1369,7 @@ internal_cfree (p, file, line, flags)
 
 #ifdef MALLOC_STATS
 int
-malloc_free_blocks (size)
-     int size;
+malloc_free_blocks (int size)
 {
   int nfree;
   register union mhead *p;
@@ -1430,58 +1384,38 @@ malloc_free_blocks (size)
 
 #if defined (MALLOC_WRAPFUNCS)
 PTR_T
-sh_malloc (bytes, file, line)
-     size_t bytes;
-     const char *file;
-     int line;
+sh_malloc (size_t bytes, const char *file, int line)
 {
   return internal_malloc (bytes, file, line, MALLOC_WRAPPER);
 }
 
 PTR_T
-sh_realloc (ptr, size, file, line)
-     PTR_T ptr;
-     size_t size;
-     const char *file;
-     int line;
+sh_realloc (PTR_T ptr, size_t size, const char *file, int line)
 {
   return internal_realloc (ptr, size, file, line, MALLOC_WRAPPER);
 }
 
 void
-sh_free (mem, file, line)
-     PTR_T mem;
-     const char *file;
-     int line;
+sh_free (PTR_T mem, const char *file, int line)
 {
   internal_free (mem, file, line, MALLOC_WRAPPER);
 }
 
 PTR_T
-sh_memalign (alignment, size, file, line)
-     size_t alignment;
-     size_t size;
-     const char *file;
-     int line;
+sh_memalign (size_t alignment, size_t size, const char *file, int line)
 {
   return internal_memalign (alignment, size, file, line, MALLOC_WRAPPER);
 }
 
 #ifndef NO_CALLOC
 PTR_T
-sh_calloc (n, s, file, line)
-     size_t n, s;
-     const char *file;
-     int line;
+sh_calloc (size_t n, size_t s, const char *file, int line)
 {
   return internal_calloc (n, s, file, line, MALLOC_WRAPPER);
 }
 
 void
-sh_cfree (mem, file, line)
-     PTR_T mem;
-     const char *file;
-     int line;
+sh_cfree (PTR_T mem, const char *file, int line)
 {
   internal_cfree (mem, file, line, MALLOC_WRAPPER);
 }
@@ -1489,10 +1423,7 @@ sh_cfree (mem, file, line)
 
 #ifndef NO_VALLOC
 PTR_T
-sh_valloc (size, file, line)
-     size_t size;
-     const char *file;
-     int line;
+sh_valloc (size_t size, const char *file, int line)
 {
   return internal_valloc (size, file, line, MALLOC_WRAPPER);
 }
@@ -1503,39 +1434,32 @@ sh_valloc (size, file, line)
 /* Externally-available functions that call their internal counterparts. */
 
 PTR_T
-malloc (size)
-     size_t size;
+malloc (size_t size)
 {
   return internal_malloc (size, (char *)NULL, 0, 0);
 }
 
 PTR_T
-realloc (mem, nbytes)
-     PTR_T mem;
-     size_t nbytes;
+realloc (PTR_T mem, size_t nbytes)
 {
   return internal_realloc (mem, nbytes, (char *)NULL, 0, 0);
 }
 
 void
-free (mem)
-     PTR_T mem;
+free (PTR_T mem)
 {
   internal_free (mem,  (char *)NULL, 0, 0);
 }
 
 PTR_T
-memalign (alignment, size)
-     size_t alignment;
-     size_t size;
+memalign (size_t alignment, size_t size)
 {
   return internal_memalign (alignment, size, (char *)NULL, 0, 0);
 }
 
 #ifndef NO_VALLOC
 PTR_T
-valloc (size)
-     size_t size;
+valloc (size_t size)
 {
   return internal_valloc (size, (char *)NULL, 0, 0);
 }
@@ -1543,15 +1467,13 @@ valloc (size)
 
 #ifndef NO_CALLOC
 PTR_T
-calloc (n, s)
-     size_t n, s;
+calloc (size_t n, size_t s)
 {
   return internal_calloc (n, s, (char *)NULL, 0, 0);
 }
 
 void
-cfree (mem)
-     PTR_T mem;
+cfree (PTR_T mem)
 {
   internal_cfree (mem, (char *)NULL, 0, 0);
 }
index aa3fa33b465fba64b853fe7e544a9d60253b1434..234725edbf01e80d9c5857dc7425c52a8a9fe7f4 100644 (file)
@@ -1,6 +1,6 @@
 /* mstats.h - definitions for malloc statistics */
 
-/*  Copyright (C) 2001-2021 Free Software Foundation, Inc.
+/*  Copyright (C) 2001-2022 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 PARAMS((int));
-extern struct _malstats malloc_stats PARAMS((void));
-extern void print_malloc_stats PARAMS((char *));
-extern void trace_malloc_stats PARAMS((char *, char *));
+extern struct bucket_stats malloc_bucket_stats (int);
+extern struct _malstats malloc_stats (void);
+extern void print_malloc_stats (char *);
+extern void trace_malloc_stats (char *, char *);
 
 #endif /* MALLOC_STATS */
 
index d51193eb04a443c5289460a10f87018e038c7737..1213169d1af660348b804295cfed23b7ddcc154d 100644 (file)
@@ -1,6 +1,7 @@
 /* Functions (currently) for use by the shell to do malloc debugging and
    tracking. */
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne-Again SHell.
 
 #ifndef _SH_MALLOC_H
 #define _SH_MALLOC_H
 
-#ifndef PARAMS
-#  if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
-#    define PARAMS(protos) protos
-#  else
-#    define PARAMS(protos) ()
-#  endif
-#endif
-
 /* Generic pointer type. */
 #ifndef PTR_T
 
 #endif /* PTR_T */
 
 
-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_malloc (size_t, const char *, int);
+extern PTR_T sh_realloc (PTR_T, size_t, const char *, int);
+extern void sh_free (PTR_T, const char *, int);
 
-extern PTR_T sh_memalign PARAMS((size_t, size_t, const char *, int));
+extern PTR_T sh_memalign (size_t, size_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_calloc (size_t, size_t, const char *, int);
+extern void sh_cfree (PTR_T, const char *, int);
 
-extern PTR_T sh_valloc PARAMS((size_t, const char *, int));
+extern PTR_T sh_valloc (size_t, const char *, int);
 
 /* trace.c */
-extern int malloc_set_trace PARAMS((int));
+extern int malloc_set_trace (int);
 extern void malloc_set_tracefp ();     /* full prototype requires stdio.h */
-extern void malloc_set_tracefn PARAMS((char *, char *));
+extern void malloc_set_tracefn (char *, char *);
 
 /* table.c */
-extern void mregister_dump_table PARAMS((void));
-extern void mregister_table_init PARAMS((void));
-extern int malloc_set_register PARAMS((int));
+extern void mregister_dump_table (void);
+extern void mregister_table_init (void);
+extern int malloc_set_register (int);
 
 /* stats.c */
-extern void print_malloc_stats PARAMS((char *));
+extern void print_malloc_stats (char *);
 extern void fprint_malloc_stats ();    /* full prototype requires stdio.h */
-extern void trace_malloc_stats PARAMS((char *, char *));
+extern void trace_malloc_stats (char *, char *);
 
 #endif
index b38df9f4d450f0a2fa5a3b88764bca9a00a474db..a26d44a7fd1e506ca5edfcab90cdd1689fa9e742 100644 (file)
@@ -1,6 +1,6 @@
 /* stats.c - malloc statistics */
 
-/*  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/*  Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
     This file is part of GNU Bash, the Bourne-Again SHell.
 
 
 #include "mstats.h"
 
-extern int malloc_free_blocks PARAMS((int));
+extern int malloc_free_blocks (int);
 
 extern int malloc_mmap_threshold;
 
 extern struct _malstats _mstats;
 
-extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
+extern FILE *_imalloc_fopen (char *, char *, char *, char *, size_t);
 
 struct bucket_stats
-malloc_bucket_stats (size)
-     int size;
+malloc_bucket_stats (int size)
 {
   struct bucket_stats v;
 
@@ -75,7 +74,7 @@ malloc_bucket_stats (size)
    is the total number of bytes in use.  These two fields are fairly
    expensive to compute, so we do it only when asked to. */
 struct _malstats
-malloc_stats ()
+malloc_stats (void)
 {
   struct _malstats result;
   struct bucket_stats v;
@@ -93,9 +92,7 @@ malloc_stats ()
 }
 
 static void
-_print_malloc_stats (s, fp)
-     char *s;
-     FILE *fp;
+_print_malloc_stats (char *s, FILE *fp)
 {
   register int i;
   unsigned long totused, totfree;
@@ -128,16 +125,13 @@ _print_malloc_stats (s, fp)
 }
 
 void
-print_malloc_stats (s)
-     char *s;
+print_malloc_stats (char *s)
 {
   _print_malloc_stats (s, stderr);
 }
 
 void
-fprint_malloc_stats (s, fp)
-     char *s;
-     FILE *fp;
+fprint_malloc_stats (char *s, FILE *fp)
 {
   _print_malloc_stats (s, fp);
 }
@@ -145,8 +139,7 @@ fprint_malloc_stats (s, fp)
 #define TRACEROOT "/var/tmp/maltrace/stats."
 
 void
-trace_malloc_stats (s, fn)
-     char *s, *fn;
+trace_malloc_stats (char *s, char *fn)
 {
   FILE *fp;
   char defname[sizeof (TRACEROOT) + 64];
@@ -166,12 +159,7 @@ trace_malloc_stats (s, fn)
 
 #if defined (MALLOC_STATS) || defined (MALLOC_TRACE)
 FILE *
-_imalloc_fopen (s, fn, def, defbuf, defsiz)
-     char *s;
-     char *fn;
-     char *def;
-     char *defbuf;
-     size_t defsiz;
+_imalloc_fopen (char *s, char *fn, char *def, char *defbuf, size_t defsiz)
 {
   char fname[1024];
   long l;
index e6acbf4ac355a40fe3935295237d9af10b77d6be..be6a88d91286065f2724bfce08ef33539b8d3a5f 100644 (file)
@@ -1,6 +1,6 @@
 /* table.c - bookkeeping functions for allocated memory */
 
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #ifdef SHELL
 extern int running_trap;
-extern int signal_is_trapped PARAMS((int));
+extern int signal_is_trapped (int);
 #endif
 
 extern int malloc_register;
 
 #ifdef MALLOC_REGISTER
 
-extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
+extern FILE *_imalloc_fopen (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 */
@@ -60,8 +60,7 @@ static ma_table_t mlocation_table[REG_TABLE_SIZE];
  * NOTE: taken from dmalloc (http://dmalloc.com) and modified.
  */
 static unsigned int
-mt_hash (key)
-     const PTR_T key;
+mt_hash (const PTR_T key)
 {
   unsigned int a, b, c;
   unsigned long x;
@@ -78,8 +77,7 @@ mt_hash (key)
 
 #if 0
 static unsigned int
-which_bucket (mem)
-     PTR_T mem;
+which_bucket (PTR_T mem)
 {
   return (mt_hash ((unsigned char *)mem) & (REG_TABLE_SIZE-1));
 }
@@ -95,9 +93,7 @@ which_bucket (mem)
 #endif
 
 static mr_table_t *
-find_entry (mem, flags)
-     PTR_T mem;
-     int flags;
+find_entry (PTR_T mem, int flags)
 {
   unsigned int bucket;
   register mr_table_t *tp;
@@ -135,16 +131,13 @@ find_entry (mem, flags)
 }
 
 mr_table_t *
-mr_table_entry (mem)
-     PTR_T mem;
+mr_table_entry (PTR_T mem)
 {
   return (find_entry (mem, FIND_EXIST));
 }
 
 void
-mregister_describe_mem (mem, fp)
-     PTR_T mem;
-     FILE *fp;
+mregister_describe_mem (PTR_T mem, FILE *fp)
 {
   mr_table_t *entry;
 
@@ -160,12 +153,7 @@ mregister_describe_mem (mem, fp)
 }
 
 void
-mregister_alloc (tag, mem, size, file, line)
-     const char *tag;
-     PTR_T mem;
-     size_t size;
-     const char *file;
-     int line;
+mregister_alloc (const char *tag, PTR_T mem, size_t size, const char *file, int line)
 {
   mr_table_t *tentry;
   sigset_t set, oset;
@@ -216,11 +204,7 @@ mregister_alloc (tag, mem, size, file, line)
 }
 
 void
-mregister_free (mem, size, file, line)
-     PTR_T mem;
-     int size;
-     const char *file;
-     int line;
+mregister_free (PTR_T mem, int size, const char *file, int line)
 {
   mr_table_t *tentry;
   sigset_t set, oset;
@@ -268,8 +252,7 @@ mregister_free (mem, size, file, line)
 
 /* If we ever add more flags, this will require changes. */
 static char *
-_entry_flags(x)
-     int x;
+_entry_flags(int x)
 {
   if (x & MT_FREE)
     return "free";
@@ -280,8 +263,7 @@ _entry_flags(x)
 }
 
 static void
-_register_dump_table(fp)
-     FILE *fp;
+_register_dump_table(FILE *fp)
 {
   register int i;
   mr_table_t entry;
@@ -303,13 +285,13 @@ _register_dump_table(fp)
 }
  
 void
-mregister_dump_table()
+mregister_dump_table(void)
 {
   _register_dump_table (stderr);
 }
 
 void
-mregister_table_init ()
+mregister_table_init (void)
 {
   memset (mem_table, 0, sizeof(mr_table_t) * REG_TABLE_SIZE);
   memset (&mem_overflow, 0, sizeof (mr_table_t));
@@ -319,9 +301,7 @@ mregister_table_init ()
 /* Simple for now */
 
 static ma_table_t *
-find_location_entry (file, line)
-     const char *file;
-     int line;
+find_location_entry (const char *file, int line)
 {
   register ma_table_t *tp, *endp;
 
@@ -335,9 +315,7 @@ find_location_entry (file, line)
 }
 
 void
-mlocation_register_alloc (file, line)
-     const char *file;
-     int line;
+mlocation_register_alloc (const char *file, int line)
 {
   ma_table_t *lentry;
   const char *nfile;
@@ -372,8 +350,7 @@ mlocation_register_alloc (file, line)
 }
 
 static void
-_location_dump_table (fp)
-     FILE *fp;
+_location_dump_table (FILE *fp)
 {
   register ma_table_t *tp, *endp;
 
@@ -385,7 +362,7 @@ _location_dump_table (fp)
 }
 
 void
-mlocation_dump_table ()
+mlocation_dump_table (void)
 {
   _location_dump_table (stderr);
 }
@@ -393,7 +370,7 @@ mlocation_dump_table ()
 #define LOCROOT "/var/tmp/maltrace/locations."
 
 void
-mlocation_write_table ()
+mlocation_write_table (void)
 {
   FILE *fp;
   char defname[sizeof (LOCROOT) + 64];
@@ -406,7 +383,7 @@ mlocation_write_table ()
 }
 
 void
-mlocation_table_init ()
+mlocation_table_init (void)
 {
   memset (mlocation_table, 0, sizeof (ma_table_t) * REG_TABLE_SIZE);
   mlocation_table[0].file = "";                /* reserve slot 0 for unknown locations */
@@ -418,8 +395,7 @@ mlocation_table_init ()
 #endif /* MALLOC_REGISTER */
 
 int
-malloc_set_register(n)
-     int n;
+malloc_set_register (int n)
 {
   int old;
 
index 92866cf28c41551dd3d627f50ab3a836b4f13685..e7803762a9311e100da1445a61fe4d998068b8a2 100644 (file)
@@ -1,6 +1,6 @@
 /* table.h - definitions for tables for keeping track of allocated memory */
 
-/*  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/*  Copyright (C) 2001-2022 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 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 mr_table_t *mr_table_entry (PTR_T);
+extern void mregister_alloc (const char *, PTR_T, size_t, const char *, int);
+extern void mregister_free (PTR_T, int, const char *, int);
 extern void mregister_describe_mem ();
-extern void mregister_dump_table PARAMS((void));
-extern void mregister_table_init PARAMS((void));
+extern void mregister_dump_table (void);
+extern void mregister_table_init (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 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));
+extern void mlocation_register_alloc (const char *, int);
+extern void mlocation_table_init (void);
+extern void mlocation_dump_table (void);
+extern void mlocation_write_table (void);
 
 /* NOTE:  HASH_MIX taken from dmalloc (http://dmalloc.com) */
 
index 391ca9d8978629e4cbebefa14a3c1252b58174c3..e968e620c3880e4ee0884f9b4c659ced3af19164 100644 (file)
@@ -1,6 +1,6 @@
 /* trace.c - tracing functions for malloc */
 
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -35,18 +35,13 @@ static int _mtrace_verbose = 0;
 
 #ifdef MALLOC_TRACE
 
-extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
+extern FILE *_imalloc_fopen (char *, char *, char *, char *, size_t);
 
 FILE *_mtrace_fp = NULL;
 extern char _malloc_trace_buckets[];
 
 void
-mtrace_alloc (tag, mem, size, file, line)
-     const char *tag;
-     PTR_T mem;
-     size_t size;
-     const char *file;
-     int line;
+mtrace_alloc (const char *tag, PTR_T mem, size_t size, const char *file, int line)
 {
   if (_mtrace_fp == NULL)
     _mtrace_fp = stderr;
@@ -60,11 +55,7 @@ mtrace_alloc (tag, mem, size, file, line)
 }
 
 void
-mtrace_free (mem, size, file, line)
-     PTR_T mem;
-     int size;
-     const char *file;
-     int line;
+mtrace_free (PTR_T mem, int size, const char *file, int line)
 {
   if (_mtrace_fp == NULL)
     _mtrace_fp = stderr;
@@ -79,8 +70,7 @@ mtrace_free (mem, size, file, line)
 #endif /* MALLOC_TRACE */
 
 int
-malloc_set_trace (n)
-     int n;
+malloc_set_trace (int n)
 {
   int old;
 
@@ -91,8 +81,7 @@ malloc_set_trace (n)
 }
 
 void
-malloc_set_tracefp (fp)
-     FILE *fp;
+malloc_set_tracefp (FILE *fp)
 {
 #ifdef MALLOC_TRACE
   _mtrace_fp = fp ? fp : stderr;
@@ -100,8 +89,7 @@ malloc_set_tracefp (fp)
 }
 
 void
-malloc_trace_bin (n)
-     int n;
+malloc_trace_bin (int n)
 {
 #ifdef MALLOC_TRACE
   _malloc_trace_buckets[n] = 1;
@@ -111,9 +99,7 @@ malloc_trace_bin (n)
 #define TRACEROOT "/var/tmp/maltrace/trace."
 
 void
-malloc_set_tracefn (s, fn)
-     char *s;
-     char *fn;
+malloc_set_tracefn (char *s, char *fn)
 {
 #ifdef MALLOC_TRACE
   FILE *fp;
index 00c8a8248b4e9bc317be38115439f0dc911d85cc..681b55939889a000a508303a53e87cc84d01af05 100644 (file)
@@ -1,6 +1,6 @@
 /* watch.c - watchpoint functions for malloc */
 
-/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -35,11 +35,7 @@ int          _malloc_nwatch;
 static PTR_T   _malloc_watch_list[WATCH_MAX];
 
 static void
-watch_warn (addr, file, line, type, data)
-     PTR_T addr;
-     const char *file;
-     int line, type;
-     unsigned long data;
+watch_warn (PTR_T addr, const char *file, int line, int type, unsigned long data)
 {
   char *tag;
 
@@ -61,11 +57,7 @@ watch_warn (addr, file, line, type, data)
 }
 
 void
-_malloc_ckwatch (addr, file, line, type, data)
-     PTR_T addr;
-     const char *file;
-     int line, type;
-     unsigned long data;
+_malloc_ckwatch (PTR_T addr, const char *file, int line, int type, unsigned long data)
 {
   register int i;
 
@@ -81,8 +73,7 @@ _malloc_ckwatch (addr, file, line, type, data)
 #endif /* MALLOC_WATCH */
 
 PTR_T
-malloc_watch (addr)
-     PTR_T addr;
+malloc_watch (PTR_T addr)
 {
   register int i;
   PTR_T ret;
@@ -117,8 +108,7 @@ malloc_watch (addr)
    watchpoints.  Returns ADDR if everything went OK, NULL if ADDR was
    not being watched. */
 PTR_T
-malloc_unwatch (addr)
-     PTR_T addr;
+malloc_unwatch (PTR_T addr)
 {
 #ifdef MALLOC_WATCH
   register int i;
index 2a0f4970ad9a35896efc886921bd45970bd1fc6c..81900d3e80c3cf279ead14b99dfa158344cdf437 100644 (file)
@@ -1,6 +1,6 @@
 /* watch.h - definitions for tables for keeping track of allocated memory */
 
-/*  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/*  Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
     This file is part of GNU Bash, the Bourne-Again SHell.
 
@@ -34,8 +34,8 @@
 
 extern int _malloc_nwatch;
 
-extern void _malloc_ckwatch PARAMS((PTR_T, const char *, int, int, unsigned long));
-                    
+extern void _malloc_ckwatch (PTR_T, const char *, int, int, unsigned long);
+
 #endif /* MALLOC_WATCH */
 
 #endif /* _MWATCH_H */
index f6dec67a8953e6812f98b27a4feba4670186d9e7..de8f38345d4f292f78f4aed86924a96489ecbfca 100644 (file)
@@ -1,6 +1,6 @@
 /* xmalloc.c -- safe versions of malloc and realloc */
 
-/* Copyright (C) 1991-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2003, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Readline, a library for reading lines
    of text with interactive input and history editing.
@@ -49,8 +49,7 @@
 /* **************************************************************** */
 
 static void
-memory_error_and_abort (fname)
-     char *fname;
+memory_error_and_abort (char *fname)
 {
   fprintf (stderr, "%s: out of virtual memory\n", fname);
   exit (2);
@@ -60,8 +59,7 @@ memory_error_and_abort (fname)
    to hold BYTES number of bytes.  If the memory cannot be allocated,
    print an error message and abort. */
 PTR_T
-xmalloc (bytes)
-     size_t bytes;
+xmalloc (size_t bytes)
 {
   PTR_T temp;
 
@@ -72,9 +70,7 @@ xmalloc (bytes)
 }
 
 PTR_T
-xrealloc (pointer, bytes)
-     PTR_T pointer;
-     size_t bytes;
+xrealloc (PTR_T pointer, size_t bytes)
 {
   PTR_T temp;
 
@@ -86,8 +82,7 @@ xrealloc (pointer, bytes)
 }
 
 void
-xfree (string)
-     PTR_T string;
+xfree (PTR_T string)
 {
   if (string)
     free (string);
index 859e6eed5aabed599a3fb4c4ac43fe537c7e67d1..1121061b8ecef23ff4847f2611cccd27ffbc8563 100644 (file)
@@ -46,14 +46,14 @@ extern char *UP, *BC;
 
 extern short ospeed;
 
-extern int tgetent ();
-extern int tgetflag ();
-extern int tgetnum ();
-extern char *tgetstr ();
+extern int tgetent PARAMS((char *, const char *));
+extern int tgetflag PARAMS((const char *));
+extern int tgetnum PARAMS((const char *));
+extern char *tgetstr PARAMS((const char *, char **));
 
-extern int tputs ();
+extern int tputs PARAMS((const char *, int, int (*)(int));
 
-extern char *tgoto ();
+extern char *tgoto PARAMS((const char *, int, int));
 
 #endif /* HAVE_TERMCAP_H */
 
index 0403f91cf817eef839a0a95d428b758b6cc5a54a..8529db3ec7a2cbbb48fef14e392f45166e011643 100644 (file)
@@ -1,6 +1,6 @@
 /* casemod.c -- functions to change case of strings */
 
-/* Copyright (C) 2008-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2022 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 PARAMS((char *, int, int));
+extern char *substring (char *, int, int);
 
 #ifndef UCHAR_MAX
 #  define UCHAR_MAX    TYPE_MAXIMUM(unsigned char)
@@ -75,9 +75,7 @@ extern char *substring PARAMS((char *, int, int));
 
 #if defined (HANDLE_MULTIBYTE)
 static wchar_t
-cval (s, i, l)
-     char *s;
-     int i, l;
+cval (char *s, int i, int l)
 {
   size_t tmp;
   wchar_t wc;
@@ -98,10 +96,7 @@ cval (s, i, l)
 /* Modify the case of characters in STRING matching PAT based on the value of
    FLAGS.  If PAT is null, modify the case of each character */
 char *
-sh_modcase (string, pat, flags)
-     const char *string;
-     char *pat;
-     int flags;
+sh_modcase (const char *string, char *pat, int flags)
 {
   int start, next, end, retind;
   int inword, c, nc, nop, match, usewords;
index 8b9b5b325366559be05c84642173fdf570e63334..654647e890f0336b8bf10fb079eb9d87914fce08 100644 (file)
@@ -1,6 +1,6 @@
 /* clktck.c - get the value of CLK_TCK. */
 
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -44,7 +44,7 @@
 #endif /* !HAVE_SYSCONF && !_SC_CLK_TCK */
 
 long
-get_clk_tck ()
+get_clk_tck (void)
 {
   static long retval = 0;
 
index c6c52bf89f7bdb3de365664fabe316c7be237d8d..ecc0ffae27f7b5e7e627b4fdb5f385bd2d168f33 100644 (file)
@@ -1,6 +1,6 @@
 /* clock.c - operations on struct tms and clock_t's */
 
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #include <sys/types.h>
 #include <posixtime.h>
-
-#if defined (HAVE_SYS_TIMES_H)
-#  include <sys/times.h>
-#endif
+#include <systimes.h>
 
 #include <stdio.h>
 #include <stdc.h>
 #include <bashintl.h>
 
 #ifndef locale_decpoint
-extern int locale_decpoint PARAMS((void));
+extern int locale_decpoint (void);
 #endif
 
-extern long get_clk_tck PARAMS((void));
+extern long get_clk_tck (void);
 
 void
-clock_t_to_secs (t, sp, sfp)
-     clock_t t;
-     time_t *sp;
-     int *sfp;
+clock_t_to_secs (clock_t t, time_t *sp, int *sfp)
 {
   static long clk_tck = -1;
 
@@ -69,9 +63,7 @@ clock_t_to_secs (t, sp, sfp)
    terms of the value of CLK_TCK, which is what is returned by the
    `times' call. */
 void
-print_clock_t (fp, t)
-     FILE *fp;
-     clock_t t;
+print_clock_t (FILE *fp, clock_t t)
 {
   time_t timestamp;
   long minutes;
index b3b5d644609a004345be117cfdfe4408c6606c7b..9d95834c17e7de0d1a80fb4fbddd8432e8e37f39 100644 (file)
@@ -1,6 +1,6 @@
 /* dprintf -- printf to a file descriptor */
 
-/* Copyright (C) 2008-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2010,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #include <stdio.h>
 
 int
-#if defined (PREFER_STDARG)
 dprintf(int fd, const char *format, ...)
-#else
-dprintf(fd, format, va_alist)
-     int fd;
-     const char *format;
-     va_dcl
-#endif
 {
   FILE *fp;
   int fd2, rc, r2;
index c3043ec139f81cf571c346cb4ec5246c2e285d0d..00aadb2113198e800de4149963ab55b2b8f19953 100644 (file)
@@ -1,6 +1,6 @@
 /* eaccess.c - eaccess replacement for the shell, plus other access functions. */
 
-/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -52,15 +52,14 @@ extern int errno;
 #define F_OK 0
 #endif /* R_OK */
 
-static int path_is_devfd PARAMS((const char *));
-static int sh_stataccess PARAMS((const char *, int));
+static int path_is_devfd (const char *);
+static int sh_stataccess (const char *, int);
 #if HAVE_DECL_SETREGID
-static int sh_euidaccess PARAMS((const char *, int));
+static int sh_euidaccess (const char *, int);
 #endif
 
 static int
-path_is_devfd (path)
-     const char *path;
+path_is_devfd (const char *path)
 {
   if (path[0] == '/' && path[1] == 'd' && strncmp (path, "/dev/fd/", 8) == 0)
     return 1;
@@ -78,9 +77,7 @@ path_is_devfd (path)
 /* A wrapper for stat () which disallows pathnames that are empty strings
    and handles /dev/fd emulation on systems that don't have it. */
 int
-sh_stat (path, finfo)
-     const char *path;
-     struct stat *finfo;
+sh_stat (const char *path, struct stat *finfo)
 {
   static char *pbuf = 0;
 
@@ -136,9 +133,7 @@ sh_stat (path, finfo)
    and don't make the mistake of telling root that any file is
    executable.  This version uses stat(2). */
 static int
-sh_stataccess (path, mode)
-     const char *path;
-     int mode;
+sh_stataccess (const char *path, int mode)
 {
   struct stat st;
 
@@ -173,9 +168,7 @@ sh_stataccess (path, mode)
 /* Version to call when uid != euid or gid != egid.  We temporarily swap
    the effective and real uid and gid as appropriate. */
 static int
-sh_euidaccess (path, mode)
-     const char *path;
-     int mode;
+sh_euidaccess (const char *path, int mode)
 {
   int r, e;
 
@@ -198,9 +191,7 @@ sh_euidaccess (path, mode)
 #endif
 
 int
-sh_eaccess (path, mode)
-     const char *path;
-     int mode;
+sh_eaccess (const char *path, int mode)
 {
   int ret;
 
index 0ccc22b4c9f257d4b2e40fc6f586699925d34079..b85fab3189aa23201019258d826d5220717321a4 100644 (file)
@@ -81,12 +81,7 @@ extern int errno;
    base.  The caller passes the output buffer and the size.  This should
    check for buffer underflow, but currently does not. */
 char *
-fmtulong (ui, base, buf, len, flags)
-     UNSIGNED_LONG ui;
-     int base;
-     char *buf;
-     size_t len;
-     int flags;
+fmtulong (UNSIGNED_LONG ui, int base, char *buf, size_t len, int flags)
 {
   char *p;
   int sign;
index 35d7e73788008443ee4b3bbeb7723740094ffd23..53db5d68c0a5833dc9ae485027c6640298b52396 100644 (file)
@@ -1,6 +1,6 @@
 /* fnxform - use iconv(3) to transform strings to and from "filename" format */
 
-/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2020,2022 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 PARAMS((void));
+extern const char *locale_charset (void);
 #else
-extern char *get_locale_var PARAMS((char *));
+extern char *get_locale_var (char *);
 #endif
 
 #if defined (HAVE_ICONV)
@@ -49,12 +49,12 @@ static iconv_t conv_tofs = (iconv_t)-1;
 static char *outbuf = 0;
 static size_t outlen = 0;
 
-static char *curencoding PARAMS((void));
-static void init_tofs PARAMS((void));
-static void init_fromfs PARAMS((void));
+static char *curencoding (void);
+static void init_tofs (void);
+static void init_fromfs (void);
 
 static char *
-curencoding ()
+curencoding (void)
 {
   char *loc;
 #if defined (HAVE_LOCALE_CHARSET)
@@ -77,7 +77,7 @@ curencoding ()
 }  
 
 static void
-init_tofs ()
+init_tofs (void)
 {
   char *cur;
 
@@ -86,7 +86,7 @@ init_tofs ()
 }
 
 static void
-init_fromfs ()
+init_fromfs (void)
 {
   char *cur;
 
@@ -95,9 +95,7 @@ init_fromfs ()
 }
 
 char *
-fnx_tofs (string, len)
-     char *string;
-     size_t len;
+fnx_tofs (char *string, size_t len)
 {
 #ifdef MACOSX
   ICONV_CONST char *inbuf;
@@ -139,9 +137,7 @@ fnx_tofs (string, len)
 }
 
 char *
-fnx_fromfs (string, len)
-     char *string;
-     size_t len;
+fnx_fromfs (char *string, size_t len)
 {
 #ifdef MACOSX
   ICONV_CONST char *inbuf;
@@ -184,15 +180,13 @@ fnx_fromfs (string, len)
 
 #else
 char *
-fnx_tofs (string)
-     char *string;
+fnx_tofs (char *string, size_t len)
 {
   return string;
 }
 
 char *
-fnx_fromfs (string)
-     char *string;
+fnx_fromfs (char *string, size_t len)
 {
   return string;
 }
index 8cd4e3685f9febfb1e8e7505beb97170768f830d..4547b838e6b5b7f01a2a68cc6c3a3ff767e96b7c 100644 (file)
@@ -1,6 +1,6 @@
 /* fpurge - Flushing buffers of a FILE stream. */
 
-/* Copyright (C) 2007-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2020,2022 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 PARAMS((FILE *stream));
+extern int fpurge (FILE *stream);
 
 #if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7 */
 # include <stdio_ext.h>
index d7bd241b1300d79876edae9f95bcad2bffe4ea28..e45ccb006075845c53db232eb3aac1889340e3e7 100644 (file)
@@ -1,6 +1,6 @@
 /* getcwd.c -- get pathname of current directory */
 
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -73,10 +73,7 @@ extern int errno;
    the inode corresponding to PATH/DIR is identical to THISINO. */
 #if !defined (D_FILENO_AVAILABLE)
 static int
-_path_checkino (dotp, name, thisino)
-     char *dotp;
-     char *name;
-     ino_t thisino;
+_path_checkino (char *dotp, char *name, ino_t thisino)
 {
   char *fullpath;
   int r, e;
@@ -102,15 +99,8 @@ _path_checkino (dotp, name, thisino)
    an array is allocated with `malloc'; the array is SIZE
    bytes long, unless SIZE <= 0, in which case it is as
    big as necessary.  */
-#if defined (__STDC__)
 char *
 getcwd (char *buf, size_t size)
-#else /* !__STDC__ */
-char *
-getcwd (buf, size)
-     char *buf;
-     size_t size;
-#endif /* !__STDC__ */
 {
   static const char dots[]
     = "../../../../../../../../../../../../../../../../../../../../../../../\
index 1e682aefb0a2be11a7f8a1467944d1904a9ad4a8..8f4510ae1d27b0a8f30e7d3b8f6a113815d49c79 100644 (file)
@@ -47,8 +47,7 @@ extern char **environ;
 static char *last_tempenv_value = (char *)NULL;
 
 char *
-getenv (name)
-     const char *name;
+getenv (const char *name)
 {
   SHELL_VAR *var;
 
@@ -90,20 +89,14 @@ getenv (name)
 
 /* Some versions of Unix use _getenv instead. */
 char *
-_getenv (name)
-     const char *name;
+_getenv (const char *name)
 {
   return (getenv (name));
 }
 
 /* SUSv3 says argument is a `char *'; BSD implementations disagree */
 int
-putenv (str)
-#ifndef HAVE_STD_PUTENV
-     const char *str;
-#else
-     char *str;
-#endif
+putenv (char *str)
 {
   SHELL_VAR *var;
   char *name, *value;
@@ -142,22 +135,14 @@ putenv (str)
 
 #if 0
 int
-_putenv (name)
-#ifndef HAVE_STD_PUTENV
-     const char *name;
-#else
-     char *name;
-#endif
+_putenv (char *name)
 {
   return putenv (name);
 }
 #endif
 
 int
-setenv (name, value, rewrite)
-     const char *name;
-     const char *value;
-     int rewrite;
+setenv (const char *name, const char *value, int rewrite)
 {
   SHELL_VAR *var;
   char *v;
@@ -188,33 +173,22 @@ setenv (name, value, rewrite)
 
 #if 0
 int
-_setenv (name, value, rewrite)
-     const char *name;
-     const char *value;
-     int rewrite;
+_setenv (const char *name, const char *value, int rewrite)
 {
   return setenv (name, value, rewrite);
 }
 #endif
 
-/* SUSv3 says unsetenv returns int; existing implementations (BSD) disagree. */
+/* SUSv3 says unsetenv returns int; existing implementations (BSD) disagree.
+   POSIX says int. */
 
-#ifdef HAVE_STD_UNSETENV
-#define UNSETENV_RETURN(N)     return(N)
-#define UNSETENV_RETTYPE       int
-#else
-#define UNSETENV_RETURN(N)     return
-#define UNSETENV_RETTYPE       void
-#endif
-
-UNSETENV_RETTYPE
-unsetenv (name)
-     const char *name;
+int
+unsetenv (const char *name)
 {
   if (name == 0 || *name == '\0' || strchr (name, '=') != 0)
     {
       errno = EINVAL;
-      UNSETENV_RETURN(-1);
+      return (-1);
     }
 
   /* XXX - should we just remove the export attribute here? */
@@ -228,6 +202,6 @@ unsetenv (name)
     VUNSETATTR (v, att_exported);
 #endif
 
-  UNSETENV_RETURN(0);
+  return (0);
 }
 #endif /* CAN_REDEFINE_GETENV */
index eaec25cc7edeb9e915b79261faa60e108297d7f4..1b78dcb2f47286573e824c579fe7937ca9d5186d 100644 (file)
@@ -1,6 +1,6 @@
 /* gettimeofday.c - gettimeofday replacement using time() */
 
-/* Copyright (C) 2020 Free Software Foundation, Inc.
+/* Copyright (C) 2020, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
index e377178e58a2e3efc6b3974058dc73e2aadf1e84..4900a62d860f447867696f8265184e7031f834e6 100644 (file)
@@ -94,8 +94,7 @@ static char rcsid[] = "$Id: inet_addr.c,v 1.5 1996/08/14 03:48:37 drepper Exp $"
  * The value returned is in network order.
  */
 u_long
-inet_addr(cp)
-       register const char *cp;
+inet_addr(register const char *cp)
 {
        struct in_addr val;
 
@@ -113,9 +112,7 @@ inet_addr(cp)
  * cannot distinguish between failure and a local broadcast address.
  */
 int
-inet_aton(cp, addr)
-       register const char *cp;
-       struct in_addr *addr;
+inet_aton(register const char *cp, struct in_addr *addr)
 {
        register u_bits32_t val;
        register int base, n;
index 262bc7490c880371d332648d33a7184aa1f28fea..9925bd3cbe4e3204199900396f2d1f867cab7bcd 100644 (file)
@@ -61,8 +61,7 @@ extern int errno;
 /* Return >= 1 if select/FIONREAD indicates data available for reading on
    file descriptor FD; 0 if no data available.  Return -1 on error. */
 int
-input_avail (fd)
-     int fd;
+input_avail (int fd)
 {
   int result, chars_avail;
 #if defined(HAVE_SELECT)
@@ -100,9 +99,7 @@ input_avail (fd)
 /* Wait until NCHARS are available for reading on file descriptor FD.
    This can wait indefinitely. Return -1 on error. */
 int
-nchars_avail (fd, nchars)
-     int fd;
-     int nchars;
+nchars_avail (int fd, int nchars)
 {
   int result, chars_avail;
 #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
index cd36ef33ff5338bfc84703403106c9f331942780..4b137b50586e0a79e154c32be6fd1ddb1f835528 100644 (file)
 #include "shell.h"
 
 char *
-inttostr (i, buf, len)
-     intmax_t i;
-     char *buf;
-     size_t len;
+inttostr (intmax_t i, char *buf, size_t len)
 {
   return (fmtumax (i, 10, buf, len, 0));
 }
@@ -41,8 +38,7 @@ inttostr (i, buf, len)
 /* Integer to string conversion.  This conses the string; the
    caller should free it. */
 char *
-itos (i)
-     intmax_t i;
+itos (intmax_t i)
 {
   char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1];
 
@@ -53,8 +49,7 @@ itos (i)
 /* Integer to string conversion.  This conses the string using strdup;
    caller should free it and be prepared to deal with NULL return. */
 char *
-mitos (i)
-     intmax_t i;
+mitos (intmax_t i)
 {
   char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1];
 
@@ -63,10 +58,7 @@ mitos (i)
 }
 
 char *
-uinttostr (i, buf, len)
-     uintmax_t i;
-     char *buf;
-     size_t len;
+uinttostr (uintmax_t i, char *buf, size_t len)
 {
   return (fmtumax (i, 10, buf, len, FL_UNSIGNED));
 }
@@ -74,8 +66,7 @@ uinttostr (i, buf, len)
 /* Integer to string conversion.  This conses the string; the
    caller should free it. */
 char *
-uitos (i)
-     uintmax_t i;
+uitos (uintmax_t i)
 {
   char *p, lbuf[INT_STRLEN_BOUND(uintmax_t) + 1];
 
index bd5c25fb4c021d252b974b4369c671b14d668e14..1ec646aa1fdf97fd36a2d3ecfa52ffadeff4f083 100644 (file)
@@ -1,6 +1,6 @@
 /* mailstat.c -- stat a mailbox file, handling maildir-type mail directories */
 
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -52,9 +52,7 @@
  */
 
 int
-mailstat(path, st)
-     const char *path;
-     struct stat *st;
+mailstat(const char *path, struct stat *st)
 {
   static struct stat st_new_last, st_ret_last;
   struct stat st_ret, st_tmp;
index ab46c9673282efe2307b5a4c6c2adb76bd9050a2..448554a8cbc3c19327efd324439041eb6df8fbf9 100644 (file)
@@ -1,6 +1,6 @@
 /* makepath.c - glue PATH and DIR together into a full pathname. */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2020,2022 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 PARAMS((char *));
+extern char *get_working_directory (char *);
 
 static char *nullpath = "";
 
@@ -67,9 +67,7 @@ static char *nullpath = "";
   } while (0)
 
 char *
-sh_makepath (path, dir, flags)
-     const char *path, *dir;
-     int flags;
+sh_makepath (const char *path, const char *dir, int flags)
 {
   int dirlen, pathlen;
   char *ret, *xpath, *xdir, *r, *s;
index bb94f183523734eb53bd77c7d0a85f84c0570a9a..9aa6a2ff99da51dc48cbdc42255156db1f1455c9 100644 (file)
@@ -31,9 +31,7 @@
 
 /* Compare MBS1 and MBS2 without regard to case.  */
 int
-mbscasecmp (mbs1, mbs2)
-    const char *mbs1;
-    const char *mbs2;
+mbscasecmp (const char *mbs1, const char *mbs2)
 {
   int len1, len2, mb_cur_max;
   wchar_t c1, c2, l1, l2;
index 639962d46317785baabae86bac6623b101ad2cc6..f86ea0bb18516388ae8be588a292eab08fe86a9e 100644 (file)
@@ -39,13 +39,7 @@ extern char *utf8_mbschr (const char *, int);        /* XXX */
    legacy strchr() might return the wrong value. */
 
 char *
-#if defined (PROTOTYPES)
 mbschr (const char *s, int c)
-#else
-mbschr (s, c)
-     const char *s;
-     int c;
-#endif
 {
 #if HANDLE_MULTIBYTE
   char *pos;
index f475c538e9ee47493cfb060da8e3455bfa6ae161..a8d4bfd1760e08e89af5bd41c815cf8f97ef441c 100644 (file)
@@ -32,9 +32,7 @@ extern int utf8_mbscmp (const char *, const char *);
 
 /* Compare MBS1 and MBS2.  */
 int
-mbscmp (mbs1, mbs2)
-    const char *mbs1;
-    const char *mbs2;
+mbscmp (const char *mbs1, const char *mbs2)
 {
   int len1, len2, mb_cur_max;
   wchar_t c1, c2;
index 9ee675bef50d54449ffc0117811c6f466633ec58..810b701daa02de3d5c26019ce333c06a5dadf98d 100644 (file)
@@ -1,6 +1,6 @@
 /* mktime - convert struct tm to a time_t value */
 
-/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    Contributed by Paul Eggert (eggert@twinsun.com).
 #define mktime my_mktime
 #endif /* DEBUG_MKTIME */
 
-#ifndef PARAMS
-#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#define PARAMS(args) args
-#else
-#define PARAMS(args) ()
-#endif  /* GCC.  */
-#endif  /* Not PARAMS.  */
-
 #ifndef CHAR_BIT
 #define CHAR_BIT 8
 #endif
@@ -117,17 +109,15 @@ 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 PARAMS ((int, int, int, int, int, const struct tm *));
-time_t __mktime_internal PARAMS ((struct tm *,
+static time_t ydhms_tm_diff (int, int, int, int, int, const struct tm *);
+time_t __mktime_internal (struct tm *,
                               struct tm *(*) (const time_t *, struct tm *),
-                              time_t *));
+                              time_t *);
 
 
-static struct tm *my_localtime_r PARAMS ((const time_t *, struct tm *));
+static struct tm *my_localtime_r (const time_t *, struct tm *);
 static struct tm *
-my_localtime_r (t, tp)
-     const time_t *t;
-     struct tm *tp;
+my_localtime_r (const time_t *t, struct tm *tp)
 {
   struct tm *l = localtime (t);
   if (! l)
@@ -136,16 +126,13 @@ my_localtime_r (t, tp)
   return tp;
 }
 
-
 /* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP),
    measured in seconds, ignoring leap seconds.
    YEAR uses the same numbering as TM->tm_year.
    All values are in range, except possibly YEAR.
    If overflow occurs, yield the low order bits of the correct answer.  */
 static time_t
-ydhms_tm_diff (year, yday, hour, min, sec, tp)
-     int year, yday, hour, min, sec;
-     const struct tm *tp;
+ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp)
 {
   /* Compute intervening leap days correctly even if year is negative.
      Take care to avoid int overflow.  time_t overflow is OK, since
@@ -167,13 +154,11 @@ ydhms_tm_diff (year, yday, hour, min, sec, tp)
          + (sec - tp->tm_sec));
 }
 
-
 static time_t localtime_offset;
 
 /* Convert *TP to a time_t value.  */
 time_t
-mktime (tp)
-     struct tm *tp;
+mktime (struct tm *tp)
 {
 #ifdef _LIBC
   /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
@@ -191,10 +176,9 @@ mktime (tp)
    compared to what the result would be for UTC without leap seconds.
    If *OFFSET's guess is correct, only one CONVERT call is needed.  */
 time_t
-__mktime_internal (tp, convert, offset)
-     struct tm *tp;
-     struct tm *(*convert) PARAMS ((const time_t *, struct tm *));
-     time_t *offset;
+__mktime_internal (struct tm *tp, 
+                  struct tm *(*convert) (const time_t *, struct tm *),
+                  time_t *offset)
 {
   time_t t, dt, t0;
   struct tm tm;
@@ -317,122 +301,3 @@ __mktime_internal (tp, convert, offset)
 #ifdef weak_alias
 weak_alias (mktime, timelocal)
 #endif
-\f
-#if DEBUG_MKTIME
-
-static int
-not_equal_tm (a, b)
-     struct tm *a;
-     struct tm *b;
-{
-  return ((a->tm_sec ^ b->tm_sec)
-         | (a->tm_min ^ b->tm_min)
-         | (a->tm_hour ^ b->tm_hour)
-         | (a->tm_mday ^ b->tm_mday)
-         | (a->tm_mon ^ b->tm_mon)
-         | (a->tm_year ^ b->tm_year)
-         | (a->tm_mday ^ b->tm_mday)
-         | (a->tm_yday ^ b->tm_yday)
-         | (a->tm_isdst ^ b->tm_isdst));
-}
-
-static void
-print_tm (tp)
-     struct tm *tp;
-{
-  printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
-         tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
-         tp->tm_hour, tp->tm_min, tp->tm_sec,
-         tp->tm_yday, tp->tm_wday, tp->tm_isdst);
-}
-
-static int
-check_result (tk, tmk, tl, tml)
-     time_t tk;
-     struct tm tmk;
-     time_t tl;
-     struct tm tml;
-{
-  if (tk != tl || not_equal_tm (&tmk, &tml))
-    {
-      printf ("mktime (");
-      print_tm (&tmk);
-      printf (")\nyields (");
-      print_tm (&tml);
-      printf (") == %ld, should be %ld\n", (long) tl, (long) tk);
-      return 1;
-    }
-
-  return 0;
-}
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  int status = 0;
-  struct tm tm, tmk, tml;
-  time_t tk, tl;
-  char trailer;
-
-  if ((argc == 3 || argc == 4)
-      && (sscanf (argv[1], "%d-%d-%d%c",
-                 &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
-         == 3)
-      && (sscanf (argv[2], "%d:%d:%d%c",
-                 &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
-         == 3))
-    {
-      tm.tm_year -= TM_YEAR_BASE;
-      tm.tm_mon--;
-      tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]);
-      tmk = tm;
-      tl = mktime (&tmk);
-      tml = *localtime (&tl);
-      printf ("mktime returns %ld == ", (long) tl);
-      print_tm (&tmk);
-      printf ("\n");
-      status = check_result (tl, tmk, tl, tml);
-    }
-  else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0))
-    {
-      time_t from = atol (argv[1]);
-      time_t by = atol (argv[2]);
-      time_t to = atol (argv[3]);
-
-      if (argc == 4)
-       for (tl = from; tl <= to; tl += by)
-         {
-           tml = *localtime (&tl);
-           tmk = tml;
-           tk = mktime (&tmk);
-           status |= check_result (tk, tmk, tl, tml);
-         }
-      else
-       for (tl = from; tl <= to; tl += by)
-         {
-           /* Null benchmark.  */
-           tml = *localtime (&tl);
-           tmk = tml;
-           tk = tl;
-           status |= check_result (tk, tmk, tl, tml);
-         }
-    }
-  else
-    printf ("Usage:\
-\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
-\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
-\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
-           argv[0], argv[0], argv[0]);
-
-  return status;
-}
-
-#endif /* DEBUG_MKTIME */
-\f
-/*
-Local Variables:
-compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime"
-End:
-*/
index e20f1042006a3230d357ce6ce88aac25633b5899..08903acd4ce49a0592c705a0524b9d65c537e186 100644 (file)
@@ -1,6 +1,6 @@
 /* netconn.c -- is a particular file descriptor a network connection?. */
 
-/* Copyright (C) 2002-2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -41,8 +41,7 @@
 
 /* Is FD a socket or network connection? */
 int
-isnetconn (fd)
-     int fd;
+isnetconn (int fd)
 {
 #if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && !defined (SVR4_2) && !defined (__BEOS__)
   int rv;
index ee0baf662ec56878b32167c8ad2c4a6a1c1fb996..23901b7fdf933b15dfd583118c95d2fd8d3da1d2 100644 (file)
@@ -5,7 +5,7 @@
  * chet@ins.CWRU.Edu
  */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -63,27 +63,25 @@ extern int errno;
 #endif
 
 #if !defined (HAVE_INET_ATON)
-extern int inet_aton PARAMS((const char *, struct in_addr *));
+extern int inet_aton (const char *, struct in_addr *);
 #endif
 
 #ifndef HAVE_GETADDRINFO
-static int _getaddr PARAMS((char *, struct in_addr *));
-static int _getserv PARAMS((char *, int, unsigned short *));
-static int _netopen4 PARAMS((char *, char *, int));
+static int _getaddr (char *, struct in_addr *);
+static int _getserv (char *, int, unsigned short *);
+static int _netopen4 (char *, char *, int);
 #else /* HAVE_GETADDRINFO */
-static int _netopen6 PARAMS((char *, char *, int));
+static int _netopen6 (char *, char *, int);
 #endif
 
-static int _netopen PARAMS((char *, char *, int));
+static int _netopen (char *, char *, int);
 
 #ifndef HAVE_GETADDRINFO
 /* Stuff the internet address corresponding to HOST into AP, in network
    byte order.  Return 1 on success, 0 on failure. */
 
 static int
-_getaddr (host, ap)
-     char *host;
-     struct in_addr *ap;
+_getaddr (char *host, struct in_addr *ap)
 {
   struct hostent *h;
   int r;
@@ -114,10 +112,7 @@ _getaddr (host, ap)
 /* Return 1 if SERV is a valid port number and stuff the converted value into
    PP in network byte order. */   
 static int
-_getserv (serv, proto, pp)
-     char *serv;
-     int proto;
-     unsigned short *pp;
+_getserv (char *serv, int proto, unsigned short *pp)
 {
   intmax_t l;
   unsigned short s;
@@ -154,9 +149,7 @@ _getserv (serv, proto, pp)
  * traditional BSD mechanisms.  Returns the connected socket or -1 on error.
  */
 static int 
-_netopen4(host, serv, typ)
-     char *host, *serv;
-     int typ;
+_netopen4(char *host, char *serv, int typ)
 {
   struct in_addr ina;
   struct sockaddr_in sin;
@@ -209,9 +202,7 @@ _netopen4(host, serv, typ)
  * on error.
  */
 static int
-_netopen6 (host, serv, typ)
-     char *host, *serv;
-     int typ;
+_netopen6 (char *host, char *serv, int typ)
 {
   int s, e;
   struct addrinfo hints, *res, *res0;
@@ -274,9 +265,7 @@ _netopen6 (host, serv, typ)
  * Returns the connected socket or -1 on error.
  */
 static int 
-_netopen(host, serv, typ)
-     char *host, *serv;
-     int typ;
+_netopen(char *host, char *serv, int typ)
 {
 #ifdef HAVE_GETADDRINFO
   return (_netopen6 (host, serv, typ));
@@ -290,8 +279,7 @@ _netopen(host, serv, typ)
  * host `host' on port `port' and return the connected socket.
  */
 int
-netopen (path)
-     char *path;
+netopen (char *path)
 {
   char *np, *s, *t;
   int fd;
@@ -320,8 +308,7 @@ netopen (path)
  * `serv' and return the connected socket.
  */
 int
-tcpopen (host, serv)
-     char *host, *serv;
+tcpopen (char *host, char *serv)
 {
   return (_netopen (host, serv, 't'));
 }
@@ -331,8 +318,7 @@ tcpopen (host, serv)
  * `serv' and return the connected socket.
  */
 int
-udpopen (host, serv)
-     char *host, *serv;
+udpopen (char *host, char *serv)
 {
   return _netopen (host, serv, 'u');
 }
@@ -341,8 +327,7 @@ udpopen (host, serv)
 #else /* !HAVE_NETWORK */
 
 int
-netopen (path)
-     char *path;
+netopen (char *path)
 {
   internal_error (_("network operations not supported"));
   return -1;
index edc5c6f20258c71457f41afe709070ecd7149b4f..b9919c718c89fbc213839c0f74b91bd07bee7d73 100644 (file)
@@ -1,6 +1,6 @@
 /* oslib.c - functions present only in some unix versions. */
 
-/* Copyright (C) 1995,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995,2010,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -54,9 +54,7 @@ extern int errno;
 /* Make the functions strchr and strrchr if they do not exist. */
 #if !defined (HAVE_STRCHR)
 char *
-strchr (string, c)
-     char *string;
-     int c;
+strchr (const char *string, int c)
 {
   register char *s;
 
@@ -68,9 +66,7 @@ strchr (string, c)
 }
 
 char *
-strrchr (string, c)
-     char *string;
-     int c;
+strrchr (const char *string, int c)
 {
   register char *s, *t;
 
@@ -85,8 +81,7 @@ strrchr (string, c)
 /* Replacement for dup2 (), for those systems which either don't have it,
    or supply one with broken behaviour. */
 int
-dup2 (fd1, fd2)
-     int fd1, fd2;
+dup2 (int fd1, int fd2)
 {
   int saved_errno, r;
 
@@ -143,7 +138,7 @@ dup2 (fd1, fd2)
 
 #if !defined (HAVE_GETDTABLESIZE)
 int
-getdtablesize ()
+getdtablesize (void)
 {
 #  if defined (_POSIX_VERSION) && defined (HAVE_SYSCONF) && defined (_SC_OPEN_MAX)
   return (sysconf(_SC_OPEN_MAX));      /* Posix systems use sysconf */
@@ -166,9 +161,7 @@ getdtablesize ()
 #    undef bcopy
 #  endif
 void
-bcopy (s,d,n)
-     void *d, *s;
-     size_t n;
+bcopy (void *s, *d, size_t n)
 {
   FASTCOPY (s, d, n);
 }
@@ -179,9 +172,7 @@ bcopy (s,d,n)
 #    undef bzero
 #  endif
 void
-bzero (s, n)
-     void *s; 
-     size_t n;
+bzero (void *s, size_t n)
 {
   register int i;
   register char *r;
@@ -195,9 +186,7 @@ bzero (s, n)
 #  if defined (HAVE_UNAME)
 #    include <sys/utsname.h>
 int
-gethostname (name, namelen)
-     char *name;
-     size_t namelen;
+gethostname (char *name, size_t namelen)
 {
   int i;
   struct utsname ut;
@@ -212,9 +201,7 @@ gethostname (name, namelen)
 }
 #  else /* !HAVE_UNAME */
 int
-gethostname (name, namelen)
-     char *name;
-     size_t namelen;
+gethostname (char *name, size_t namelen)
 {
   strncpy (name, "unknown", namelen);
   name[namelen] = '\0';
@@ -225,9 +212,7 @@ gethostname (name, namelen)
 
 #if !defined (HAVE_KILLPG)
 int
-killpg (pgrp, sig)
-     pid_t pgrp;
-     int sig;
+killpg (pid_t pgrp, int sig)
 {
   return (kill (-pgrp, sig));
 }
@@ -235,9 +220,7 @@ killpg (pgrp, sig)
 
 #if !defined (HAVE_MKFIFO) && defined (PROCESS_SUBSTITUTION)
 int
-mkfifo (path, mode)
-     char *path;
-     mode_t mode;
+mkfifo (char *path, mode_t mode)
 {
 #if defined (S_IFIFO)
   return (mknod (path, (mode | S_IFIFO), 0));
@@ -250,7 +233,7 @@ mkfifo (path, mode)
 #define DEFAULT_MAXGROUPS 64
 
 int
-getmaxgroups ()
+getmaxgroups (void)
 {
   static int maxgroups = -1;
 
@@ -278,7 +261,7 @@ getmaxgroups ()
 }
 
 long
-getmaxchild ()
+getmaxchild (void)
 {
   static long maxchild = -1L;
 
index 7d0df9f9294c7bdfa692483a5d9d1fa283b5a939..2820e310e353e9d4d67951fe6a74698b0cc1edfb 100644 (file)
@@ -1,6 +1,6 @@
 /* pathcanon.c -- canonicalize and manipulate pathnames. */
 
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -45,9 +45,8 @@ extern int errno;
 #if defined (__CYGWIN__)
 #include <sys/cygwin.h>
 
-static int
-_is_cygdrive (path)
-     char *path;
+static inline int
+_is_cygdrive (char *path)
 {
   static char user[MAXPATHLEN];
   static char system[MAXPATHLEN];
@@ -72,8 +71,7 @@ _is_cygdrive (path)
 
 /* Return 1 if PATH corresponds to a directory.  A function for debugging. */
 static int
-_path_isdir (path)
-     char *path;
+_path_isdir (char *path)
 {
   int l;
   struct stat sb;
@@ -101,9 +99,7 @@ _path_isdir (path)
 #define DOUBLE_SLASH(p)        ((p[0] == '/') && (p[1] == '/') && p[2] != '/')
 
 char *
-sh_canonpath (path, flags)
-     char *path;
-     int flags;
+sh_canonpath (char *path, int flags)
 {
   char stub_char;
   char *result, *p, *q, *base, *dotdot;
index 95b72f1978ba338dd8f5528a1e5aa2d2f3b2760b..b0ffdb99fe2e0e018186e9bd9bb5de0e7ecb0230 100644 (file)
@@ -1,6 +1,6 @@
 /* pathphys.c -- return pathname with all symlinks expanded. */
 
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 extern int errno;
 #endif /* !errno */
 
-extern char *get_working_directory PARAMS((char *));
+extern char *get_working_directory (char *);
 
-static int
-_path_readlink (path, buf, bufsiz)
-     char *path;
-     char *buf;
-     int bufsiz;
+static inline int
+_path_readlink (char *path, char *buf, int bufsiz)
 {
 #ifdef HAVE_READLINK
   return readlink (path, buf, bufsiz);
@@ -72,9 +69,7 @@ _path_readlink (path, buf, bufsiz)
  */
 
 char *
-sh_physpath (path, flags)
-     char *path;
-     int flags;
+sh_physpath (char *path, int flags)
 {
   char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
   char *result, *p, *q, *qsave, *qbase, *workpath;
@@ -252,9 +247,7 @@ error:
 }
 
 char *
-sh_realpath (pathname, resolved)
-     const char *pathname;
-     char *resolved;
+sh_realpath (const char *pathname, char *resolved)
 {
   char *tdir, *wd;
 
index 1eaa71aac70b24e720db70bc5766f8c063ecb464..d1b3df2831e5e608375cf9b94bdaa56e4fe90a09 100644 (file)
@@ -1,6 +1,6 @@
 /* random.c -- Functions for managing 16-bit and 32-bit random numbers. */
 
-/* Copyright (C) 2020 Free Software Foundation, Inc.
+/* Copyright (C) 2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -40,20 +40,19 @@ extern time_t shell_start_time;
 
 extern int last_random_value;
 
-static u_bits32_t intrand32 PARAMS((u_bits32_t));
-static u_bits32_t genseed PARAMS((void));
+static u_bits32_t intrand32 (u_bits32_t);
+static u_bits32_t genseed (void);
 
-static u_bits32_t brand32 PARAMS((void));
-static void sbrand32 PARAMS((u_bits32_t));
-static void perturb_rand32 PARAMS((void));
+static u_bits32_t brand32 (void);
+static void sbrand32 (u_bits32_t);
+static void perturb_rand32 (void);
 
 /* The random number seed.  You can change this by setting RANDOM. */
 static u_bits32_t rseed = 1;
 
 /* Returns a 32-bit pseudo-random number. */
 static u_bits32_t
-intrand32 (last)
-     u_bits32_t last;
+intrand32 (u_bits32_t last)
 {
   /* Minimal Standard generator from
      "Random number generators: good ones are hard to find",
@@ -84,7 +83,7 @@ intrand32 (last)
 }
 
 static u_bits32_t
-genseed ()
+genseed (void)
 {
   struct timeval tv;
   u_bits32_t iv;
@@ -99,7 +98,7 @@ genseed ()
 
 /* Returns a pseudo-random number between 0 and 32767. */
 int
-brand ()
+brand (void)
 {
   unsigned int ret;
 
@@ -113,15 +112,14 @@ brand ()
 
 /* Set the random number generator seed to SEED. */
 void
-sbrand (seed)
-     unsigned long seed;
+sbrand (unsigned long seed)
 {
   rseed = seed;
   last_random_value = 0;
 }
 
 void
-seedrand ()
+seedrand (void)
 {
   u_bits32_t iv;
 
@@ -138,7 +136,7 @@ static int urandfd = -1;
 
 /* Returns a 32-bit pseudo-random number between 0 and 4294967295. */
 static u_bits32_t
-brand32 ()
+brand32 (void)
 {
   u_bits32_t ret;
 
@@ -147,14 +145,13 @@ brand32 ()
 }
 
 static void
-sbrand32 (seed)
-     u_bits32_t seed;
+sbrand32 (u_bits32_t seed)
 {
   last_rand32 = rseed32 = seed;
 }
 
 void
-seedrand32 ()
+seedrand32 (void)
 {
   u_bits32_t iv;
 
@@ -163,14 +160,14 @@ seedrand32 ()
 }
 
 static void
-perturb_rand32 ()
+perturb_rand32 (void)
 {
   rseed32 ^= genseed ();
 }
 
 /* Force another attempt to open /dev/urandom on the next call to get_urandom32 */
 void
-urandom_close ()
+urandom_close (void)
 {
   if (urandfd >= 0)
     close (urandfd);
@@ -185,10 +182,7 @@ urandom_close ()
 #endif
 
 static ssize_t
-getrandom (buf, len, flags)
-     void *buf;
-     size_t len;
-     unsigned int flags;
+getrandom (void *buf, size_t len, unsigned int flags)
 {
   int oflags;
   ssize_t r;
@@ -220,7 +214,7 @@ getrandom (buf, len, flags)
 #endif
       
 u_bits32_t
-get_urandom32 ()
+get_urandom32 (void)
 {
   u_bits32_t ret;
 
index e410b5e8d64b3b09925ba71f3437e21b1b9885ad..2bd807f79413ccb53250379659ed6f2f9004dfd3 100644 (file)
@@ -2,7 +2,7 @@
  * rename - rename a file
  */
 
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -39,8 +39,7 @@ extern int errno;
 #endif
 
 int
-rename (from, to)
-     const char *from, *to;
+rename (const char *from, const char *to)
 {
   struct stat fb, tb;
 
index dd76e9fcb7c5bccba1726b00d411343600ab71c7..249067b71f4f772664df43eacda70791383d8cf7 100644 (file)
@@ -35,8 +35,7 @@ static char *stderrbuf = 0;
 
 /* Cause STREAM to buffer lines as opposed to characters or blocks. */
 int
-sh_setlinebuf (stream)
-     FILE *stream;
+sh_setlinebuf (FILE *stream)
 {
 #if !defined (HAVE_SETLINEBUF) && !defined (HAVE_SETVBUF)
   return (0);
index a717d45c9fd71aa33a3b0cbe0661336f95e3e33e..6bcfc6035f7dfbf1b0cee2e1621a0f5636c75e28 100644 (file)
@@ -46,10 +46,7 @@ extern SHELL_VAR *builtin_find_indexed_array (char *, int);
 #endif
 
 int
-sh_regmatch (string, pattern, flags)
-     const char *string;
-     const char *pattern;
-     int flags;
+sh_regmatch (const char *string, const char *pattern, int flags)
 {
   regex_t regex = { 0 };
   regmatch_t *matches;
index f2f2582b442d5ca45b49933d3e4a9dfba3ff6df5..22a6de293a389fbfec8e532768941545b24a47b6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2006, 2009, 2010, 2012, 2015-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2006, 2009, 2010, 2012, 2015-2018, 2022 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
@@ -51,8 +51,7 @@ extern int utf8_mblen (const char *, size_t);
 /* Count the number of characters in S, counting multi-byte characters as a
    single character. */
 size_t
-mbstrlen (s)
-     const char *s;
+mbstrlen (const char *s)
 {
   size_t clen, nc;
   mbstate_t mbs = { 0 }, mbsbak = { 0 };
@@ -81,8 +80,7 @@ mbstrlen (s)
 /* XXX - if we know that the locale is UTF-8, we can just check whether or
    not any byte has the eighth bit turned on */
 char *
-mbsmbchar (s)
-     const char *s;
+mbsmbchar (const char *s)
 {
   char *t;
   size_t clen;
@@ -115,10 +113,7 @@ mbsmbchar (s)
 }
 
 int
-sh_mbsnlen(src, srclen, maxlen)
-     const char *src;
-     size_t srclen;
-     int maxlen;
+sh_mbsnlen(const char *src, size_t srclen, int maxlen)
 {
   int count;
   int sind;
index 26fe0185372c388f297c9d4bc7b3effc5fe3df75..adf441c15456c7b85f4ebb2db371ae3e073d76cc 100644 (file)
@@ -1,6 +1,6 @@
 /* shquote - functions to quote and dequote strings */
 
-/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -36,8 +36,8 @@
 #include "shmbchar.h"
 #include "shmbutil.h"
 
-extern char *ansic_quote PARAMS((char *, int, int *));
-extern int ansic_shouldquote PARAMS((const char *));
+extern char *ansic_quote (char *, int, int *);
+extern int ansic_shouldquote (const char *);
 
 /* Default set of characters that should be backslash-quoted in strings */
 static const char bstab[256] =
@@ -92,8 +92,7 @@ static const char bstab[256] =
 /* Return a new string which is the single-quoted version of STRING.
    Used by alias and trap, among others. */
 char *
-sh_single_quote (string)
-     const char *string;
+sh_single_quote (const char *string)
 {
   register int c;
   char *result, *r;
@@ -132,8 +131,7 @@ sh_single_quote (string)
 
 /* Quote STRING using double quotes.  Return a new string. */
 char *
-sh_double_quote (string)
-     const char *string;
+sh_double_quote (const char *string)
 {
   register unsigned char c;
   int mb_cur_max;
@@ -180,9 +178,7 @@ sh_double_quote (string)
 /* Turn S into a simple double-quoted string.  If FLAGS is non-zero, quote
    double quote characters in S with backslashes. */
 char *
-sh_mkdoublequoted (s, slen, flags)
-     const char *s;
-     int slen, flags;
+sh_mkdoublequoted (const char *s, int slen, int flags)
 {
   char *r, *ret;
   const char *send;
@@ -220,8 +216,7 @@ sh_mkdoublequoted (s, slen, flags)
    double quotes.  Return a new string.  XXX - should this handle CTLESC
    and CTLNUL? */
 char *
-sh_un_double_quote (string)
-     char *string;
+sh_un_double_quote (char *string)
 {
   register int c, pass_next;
   char *result, *r, *s;
@@ -259,10 +254,7 @@ sh_un_double_quote (string)
    other shell blank characters. */
    
 char *
-sh_backslash_quote (string, table, flags)
-     char *string;
-     char *table;
-     int flags;
+sh_backslash_quote (char *string, char *table, int flags)
 {
   int c, mb_cur_max;
   size_t slen;
@@ -315,9 +307,7 @@ sh_backslash_quote (string, table, flags)
 /* Quote characters that get special treatment when in double quotes in STRING
    using backslashes. FLAGS is reserved for future use. Return a new string. */
 char *
-sh_backslash_quote_for_double_quotes (string, flags)
-     char *string;
-     int flags;
+sh_backslash_quote_for_double_quotes (char *string, int flags)
 {
   unsigned char c;
   char *result, *r, *s, *send;
@@ -358,9 +348,7 @@ sh_backslash_quote_for_double_quotes (string, flags)
 #endif /* PROMPT_STRING_DECODE */
 
 char *
-sh_quote_reusable (s, flags)
-     char *s;
-     int flags;
+sh_quote_reusable (char *s, int flags)
 {
   char *ret;
 
@@ -383,8 +371,7 @@ sh_quote_reusable (s, flags)
 }
 
 int
-sh_contains_shell_metas (string)
-     const char *string;
+sh_contains_shell_metas (const char *string)
 {
   const char *s;
 
@@ -418,8 +405,7 @@ sh_contains_shell_metas (string)
 }
 
 int
-sh_contains_quotes (string)
-     const char *string;
+sh_contains_quotes (const char *string)
 {
   const char *s;
 
index 0433f5e2774bfeac092633d77ebb22a1d0b0365a..027941ca30232a35fa13b5a55acaf4c81d4c13e3 100644 (file)
@@ -2,7 +2,7 @@
  * shtty.c -- abstract interface to the terminal, focusing on capabilities.
  */
 
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -34,9 +34,7 @@ static TTYSTRUCT ttin, ttout;
 static int ttsaved = 0;
 
 int
-ttgetattr(fd, ttp)
-int    fd;
-TTYSTRUCT *ttp;
+ttgetattr(int fd, TTYSTRUCT *ttp)
 {
 #ifdef TERMIOS_TTY_DRIVER
   return tcgetattr(fd, ttp);
@@ -50,9 +48,7 @@ TTYSTRUCT *ttp;
 }
 
 int
-ttsetattr(fd, ttp)
-int    fd;
-TTYSTRUCT *ttp;
+ttsetattr(int fd, TTYSTRUCT *ttp)
 {
 #ifdef TERMIOS_TTY_DRIVER
   return tcsetattr(fd, TCSADRAIN, ttp);
@@ -66,7 +62,7 @@ TTYSTRUCT *ttp;
 }
 
 void
-ttsave()
+ttsave(void)
 {
   if (ttsaved)
    return;
@@ -76,7 +72,7 @@ ttsave()
 }
 
 void
-ttrestore()
+ttrestore(void)
 {
   if (ttsaved == 0)
     return;
@@ -87,8 +83,7 @@ ttrestore()
 
 /* Retrieve the internally-saved attributes associated with tty fd FD. */
 TTYSTRUCT *
-ttattr (fd)
-     int fd;
+ttattr (int fd)
 {
   if (ttsaved == 0)
     return ((TTYSTRUCT *)0);
@@ -105,8 +100,7 @@ ttattr (fd)
  * ttsetattr, the terminal will be in one-char-at-a-time mode.
  */
 int
-tt_setonechar(ttp)
-     TTYSTRUCT *ttp;
+tt_setonechar(TTYSTRUCT *ttp)
 {
 #if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER)
 
@@ -151,9 +145,7 @@ tt_setonechar(ttp)
 
 /* Set the tty associated with FD and TTP into one-character-at-a-time mode */
 int
-ttfd_onechar (fd, ttp)
-     int fd;
-     TTYSTRUCT *ttp;
+ttfd_onechar (int fd, TTYSTRUCT *ttp)
 {
   if (tt_setonechar(ttp) < 0)
     return -1;
@@ -162,7 +154,7 @@ ttfd_onechar (fd, ttp)
 
 /* Set the terminal into one-character-at-a-time mode */
 int
-ttonechar ()
+ttonechar (void)
 {
   TTYSTRUCT tt;
 
@@ -177,8 +169,7 @@ ttonechar ()
  * ttsetattr, the terminal will be in no-echo mode.
  */
 int
-tt_setnoecho(ttp)
-     TTYSTRUCT *ttp;
+tt_setnoecho(TTYSTRUCT *ttp)
 {
 #if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER)
   ttp->c_lflag &= ~(ECHO|ECHOK|ECHONL);
@@ -191,9 +182,7 @@ tt_setnoecho(ttp)
 
 /* Set the tty associated with FD and TTP into no-echo mode */
 int
-ttfd_noecho (fd, ttp)
-     int fd;
-     TTYSTRUCT *ttp;
+ttfd_noecho (int fd, TTYSTRUCT *ttp)
 {
   if (tt_setnoecho (ttp) < 0)
     return -1;
@@ -202,7 +191,7 @@ ttfd_noecho (fd, ttp)
 
 /* Set the terminal into no-echo mode */
 int
-ttnoecho ()
+ttnoecho (void)
 {
   TTYSTRUCT tt;
 
@@ -217,8 +206,7 @@ ttnoecho ()
  * ttsetattr, the terminal will be in eight-bit mode (pass8).
  */
 int
-tt_seteightbit (ttp)
-     TTYSTRUCT *ttp;
+tt_seteightbit (TTYSTRUCT *ttp)
 {
 #if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER)
   ttp->c_iflag &= ~ISTRIP;
@@ -233,9 +221,7 @@ tt_seteightbit (ttp)
 
 /* Set the tty associated with FD and TTP into eight-bit mode */
 int
-ttfd_eightbit (fd, ttp)
-     int fd;
-     TTYSTRUCT *ttp;
+ttfd_eightbit (int fd, TTYSTRUCT *ttp)
 {
   if (tt_seteightbit (ttp) < 0)
     return -1;
@@ -244,7 +230,7 @@ ttfd_eightbit (fd, ttp)
 
 /* Set the terminal into eight-bit mode */
 int
-tteightbit ()
+tteightbit (void)
 {
   TTYSTRUCT tt;
 
@@ -259,8 +245,7 @@ tteightbit ()
  * ttsetattr, the terminal will be in non-canonical input mode.
  */
 int
-tt_setnocanon (ttp)
-     TTYSTRUCT *ttp;
+tt_setnocanon (TTYSTRUCT *ttp)
 {
 #if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER)
   ttp->c_lflag &= ~ICANON;
@@ -271,9 +256,7 @@ tt_setnocanon (ttp)
 
 /* Set the tty associated with FD and TTP into non-canonical mode */
 int
-ttfd_nocanon (fd, ttp)
-     int fd;
-     TTYSTRUCT *ttp;
+ttfd_nocanon (int fd, TTYSTRUCT *ttp)
 {
   if (tt_setnocanon (ttp) < 0)
     return -1;
@@ -282,7 +265,7 @@ ttfd_nocanon (fd, ttp)
 
 /* Set the terminal into non-canonical mode */
 int
-ttnocanon ()
+ttnocanon (void)
 {
   TTYSTRUCT tt;
 
@@ -297,8 +280,7 @@ ttnocanon ()
  * ttsetattr, the terminal will be in cbreak, no-echo mode.
  */
 int
-tt_setcbreak(ttp)
-     TTYSTRUCT *ttp;
+tt_setcbreak(TTYSTRUCT *ttp)
 {
   if (tt_setonechar (ttp) < 0)
     return -1;
@@ -308,9 +290,7 @@ tt_setcbreak(ttp)
 /* Set the tty associated with FD and TTP into cbreak (no-echo,
    one-character-at-a-time) mode */
 int
-ttfd_cbreak (fd, ttp)
-     int fd;
-     TTYSTRUCT *ttp;
+ttfd_cbreak (int fd, TTYSTRUCT *ttp)
 {
   if (tt_setcbreak (ttp) < 0)
     return -1;
@@ -319,7 +299,7 @@ ttfd_cbreak (fd, ttp)
 
 /* Set the terminal into cbreak (no-echo, one-character-at-a-time) mode */
 int
-ttcbreak ()
+ttcbreak (void)
 {
   TTYSTRUCT tt;
 
index 1f0f4c736f16e2ace663e1a437cefb349e11c76f..678048c280aef7134ce19bc66c15ce7f56af10d3 100644 (file)
@@ -9,7 +9,7 @@
    Unix snprintf implementation.
    derived from inetutils/libinetutils/snprintf.c Version 1.1
 
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #  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 PARAMS((unsigned long int, int, char *, size_t, int));
-extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int));
+extern char *fmtulong (unsigned long int, int, char *, size_t, int);
+extern char *fmtullong (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 PARAMS((int));
-static int log_10 PARAMS((double));
-static double integral PARAMS((double, double *));
-static char *numtoa PARAMS((double, int, int, char **));
+static double pow_10 (int);
+static int log_10 (double);
+static double integral (double, double *);
+static char *numtoa (double, int, int, char **);
 #endif
 
-static void init_data PARAMS((struct DATA *, char *, size_t, const char *, int));
-static void init_conv_flag PARAMS((struct DATA *));
+static void init_data (struct DATA *, char *, size_t, const char *, int);
+static void init_conv_flag (struct DATA *);
 
 /* for the format */
 #ifdef FLOATING_POINT
-static void floating PARAMS((struct DATA *, double));
-static void exponent PARAMS((struct DATA *, double));
+static void floating (struct DATA *, double);
+static void exponent (struct DATA *, double);
 #endif
-static void number PARAMS((struct DATA *, unsigned long, int));
+static void number (struct DATA *, unsigned long, int);
 #ifdef HAVE_LONG_LONG_INT
-static void lnumber PARAMS((struct DATA *, unsigned long long, int));
+static void lnumber (struct DATA *, unsigned long long, int);
 #endif
-static void pointer PARAMS((struct DATA *, unsigned long));
-static void strings PARAMS((struct DATA *, char *));
+static void pointer (struct DATA *, unsigned long);
+static void strings (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 PARAMS((struct DATA *, const char *, const char *, long double));
+static void ldfallback (struct DATA *, const char *, const char *, long double);
 #  endif
-static void dfallback PARAMS((struct DATA *, const char *, const char *, double));
+static void dfallback (struct DATA *, const char *, const char *, double);
 #endif
 
-static char *groupnum PARAMS((char *));
+static char *groupnum (char *);
 
 #if defined (HAVE_LONG_DOUBLE)
 #  define LONGDOUBLE long double
@@ -331,10 +331,10 @@ static char *groupnum PARAMS((char *));
 #endif
 
 #ifdef DRIVER
-static void memory_error_and_abort ();
-static void *xmalloc PARAMS((size_t));
-static void *xrealloc PARAMS((void *, size_t));
-static void xfree PARAMS((void *));
+static void memory_error_and_abort (void);
+static void *xmalloc (size_t);
+static void *xrealloc (void *, size_t);
+static void xfree (void *);
 #else
 #  include <xmalloc.h>
 #endif
@@ -470,8 +470,7 @@ static void xfree PARAMS((void *));
  * Find the nth power of 10
  */
 static double
-pow_10(n)
-     int n;
+pow_10(int n)
 { 
   double P;
 
@@ -514,8 +513,7 @@ pow_10(n)
  * NOTE: do not call this with r == 0 -- an infinite loop results.
  */
 static int
-log_10(r)
-     double r;
+log_10(double r)
 { 
   int i = 0;
   double result = 1.;
@@ -549,9 +547,7 @@ log_10(r)
  * In many ways it resemble the modf() found on most Un*x
  */
 static double
-integral(real, ip)
-     double real;
-     double *ip;
+integral(double real, double *ip)
 { 
   int j;
   double i, s, p;
@@ -598,10 +594,7 @@ integral(real, ip)
  * declare with fix size 
  */
 static char *
-numtoa(number, base, precision, fract)
-     double number;
-     int base, precision;
-     char **fract;
+numtoa(double number, int base, int precision, char **fract)
 {
   register int i, j;
   double ip, fp; /* integer and fraction part */
@@ -696,10 +689,7 @@ numtoa(number, base, precision, fract)
  * the representation with the right padding
  */
 static void
-number(p, d, base)
-     struct DATA *p;
-     unsigned long d;
-     int base;
+number(struct DATA *p, unsigned long d, int base)
 {
   char *tmp, *t;
   long sd;
@@ -772,10 +762,7 @@ number(p, d, base)
  * identical to number() but works for `long long'
  */
 static void
-lnumber(p, d, base)
-     struct DATA *p;
-     unsigned long long d;
-     int base;
+lnumber(struct DATA *p, unsigned long long d, int base)
 {
   char *tmp, *t;
   long long sd;
@@ -844,9 +831,7 @@ lnumber(p, d, base)
 #endif
 
 static void
-pointer(p, d)
-     struct DATA *p;
-     unsigned long d;
+pointer(struct DATA *p, unsigned long d)
 {
   char *tmp;
 
@@ -869,9 +854,7 @@ pointer(p, d)
 
 /* %s strings */
 static void
-strings(p, tmp)
-     struct DATA *p;
-     char *tmp;
+strings(struct DATA *p, char *tmp)
 {
   size_t len;
 
@@ -886,9 +869,7 @@ strings(p, tmp)
 #if HANDLE_MULTIBYTE
 /* %ls wide-character strings */
 static void
-wstrings(p, tmp)
-     struct DATA *p;
-     wchar_t *tmp;
+wstrings(struct DATA *p, wchar_t *tmp)
 {
   size_t len;
   mbstate_t mbs;
@@ -927,9 +908,7 @@ wstrings(p, tmp)
 }
 
 static void
-wchars (p, wc)
-     struct DATA *p;
-     wint_t wc;
+wchars (struct DATA *p, wint_t wc)
 {
   char *lbuf, *l;
   mbstate_t mbs;
@@ -956,10 +935,7 @@ wchars (p, wc)
    (mode == 2) we check for NaN.  This does the necessary printing.  Returns
    1 if Inf or Nan, 0 if not. */
 static int
-chkinfnan(p, d, mode)
-     struct DATA *p;
-     double d;
-     int mode;         /* == 1 for inf, == 2 for nan */
+chkinfnan(struct DATA *p, double d, int mode)
 {
   int i;
   char *tmp;
@@ -987,9 +963,7 @@ chkinfnan(p, d, mode)
 
 /* %f %F %g %G floating point representation */
 static void
-floating(p, d)
-     struct DATA *p;
-     double d;
+floating(struct DATA *p, double d)
 {
   char *tmp, *tmp2, *t;
   int i;
@@ -1058,9 +1032,7 @@ floating(p, d)
 
 /* %e %E %g %G exponent representation */
 static void
-exponent(p, d)
-     struct DATA *p;
-     double d;
+exponent(struct DATA *p, double d)
 {
   char *tmp, *tmp2;
   int j, i;
@@ -1160,8 +1132,7 @@ exponent(p, d)
    grouping info and thousands separator.  If no grouping should be performed,
    this returns NULL; the caller needs to check for it. */
 static char *
-groupnum (s)
-     char *s;
+groupnum (char *s)
 {
   char *se, *ret, *re, *g;
   int len, slen;
@@ -1221,8 +1192,7 @@ groupnum (s)
 
 /* initialize the conversion specifiers */
 static void
-init_conv_flag (p)
-     struct DATA *p;
+init_conv_flag (struct DATA *p)
 {
   p->flags &= PF_ALLOCBUF;             /* preserve PF_ALLOCBUF flag */
   p->precision = p->width = NOT_FOUND;
@@ -1231,12 +1201,7 @@ init_conv_flag (p)
 }
 
 static void
-init_data (p, string, length, format, mode)
-     struct DATA *p;
-     char *string;
-     size_t length;
-     const char *format;
-     int mode;
+init_data (struct DATA *p, char *string, size_t length, const char *format, int mode)
 {
   p->length = length - 1; /* leave room for '\0' */
   p->holder = p->base = string;
@@ -1246,16 +1211,7 @@ init_data (p, string, length, format, mode)
 }
 
 static int
-#if defined (__STDC__)
 vsnprintf_internal(struct DATA *data, char *string, size_t length, const char *format, va_list args)
-#else
-vsnprintf_internal(data, string, length, format, args)
-     struct DATA *data;
-     char *string;
-     size_t length;
-     const char *format;
-     va_list args;
-#endif
 {
   double d; /* temporary holder */
 #ifdef HAVE_LONG_DOUBLE
@@ -1639,10 +1595,7 @@ conv_break:
  * at it.  Fall back to sprintf for long double formats.
  */
 static void
-ldfallback (data, fs, fe, ld)
-     struct DATA *data;
-     const char *fs, *fe;
-     long double ld;
+ldfallback (struct DATA *data, const char *fs, const char *fe, long double ld)
 {
   register char *x;
   char fmtbuf[FALLBACK_FMTSIZE], *obuf;
@@ -1672,10 +1625,7 @@ ldfallback (data, fs, fe, ld)
 #ifdef FLOATING_POINT
 /* Used for %a, %A if the libc printf supports them. */
 static void
-dfallback (data, fs, fe, d)
-     struct DATA *data;
-     const char *fs, *fe;
-     double d;
+dfallback (struct DATA *data, const char *fs, const char *fe, double d)
 {
   register char *x;
   char fmtbuf[FALLBACK_FMTSIZE], obuf[FALLBACK_BASE];
@@ -1702,15 +1652,7 @@ dfallback (data, fs, fe, d)
 #if !HAVE_SNPRINTF
 
 int
-#if defined (__STDC__)
 vsnprintf(char *string, size_t length, const char *format, va_list args)
-#else
-vsnprintf(string, length, format, args)
-     char *string;
-     size_t length;
-     const char *format;
-     va_list args;
-#endif
 {
   struct DATA data;
 
@@ -1721,15 +1663,7 @@ vsnprintf(string, length, format, args)
 }
 
 int
-#if defined(PREFER_STDARG)
 snprintf(char *string, size_t length, const char * format, ...)
-#else
-snprintf(string, length, format, va_alist)
-     char *string;
-     size_t length;
-     const char *format;
-     va_dcl
-#endif
 {
   struct DATA data;
   int rval;
@@ -1752,14 +1686,7 @@ snprintf(string, length, format, va_alist)
 #if !HAVE_ASPRINTF
 
 int
-#if defined (__STDC__)
 vasprintf(char **stringp, const char *format, va_list args)
-#else
-vasprintf(stringp, format, args)
-     char **stringp;
-     const char *format;
-     va_list args;
-#endif
 {
   struct DATA data;
   char *string;
@@ -1773,14 +1700,7 @@ vasprintf(stringp, format, args)
 }
 
 int
-#if defined(PREFER_STDARG)
 asprintf(char **stringp, const char * format, ...)
-#else
-asprintf(stringp, format, va_alist)
-     char **stringp;
-     const char *format;
-     va_dcl
-#endif
 {
   int rval;
   va_list args;
@@ -1801,15 +1721,14 @@ asprintf(stringp, format, va_alist)
 #ifdef DRIVER
 
 static void
-memory_error_and_abort ()
+memory_error_and_abort (void)
 {
   write (2, "out of virtual memory\n", 22);
   abort ();
 }
 
 static void *
-xmalloc(bytes)
-     size_t bytes;
+xmalloc(size_t bytes)
 {
   void *ret;
 
@@ -1820,9 +1739,7 @@ xmalloc(bytes)
 }
 
 static void *
-xrealloc (pointer, bytes)
-     void *pointer;
-     size_t bytes;
+xrealloc (void *pointer, size_t bytes)
 {
   void *ret;
 
@@ -1833,15 +1750,14 @@ xrealloc (pointer, bytes)
 }
 
 static void
-xfree(x)
-     void *x;
+xfree(void *x)
 {
   if (x)
     free (x);
 }
 
 /* set of small tests for snprintf() */
-main()
+main(int c, char **v)
 {
   char holder[100];
   char *h;
index cdf465b2d9602141f24a244780e8e1ed4459087a..d25e4135b68b3bcf1f95e1d11d990fbfac871e38 100644 (file)
@@ -1,6 +1,6 @@
 /* spell.c -- spelling correction for pathnames. */
 
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2022 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 PARAMS((char *, char *, char *));
-static int spdist PARAMS((char *, char *));
+static int mindist (char *, char *, char *);
+static int spdist (char *, char *);
 
 /*
  * `spname' and its helpers are inspired by the code in "The UNIX
@@ -59,9 +59,7 @@ static int spdist PARAMS((char *, char *));
  *     Stores corrected name in `newname'.
  */
 int
-spname(oldname, newname)
-     char *oldname;
-     char *newname;
+spname(char *oldname, char *newname)
 {
   char *op, *np, *p;
   char guess[PATH_MAX + 1], best[PATH_MAX + 1];
@@ -104,10 +102,7 @@ spname(oldname, newname)
  *  Search directory for a guess
  */
 static int
-mindist(dir, guess, best)
-     char *dir;
-     char *guess;
-     char *best;
+mindist(char *dir, char *guess, char *best)
 {
   DIR *fd;
   struct dirent *dp;
@@ -155,8 +150,7 @@ mindist(dir, guess, best)
  *      3 otherwise
  */
 static int
-spdist(cur, new)
-     char *cur, *new;
+spdist(char *cur, char *new)
 {
   while (*cur == *new)
     {
@@ -188,8 +182,7 @@ spdist(cur, new)
 }
 
 char *
-dirspell (dirname)
-     char *dirname;
+dirspell (char *dirname)
 {
   int n;
   char *guess;
index 70d0551a11dcc5a7f7b371bd97ec07e9fd89e5df..e68dffc6f0ce5dfd541d34489a3ff550c086d02d 100644 (file)
@@ -1,6 +1,6 @@
 /* strcasecmp.c - functions for case-insensitive string comparison. */
 
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 /* Compare at most COUNT characters from string1 to string2.  Case
    doesn't matter. */
 int
-strncasecmp (string1, string2, count)
-     const char *string1;
-     const char *string2;
-     size_t count;
+strncasecmp (const char *string1, const char *string2, size_t count)
 {
   register const char *s1;
   register const char *s2;
@@ -58,9 +55,7 @@ strncasecmp (string1, string2, count)
 
 /* strcmp (), but caseless. */
 int
-strcasecmp (string1, string2)
-     const char *string1;
-     const char *string2;
+strcasecmp (const char *string1, const char *string2)
 {
   register const char *s1;
   register const char *s2;
index c819b3eb8c0344d419391910b49ee00afb9683ba..7239277ac47ede33969feb58e88dd54f9b4ba58c 100644 (file)
@@ -1,7 +1,7 @@
 /* strcasestr.c - Find if one string appears as a substring of another string,
                  without regard to case. */
 
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -30,9 +30,7 @@
    match in s1.  The compare is case insensitive.  This is a
    case-insensitive strstr(3). */
 char *
-strcasestr (s1, s2)
-     const char *s1;
-     const char *s2;
+strcasestr (const char *s1, const char *s2)
 {
   register int i, l, len, c;
 
index 00cb88c4e5e90f0751d9069669ba10e6b942e9f9..65273af2b01aaa3ff029f389e99c22f1871aa15c 100644 (file)
@@ -1,5 +1,5 @@
 /* Searching in a string.
-   Copyright (C) 2012 Free Software Foundation, Inc.
+   Copyright (C) 2012, 2022 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
@@ -22,9 +22,7 @@
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
 char *
-strchrnul (s, c_in)
-     const char *s;
-     int c_in;
+strchrnul (const char *s, int c_in)
 {
   char c;
   register char *s1;
index 3d35f7c0aedd1d71b889eaadfe08a7a582576363..51f6dea6065864ebf2d4b918c66f2b4920007a60 100644 (file)
@@ -1,6 +1,6 @@
 /* strdup - return a copy of a string in newly-allocated memory. */
 
-/* Copyright (C) 2013 Free Software Foundation, Inc.
+/* Copyright (C) 2013,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
@@ -26,8 +26,7 @@
 
 /* Duplicate S, returning an identical malloc'd string.  */
 char *
-strdup (s)
-     const char *s;
+strdup (const char *s)
 {
   size_t len;
   void *new;
index bf63926300d7ddab75dff5d3f65ba94d7ec32445..0de2f80014cce9cc64148ebd78890d8cf08d51ad 100644 (file)
@@ -1,6 +1,6 @@
 /* strerror.c - string corresponding to a particular value of errno. */
 
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -49,8 +49,7 @@ extern int errno;
 static char *errbase = "Unknown system error ";
 
 char *
-strerror (e)
-     int e;
+strerror (int e)
 {
   static char emsg[40];
 #if defined (HAVE_SYS_ERRLIST)
index 3f28b63193a863f7b2784f6ebb4b4798c5f5da03..8c1de7c7ff760c3e356a5b8deac40419b6189f97 100644 (file)
@@ -1,6 +1,6 @@
 /* stringlist.c - functions to handle a generic `list of strings' structure */
 
-/* Copyright (C) 2000-2019 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -37,8 +37,7 @@
 /* Allocate a new STRINGLIST, with room for N strings. */
 
 STRINGLIST *
-strlist_create (n)
-     int n;
+strlist_create (int n)
 {
   STRINGLIST *ret;
   register int i;
@@ -61,9 +60,7 @@ strlist_create (n)
 }
 
 STRINGLIST *
-strlist_resize (sl, n)
-     STRINGLIST *sl;
-     int n;
+strlist_resize (STRINGLIST *sl, int n)
 {
   register int i;
 
@@ -81,8 +78,7 @@ strlist_resize (sl, n)
 }
 
 void
-strlist_flush (sl)
-     STRINGLIST *sl;
+strlist_flush (STRINGLIST *sl)
 {
   if (sl == 0 || sl->list == 0)
     return;
@@ -91,8 +87,7 @@ strlist_flush (sl)
 }
   
 void
-strlist_dispose (sl)
-     STRINGLIST *sl;
+strlist_dispose (STRINGLIST *sl)
 {
   if (sl == 0)
     return;
@@ -102,9 +97,7 @@ strlist_dispose (sl)
 }
 
 int
-strlist_remove (sl, s)
-     STRINGLIST *sl;
-     char *s;
+strlist_remove (STRINGLIST *sl, char *s)
 {
   int r;
 
@@ -118,8 +111,7 @@ strlist_remove (sl, s)
 }
 
 STRINGLIST *
-strlist_copy (sl)
-     STRINGLIST *sl;
+strlist_copy (STRINGLIST *sl)
 {
   STRINGLIST *new;
   register int i;
@@ -144,8 +136,7 @@ strlist_copy (sl)
 /* Return a new STRINGLIST with everything from M1 and M2. */
 
 STRINGLIST *
-strlist_merge (m1, m2)
-     STRINGLIST *m1, *m2;
+strlist_merge (STRINGLIST *m1, STRINGLIST *m2)
 {
   STRINGLIST *sl;
   int i, n, l1, l2;
@@ -165,8 +156,7 @@ strlist_merge (m1, m2)
 
 /* Make STRINGLIST M1 contain everything in M1 and M2. */
 STRINGLIST *
-strlist_append (m1, m2)
-     STRINGLIST *m1, *m2;
+strlist_append (STRINGLIST *m1, STRINGLIST *m2)
 {
   register int i, n, len1, len2;
 
@@ -189,9 +179,7 @@ strlist_append (m1, m2)
 }
 
 STRINGLIST *
-strlist_prefix_suffix (sl, prefix, suffix)
-     STRINGLIST *sl;
-     char *prefix, *suffix;
+strlist_prefix_suffix (STRINGLIST *sl, char *prefix, char *suffix)
 {
   int plen, slen, tlen, llen, i;
   char *t;
@@ -223,9 +211,7 @@ strlist_prefix_suffix (sl, prefix, suffix)
 }
    
 void
-strlist_print (sl, prefix)
-     STRINGLIST *sl;
-     char *prefix;
+strlist_print (STRINGLIST *sl, char *prefix)
 {
   register int i;
 
@@ -236,9 +222,7 @@ strlist_print (sl, prefix)
 }
 
 void
-strlist_walk (sl, func)
-     STRINGLIST *sl;
-     sh_strlist_map_func_t *func;
+strlist_walk (STRINGLIST *sl, sh_strlist_map_func_t *func)
 {
   register int i;
 
@@ -250,8 +234,7 @@ strlist_walk (sl, func)
 } 
      
 void
-strlist_sort (sl)
-     STRINGLIST *sl;
+strlist_sort (STRINGLIST *sl)
 {
   if (sl == 0 || sl->list_len == 0 || sl->list == 0)
     return;
@@ -259,9 +242,7 @@ strlist_sort (sl)
 }
 
 STRINGLIST *
-strlist_from_word_list (list, alloc, starting_index, ip)
-     WORD_LIST *list;
-     int alloc, starting_index, *ip;
+strlist_from_word_list (WORD_LIST *list, int alloc, int starting_index, int *ip)
 {
   STRINGLIST *ret;
   int slen, len;
@@ -283,9 +264,7 @@ strlist_from_word_list (list, alloc, starting_index, ip)
 }
 
 WORD_LIST *
-strlist_to_word_list (sl, alloc, starting_index)
-     STRINGLIST *sl;
-     int alloc, starting_index;
+strlist_to_word_list (STRINGLIST *sl, int alloc, int starting_index)
 {
   WORD_LIST *list;
 
index 860004296a910eb5461982eecf2e4dc16bf8ba28..fd3d3e47ce8634eea8da90d416a4977861617443 100644 (file)
@@ -1,6 +1,6 @@
 /* stringvec.c - functions for managing arrays of strings. */
 
-/* Copyright (C) 2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2002,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 /* Allocate an array of strings with room for N members. */
 char **
-strvec_create (n)
-     int n;
+strvec_create (int n)
 {
   return ((char **)xmalloc ((n) * sizeof (char *)));
 }
 
 /* Allocate an array of strings with room for N members. */
 char **
-strvec_mcreate (n)
-     int n;
+strvec_mcreate (int n)
 {
   return ((char **)malloc ((n) * sizeof (char *)));
 }
 
 char **
-strvec_resize (array, nsize)
-     char **array;
-     int nsize;
+strvec_resize (char **array, int nsize)
 {
   return ((char **)xrealloc (array, nsize * sizeof (char *)));
 }
 
 char **
-strvec_mresize (array, nsize)
-     char **array;
-     int nsize;
+strvec_mresize (char **array, int nsize)
 {
   return ((char **)realloc (array, nsize * sizeof (char *)));
 }
 
 /* Return the length of ARRAY, a NULL terminated array of char *. */
 int
-strvec_len (array)
-     char **array;
+strvec_len (char **array)
 {
   register int i;
 
@@ -77,8 +70,7 @@ strvec_len (array)
 
 /* Free the contents of ARRAY, a NULL terminated array of char *. */
 void
-strvec_flush (array)
-     char **array;
+strvec_flush (char **array)
 {
   register int i;
 
@@ -90,8 +82,7 @@ strvec_flush (array)
 }
 
 void
-strvec_dispose (array)
-     char **array;
+strvec_dispose (char **array)
 {
   if (array == 0)
     return;
@@ -101,8 +92,7 @@ strvec_dispose (array)
 }
 
 int
-strvec_remove (array, name)
-     char **array, *name;
+strvec_remove (char **array, char *name)
 {
   register int i, j;
   char *x;
@@ -125,8 +115,7 @@ strvec_remove (array, name)
 /* Find NAME in ARRAY.  Return the index of NAME, or -1 if not present.
    ARRAY should be NULL terminated. */
 int
-strvec_search (array, name)
-     char **array, *name;
+strvec_search (char **array, char *name)
 {
   int i;
 
@@ -139,8 +128,7 @@ strvec_search (array, name)
 
 /* Allocate and return a new copy of ARRAY and its contents. */
 char **
-strvec_copy (array)
-     char **array;
+strvec_copy (char **array)
 {
   register int i;
   int len;
@@ -161,8 +149,7 @@ strvec_copy (array)
 
    Perform a bytewise comparison if *S1 and *S2 collate equally. */
 int
-strvec_posixcmp (s1, s2)
-     register char **s1, **s2;
+strvec_posixcmp (char **s1, char **s2)
 {
   int result;
 
@@ -181,8 +168,7 @@ strvec_posixcmp (s1, s2)
 /* Comparison routine for use with qsort() on arrays of strings.  Uses
    strcoll(3) if available, otherwise it uses strcmp(3). */
 int
-strvec_strcmp (s1, s2)
-     register char **s1, **s2;
+strvec_strcmp (char **s1, char **s2)
 {
 #if defined (HAVE_STRCOLL)
    return (strcoll (*s1, *s2));
@@ -198,9 +184,7 @@ strvec_strcmp (s1, s2)
 
 /* Sort ARRAY, a null terminated array of pointers to strings. */
 void
-strvec_sort (array, posix)
-     char **array;
-     int posix;
+strvec_sort (char **array, int posix)
 {
   if (posix)
     qsort (array, strvec_len (array), sizeof (char *), (QSFUNC *)strvec_posixcmp);
@@ -217,9 +201,7 @@ strvec_sort (array, posix)
    space at the beginning of the array. */
 
 char **
-strvec_from_word_list (list, alloc, starting_index, ip)
-     WORD_LIST *list;
-     int alloc, starting_index, *ip;
+strvec_from_word_list (WORD_LIST *list, int alloc, int starting_index, int *ip)
 {
   int count;
   char **array;
@@ -244,9 +226,7 @@ strvec_from_word_list (list, alloc, starting_index, ip)
    in ARRAY to begin. */
 
 WORD_LIST *
-strvec_to_word_list (array, alloc, starting_index)
-     char **array;
-     int alloc, starting_index;
+strvec_to_word_list (char **array, int alloc, int starting_index)
 {
   WORD_LIST *list;
   WORD_DESC *w;
index 10414d358424bf014d50700b55295f1c31c3290e..06eaa0b9204b377ab540a435466b04b051fc1fae 100644 (file)
@@ -1,6 +1,6 @@
 /* strnlen - return length of passed string, with length limit */
 
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
@@ -35,9 +35,7 @@
 /* Find the length of S, but scan at most MAXLEN characters.  If no '\0'
    terminator is found within the first MAXLEN characters, return MAXLEN. */
 size_t
-strnlen (s, maxlen)
-     register const char *s;
-     size_t maxlen;
+strnlen (register const char *s, size_t maxlen)
 {
   register const char *e;
   size_t n;
index 8cce8308ed30f0238745df28d098f2cca5a05e56..3ef4340174a26c74942a7bb2463a2e6405133823 100644 (file)
@@ -1,6 +1,6 @@
 /* strpbrk.c - locate multiple characters in a string */
 
-/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 2022 Free Software Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -31,9 +31,7 @@
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
 char *
-strpbrk (s, accept)
-     register const char *s;
-     register const char *accept;
+strpbrk (const char *s, const char *accept)
 {
   while (*s != '\0')
     {
index c43b05e379bce886902bc1b7537ce6daac396aa4..fb69f9556c6e6deeb2eeebc1160e55fbf3b71660 100644 (file)
@@ -36,7 +36,7 @@
 #endif
 #include <sys/types.h>
 
-typedef unsigned chartype;
+typedef unsigned int chartype;
 
 #undef strstr
 
index 55e11540588b428fb8698f6b04c4c82a9af5cab4..e6c1c360af3bd7454644c6da8b863742dffc97e5 100644 (file)
@@ -1,6 +1,6 @@
 /* strtod.c - convert string to double-precision floating-point value. */
 
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
@@ -50,15 +50,13 @@ extern int errno;
 #endif
 
 #ifndef locale_decpoint
-extern int locale_decpoint PARAMS((void));
+extern int locale_decpoint (void);
 #endif
 
 /* Convert NPTR to a double.  If ENDPTR is not NULL, a pointer to the
    character after the last one used in the number is put in *ENDPTR.  */
 double
-strtod (nptr, endptr)
-     const char *nptr;
-     char **endptr;
+strtod (const char *nptr, char **endptr)
 {
   register const char *s;
   short sign;
index 584fa0ba20f5fc81c9beaac689da7e98ceb5383d..0e6c1c267d1816cf834d2fd12d7948823b679198 100644 (file)
@@ -1,6 +1,6 @@
 /* strtoimax - convert string representation of a number into an intmax_t value. */
 
-/* Copyright 1999-2020 Free Software Foundation, Inc.
+/* Copyright 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
    
 "this configure-time declaration test was not run"
 #endif
 #if !HAVE_DECL_STRTOL
-extern long strtol PARAMS((const char *, char **, int));
+extern long strtol (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_INT
-extern long long strtoll PARAMS((const char *, char **, int));
+extern long long strtoll (const char *, char **, int);
 #endif
 
 #ifdef strtoimax
@@ -60,10 +60,7 @@ extern long long strtoll PARAMS((const char *, char **, int));
 #endif
 
 intmax_t
-strtoimax (ptr, endptr, base)
-     const char *ptr;
-     char **endptr;
-     int base;
+strtoimax (const char *ptr, char **endptr, int base)
 {
 #if HAVE_LONG_LONG_INT
   verify(size_is_that_of_long_or_long_long,
index c839a97ca75f713d4376aca654169db8707c0ec3..ac30dbd9085796756571e73f66b80dda3ff68f3d 100644 (file)
@@ -1,6 +1,6 @@
 /* strtol - convert string representation of a number into a long integer value. */
 
-/* Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2001,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -90,10 +90,7 @@ extern int errno;
    one converted is stored in *ENDPTR.  */
 
 INT
-strtol (nptr, endptr, base)
-     const char *nptr;
-     char **endptr;
-     int base;
+strtol (const char *nptr, char **endptr, int base)
 {
   int negative;
   register unsigned LONG int cutoff;
index 2e26efcf2e93875ad16737f29e8153f6f89b3513..8996f69fbadbd35b64fac59ac187365aa0d583ac 100644 (file)
@@ -1,6 +1,6 @@
 /* strtoumax - convert string representation of a number into an uintmax_t value. */
 
-/* Copyright 1999-2020 Free Software Foundation, Inc.
+/* Copyright 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 "this configure-time declaration test was not run"
 #endif
 #if !HAVE_DECL_STRTOUL
-extern unsigned long strtoul PARAMS((const char *, char **, int));
+extern unsigned long strtoul (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_INT
-extern unsigned long long strtoull PARAMS((const char *, char **, int));
+extern unsigned long long strtoull (const char *, char **, int);
 #endif
 
 #ifdef strtoumax
@@ -60,10 +60,7 @@ extern unsigned long long strtoull PARAMS((const char *, char **, int));
 #endif
 
 uintmax_t
-strtoumax (ptr, endptr, base)
-     const char *ptr;
-     char **endptr;
-     int base;
+strtoumax (const char *ptr, char **endptr, int base)
 {
 #if HAVE_UNSIGNED_LONG_LONG_INT
   verify (size_is_that_of_unsigned_long_or_unsigned_long_long,
index b2b1acca3348d18ba08bd43975f151f178c644cc..5d5f7599c78508da3c0e472f6f12b342ba36836c 100644 (file)
@@ -1,6 +1,6 @@
 /* strtrans.c - Translate and untranslate strings with ANSI-C escape sequences. */
 
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2015,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -48,9 +48,7 @@
    quote CTLESC and CTLNUL with CTLESC.  If (flags&4) is non-zero, we want
    to remove the backslash before any unrecognized escape sequence. */
 char *
-ansicstr (string, len, flags, sawc, rlen)
-     char *string;
-     int len, flags, *sawc, *rlen;
+ansicstr (char *string, int len, int flags, int *sawc, int *rlen)
 {
   int c, temp;
   char *ret, *r, *s;
@@ -227,9 +225,7 @@ ansicstr (string, len, flags, sawc, rlen)
 /* Take a string STR, possibly containing non-printing characters, and turn it
    into a $'...' ANSI-C style quoted string.  Returns a new string. */
 char *
-ansic_quote (str, flags, rlen)
-     char *str;
-     int flags, *rlen;
+ansic_quote (char *str, int flags, int *rlen)
 {
   char *r, *ret, *s;
   int l, rsize;
@@ -318,8 +314,7 @@ ansic_quote (str, flags, rlen)
 
 #if defined (HANDLE_MULTIBYTE)
 int
-ansic_wshouldquote (string)
-     const char *string;
+ansic_wshouldquote (const char *string)
 {
   const wchar_t *wcs;
   wchar_t wcc;
@@ -348,8 +343,7 @@ ansic_wshouldquote (string)
 
 /* return 1 if we need to quote with $'...' because of non-printing chars. */
 int
-ansic_shouldquote (string)
-     const char *string;
+ansic_shouldquote (const char *string)
 {
   const char *s;
   unsigned char c;
@@ -373,9 +367,7 @@ ansic_shouldquote (string)
 /* $'...' ANSI-C expand the portion of STRING between START and END and
    return the result.  The result cannot be longer than the input string. */
 char *
-ansiexpand (string, start, end, lenp)
-     char *string;
-     int start, end, *lenp;
+ansiexpand (char *string, int start, int end, int *lenp)
 {
   char *temp, *t;
   int len, tlen;
index 7a11d5799ff0014b7d4a08aed7a31bc6190f0a08..a4d5bf04ed7ec26b06fb4c361fad2fcf8c83d991 100644 (file)
 #endif
 
 int
-sh_charvis (s, sindp, slen, ret, rindp)
-     const char *s;
-     size_t *sindp;
-     size_t slen;
-     char *ret;
-     size_t *rindp;
+sh_charvis (const char *s, size_t *sindp, size_t slen, char *ret, size_t *rindp)
 {
   unsigned char c;
   size_t si, ri;
@@ -117,8 +112,7 @@ sh_charvis (s, sindp, slen, ret, rindp)
 /* Return a new string with `unsafe' non-graphical characters in S rendered
    in a visible way. */
 char *
-sh_strvis (string)
-     const char *string;
+sh_strvis (const char *string)
 {
   size_t slen, sind;
   char *ret;
index 2423078ab440a319c3d4cb8104373ad3612d1b62..d8a376857cd9e248e6112f9a484f718472e43607 100644 (file)
@@ -1,6 +1,6 @@
 /* times.c - times(3) library function */
 
-/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #  include <sys/resource.h>
 #endif /* HAVE_SYS_RESOURCE_H && HAVE_GETRUSAGE */
 
-extern long    get_clk_tck PARAMS((void));
+extern long get_clk_tck (void);
 
 #define CONVTCK(r)      (r.tv_sec * clk_tck + r.tv_usec / (1000000 / clk_tck))
 
 clock_t
-times(tms)
-       struct tms *tms;
+times(struct tms *tms)
 {
        clock_t rv;
        static long clk_tck = -1;
index f2ca7624ad2bff8561d011d49ed7e2efa855d233..f50d62445d9541d609d82818070a7b4d0b6748a4 100644 (file)
@@ -1,6 +1,6 @@
 /* timeval.c - functions to perform operations on struct timevals */
 
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #include <stdc.h>
 
 #ifndef locale_decpoint
-extern int locale_decpoint PARAMS((void));
+extern int locale_decpoint (void);
 #endif
 
 #include <stdio.h>
 
 struct timeval *
-difftimeval (d, t1, t2)
-     struct timeval *d, *t1, *t2;
+difftimeval (struct timeval *d, struct timeval *t1, struct timeval *t2)
 {
   d->tv_sec = t2->tv_sec - t1->tv_sec;
   d->tv_usec = t2->tv_usec - t1->tv_usec;
@@ -54,8 +53,7 @@ difftimeval (d, t1, t2)
 }
 
 struct timeval *
-addtimeval (d, t1, t2)
-     struct timeval *d, *t1, *t2;
+addtimeval (struct timeval *d, struct timeval *t1, struct timeval *t2)
 {
   d->tv_sec = t1->tv_sec + t2->tv_sec;
   d->tv_usec = t1->tv_usec + t2->tv_usec;
@@ -68,9 +66,7 @@ addtimeval (d, t1, t2)
 }
 
 struct timeval *
-multimeval (d, m)
-     struct timeval *d;
-     int m;
+multimeval (struct timeval *d, int m)
 {
   time_t t;
 
@@ -81,9 +77,7 @@ multimeval (d, m)
 }
 
 struct timeval *
-divtimeval (d, m)
-     struct timeval *d;
-     int m;
+divtimeval (struct timeval *d, int m)
 {
   time_t t;
 
@@ -96,8 +90,7 @@ divtimeval (d, m)
 /* Do "cpu = ((user + sys) * 10000) / real;" with timevals.
    Barely-tested code from Deven T. Corzine <deven@ties.org>. */
 int
-timeval_to_cpu (rt, ut, st)
-     struct timeval *rt, *ut, *st;     /* real, user, sys */
+timeval_to_cpu (struct timeval *rt, struct timeval *ut, struct timeval *st)
 {
   struct timeval t1, t2;
   register int i;
@@ -134,10 +127,7 @@ timeval_to_cpu (rt, ut, st)
    second, returning the values in *SP and *SFP, respectively.  This does
    rounding on the fractional part, not just truncation to three places. */
 void
-timeval_to_secs (tvp, sp, sfp)
-     struct timeval *tvp;
-     time_t *sp;
-     int *sfp;
+timeval_to_secs (struct timeval *tvp, time_t *sp, int *sfp)
 {
   int rest;
 
@@ -160,9 +150,7 @@ timeval_to_secs (tvp, sp, sfp)
 /* Print the contents of a struct timeval * in a standard way to stdio
    stream FP.  */
 void
-print_timeval (fp, tvp)
-     FILE *fp;
-     struct timeval *tvp;
+print_timeval (FILE *fp, struct timeval *tvp)
 {
   time_t timestamp;
   long minutes;
index d107e745c3e0ef51fe74e1cc6f77ed34dfc365d1..098c111b8dcd7eb7f423eb7b6d9ec7634384499a 100644 (file)
@@ -2,7 +2,7 @@
  * tmpfile.c - functions to create and safely open temp files for the shell.
  */
 
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -58,8 +58,8 @@ extern int errno;
 
 extern pid_t dollar_dollar_pid;
 
-static char *get_sys_tmpdir PARAMS((void));
-static char *get_tmpdir PARAMS((int));
+static char *get_sys_tmpdir (void);
+static char *get_tmpdir (int);
 
 static char *sys_tmpdir = (char *)NULL;
 static int ntmpfiles;
@@ -67,7 +67,7 @@ static int tmpnamelen = -1;
 static unsigned long filenum = 1L;
 
 static char *
-get_sys_tmpdir ()
+get_sys_tmpdir (void)
 {
   if (sys_tmpdir)
     return sys_tmpdir;
@@ -96,8 +96,7 @@ get_sys_tmpdir ()
 }
 
 static char *
-get_tmpdir (flags)
-     int flags;
+get_tmpdir (int flags)
 {
   char *tdir;
 
@@ -119,7 +118,7 @@ get_tmpdir (flags)
 }
 
 static void
-sh_seedrand ()
+sh_seedrand (void)
 {
 #if HAVE_RANDOM
   int d;
@@ -136,9 +135,7 @@ sh_seedrand ()
 }
 
 char *
-sh_mktmpname (nameroot, flags)
-     char *nameroot;
-     int flags;
+sh_mktmpname (char *nameroot, int flags)
 {
   char *filename, *tdir, *lroot;
   struct stat sb;
@@ -199,10 +196,7 @@ sh_mktmpname (nameroot, flags)
 }
 
 int
-sh_mktmpfd (nameroot, flags, namep)
-     char *nameroot;
-     int flags;
-     char **namep;
+sh_mktmpfd (char *nameroot, int flags, char **namep)
 {
   char *filename, *tdir, *lroot;
   int fd, tdlen;
@@ -265,10 +259,7 @@ sh_mktmpfd (nameroot, flags, namep)
 }
 
 FILE *
-sh_mktmpfp (nameroot, flags, namep)
-     char *nameroot;
-     int flags;
-     char **namep;
+sh_mktmpfp (char *nameroot, int flags, char **namep)
 {
   int fd;
   FILE *fp;
@@ -283,9 +274,7 @@ sh_mktmpfp (nameroot, flags, namep)
 }
 
 char *
-sh_mktmpdir (nameroot, flags)
-     char *nameroot;
-     int flags;
+sh_mktmpdir (char *nameroot, int flags)
 {
   char *filename, *tdir, *lroot, *dirname;
   int fd, tdlen;
index f3a4cc9f6bb84f5ff374da88131a1f3492c823f6..909686cfcf92e578aaaf3d2978a806276ba99e0b 100644 (file)
@@ -1,7 +1,7 @@
 /* uconvert - convert string representations of decimal numbers into whole
              number/fractional value pairs. */
 
-/* Copyright (C) 2008,2009,2020 Free Software Foundation, Inc.
+/* Copyright (C) 2008,2009,2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -57,10 +57,7 @@ static int multiplier[7] = { 1, 100000, 10000, 1000, 100, 10, 1 };
    Return 1 if value converted; 0 if invalid integer for either whole or
    fractional parts. */
 int
-uconvert(s, ip, up, ep)
-     char *s;
-     long *ip, *up;
-     char **ep;
+uconvert(char *s, long *ip, long *up, char **ep)
 {
   int n, mult;
   long ipart, upart;
index 03243918aa927b103da52dbf49099d15b2a5ff00..ebdae226d987be7f4e0071f66aa161ea8b375c91 100644 (file)
@@ -45,8 +45,7 @@ extern int errno;
 
 #if defined (HAVE_SETITIMER)
 unsigned int
-falarm(secs, usecs)
-     unsigned int secs, usecs;
+falarm(unsigned int secs, unsigned int usecs)
 {
   struct itimerval it, oit;
 
@@ -66,8 +65,7 @@ falarm(secs, usecs)
 }
 #else
 int
-falarm (secs, usecs)
-     unsigned int secs, usecs;
+falarm (unsigned int secs, unsigned int usecs)
 {
   if (secs == 0 && usecs == 0)
     return (alarm (0));
@@ -86,8 +84,7 @@ falarm (secs, usecs)
 
 #if defined (HAVE_TIMEVAL) && (defined (HAVE_SELECT) || defined (HAVE_PSELECT))
 int
-fsleep(sec, usec)
-     unsigned int sec, usec;
+fsleep(unsigned int sec, unsigned int usec)
 {
   int e, r;
   sigset_t blocked_sigs, prevmask;
@@ -131,8 +128,7 @@ fsleep(sec, usec)
 }
 #else /* !HAVE_TIMEVAL || !HAVE_SELECT */
 int
-fsleep(sec, usec)
-     long sec, usec;
+fsleep(unsigned int sec, unsigned int usec)
 {
   if (usec >= 500000)  /* round */
    sec++;
index d781353b6b4cda33448d2eb1febbdb690d1f8e4c..24d3d50d640a12f0f36b16f38e4cae64ccfbf0b0 100644 (file)
@@ -1,6 +1,6 @@
 /* unicode.c - functions to convert unicode characters */
 
-/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2020,2022 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 PARAMS((void));
+extern const char *locale_charset (void);
 #else
-extern char *get_locale_var PARAMS((char *));
+extern char *get_locale_var (char *);
 #endif
 
 extern int locale_utf8locale;
@@ -67,7 +67,7 @@ static iconv_t localconv;
 static char charsetbuf[40];
 
 static char *
-stub_charset ()
+stub_charset (void)
 {
   char *locale, *s, *t;
 
@@ -94,7 +94,7 @@ stub_charset ()
 #endif
 
 void
-u32reset ()
+u32reset (void)
 {
 #if defined (HAVE_ICONV)
   if (u32init && localconv != (iconv_t)-1)
@@ -109,9 +109,7 @@ u32reset ()
 
 /* u32toascii ? */
 int
-u32tochar (x, s)
-     unsigned long x;
-     char *s;
+u32tochar (unsigned long x, char *s)
 {
   int l;
 
@@ -136,9 +134,7 @@ u32tochar (x, s)
 }
 
 int
-u32tocesc (wc, s)
-     u_bits32_t wc;
-     char *s;
+u32tocesc (u_bits32_t wc, char *s)
 {
   int l;
 
@@ -151,9 +147,7 @@ u32tocesc (wc, s)
 
 /* Convert unsigned 32-bit int to utf-8 character string */
 int
-u32toutf8 (wc, s)
-     u_bits32_t wc;
-     char *s;
+u32toutf8 (u_bits32_t wc, char *s)
 {
   int l;
 
@@ -214,9 +208,7 @@ u32toutf8 (wc, s)
 /* Convert a 32-bit unsigned int (unicode) to a UTF-16 string.  Rarely used,
    only if sizeof(wchar_t) == 2. */
 int
-u32toutf16 (c, s)
-     u_bits32_t c;
-     wchar_t *s;
+u32toutf16 (u_bits32_t c, wchar_t *s)
 {
   int l;
 
@@ -240,9 +232,7 @@ u32toutf16 (c, s)
 /* convert a single unicode-32 character into a multibyte string and put the
    result in S, which must be large enough (at least max(10,MB_LEN_MAX) bytes) */
 int
-u32cconv (c, s)
-     unsigned long c;
-     char *s;
+u32cconv (unsigned long c, char *s)
 {
   wchar_t wc;
   wchar_t ws[3];
@@ -333,7 +323,7 @@ u32cconv (c, s)
 }
 #else
 void
-u32reset ()
+u32reset (void)
 {
 }
 #endif /* HANDLE_MULTIBYTE */
index fed252264b261ebc7e6cbc93d7ef608e4bc7a131..f762b8843e250eefb9a329c7f0256ce8233e0b1a 100644 (file)
@@ -1,6 +1,6 @@
 /* utf8.c - UTF-8 character handling functions */
 
-/* Copyright (C) 2018 Free Software Foundation, Inc.
+/* Copyright (C) 2018, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -33,24 +33,20 @@ extern int locale_utf8locale;
 #if defined (HANDLE_MULTIBYTE)
 
 char *
-utf8_mbschr (s, c)
-     const char *s;
-     int c;
+utf8_mbschr (const char *s, int c)
 {
   return strchr (s, c);                /* for now */
 }
 
 int
-utf8_mbscmp (s1, s2)
-     const char *s1, *s2;
+utf8_mbscmp (const char *s1, const char *s2)
 {
   /* Use the fact that the UTF-8 encoding preserves lexicographic order.  */
   return strcmp (s1, s2);
 }
 
 char *
-utf8_mbsmbchar (str)
-     const char *str;
+utf8_mbsmbchar (const char *str)
 {
   register char *s;
 
@@ -61,10 +57,7 @@ utf8_mbsmbchar (str)
 }
 
 int
-utf8_mbsnlen(src, srclen, maxlen)
-     const char *src;
-     size_t srclen;
-     int maxlen;
+utf8_mbsnlen(const char *src, size_t srclen, int maxlen)
 {
   register int sind, count;
 
@@ -78,9 +71,7 @@ utf8_mbsnlen(src, srclen, maxlen)
 
 /* Adapted from GNU gnulib. Handles UTF-8 characters up to 4 bytes long */
 int
-utf8_mblen (s, n)
-     const char *s;
-     size_t n;
+utf8_mblen (const char *s, size_t n)
 {
   unsigned char c, c1, c2, c3;
 
@@ -174,8 +165,7 @@ utf8_mblen (s, n)
 /* We can optimize this if we know the locale is UTF-8, but needs to handle
    malformed byte sequences. */
 size_t
-utf8_mbstrlen(s)
-     const char *s;
+utf8_mbstrlen (const char *s)
 {
   size_t clen, nc;
   int mb_cur_max;
index 567fba3849141cc418fc29d837706baa708c0429..b4c09e89d7068e973566f709acd7cce92436e285 100644 (file)
 #include <varargs.h>
 
 int
-vfprintf (iop, fmt, ap)
-     FILE *iop;
-     char *fmt;
-     va_list ap;
+vfprintf (FILE *iop, char *fmt, va_list ap)
 {
   int len;
   char localbuf[BUFSIZ];
@@ -68,9 +65,7 @@ vfprintf (iop, fmt, ap)
  * Ditto for vsprintf
  */
 int
-vsprintf (str, fmt, ap)
-     char *str, *fmt;
-     va_list ap;
+vsprintf (char *str, char *fmt, va_list ap)
 {
   FILE f;
   int len;
index 62a3c8641edb1de4d2950adc818de4aec7d33438..a7a6ac53dec0715960280f79712d197cbe3660b3 100644 (file)
@@ -1,6 +1,6 @@
 /* wcsdup.c - duplicate wide character string */
 
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -28,8 +28,7 @@
 #include <xmalloc.h>
 
 wchar_t *
-wcsdup (ws)
-     const wchar_t *ws;
+wcsdup (const wchar_t *ws)
 {
   wchar_t *ret;
   size_t len;
index 9c7e7cc5592ef4574180649b911f3a63e0d18f0c..12197bde67ef8d3b1f836334afb4204c50d5c458 100644 (file)
@@ -1,7 +1,7 @@
 /* wcsnwidth.c - compute display width of wide character string, up to max
                 specified width, return length. */
 
-/* Copyright (C) 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2012,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -31,9 +31,7 @@
    PWCS.  If the display width exceeds MAX, return the number of wide chars
    from PWCS required to display MAX characters on the screen. */
 int
-wcsnwidth(pwcs, n, max)
-     const wchar_t *pwcs;
-     size_t n, max;
+wcsnwidth(const wchar_t *pwcs, size_t n, size_t max)
 {
   wchar_t wc, *ws;
   int len, l;
index 1a30d9fc3eaf5659ec84f4250fbe1aeeaa76b9dd..2465e57516f17a6adaadbb2c6a205fb73b902f91 100644 (file)
@@ -1,6 +1,6 @@
 /* wcswidth.c - compute display width of wide character string */
 
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -27,9 +27,7 @@
 #include <bashansi.h>
 
 int
-wcswidth(pwcs, n)
-     const wchar_t *pwcs;
-     size_t n;
+wcswidth(const wchar_t *pwcs, size_t n)
 {
   wchar_t wc;
   int len, l;
index 846fcd58a3b1fe410b06386611b54f731f76b587..42461c8ff0ae94ee6465616f8119df17f92b6d6b 100644 (file)
@@ -1,6 +1,6 @@
 /* winsize.c - handle window size changes and information. */
 
-/* Copyright (C) 2005-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 /* Try to find the definitions of `struct winsize' and TIOGCWINSZ */
 
-#if 0
-#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
-#  include <sys/ioctl.h>
-#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
-#endif
-
 #if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
 #  include <termios.h>
 #endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
@@ -73,14 +67,12 @@ extern int shell_tty;
 extern int interactive_shell;
 extern int no_line_editing;
 extern int bash_readline_initialized;
-extern void rl_set_screen_size PARAMS((int, int));
+extern void rl_set_screen_size (int, int);
 #endif
-extern void sh_set_lines_and_columns PARAMS((int, int));
+extern void sh_set_lines_and_columns (int, int);
 
 void
-get_new_window_size (from_sig, rp, cp)
-     int from_sig;
-     int *rp, *cp;
+get_new_window_size (int from_sig, int *rp, int *cp)
 {
 #if defined (TIOCGWINSZ)
   struct winsize win;
index aa8199fdd206f12e2f9868c69936dcff550e1916..fe7b2a23b1f72e4f7084603b3cdbe70f5b5187a2 100644 (file)
@@ -1,6 +1,6 @@
 /* zcatfd - copy contents of file descriptor to another */
 
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -38,15 +38,13 @@ extern int errno;
 #  define ZBUFSIZ 4096
 #endif
 
-extern ssize_t zread PARAMS((int, char *, size_t));
-extern int zwrite PARAMS((int, char *, ssize_t));
+extern ssize_t zread (int, char *, size_t);
+extern int zwrite (int, char *, ssize_t);
 
 /* Dump contents of file descriptor FD to OFD.  FN is the filename for
    error messages (not used right now). */
 int
-zcatfd (fd, ofd, fn)
-     int fd, ofd;
-     char *fn;
+zcatfd (int fd, int ofd, char *fn)
 {
   ssize_t nr;
   int rval;
index 5e1ef724294f79793d4f7d0810355a649be057aa..fd33440c34fd58244807a27ff8050b482ce87fb5 100644 (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-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 extern int errno;
 #endif
 
-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 *));
+extern ssize_t zread (int, char *, size_t);
+extern ssize_t zreadc (int, char *);
+extern ssize_t zreadintr (int, char *, size_t);
+extern ssize_t zreadcintr (int, char *);
 
-typedef ssize_t breadfunc_t PARAMS((int, char *, size_t));
-typedef ssize_t creadfunc_t PARAMS((int, char *));
+typedef ssize_t breadfunc_t (int, char *, size_t);
+typedef ssize_t creadfunc_t (int, char *);
 
 /* Initial memory allocation for automatic growing buffer in zreadlinec */
 #define GET_LINE_INITIAL_ALLOCATION 16
@@ -61,12 +61,7 @@ typedef ssize_t creadfunc_t PARAMS((int, char *));
    Returns number of bytes read or -1 on error. */
 
 ssize_t
-zgetline (fd, lineptr, n, delim, unbuffered_read)
-     int fd;
-     char **lineptr;
-     size_t *n;
-     int delim;
-     int unbuffered_read;
+zgetline (int fd, char **lineptr, size_t *n, int delim, int unbuffered_read)
 {
   int retval;
   size_t nr;
index 9ff50a474d7b0f65e016f923d326086d1ed9b579..f577a1b39c1799512fc44fe3380de121031372eb 100644 (file)
@@ -1,6 +1,6 @@
 /* zmapfd - read contents of file descriptor into a newly-allocated buffer */
 
-/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2020,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -40,15 +40,12 @@ extern int errno;
 #  define ZBUFSIZ 4096
 #endif
 
-extern ssize_t zread PARAMS((int, char *, size_t));
+extern ssize_t zread (int, char *, size_t);
 
 /* Dump contents of file descriptor FD to *OSTR.  FN is the filename for
    error messages (not used right now). */
 int
-zmapfd (fd, ostr, fn)
-     int fd;
-     char **ostr;
-     char *fn;
+zmapfd (int fd, char **ostr, char *fn)
 {
   ssize_t nr;
   int rval;
index dafb7f60ab0ced1da03c2ba739777b57d0199dd1..acae1b5a3de8e6f3f4724462c4d9ab12a3cd22fb 100644 (file)
@@ -1,6 +1,6 @@
 /* zread - read data from file descriptor into buffer with retries */
 
-/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -51,10 +51,7 @@ extern int read_builtin_timeout (int);
 /* Read LEN bytes from FD into BUF.  Retry the read on EINTR.  Any other
    error causes the loop to break. */
 ssize_t
-zread (fd, buf, len)
-     int fd;
-     char *buf;
-     size_t len;
+zread (int fd, char *buf, size_t len)
 {
   ssize_t r;
 
@@ -87,10 +84,7 @@ zread (fd, buf, len)
 #define NUM_INTR 3
 
 ssize_t
-zreadretry (fd, buf, len)
-     int fd;
-     char *buf;
-     size_t len;
+zreadretry (int fd, char *buf, size_t len)
 {
   ssize_t r;
   int nintr;
@@ -112,10 +106,7 @@ zreadretry (fd, buf, len)
 
 /* Call read(2) and allow it to be interrupted.  Just a stub for now. */
 ssize_t
-zreadintr (fd, buf, len)
-     int fd;
-     char *buf;
-     size_t len;
+zreadintr (int fd, char *buf, size_t len)
 {
   check_signals ();
   return (read (fd, buf, len));
@@ -129,9 +120,7 @@ static char lbuf[ZBUFSIZ];
 static size_t lind, lused;
 
 ssize_t
-zreadc (fd, cp)
-     int fd;
-     char *cp;
+zreadc (int fd, char *cp)
 {
   ssize_t nr;
 
@@ -154,9 +143,7 @@ zreadc (fd, cp)
 /* Don't mix calls to zreadc and zreadcintr in the same function, since they
    use the same local buffer. */
 ssize_t
-zreadcintr (fd, cp)
-     int fd;
-     char *cp;
+zreadcintr (int fd, char *cp)
 {
   ssize_t nr;
 
@@ -179,10 +166,7 @@ zreadcintr (fd, cp)
 /* Like zreadc, but read a specified number of characters at a time.  Used
    for `read -N'. */
 ssize_t
-zreadn (fd, cp, len)
-     int fd;
-     char *cp;
-     size_t len;
+zreadn (int fd, char *cp, size_t len)
 {
   ssize_t nr;
 
@@ -205,7 +189,7 @@ zreadn (fd, cp, len)
 }
 
 void
-zreset ()
+zreset (void)
 {
   lind = lused = 0;
 }
@@ -213,8 +197,7 @@ zreset ()
 /* Sync the seek pointer for FD so that the kernel's idea of the last char
    read is the last char returned by zreadc. */
 void
-zsyncfd (fd)
-     int fd;
+zsyncfd (int fd)
 {
   off_t off, r;
 
index 3240f4f42264a471bd1f4c1ce6e92512e4541f53..54acc651eeaa5e3e5b1f7ae8458e29697d8e320b 100644 (file)
@@ -1,6 +1,6 @@
 /* zwrite - write contents of buffer to file descriptor, retrying on error */
 
-/* Copyright (C) 1999-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2002, 2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -36,10 +36,7 @@ extern int errno;
    it is interrupted.  We retry three times if we get a zero-length
    write.  Any other signal causes this function to return prematurely. */
 int
-zwrite (fd, buf, nb)
-     int fd;
-     char *buf;
-     size_t nb;
+zwrite (int fd, char *buf, size_t nb)
 {
   int n, i, nt;
 
diff --git a/list.c b/list.c
index 88835f58e517bcd1f510183048478278e020f76f..a470cf7f8246d54f9f5f32211c9c776f724e34b6 100644 (file)
--- a/list.c
+++ b/list.c
@@ -1,6 +1,6 @@
 /* list.c - Functions for manipulating linked lists of objects. */
 
-/* Copyright (C) 1996-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2009,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -35,9 +35,7 @@ GENERIC_LIST global_error_list;
 #ifdef INCLUDE_UNUSED
 /* Call FUNCTION on every member of LIST, a generic list. */
 void
-list_walk (list, function)
-     GENERIC_LIST *list;
-     sh_glist_func_t *function;
+list_walk (GENERIC_LIST *list, sh_glist_func_t *function)
 {
   for ( ; list; list = list->next)
     if ((*function) (list) < 0)
@@ -46,9 +44,7 @@ list_walk (list, function)
 
 /* Call FUNCTION on every string in WORDS. */
 void
-wlist_walk (words, function)
-     WORD_LIST *words;
-     sh_icpfunc_t *function;
+wlist_walk (WORD_LIST *words, sh_icpfunc_t *function)
 {
   for ( ; words; words = words->next)
     if ((*function) (words->word->word) < 0)
@@ -60,8 +56,7 @@ wlist_walk (words, function)
    of the chain.  You should always assign the output value of this
    function to something, or you will lose the chain. */
 GENERIC_LIST *
-list_reverse (list)
-     GENERIC_LIST *list;
+list_reverse (GENERIC_LIST *list)
 {
   register GENERIC_LIST *next, *prev;
 
@@ -77,8 +72,7 @@ list_reverse (list)
 
 /* Return the number of elements in LIST, a generic list. */
 int
-list_length (list)
-     GENERIC_LIST *list;
+list_length (GENERIC_LIST *list)
 {
   register int i;
 
@@ -88,8 +82,7 @@ list_length (list)
 
 /* Append TAIL to HEAD.  Return the header of the list. */
 GENERIC_LIST *
-list_append (head, tail)
-     GENERIC_LIST *head, *tail;
+list_append (GENERIC_LIST *head, GENERIC_LIST *tail)
 {
   register GENERIC_LIST *t_head;
 
@@ -113,10 +106,7 @@ list_append (head, tail)
    dispose_variable (elt);
 */
 GENERIC_LIST *
-list_remove (list, comparer, arg)
-     GENERIC_LIST **list;
-     Function *comparer;
-     char *arg;
+list_remove (GENERIC_LIST **list, sh_gcp_func_t *comparer, char *arg)
 {
   register GENERIC_LIST *prev, *temp;
 
index e930124c3a47871a620082c644b8ad5deae0e52b..a82da75830a2fdcfff119bd4aadd58422a13b855 100644 (file)
@@ -1,6 +1,6 @@
 /* mailcheck.h -- variables and function declarations for mail checking. */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #define _MAILCHECK_H_
 
 /* Functions from mailcheck.c */
-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));
+extern int time_to_check_mail (void);
+extern void reset_mail_timer (void);
+extern void reset_mail_files (void);
+extern void free_mail_files (void);
+extern char *make_default_mailpath (void);
+extern void remember_mail_dates (void);
+extern void init_mail_dates (void);
+extern void check_mail (void);
 
 #endif /* _MAILCHECK_H */
index bf1fb008df32aee951c3e73ea7f683d09b1b0d2d..a138133ead70107e7d55a413754b0d7a26fa6346 100644 (file)
@@ -1,6 +1,6 @@
 /* make_cmd.h -- Declarations of functions found in make_cmd.c */
 
-/* Copyright (C) 1993-2009,2020  Free Software Foundation, Inc.
+/* Copyright (C) 1993-2009,2020-2022  Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 extern int here_doc_first_line;
 
-extern void cmd_init PARAMS((void));
+extern void cmd_init (void);
 
-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_DESC *alloc_word_desc (void);
+extern WORD_DESC *make_bare_word (const char *);
+extern WORD_DESC *make_word_flags (WORD_DESC *, const char *);
+extern WORD_DESC *make_word (const char *);
+extern WORD_DESC *make_word_from_token (int);
 
-extern WORD_LIST *make_word_list PARAMS((WORD_DESC *, WORD_LIST *));
+extern WORD_LIST *make_word_list (WORD_DESC *, WORD_LIST *);
 
 #define add_string_to_list(s, l) make_word_list (make_word(s), (l))
 
-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 PARAMS((WORD_LIST *));
-
-extern COMMAND *make_select_command PARAMS((WORD_DESC *, WORD_LIST *, COMMAND *, int));
+extern COMMAND *make_command (enum command_type, SIMPLE_COM *);
+extern COMMAND *command_connect (COMMAND *, COMMAND *, int);
+extern COMMAND *make_for_command (WORD_DESC *, WORD_LIST *, COMMAND *, int);
+extern COMMAND *make_group_command (COMMAND *);
+extern COMMAND *make_case_command (WORD_DESC *, PATTERN_LIST *, int);
+extern PATTERN_LIST *make_pattern_list (WORD_LIST *, COMMAND *);
+extern COMMAND *make_if_command (COMMAND *, COMMAND *, COMMAND *);
+extern COMMAND *make_while_command (COMMAND *, COMMAND *);
+extern COMMAND *make_until_command (COMMAND *, COMMAND *);
+extern COMMAND *make_bare_simple_command (void);
+extern COMMAND *make_simple_command (ELEMENT, COMMAND *);
+extern void make_here_document (REDIRECT *, int);
+extern REDIRECT *make_redirection (REDIRECTEE, enum r_instruction, REDIRECTEE, int);
+extern COMMAND *make_function_def (WORD_DESC *, COMMAND *, int, int);
+extern COMMAND *clean_simple_command (COMMAND *);
+
+extern COMMAND *make_arith_command (WORD_LIST *);
+
+extern COMMAND *make_select_command (WORD_DESC *, WORD_LIST *, COMMAND *, int);
 
 #if defined (COND_COMMAND)
-extern COND_COM *make_cond_node PARAMS((int, WORD_DESC *, COND_COM *, COND_COM *));
-extern COMMAND *make_cond_command PARAMS((COND_COM *));
+extern COND_COM *make_cond_node (int, WORD_DESC *, COND_COM *, COND_COM *);
+extern COMMAND *make_cond_command (COND_COM *);
 #endif
 
-extern COMMAND *make_arith_for_command PARAMS((WORD_LIST *, COMMAND *, int));
+extern COMMAND *make_arith_for_command (WORD_LIST *, COMMAND *, int);
 
-extern COMMAND *make_subshell_command PARAMS((COMMAND *));
-extern COMMAND *make_coproc_command PARAMS((char *, COMMAND *));
+extern COMMAND *make_subshell_command (COMMAND *);
+extern COMMAND *make_coproc_command (char *, COMMAND *);
 
-extern COMMAND *connect_async_list PARAMS((COMMAND *, COMMAND *, int));
+extern COMMAND *connect_async_list (COMMAND *, COMMAND *, int);
 
 #endif /* !_MAKE_CMD_H */
index 03856866a34bfe2b084b7a319cbd1af2b7d02f58..effbe7c8ff30acac0f54f06bb5ca5ab164363b90 100644 (file)
@@ -2,7 +2,7 @@
  * mksyntax.c - construct shell syntax table for fast char attribute lookup.
  */
 
-/* Copyright (C) 2000-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2009,2012,2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -84,7 +84,7 @@ char  includes[] = "\
 #include \"syntax.h\"\n\n";
 
 static void
-usage()
+usage(void)
 {
   fprintf (stderr, "%s: usage: %s [-d] [-o filename]\n", progname, progname);
   exit (2);
@@ -92,8 +92,7 @@ usage()
 
 #ifdef INCLUDE_UNUSED
 static int
-getcflag (s)
-     char *s;
+getcflag (char *s)
 {
   int i;
 
@@ -105,8 +104,7 @@ getcflag (s)
 #endif
 
 static char *
-cdesc (i)
-     int i;
+cdesc (int i)
 {
   static char xbuf[16];
 
@@ -149,8 +147,7 @@ cdesc (i)
 }
 
 static char *
-getcstr (f)
-     int f;
+getcstr (int f)
 {
   int i;
 
@@ -161,9 +158,7 @@ getcstr (f)
 }
 
 static void
-addcstr (str, flag)
-     char *str;
-     int flag;
+addcstr (char *str, int flag)
 {
   char *s, *fstr;
   unsigned char uc;
@@ -183,9 +178,7 @@ addcstr (str, flag)
 }
 
 static void
-addcchar (c, flag)
-     unsigned char c;
-     int flag;
+addcchar (unsigned char c, int flag)
 {
   char *fstr;
 
@@ -198,7 +191,7 @@ addcchar (c, flag)
 }
 
 static void
-addblanks ()
+addblanks (void)
 {
   register int i;
   unsigned char uc;
@@ -215,7 +208,7 @@ addblanks ()
 
 /* load up the correct flag values in lsyntax */
 static void
-load_lsyntax ()
+load_lsyntax (void)
 {
   /* shell metacharacters */
   addcstr (shell_meta_chars, CSHMETA);
@@ -252,9 +245,7 @@ load_lsyntax ()
 }
 
 static void
-dump_lflags (fp, ind)
-     FILE *fp;
-     int ind;
+dump_lflags (FILE *fp, int ind)
 {
   int xflags, first, i;
 
@@ -278,9 +269,7 @@ dump_lflags (fp, ind)
 }
 
 static void
-wcomment (fp, i)
-     FILE *fp;
-     int i;
+wcomment (FILE *fp, int i)
 {
   fputs ("\t\t/* ", fp);
 
@@ -290,8 +279,7 @@ wcomment (fp, i)
 }
 
 static void
-dump_lsyntax (fp)
-     FILE *fp;
+dump_lsyntax (FILE *fp)
 {
   int i;
 
@@ -311,9 +299,7 @@ dump_lsyntax (fp)
 }
 
 int
-main(argc, argv)
-     int argc;
-     char **argv;
+main(int argc, char **argv)
 {
   int opt, i;
   char *filename;
@@ -395,8 +381,7 @@ main(argc, argv)
 #endif
 
 char *
-strerror (e)
-     int e;
+strerror (int e)
 {
   static char emsg[40];
 #if defined (HAVE_SYS_ERRLIST)
index b96f92af488a6f874f43e871b86ed2a7841da298..7bd2665ce40be567d3ae7905a5e1466002627194 100644 (file)
--- a/pathexp.h
+++ b/pathexp.h
@@ -1,6 +1,6 @@
 /* pathexp.h -- The shell interface to the globbing library. */
 
-/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -49,7 +49,7 @@ extern int extended_glob;
 extern int glob_star;
 extern int match_ignore_case;  /* doesn't really belong here */
 
-extern int unquoted_glob_pattern_p PARAMS((char *));
+extern int unquoted_glob_pattern_p (char *);
 
 /* PATHNAME can contain characters prefixed by CTLESC; this indicates
    that the character is to be quoted.  We quote it here in the style
@@ -61,15 +61,15 @@ extern int unquoted_glob_pattern_p PARAMS((char *));
    pattern while executing a case statement), flags should include
    QGLOB_CVTNULL.  If flags includes QGLOB_FILENAME, appropriate quoting
    to match a filename should be performed. */
-extern char *quote_string_for_globbing PARAMS((const char *, int));
+extern char *quote_string_for_globbing (const char *, int);
 
-extern int glob_char_p PARAMS((const char *));
-extern char *quote_globbing_chars PARAMS((const char *));
+extern int glob_char_p (const char *);
+extern char *quote_globbing_chars (const char *);
 
 /* Call the glob library to do globbing on PATHNAME. FLAGS is additional
    flags to pass to QUOTE_STRING_FOR_GLOBBING, mostly having to do with
    whether or not we've already performed quote removal. */
-extern char **shell_glob_filename PARAMS((const char *, int));
+extern char **shell_glob_filename (const char *, int);
 
 /* Filename completion ignore.  Used to implement the "fignore" facility of
    tcsh, GLOBIGNORE (like ksh-93 FIGNORE), and EXECIGNORE.
@@ -85,7 +85,7 @@ struct ign {
   int len, flags;
 };
 
-typedef int sh_iv_item_func_t PARAMS((struct ign *));
+typedef int sh_iv_item_func_t (struct ign *);
 
 struct ignorevar {
   char *varname;       /* FIGNORE, GLOBIGNORE, or EXECIGNORE */
@@ -95,10 +95,10 @@ struct ignorevar {
   sh_iv_item_func_t *item_func; /* Called when each item is parsed from $`varname' */
 };
 
-extern void setup_ignore_patterns PARAMS((struct ignorevar *));
+extern void setup_ignore_patterns (struct ignorevar *);
 
-extern void setup_glob_ignore PARAMS((char *));
-extern int should_ignore_glob_matches PARAMS((void));
-extern void ignore_glob_matches PARAMS((char **));
+extern void setup_glob_ignore (char *);
+extern int should_ignore_glob_matches (void);
+extern void ignore_glob_matches (char **);
 
 #endif
index 2a68e6a3f0c9c94071bb5574bceec957040190c5..945e9381b97441d28c395e8335bf9787c0f08445 100644 (file)
@@ -1,7 +1,7 @@
 /* pcomplete.h - structure definitions and other stuff for programmable
                 completion. */
 
-/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -87,7 +87,7 @@ typedef struct compspec {
    completions. */
 typedef struct _list_of_items {
   int flags;
-  int (*list_getter) PARAMS((struct _list_of_items *));        /* function to call to get the list */
+  int (*list_getter) (struct _list_of_items *);        /* function to call to get the list */
 
   STRINGLIST *slist;
 
@@ -147,31 +147,31 @@ extern COMPSPEC *pcomp_curcs;
 extern const char *pcomp_curcmd;
 
 /* Functions from pcomplib.c */
-extern COMPSPEC *compspec_create PARAMS((void));
-extern void compspec_dispose PARAMS((COMPSPEC *));
-extern COMPSPEC *compspec_copy PARAMS((COMPSPEC *));
+extern COMPSPEC *compspec_create (void);
+extern void compspec_dispose (COMPSPEC *);
+extern COMPSPEC *compspec_copy (COMPSPEC *);
 
-extern void progcomp_create PARAMS((void));
-extern void progcomp_flush PARAMS((void));
-extern void progcomp_dispose PARAMS((void));
+extern void progcomp_create (void);
+extern void progcomp_flush (void);
+extern void progcomp_dispose (void);
 
-extern int progcomp_size PARAMS((void));
+extern int progcomp_size (void);
 
-extern int progcomp_insert PARAMS((char *, COMPSPEC *));
-extern int progcomp_remove PARAMS((char *));
+extern int progcomp_insert (char *, COMPSPEC *);
+extern int progcomp_remove (char *);
 
-extern COMPSPEC *progcomp_search PARAMS((const char *));
+extern COMPSPEC *progcomp_search (const char *);
 
-extern void progcomp_walk PARAMS((hash_wfunc *));
+extern void progcomp_walk (hash_wfunc *);
 
 /* Functions from pcomplete.c */
-extern void set_itemlist_dirty PARAMS((ITEMLIST *));
+extern void set_itemlist_dirty (ITEMLIST *);
 
-extern STRINGLIST *completions_to_stringlist PARAMS((char **));
+extern STRINGLIST *completions_to_stringlist (char **);
 
-extern STRINGLIST *gen_compspec_completions PARAMS((COMPSPEC *, const char *, const char *, int, int, int *));
-extern char **programmable_completions PARAMS((const char *, const char *, int, int, int *));
+extern STRINGLIST *gen_compspec_completions (COMPSPEC *, const char *, const char *, int, int, int *);
+extern char **programmable_completions (const char *, const char *, int, int, int *);
 
-extern void pcomp_set_readline_variables PARAMS((int, int));
-extern void pcomp_set_compspec_options PARAMS((COMPSPEC *, int, int));
+extern void pcomp_set_readline_variables (int, int);
+extern void pcomp_set_compspec_options (COMPSPEC *, int, int);
 #endif /* _PCOMPLETE_H_ */
diff --git a/redir.h b/redir.h
index 340dc1c0218477129d3f825b0a6e5928614d88a7..f1378ccb39f0f9c57f2aa21a68c180d863c4b23c 100644 (file)
--- a/redir.h
+++ b/redir.h
@@ -1,6 +1,6 @@
 /* redir.h - functions from redir.c. */
 
-/* Copyright (C) 1997, 2001, 2005, 2008, 2009-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2005, 2008, 2009-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #define RX_SAVCLEXEC   0x20    /* set close-on-exec off in restored fd even though saved on has it on */
 #define RX_SAVEFD      0x40    /* fd used to save another even if < SHELL_FD_BASE */
 
-extern void redirection_error PARAMS((REDIRECT *, int, char *));
-extern int do_redirections PARAMS((REDIRECT *, int));
-extern char *redirection_expand PARAMS((WORD_DESC *));
-extern int stdin_redirects PARAMS((REDIRECT *));
+extern void redirection_error (REDIRECT *, int, char *);
+extern int do_redirections (REDIRECT *, int);
+extern char *redirection_expand (WORD_DESC *);
+extern int stdin_redirects (REDIRECT *);
 
 /* in builtins/evalstring.c for now, could move later */
-extern int open_redir_file PARAMS((REDIRECT *, char **));
+extern int open_redir_file (REDIRECT *, char **);
 
 #endif /* _REDIR_H_ */
diff --git a/shell.h b/shell.h
index 152350768773c8d3ad78db4e389b0d07378ac524..d56afae202ac85c694d7302cb226faf24b8c9f89 100644 (file)
--- a/shell.h
+++ b/shell.h
@@ -1,6 +1,6 @@
 /* shell.h -- The data structures used by the shell */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -229,13 +229,13 @@ typedef struct _sh_input_line_state_t
 } sh_input_line_state_t;
 
 /* Let's try declaring these here. */
-extern void shell_ungets PARAMS((char *));
-extern void rewind_input_string PARAMS((void));
+extern void shell_ungets (char *);
+extern void rewind_input_string (void);
 
-extern char *parser_remaining_input PARAMS((void));
+extern char *parser_remaining_input (void);
 
-extern sh_parser_state_t *save_parser_state PARAMS((sh_parser_state_t *));
-extern void restore_parser_state PARAMS((sh_parser_state_t *));
+extern sh_parser_state_t *save_parser_state (sh_parser_state_t *);
+extern void restore_parser_state (sh_parser_state_t *);
 
-extern sh_input_line_state_t *save_input_line_state PARAMS((sh_input_line_state_t *));
-extern void restore_input_line_state PARAMS((sh_input_line_state_t *));
+extern sh_input_line_state_t *save_input_line_state (sh_input_line_state_t *);
+extern void restore_input_line_state (sh_input_line_state_t *);
diff --git a/sig.h b/sig.h
index 0217be53d9adc89e7dd516bae6ee8f1d0b87d9c8..720e7969a23cf4e63cd805892d3e90e466306370 100644 (file)
--- a/sig.h
+++ b/sig.h
@@ -1,6 +1,6 @@
 /* sig.h -- header file for signal handler definitions. */
 
-/* Copyright (C) 1994-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -32,7 +32,7 @@
 #endif
 
 #define sighandler void
-typedef void SigHandler PARAMS((int));
+typedef void SigHandler (int);
 
 #define SIGRETURN(n)   return
 
@@ -42,7 +42,7 @@ typedef void SigHandler PARAMS((int));
 #if !defined (HAVE_POSIX_SIGNALS)
 #  define set_signal_handler(sig, handler) (SigHandler *)signal (sig, handler)
 #else
-extern SigHandler *set_signal_handler PARAMS((int, SigHandler *));     /* in sig.c */
+extern SigHandler *set_signal_handler (int, SigHandler *);     /* in sig.c */
 #endif /* _POSIX_VERSION */
 
 #if !defined (SIGCHLD) && defined (SIGCLD)
@@ -109,28 +109,28 @@ extern int interrupt_immediately; /* no longer used */
 extern int terminate_immediately;
 
 /* Functions from sig.c. */
-extern sighandler termsig_sighandler PARAMS((int));
-extern void termsig_handler PARAMS((int));
-extern sighandler sigint_sighandler PARAMS((int));
-extern void initialize_signals PARAMS((int));
-extern void initialize_terminating_signals PARAMS((void));
-extern void reset_terminating_signals PARAMS((void));
-extern void top_level_cleanup PARAMS((void));
-extern void throw_to_top_level PARAMS((void));
-extern void jump_to_top_level PARAMS((int)) __attribute__((__noreturn__));
-extern void restore_sigmask PARAMS((void));
-
-extern sighandler sigwinch_sighandler PARAMS((int));
-extern void set_sigwinch_handler PARAMS((void));
-extern void unset_sigwinch_handler PARAMS((void));
-
-extern sighandler sigterm_sighandler PARAMS((int));
+extern sighandler termsig_sighandler (int);
+extern void termsig_handler (int);
+extern sighandler sigint_sighandler (int);
+extern void initialize_signals (int);
+extern void initialize_terminating_signals (void);
+extern void reset_terminating_signals (void);
+extern void top_level_cleanup (void);
+extern void throw_to_top_level (void);
+extern void jump_to_top_level (int) __attribute__((__noreturn__));
+extern void restore_sigmask (void);
+
+extern sighandler sigwinch_sighandler (int);
+extern void set_sigwinch_handler (void);
+extern void unset_sigwinch_handler (void);
+
+extern sighandler sigterm_sighandler (int);
 
 /* Functions defined in trap.c. */
-extern SigHandler *set_sigint_handler PARAMS((void));
-extern SigHandler *trap_to_sighandler PARAMS((int));
-extern sighandler trap_handler PARAMS((int));
+extern SigHandler *set_sigint_handler (void);
+extern SigHandler *trap_to_sighandler (int);
+extern sighandler trap_handler (int);
 
-extern int block_trapped_signals PARAMS((sigset_t *, sigset_t *));
-extern int unblock_trapped_signals PARAMS((sigset_t *));
+extern int block_trapped_signals (sigset_t *, sigset_t *);
+extern int unblock_trapped_signals (sigset_t *);
 #endif /* _SIG_H_ */
index 321c20c461ecfb54e64b29c30a4f874bfb4855c8..6ac84efb48433661ee384d08759b34a4d1503cae 100644 (file)
--- a/siglist.h
+++ b/siglist.h
@@ -1,6 +1,6 @@
 /* siglist.h -- encapsulate various definitions for sys_siglist */
 
-/* Copyright (C) 1993, 2001, 2005, 2008-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 2001, 2005, 2008-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -38,7 +38,7 @@ extern char *sys_siglist[];
 #endif /* !strsignal && !HAVE_STRSIGNAL */
 
 #if !defined (strsignal) && !HAVE_DECL_STRSIGNAL
-extern char *strsignal PARAMS((int));
+extern char *strsignal (int);
 #endif
 
 #endif /* _SIGLIST_H */
diff --git a/subst.h b/subst.h
index 231b9e98f98a66602f0c57fc63b2127db3d00c4f..9c9194ea5dcbb3eb1be5c512e8a55b7d6ffbd947 100644 (file)
--- a/subst.h
+++ b/subst.h
@@ -1,6 +1,6 @@
 /* subst.h -- Names of externally visible functions in subst.c. */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 /* Remove backslashes which are quoting backquotes from STRING.  Modifies
    STRING, and returns a pointer to it. */
-extern char * de_backslash PARAMS((char *, int));
+extern char * de_backslash (char *, int);
 
 /* Replace instances of \! in a string with !. */
-extern void unquote_bang PARAMS((char *));
+extern void unquote_bang (char *);
 
 /* Extract the $( construct in STRING, and return a new string.
    Start extracting at (SINDEX) as if we had just seen "$(".
    Make (SINDEX) get the position just after the matching ")".
    XFLAGS is additional flags to pass to other extraction functions, */
-extern char *extract_command_subst PARAMS((char *, int *, int));
+extern char *extract_command_subst (char *, int *, int);
 
 /* Extract the $[ construct in STRING, and return a new string.
    Start extracting at (SINDEX) as if we had just seen "$[".
    Make (SINDEX) get the position just after the matching "]". */
-extern char *extract_arithmetic_subst PARAMS((char *, int *));
+extern char *extract_arithmetic_subst (char *, int *);
 
 #if defined (PROCESS_SUBSTITUTION)
 /* Extract the <( or >( construct in STRING, and return a new string.
    Start extracting at (SINDEX) as if we had just seen "<(".
    Make (SINDEX) get the position just after the matching ")". */
-extern char *extract_process_subst PARAMS((char *, char *, int *, int));
+extern char *extract_process_subst (char *, char *, int *, int);
 #endif /* PROCESS_SUBSTITUTION */
 
 /* Extract the name of the variable to bind to from the assignment string. */
-extern char *assignment_name PARAMS((char *));
+extern char *assignment_name (char *);
 
 /* Return a single string of all the words present in LIST, separating
    each word with SEP. */
-extern char *string_list_internal PARAMS((WORD_LIST *, char *));
+extern char *string_list_internal (WORD_LIST *, char *);
 
 /* Return a single string of all the words present in LIST, separating
    each word with a space. */
-extern char *string_list PARAMS((WORD_LIST *));
+extern char *string_list (WORD_LIST *);
 
 /* Turn $* into a single string, obeying POSIX rules. */
-extern char *string_list_dollar_star PARAMS((WORD_LIST *, int, int));
+extern char *string_list_dollar_star (WORD_LIST *, int, int);
 
 /* Expand $@ into a single string, obeying POSIX rules. */
-extern char *string_list_dollar_at PARAMS((WORD_LIST *, int, int));
+extern char *string_list_dollar_at (WORD_LIST *, int, int);
 
 /* Turn the positional parameters into a string, understanding quoting and
    the various subtleties of using the first character of $IFS as the
    separator.  Calls string_list_dollar_at, string_list_dollar_star, and
    string_list as appropriate. */
-extern char *string_list_pos_params PARAMS((int, WORD_LIST *, int, int));
+extern char *string_list_pos_params (int, WORD_LIST *, int, int);
 
 /* Perform quoted null character removal on each element of LIST.
    This modifies LIST. */
-extern void word_list_remove_quoted_nulls PARAMS((WORD_LIST *));
+extern void word_list_remove_quoted_nulls (WORD_LIST *);
 
 /* This performs word splitting and quoted null character removal on
    STRING. */
-extern WORD_LIST *list_string PARAMS((char *, char *, int));
+extern WORD_LIST *list_string (char *, char *, int);
 
-extern char *ifs_firstchar  PARAMS((int *));
-extern char *get_word_from_string PARAMS((char **, char *, char **));
-extern char *strip_trailing_ifs_whitespace PARAMS((char *, char *, int));
+extern char *ifs_firstchar  (int *);
+extern char *get_word_from_string (char **, char *, char **);
+extern char *strip_trailing_ifs_whitespace (char *, char *, int);
 
 /* Given STRING, an assignment string, get the value of the right side
    of the `=', and bind it to the left side.  If EXPAND is true, then
    perform tilde expansion, parameter expansion, command substitution,
    and arithmetic expansion on the right-hand side.  Do not perform word
    splitting on the result of expansion. */
-extern int do_assignment PARAMS((char *));
-extern int do_assignment_no_expand PARAMS((char *));
-extern int do_word_assignment PARAMS((WORD_DESC *, int));
+extern int do_assignment (char *);
+extern int do_assignment_no_expand (char *);
+extern int do_word_assignment (WORD_DESC *, int);
 
 /* Append SOURCE to TARGET at INDEX.  SIZE is the current amount
    of space allocated to TARGET.  SOURCE can be NULL, in which
    case nothing happens.  Gets rid of SOURCE by free ()ing it.
    Returns TARGET in case the location has changed. */
-extern char *sub_append_string PARAMS((char *, char *, size_t *, size_t *));
+extern char *sub_append_string (char *, char *, size_t *, size_t *);
 
 /* Append the textual representation of NUMBER to TARGET.
    INDEX and SIZE are as in SUB_APPEND_STRING. */
-extern char *sub_append_number PARAMS((intmax_t, char *, int *, int *));
+extern char *sub_append_number (intmax_t, char *, int *, int *);
 
 /* Return the word list that corresponds to `$*'. */
-extern WORD_LIST *list_rest_of_args PARAMS((void));
+extern WORD_LIST *list_rest_of_args (void);
 
 /* Make a single large string out of the dollar digit variables,
    and the rest_of_args.  If DOLLAR_STAR is 1, then obey the special
    case of "$*" with respect to IFS. */
-extern char *string_rest_of_args PARAMS((int));
+extern char *string_rest_of_args (int);
 
 /* Expand STRING by performing parameter expansion, command substitution,
    and arithmetic expansion.  Dequote the resulting WORD_LIST before
    returning it, but do not perform word splitting.  The call to
    remove_quoted_nulls () is made here because word splitting normally
    takes care of quote removal. */
-extern WORD_LIST *expand_string_unsplit PARAMS((char *, int));
+extern WORD_LIST *expand_string_unsplit (char *, int);
 
 /* Expand the rhs of an assignment statement. */
-extern WORD_LIST *expand_string_assignment PARAMS((char *, int));
+extern WORD_LIST *expand_string_assignment (char *, int);
 
 /* Expand a prompt string. */
-extern WORD_LIST *expand_prompt_string PARAMS((char *, int, int));
+extern WORD_LIST *expand_prompt_string (char *, int, int);
 
 /* Expand STRING just as if you were expanding a word.  This also returns
    a list of words.  Note that filename globbing is *NOT* done for word
    or string expansion, just when the shell is expanding a command.  This
    does parameter expansion, command substitution, arithmetic expansion,
    and word splitting.  Dequote the resultant WORD_LIST before returning. */
-extern WORD_LIST *expand_string PARAMS((char *, int));
+extern WORD_LIST *expand_string (char *, int);
 
 /* Convenience functions that expand strings to strings, taking care of
    converting the WORD_LIST * returned by the expand_string* functions
    to a string and deallocating the WORD_LIST *. */
-extern char *expand_string_to_string PARAMS((char *, int));
-extern char *expand_string_unsplit_to_string PARAMS((char *, int));
-extern char *expand_assignment_string_to_string PARAMS((char *, int));
-extern char *expand_subscript_string PARAMS((char *, int));
+extern char *expand_string_to_string (char *, int);
+extern char *expand_string_unsplit_to_string (char *, int);
+extern char *expand_assignment_string_to_string (char *, int);
+extern char *expand_subscript_string (char *, int);
 
 /* Expand an arithmetic expression string */
-extern char *expand_arith_string PARAMS((char *, int));
+extern char *expand_arith_string (char *, int);
 
 /* Expand $'...' and $"..." in a string for code paths that do not. */
-extern char *expand_string_dollar_quote PARAMS((char *, int));
+extern char *expand_string_dollar_quote (char *, int);
 
 /* De-quote quoted characters in STRING. */
-extern char *dequote_string PARAMS((char *));
+extern char *dequote_string (char *);
 
 /* De-quote CTLESC-escaped CTLESC or CTLNUL characters in STRING. */
-extern char *dequote_escapes PARAMS((const char *));
+extern char *dequote_escapes (const char *);
 
-extern WORD_DESC *dequote_word PARAMS((WORD_DESC *));
+extern WORD_DESC *dequote_word (WORD_DESC *);
 
 /* De-quote quoted characters in each word in LIST. */
-extern WORD_LIST *dequote_list PARAMS((WORD_LIST *));
+extern WORD_LIST *dequote_list (WORD_LIST *);
 
 /* Expand WORD, performing word splitting on the result.  This does
    parameter expansion, command substitution, arithmetic expansion,
    word splitting, and quote removal. */
-extern WORD_LIST *expand_word PARAMS((WORD_DESC *, int));
+extern WORD_LIST *expand_word (WORD_DESC *, int);
 
 /* Expand WORD, but do not perform word splitting on the result.  This
    does parameter expansion, command substitution, arithmetic expansion,
    and quote removal. */
-extern WORD_LIST *expand_word_unsplit PARAMS((WORD_DESC *, int));
-extern WORD_LIST *expand_word_leave_quoted PARAMS((WORD_DESC *, int));
+extern WORD_LIST *expand_word_unsplit (WORD_DESC *, int);
+extern WORD_LIST *expand_word_leave_quoted (WORD_DESC *, int);
 
 /* Return the value of a positional parameter.  This handles values > 10. */
-extern char *get_dollar_var_value PARAMS((intmax_t));
+extern char *get_dollar_var_value (intmax_t);
 
 /* Quote a string to protect it from word splitting. */
-extern char *quote_string PARAMS((char *));
+extern char *quote_string (char *);
 
 /* Quote escape characters (characters special to internals of expansion)
    in a string. */
-extern char *quote_escapes PARAMS((const char *));
+extern char *quote_escapes (const char *);
 
 /* And remove such quoted special characters. */
-extern char *remove_quoted_escapes PARAMS((char *));
+extern char *remove_quoted_escapes (char *);
 
 /* Remove CTLNUL characters from STRING unless they are quoted with CTLESC. */
-extern char *remove_quoted_nulls PARAMS((char *));
+extern char *remove_quoted_nulls (char *);
 
 /* Perform quote removal on STRING.  If QUOTED > 0, assume we are obeying the
    backslash quoting rules for within double quotes. */
-extern char *string_quote_removal PARAMS((char *, int));
+extern char *string_quote_removal (char *, int);
 
 /* Perform quote removal on word WORD.  This allocates and returns a new
    WORD_DESC *. */
-extern WORD_DESC *word_quote_removal PARAMS((WORD_DESC *, int));
+extern WORD_DESC *word_quote_removal (WORD_DESC *, int);
 
 /* Perform quote removal on all words in LIST.  If QUOTED is non-zero,
    the members of the list are treated as if they are surrounded by
    double quotes.  Return a new list, or NULL if LIST is NULL. */
-extern WORD_LIST *word_list_quote_removal PARAMS((WORD_LIST *, int));
+extern WORD_LIST *word_list_quote_removal (WORD_LIST *, int);
 
 /* Called when IFS is changed to maintain some private variables. */
-extern void setifs PARAMS((SHELL_VAR *));
+extern void setifs (SHELL_VAR *);
 
 /* Return the value of $IFS, or " \t\n" if IFS is unset. */
-extern char *getifs PARAMS((void));
+extern char *getifs (void);
 
 /* This splits a single word into a WORD LIST on $IFS, but only if the word
    is not quoted.  list_string () performs quote removal for us, even if we
    don't do any splitting. */
-extern WORD_LIST *word_split PARAMS((WORD_DESC *, char *));
+extern WORD_LIST *word_split (WORD_DESC *, char *);
 
 /* Take the list of words in LIST and do the various substitutions.  Return
    a new list of words which is the expanded list, and without things like
    variable assignments. */
-extern WORD_LIST *expand_words PARAMS((WORD_LIST *));
+extern WORD_LIST *expand_words (WORD_LIST *);
 
 /* Same as expand_words (), but doesn't hack variable or environment
    variables. */
-extern WORD_LIST *expand_words_no_vars PARAMS((WORD_LIST *));
+extern WORD_LIST *expand_words_no_vars (WORD_LIST *);
 
 /* Perform the `normal shell expansions' on a WORD_LIST.  These are
    brace expansion, tilde expansion, parameter and variable substitution,
    command substitution, arithmetic expansion, and word splitting. */
-extern WORD_LIST *expand_words_shellexp PARAMS((WORD_LIST *));
+extern WORD_LIST *expand_words_shellexp (WORD_LIST *);
 
-extern WORD_DESC *command_substitute PARAMS((char *, int, int));
-extern char *pat_subst PARAMS((char *, char *, char *, int));
+extern WORD_DESC *command_substitute (char *, int, int);
+extern char *pat_subst (char *, char *, char *, int);
 
 #if defined (PROCESS_SUBSTITUTION)
-extern int fifos_pending PARAMS((void));
-extern int num_fifos PARAMS((void));
-extern void unlink_fifo_list PARAMS((void));
-extern void unlink_all_fifos PARAMS((void));
-extern void unlink_fifo PARAMS((int));
+extern int fifos_pending (void);
+extern int num_fifos (void);
+extern void unlink_fifo_list (void);
+extern void unlink_all_fifos (void);
+extern void unlink_fifo (int);
 
-extern void *copy_fifo_list PARAMS((int *));
-extern void close_new_fifos PARAMS((void *, int));
+extern void *copy_fifo_list (int *);
+extern void close_new_fifos (void *, int);
 
-extern void clear_fifo_list PARAMS((void));
+extern void clear_fifo_list (void);
 
-extern int find_procsub_child PARAMS((pid_t));
-extern void set_procsub_status PARAMS((int, pid_t, int));
+extern int find_procsub_child (pid_t);
+extern void set_procsub_status (int, pid_t, int);
 
-extern void wait_procsubs PARAMS((void));
-extern void reap_procsubs PARAMS((void));
+extern void wait_procsubs (void);
+extern void reap_procsubs (void);
 #endif
 
-extern WORD_LIST *list_string_with_quotes PARAMS((char *));
+extern WORD_LIST *list_string_with_quotes (char *);
 
 #if defined (ARRAY_VARS)
-extern char *extract_array_assignment_list PARAMS((char *, int *));
+extern char *extract_array_assignment_list (char *, int *);
 #endif
 
 #if defined (COND_COMMAND)
-extern char *remove_backslashes PARAMS((char *));
-extern char *cond_expand_word PARAMS((WORD_DESC *, int));
+extern char *remove_backslashes (char *);
+extern char *cond_expand_word (WORD_DESC *, int);
 #endif
 
 /* Flags for skip_to_delim */
@@ -317,16 +317,16 @@ extern char *cond_expand_word PARAMS((WORD_DESC *, int));
 #define SD_ARITHEXP    0x400   /* skip_to_delim during arithmetic expansion */
 #define SD_NOERROR     0x800   /* don't print error messages */
 
-extern int skip_to_delim PARAMS((char *, int, char *, int));
+extern int skip_to_delim (char *, int, char *, int);
 
 #if defined (BANG_HISTORY)
-extern int skip_to_histexp PARAMS((char *, int, char *, int));
+extern int skip_to_histexp (char *, int, char *, int);
 #endif
 
 #if defined (READLINE)
-extern int char_is_quoted PARAMS((char *, int));
-extern int unclosed_pair PARAMS((char *, int, char *));
-extern WORD_LIST *split_at_delims PARAMS((char *, int, const char *, int, int, int *, int *));
+extern int char_is_quoted (char *, int);
+extern int unclosed_pair (char *, int, char *);
+extern WORD_LIST *split_at_delims (char *, int, const char *, int, int, int *, int *);
 #endif
 
 /* Variables used to keep track of the characters in IFS. */
@@ -357,6 +357,6 @@ extern pid_t last_command_subst_pid;
 /* Is the first character of STRING a quoted NULL character? */
 #define QUOTED_NULL(string) ((string)[0] == CTLNUL && (string)[1] == '\0')
 
-extern void invalidate_cached_quoted_dollar_at PARAMS((void));
+extern void invalidate_cached_quoted_dollar_at (void);
 
 #endif /* !_SUBST_H_ */
index ad02d46ea06bc16679608280c7b1eaefd173593e..63a634d084d3115144868dd84cf5a6845d2a567a 100644 (file)
@@ -1,6 +1,6 @@
 /* bashversion.c -- Display bash version information. */
 
-/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -47,8 +47,8 @@ extern char *optarg;
 extern char *dist_version;
 extern int patch_level;
 
-extern char *shell_version_string PARAMS((void));
-extern void show_shell_version PARAMS((int));
+extern char *shell_version_string (void);
+extern void show_shell_version (int);
 
 char *shell_name = "bash";
 char *progname;
index ba87ae8bca69e8ae3749df953de1ce51954fa976..0a48cee40cfaeffe028c6a889d745696cec3733f 100644 (file)
@@ -1,7 +1,7 @@
 /* mksignames.c -- Create and write `signames.h', which contains an array of
    signal names. */
 
-/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -57,7 +57,7 @@ write_signames (stream)
           "/* A translation list so we can be polite to our users. */\n");
 #if defined (CROSS_COMPILING)
   fprintf (stream, "extern char *signal_names[];\n\n");
-  fprintf (stream, "extern void initialize_signames PARAMS((void));\n\n");
+  fprintf (stream, "extern void initialize_signames (void);\n\n");
 #else
   fprintf (stream, "char *signal_names[NSIG + 4] = {\n");
 
index 5960a42555a12f860a3d0f296bba1464c3addbab..d61f59a2c51153f22d3ef1976d0b36d10b6d01f9 100644 (file)
@@ -5,7 +5,7 @@
 # in the makefile.  This creates a file named by the -o option,
 # otherwise everything is echoed to the standard output.
 
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2022 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
@@ -153,8 +153,8 @@ echo "#define SCCSVERSION \"@(#)Bash version ${sccs_string}\""
 # extern function declarations
 #echo
 #echo '/* Functions from version.c. */'
-#echo 'extern char *shell_version_string PARAMS((void));'
-#echo 'extern void show_shell_version PARAMS((int));'
+#echo 'extern char *shell_version_string (void);'
+#echo 'extern void show_shell_version (int);'
 
 if [ -n "$inc_build" ]; then
        # Make sure we can write to .build
diff --git a/test.h b/test.h
index ffd79e5e0dad10af36b29cd4b13e99a3f0116e53..2a8168926804e891e3d964b708388dce159f4360 100644 (file)
--- a/test.h
+++ b/test.h
@@ -1,6 +1,6 @@
 /* test.h -- external interface to the conditional command code. */
 
-/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #define TEST_LOCALE    0x04
 #define TEST_ARRAYEXP  0x08            /* array subscript expansion */
 
-extern int test_unop PARAMS((char *));
-extern int test_binop PARAMS((char *));
+extern int test_unop (char *);
+extern int test_binop (char *);
 
-extern int unary_test PARAMS((char *, char *, int));
-extern int binary_test PARAMS((char *, char *, char *, int));
+extern int unary_test (char *, char *, int);
+extern int binary_test (char *, char *, char *, int);
 
-extern int test_command PARAMS((int, char **));
+extern int test_command (int, char **);
 
 #endif /* _TEST_H_ */
diff --git a/trap.h b/trap.h
index b2ceca9fa05ecdba4e13c158a97e88f2c86ed049..3a0035f2c22e63f93f09cfa0951b42d4092a1979 100644 (file)
--- a/trap.h
+++ b/trap.h
@@ -1,6 +1,6 @@
 /* trap.h -- data structures used in the trap mechanism. */
 
-/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -68,63 +68,63 @@ extern int trap_saved_exit_value;
 extern int suppress_debug_trap_verbose;
 
 /* Externally-visible functions declared in trap.c. */
-extern void initialize_traps PARAMS((void));
-
-extern void run_pending_traps PARAMS((void));
-
-extern void queue_sigchld_trap PARAMS((int));
-extern void maybe_set_sigchld_trap PARAMS((char *));
-extern void set_impossible_sigchld_trap PARAMS((void));
-extern void set_sigchld_trap PARAMS((char *));
-
-extern void set_debug_trap PARAMS((char *));
-extern void set_error_trap PARAMS((char *));
-extern void set_return_trap PARAMS((char *));
-
-extern void maybe_set_debug_trap PARAMS((char *));
-extern void maybe_set_error_trap PARAMS((char *));
-extern void maybe_set_return_trap PARAMS((char *));
-
-extern void set_sigint_trap PARAMS((char *));
-extern void set_signal PARAMS((int, char *));
-
-extern void restore_default_signal PARAMS((int));
-extern void ignore_signal PARAMS((int));
-extern int run_exit_trap PARAMS((void));
-extern void run_trap_cleanup PARAMS((int));
-extern int run_debug_trap PARAMS((void));
-extern void run_error_trap PARAMS((void));
-extern void run_return_trap PARAMS((void));
-
-extern void free_trap_strings PARAMS((void));
-extern void reset_signal_handlers PARAMS((void));
-extern void restore_original_signals PARAMS((void));
-extern void restore_traps PARAMS((void));
-
-extern void get_original_signal PARAMS((int));
-extern void get_all_original_signals PARAMS((void));
-
-extern char *signal_name PARAMS((int));
-
-extern int decode_signal PARAMS((char *, int));
-extern void run_interrupt_trap PARAMS((int));
-extern int maybe_call_trap_handler PARAMS((int));
-extern int signal_is_special PARAMS((int));
-extern int signal_is_trapped PARAMS((int));
-extern int signal_is_pending PARAMS((int));
-extern int signal_is_ignored PARAMS((int));
-extern int signal_is_hard_ignored PARAMS((int));
-extern void set_signal_hard_ignored PARAMS((int));
-extern void set_signal_ignored PARAMS((int));
-extern int signal_in_progress PARAMS((int));
-
-extern void set_trap_state PARAMS((int));
-
-extern int next_pending_trap PARAMS((int));
-extern int first_pending_trap PARAMS((void));
-extern void clear_pending_traps PARAMS((void));
-extern int any_signals_trapped PARAMS((void));
-extern void check_signals PARAMS((void));
-extern void check_signals_and_traps PARAMS((void));
+extern void initialize_traps (void);
+
+extern void run_pending_traps (void);
+
+extern void queue_sigchld_trap (int);
+extern void maybe_set_sigchld_trap (char *);
+extern void set_impossible_sigchld_trap (void);
+extern void set_sigchld_trap (char *);
+
+extern void set_debug_trap (char *);
+extern void set_error_trap (char *);
+extern void set_return_trap (char *);
+
+extern void maybe_set_debug_trap (char *);
+extern void maybe_set_error_trap (char *);
+extern void maybe_set_return_trap (char *);
+
+extern void set_sigint_trap (char *);
+extern void set_signal (int, char *);
+
+extern void restore_default_signal (int);
+extern void ignore_signal (int);
+extern int run_exit_trap (void);
+extern void run_trap_cleanup (int);
+extern int run_debug_trap (void);
+extern void run_error_trap (void);
+extern void run_return_trap (void);
+
+extern void free_trap_strings (void);
+extern void reset_signal_handlers (void);
+extern void restore_original_signals (void);
+extern void restore_traps (void);
+
+extern void get_original_signal (int);
+extern void get_all_original_signals (void);
+
+extern char *signal_name (int);
+
+extern int decode_signal (char *, int);
+extern void run_interrupt_trap (int);
+extern int maybe_call_trap_handler (int);
+extern int signal_is_special (int);
+extern int signal_is_trapped (int);
+extern int signal_is_pending (int);
+extern int signal_is_ignored (int);
+extern int signal_is_hard_ignored (int);
+extern void set_signal_hard_ignored (int);
+extern void set_signal_ignored (int);
+extern int signal_in_progress (int);
+
+extern void set_trap_state (int);
+
+extern int next_pending_trap (int);
+extern int first_pending_trap (void);
+extern void clear_pending_traps (void);
+extern int any_signals_trapped (void);
+extern void check_signals (void);
+extern void check_signals_and_traps (void);
 
 #endif /* _TRAP_H_ */
index 97b3af90236b66fb757186041a0af7633ba6a9ca..a5dfeeeae3aefda0a1cf27ba54c91e5d20588a39 100644 (file)
 #if !defined (_UNWIND_PROT_H)
 #define _UNWIND_PROT_H
 
-extern void uwp_init PARAMS((void));
+extern void uwp_init (void);
 
 /* Run a function without interrupts. */
-extern void begin_unwind_frame PARAMS((char *));
-extern void discard_unwind_frame PARAMS((char *));
-extern void run_unwind_frame PARAMS((char *));
+extern void begin_unwind_frame (char *);
+extern void discard_unwind_frame (char *);
+extern void run_unwind_frame (char *);
 extern void add_unwind_protect (); /* Not portable to arbitrary C99 hosts.  */
-extern void remove_unwind_protect PARAMS((void));
-extern void run_unwind_protects PARAMS((void));
-extern void clear_unwind_protect_list PARAMS((int));
-extern int have_unwind_protects PARAMS((void));
-extern int unwind_protect_tag_on_stack PARAMS((const char *));
-extern void uwp_init PARAMS((void));
+extern void remove_unwind_protect (void);
+extern void run_unwind_protects (void);
+extern void clear_unwind_protect_list (int);
+extern int have_unwind_protects (void);
+extern int unwind_protect_tag_on_stack (const char *);
+extern void uwp_init (void);
 
 /* Define for people who like their code to look a certain way. */
 #define end_unwind_frame()
 
 /* How to protect a variable.  */
 #define unwind_protect_var(X) unwind_protect_mem ((char *)&(X), sizeof (X))
-extern void unwind_protect_mem PARAMS((char *, int));
+extern void unwind_protect_mem (char *, int);
 
 /* Backwards compatibility */
 #define unwind_protect_int     unwind_protect_var
index 55f497de062736a0d052d0706709115bed48b32b..38c8720f5b240aca0f0629328671d6a91a2e58c3 100644 (file)
@@ -61,8 +61,8 @@ typedef struct var_context {
 
 /* What a shell variable looks like. */
 
-typedef struct variable *sh_var_value_func_t PARAMS((struct variable *));
-typedef struct variable *sh_var_assign_func_t PARAMS((struct variable *, char *, arrayind_t, char *));
+typedef struct variable *sh_var_value_func_t (struct variable *);
+typedef struct variable *sh_var_assign_func_t (struct variable *, char *, arrayind_t, char *);
 
 /* For the future */
 union _value {
@@ -231,7 +231,7 @@ extern SHELL_VAR nameref_invalid_value;
 #define INVALID_NAMEREF_VALUE  (void *)&nameref_invalid_value
        
 /* Stuff for hacking variables. */
-typedef int sh_var_map_func_t PARAMS((SHELL_VAR *));
+typedef int sh_var_map_func_t (SHELL_VAR *);
 
 /* Where we keep the variables and functions */
 extern VAR_CONTEXT *global_variables;
@@ -255,208 +255,208 @@ extern pid_t dollar_dollar_pid;
 
 extern int localvar_inherit;           /* declared in variables.c */
 
-extern void initialize_shell_variables PARAMS((char **, int));
-
-extern int validate_inherited_value PARAMS((SHELL_VAR *, int));
-
-extern SHELL_VAR *set_if_not PARAMS((char *, char *));
-
-extern void sh_set_lines_and_columns PARAMS((int, int));
-extern void set_pwd PARAMS((void));
-extern void set_ppid PARAMS((void));
-extern void make_funcname_visible PARAMS((int));
-
-extern SHELL_VAR *var_lookup PARAMS((const char *, VAR_CONTEXT *));
-
-extern SHELL_VAR *find_function PARAMS((const char *));
-extern FUNCTION_DEF *find_function_def PARAMS((const char *));
-extern SHELL_VAR *find_variable PARAMS((const char *));
-extern SHELL_VAR *find_variable_noref PARAMS((const char *));
-extern SHELL_VAR *find_variable_last_nameref PARAMS((const char *, int));
-extern SHELL_VAR *find_global_variable_last_nameref PARAMS((const char *, int));
-extern SHELL_VAR *find_variable_nameref PARAMS((SHELL_VAR *));
-extern SHELL_VAR *find_variable_nameref_for_create PARAMS((const char *, int));
-extern SHELL_VAR *find_variable_nameref_for_assignment PARAMS((const char *, int));
-/*extern SHELL_VAR *find_variable_internal PARAMS((const char *, int));*/
-extern SHELL_VAR *find_variable_tempenv PARAMS((const char *));
-extern SHELL_VAR *find_variable_notempenv PARAMS((const char *));
-extern SHELL_VAR *find_global_variable PARAMS((const char *));
-extern SHELL_VAR *find_global_variable_noref PARAMS((const char *));
-extern SHELL_VAR *find_shell_variable PARAMS((const char *));
-extern SHELL_VAR *find_tempenv_variable PARAMS((const char *));
-extern SHELL_VAR *find_variable_no_invisible PARAMS((const char *));
-extern SHELL_VAR *find_variable_for_assignment PARAMS((const char *));
-extern char *nameref_transform_name PARAMS((char *, int));
-extern SHELL_VAR *copy_variable PARAMS((SHELL_VAR *));
-extern SHELL_VAR *make_local_variable PARAMS((const char *, int));
-extern SHELL_VAR *bind_variable PARAMS((const char *, char *, int));
-extern SHELL_VAR *bind_global_variable PARAMS((const char *, char *, int));
-extern SHELL_VAR *bind_function PARAMS((const char *, COMMAND *));
-
-extern void bind_function_def PARAMS((const char *, FUNCTION_DEF *, int));
-
-extern SHELL_VAR **map_over PARAMS((sh_var_map_func_t *, VAR_CONTEXT *));
-SHELL_VAR **map_over_funcs PARAMS((sh_var_map_func_t *));
+extern void initialize_shell_variables (char **, int);
+
+extern int validate_inherited_value (SHELL_VAR *, int);
+
+extern SHELL_VAR *set_if_not (char *, char *);
+
+extern void sh_set_lines_and_columns (int, int);
+extern void set_pwd (void);
+extern void set_ppid (void);
+extern void make_funcname_visible (int);
+
+extern SHELL_VAR *var_lookup (const char *, VAR_CONTEXT *);
+
+extern SHELL_VAR *find_function (const char *);
+extern FUNCTION_DEF *find_function_def (const char *);
+extern SHELL_VAR *find_variable (const char *);
+extern SHELL_VAR *find_variable_noref (const char *);
+extern SHELL_VAR *find_variable_last_nameref (const char *, int);
+extern SHELL_VAR *find_global_variable_last_nameref (const char *, int);
+extern SHELL_VAR *find_variable_nameref (SHELL_VAR *);
+extern SHELL_VAR *find_variable_nameref_for_create (const char *, int);
+extern SHELL_VAR *find_variable_nameref_for_assignment (const char *, int);
+/*extern SHELL_VAR *find_variable_internal (const char *, int);*/
+extern SHELL_VAR *find_variable_tempenv (const char *);
+extern SHELL_VAR *find_variable_notempenv (const char *);
+extern SHELL_VAR *find_global_variable (const char *);
+extern SHELL_VAR *find_global_variable_noref (const char *);
+extern SHELL_VAR *find_shell_variable (const char *);
+extern SHELL_VAR *find_tempenv_variable (const char *);
+extern SHELL_VAR *find_variable_no_invisible (const char *);
+extern SHELL_VAR *find_variable_for_assignment (const char *);
+extern char *nameref_transform_name (char *, int);
+extern SHELL_VAR *copy_variable (SHELL_VAR *);
+extern SHELL_VAR *make_local_variable (const char *, int);
+extern SHELL_VAR *bind_variable (const char *, char *, int);
+extern SHELL_VAR *bind_global_variable (const char *, char *, int);
+extern SHELL_VAR *bind_function (const char *, COMMAND *);
+
+extern void bind_function_def (const char *, FUNCTION_DEF *, int);
+
+extern SHELL_VAR **map_over (sh_var_map_func_t *, VAR_CONTEXT *);
+SHELL_VAR **map_over_funcs (sh_var_map_func_t *);
      
-extern SHELL_VAR **all_shell_variables PARAMS((void));
-extern SHELL_VAR **all_shell_functions PARAMS((void));
-extern SHELL_VAR **all_visible_variables PARAMS((void));
-extern SHELL_VAR **all_visible_functions PARAMS((void));
-extern SHELL_VAR **all_exported_variables PARAMS((void));
-extern SHELL_VAR **local_exported_variables PARAMS((void));
-extern SHELL_VAR **all_local_variables PARAMS((int));
+extern SHELL_VAR **all_shell_variables (void);
+extern SHELL_VAR **all_shell_functions (void);
+extern SHELL_VAR **all_visible_variables (void);
+extern SHELL_VAR **all_visible_functions (void);
+extern SHELL_VAR **all_exported_variables (void);
+extern SHELL_VAR **local_exported_variables (void);
+extern SHELL_VAR **all_local_variables (int);
 #if defined (ARRAY_VARS)
-extern SHELL_VAR **all_array_variables PARAMS((void));
+extern SHELL_VAR **all_array_variables (void);
 #endif
-extern char **all_variables_matching_prefix PARAMS((const char *));
-
-extern char **make_var_array PARAMS((HASH_TABLE *));
-extern char **add_or_supercede_exported_var PARAMS((char *, int));
-
-extern char *get_variable_value PARAMS((SHELL_VAR *));
-extern char *get_string_value PARAMS((const char *));
-extern char *sh_get_env_value PARAMS((const char *));
-extern char *make_variable_value PARAMS((SHELL_VAR *, char *, int));
-
-extern SHELL_VAR *bind_variable_value PARAMS((SHELL_VAR *, char *, int));
-extern SHELL_VAR *bind_int_variable PARAMS((char *, char *, int));
-extern SHELL_VAR *bind_var_to_int PARAMS((char *, intmax_t, int));
-
-extern int assign_in_env PARAMS((WORD_DESC *, int));
-
-extern int unbind_variable PARAMS((const char *));
-extern int check_unbind_variable PARAMS((const char *));
-extern int unbind_nameref PARAMS((const char *));
-extern int unbind_variable_noref PARAMS((const char *));
-extern int unbind_global_variable PARAMS((const char *));
-extern int unbind_global_variable_noref PARAMS((const char *));
-extern int unbind_func PARAMS((const char *));
-extern int unbind_function_def PARAMS((const char *));
-extern int delete_var PARAMS((const char *, VAR_CONTEXT *));
-extern int makunbound PARAMS((const char *, VAR_CONTEXT *));
-extern int kill_local_variable PARAMS((const char *));
-
-extern void delete_all_variables PARAMS((HASH_TABLE *));
-extern void delete_all_contexts PARAMS((VAR_CONTEXT *));
-extern void reset_local_contexts PARAMS((void));
-
-extern VAR_CONTEXT *new_var_context PARAMS((char *, int));
-extern void dispose_var_context PARAMS((VAR_CONTEXT *));
-extern VAR_CONTEXT *push_var_context PARAMS((char *, int, HASH_TABLE *));
-extern void pop_var_context PARAMS((void));
-extern VAR_CONTEXT *push_scope PARAMS((int, HASH_TABLE *));
-extern void pop_scope PARAMS((int));
-
-extern void clear_dollar_vars PARAMS((void));
-
-extern void push_context PARAMS((char *, int, HASH_TABLE *));
-extern void pop_context PARAMS((void));
-extern void push_dollar_vars PARAMS((void));
-extern void pop_dollar_vars PARAMS((void));
-extern void dispose_saved_dollar_vars PARAMS((void));
-
-extern void init_bash_argv PARAMS((void));
-extern void save_bash_argv PARAMS((void));
-extern void push_args PARAMS((WORD_LIST *));
-extern void pop_args PARAMS((void));
-
-extern void adjust_shell_level PARAMS((int));
-extern void non_unsettable PARAMS((char *));
-extern void dispose_variable PARAMS((SHELL_VAR *));
-extern void dispose_used_env_vars PARAMS((void));
-extern void dispose_function_env PARAMS((void));
-extern void dispose_builtin_env PARAMS((void));
-extern void merge_temporary_env PARAMS((void));
-extern void flush_temporary_env PARAMS((void));
-extern void merge_builtin_env PARAMS((void));
-extern void kill_all_local_variables PARAMS((void));
-
-extern void set_var_read_only PARAMS((char *));
-extern void set_func_read_only PARAMS((const char *));
-extern void set_var_auto_export PARAMS((char *));
-extern void set_func_auto_export PARAMS((const char *));
-
-extern void sort_variables PARAMS((SHELL_VAR **));
-
-extern int chkexport PARAMS((char *));
-extern void maybe_make_export_env PARAMS((void));
-extern void update_export_env_inplace PARAMS((char *, int, char *));
-extern void put_command_name_into_env PARAMS((char *));
-extern void put_gnu_argv_flags_into_env PARAMS((intmax_t, char *));
-
-extern void print_var_list PARAMS((SHELL_VAR **));
-extern void print_func_list PARAMS((SHELL_VAR **));
-extern void print_assignment PARAMS((SHELL_VAR *));
-extern void print_var_value PARAMS((SHELL_VAR *, int));
-extern void print_var_function PARAMS((SHELL_VAR *));
+extern char **all_variables_matching_prefix (const char *);
+
+extern char **make_var_array (HASH_TABLE *);
+extern char **add_or_supercede_exported_var (char *, int);
+
+extern char *get_variable_value (SHELL_VAR *);
+extern char *get_string_value (const char *);
+extern char *sh_get_env_value (const char *);
+extern char *make_variable_value (SHELL_VAR *, char *, int);
+
+extern SHELL_VAR *bind_variable_value (SHELL_VAR *, char *, int);
+extern SHELL_VAR *bind_int_variable (char *, char *, int);
+extern SHELL_VAR *bind_var_to_int (char *, intmax_t, int);
+
+extern int assign_in_env (WORD_DESC *, int);
+
+extern int unbind_variable (const char *);
+extern int check_unbind_variable (const char *);
+extern int unbind_nameref (const char *);
+extern int unbind_variable_noref (const char *);
+extern int unbind_global_variable (const char *);
+extern int unbind_global_variable_noref (const char *);
+extern int unbind_func (const char *);
+extern int unbind_function_def (const char *);
+extern int delete_var (const char *, VAR_CONTEXT *);
+extern int makunbound (const char *, VAR_CONTEXT *);
+extern int kill_local_variable (const char *);
+
+extern void delete_all_variables (HASH_TABLE *);
+extern void delete_all_contexts (VAR_CONTEXT *);
+extern void reset_local_contexts (void);
+
+extern VAR_CONTEXT *new_var_context (char *, int);
+extern void dispose_var_context (VAR_CONTEXT *);
+extern VAR_CONTEXT *push_var_context (char *, int, HASH_TABLE *);
+extern void pop_var_context (void);
+extern VAR_CONTEXT *push_scope (int, HASH_TABLE *);
+extern void pop_scope (int);
+
+extern void clear_dollar_vars (void);
+
+extern void push_context (char *, int, HASH_TABLE *);
+extern void pop_context (void);
+extern void push_dollar_vars (void);
+extern void pop_dollar_vars (void);
+extern void dispose_saved_dollar_vars (void);
+
+extern void init_bash_argv (void);
+extern void save_bash_argv (void);
+extern void push_args (WORD_LIST *);
+extern void pop_args (void);
+
+extern void adjust_shell_level (int);
+extern void non_unsettable (char *);
+extern void dispose_variable (SHELL_VAR *);
+extern void dispose_used_env_vars (void);
+extern void dispose_function_env (void);
+extern void dispose_builtin_env (void);
+extern void merge_temporary_env (void);
+extern void flush_temporary_env (void);
+extern void merge_builtin_env (void);
+extern void kill_all_local_variables (void);
+
+extern void set_var_read_only (char *);
+extern void set_func_read_only (const char *);
+extern void set_var_auto_export (char *);
+extern void set_func_auto_export (const char *);
+
+extern void sort_variables (SHELL_VAR **);
+
+extern int chkexport (char *);
+extern void maybe_make_export_env (void);
+extern void update_export_env_inplace (char *, int, char *);
+extern void put_command_name_into_env (char *);
+extern void put_gnu_argv_flags_into_env (intmax_t, char *);
+
+extern void print_var_list (SHELL_VAR **);
+extern void print_func_list (SHELL_VAR **);
+extern void print_assignment (SHELL_VAR *);
+extern void print_var_value (SHELL_VAR *, int);
+extern void print_var_function (SHELL_VAR *);
 
 #if defined (ARRAY_VARS)
-extern SHELL_VAR *make_new_array_variable PARAMS((char *));
-extern SHELL_VAR *make_local_array_variable PARAMS((char *, int));
+extern SHELL_VAR *make_new_array_variable (char *);
+extern SHELL_VAR *make_local_array_variable (char *, int);
 
-extern SHELL_VAR *make_new_assoc_variable PARAMS((char *));
-extern SHELL_VAR *make_local_assoc_variable PARAMS((char *, int));
+extern SHELL_VAR *make_new_assoc_variable (char *);
+extern SHELL_VAR *make_local_assoc_variable (char *, int);
 
-extern void set_pipestatus_array PARAMS((int *, int));
-extern ARRAY *save_pipestatus_array PARAMS((void));
-extern void restore_pipestatus_array PARAMS((ARRAY *));
+extern void set_pipestatus_array (int *, int);
+extern ARRAY *save_pipestatus_array (void);
+extern void restore_pipestatus_array (ARRAY *);
 #endif
 
-extern void set_pipestatus_from_exit PARAMS((int));
+extern void set_pipestatus_from_exit (int);
 
 /* The variable in NAME has just had its state changed.  Check to see if it
    is one of the special ones where something special happens. */
-extern void stupidly_hack_special_variables PARAMS((char *));
+extern void stupidly_hack_special_variables (char *);
 
 /* Reinitialize some special variables that have external effects upon unset
    when the shell reinitializes itself. */
-extern void reinit_special_variables PARAMS((void));
+extern void reinit_special_variables (void);
 
-extern int get_random_number PARAMS((void));
+extern int get_random_number (void);
 
 /* The `special variable' functions that get called when a particular
    variable is set. */
-extern void sv_ifs PARAMS((char *));
-extern void sv_path PARAMS((char *));
-extern void sv_mail PARAMS((char *));
-extern void sv_funcnest PARAMS((char *));
-extern void sv_execignore PARAMS((char *));
-extern void sv_globignore PARAMS((char *));
-extern void sv_ignoreeof PARAMS((char *));
-extern void sv_strict_posix PARAMS((char *));
-extern void sv_optind PARAMS((char *));
-extern void sv_opterr PARAMS((char *));
-extern void sv_locale PARAMS((char *));
-extern void sv_xtracefd PARAMS((char *));
-extern void sv_shcompat PARAMS((char *));
+extern void sv_ifs (char *);
+extern void sv_path (char *);
+extern void sv_mail (char *);
+extern void sv_funcnest (char *);
+extern void sv_execignore (char *);
+extern void sv_globignore (char *);
+extern void sv_ignoreeof (char *);
+extern void sv_strict_posix (char *);
+extern void sv_optind (char *);
+extern void sv_opterr (char *);
+extern void sv_locale (char *);
+extern void sv_xtracefd (char *);
+extern void sv_shcompat (char *);
 
 #if defined (READLINE)
-extern void sv_comp_wordbreaks PARAMS((char *));
-extern void sv_terminal PARAMS((char *));
-extern void sv_hostfile PARAMS((char *));
-extern void sv_winsize PARAMS((char *));
+extern void sv_comp_wordbreaks (char *);
+extern void sv_terminal (char *);
+extern void sv_hostfile (char *);
+extern void sv_winsize (char *);
 #endif
 
 #if defined (__CYGWIN__)
-extern void sv_home PARAMS((char *));
+extern void sv_home (char *);
 #endif
 
 #if defined (HISTORY)
-extern void sv_histsize PARAMS((char *));
-extern void sv_histignore PARAMS((char *));
-extern void sv_history_control PARAMS((char *));
+extern void sv_histsize (char *);
+extern void sv_histignore (char *);
+extern void sv_history_control (char *);
 #  if defined (BANG_HISTORY)
-extern void sv_histchars PARAMS((char *));
+extern void sv_histchars (char *);
 #  endif
-extern void sv_histtimefmt PARAMS((char *));
+extern void sv_histtimefmt (char *);
 #endif /* HISTORY */
 
 #if defined (HAVE_TZSET)
-extern void sv_tz PARAMS((char *));
+extern void sv_tz (char *);
 #endif
 
 #if defined (JOB_CONTROL)
-extern void sv_childmax PARAMS((char *));
+extern void sv_childmax (char *);
 #endif
 
 #endif /* !_VARIABLES_H_ */
index 94c85bd22248d263d2f760b1da55e98e6f54358c..5bb456acb299ffba449746d72e1049895c3fa08e 100644 (file)
--- a/version.c
+++ b/version.c
@@ -52,8 +52,8 @@ int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
 /* Functions for getting, setting, and displaying the shell version. */
 
 /* Forward declarations so we don't have to include externs.h */
-extern char *shell_version_string PARAMS((void));
-extern void show_shell_version PARAMS((int));
+extern char *shell_version_string (void);
+extern void show_shell_version (int);
 
 /* Give version information about this shell. */
 char *
index 94c85bd22248d263d2f760b1da55e98e6f54358c..5bb456acb299ffba449746d72e1049895c3fa08e 100644 (file)
@@ -52,8 +52,8 @@ int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
 /* Functions for getting, setting, and displaying the shell version. */
 
 /* Forward declarations so we don't have to include externs.h */
-extern char *shell_version_string PARAMS((void));
-extern void show_shell_version PARAMS((int));
+extern char *shell_version_string (void);
+extern void show_shell_version (int);
 
 /* Give version information about this shell. */
 char *
index 1b3b40887a886943cddb7a1daa23d281eca2a752..aee8a492bdb571aa6ad27491172d003bda9e6303 100644 (file)
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -74,7 +74,7 @@ do { \
 } while (0)
 
 static size_t
-findbrk ()
+findbrk (void)
 {
   FINDBRK();
   return (char *)sbrk (0) - (char *)lbreak;
@@ -84,9 +84,7 @@ findbrk ()
 #endif
 
 static void
-allocerr (func, bytes)
-     const char *func;
-     size_t bytes;
+allocerr (const char *func, size_t bytes)
 {
 #if HAVE_SBRK && defined (USING_BASH_MALLOC)
       allocated = findbrk ();
@@ -100,8 +98,7 @@ allocerr (func, bytes)
    to hold BYTES number of bytes.  If the memory cannot be allocated,
    print an error message and abort. */
 PTR_T
-xmalloc (bytes)
-     size_t bytes;
+xmalloc (size_t bytes)
 {
   PTR_T temp;
 
@@ -120,9 +117,7 @@ xmalloc (bytes)
 }
 
 PTR_T
-xrealloc (pointer, bytes)
-     PTR_T pointer;
-     size_t bytes;
+xrealloc (PTR_T pointer, size_t bytes)
 {
   PTR_T temp;
 
@@ -143,8 +138,7 @@ xrealloc (pointer, bytes)
 /* Use this as the function to call when adding unwind protects so we
    don't need to know what free() returns. */
 void
-xfree (string)
-     PTR_T string;
+xfree (PTR_T string)
 {
   if (string)
     free (string);
@@ -154,11 +148,7 @@ xfree (string)
 #include <malloc/shmalloc.h>
 
 static void
-sh_allocerr (func, bytes, file, line)
-     const char *func;
-     size_t bytes;
-     char *file;
-     int line;
+sh_allocerr (const char *func, size_t bytes, char *file, int line)
 {
 #if HAVE_SBRK
       allocated = findbrk ();
@@ -169,10 +159,7 @@ sh_allocerr (func, bytes, file, line)
 }
 
 PTR_T
-sh_xmalloc (bytes, file, line)
-     size_t bytes;
-     char *file;
-     int line;
+sh_xmalloc (size_t bytes, char *file, int line)
 {
   PTR_T temp;
 
@@ -191,11 +178,7 @@ sh_xmalloc (bytes, file, line)
 }
 
 PTR_T
-sh_xrealloc (pointer, bytes, file, line)
-     PTR_T pointer;
-     size_t bytes;
-     char *file;
-     int line;
+sh_xrealloc (PTR_T pointer, size_t bytes, char *file, int line)
 {
   PTR_T temp;
 
@@ -214,10 +197,7 @@ sh_xrealloc (pointer, bytes, file, line)
 }
 
 void
-sh_xfree (string, file, line)
-     PTR_T string;
-     char *file;
-     int line;
+sh_xfree (PTR_T string, char *file, int line)
 {
   if (string)
     sh_free (string, file, line);
index 55d2e3d048ab2b4a8bec2e2b0fd0dfe641a793b1..84edcc31a3e4d7ecfe410f6d905be9e627dcc6ef 100644 (file)
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,6 +1,6 @@
 /* xmalloc.h -- defines for the `x' memory allocation functions */
 
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #endif /* PTR_T */
 
 /* Allocation functions in xmalloc.c */
-extern PTR_T xmalloc PARAMS((size_t));
-extern PTR_T xrealloc PARAMS((void *, size_t));
-extern void xfree PARAMS((void *));
+extern PTR_T xmalloc (size_t);
+extern PTR_T xrealloc (void *, size_t);
+extern void xfree (void *);
 
 #if defined(USING_BASH_MALLOC) && !defined (DISABLE_MALLOC_WRAPPERS)
-extern PTR_T sh_xmalloc PARAMS((size_t, const char *, int));
-extern PTR_T sh_xrealloc PARAMS((void *, size_t, const char *, int));
-extern void sh_xfree PARAMS((void *, const char *, int));
+extern PTR_T sh_xmalloc (size_t, const char *, int);
+extern PTR_T sh_xrealloc (void *, size_t, const char *, int);
+extern void sh_xfree (void *, const char *, int);
 
 #define xmalloc(x)     sh_xmalloc((x), __FILE__, __LINE__)
 #define xrealloc(x, n) sh_xrealloc((x), (n), __FILE__, __LINE__)
@@ -54,7 +54,7 @@ extern void sh_xfree PARAMS((void *, const char *, int));
 #endif
 #define free(x)                sh_xfree((x), __FILE__, __LINE__)
 
-extern PTR_T sh_malloc PARAMS((size_t, const char *, int));
+extern PTR_T sh_malloc (size_t, const char *, int);
 
 #ifdef malloc
 #undef malloc