mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 03:10:50 +02:00
first set of ANSI C changes: remove PARAMS
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -47,15 +47,13 @@
|
||||
|
||||
#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;
|
||||
|
||||
+30
-30
@@ -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 *);
|
||||
|
||||
@@ -36,31 +36,31 @@
|
||||
|
||||
#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_ */
|
||||
|
||||
+20
-20
@@ -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 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 PARAMS((char *));
|
||||
extern void setup_history_ignore (char *);
|
||||
|
||||
extern char *last_history_line PARAMS((void));
|
||||
extern char *last_history_line (void);
|
||||
|
||||
#endif /* _BASHHIST_H_ */
|
||||
|
||||
+23
-23
@@ -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_ */
|
||||
|
||||
+7
-13
@@ -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.
|
||||
|
||||
@@ -41,12 +41,11 @@
|
||||
#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;
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+4
-4
@@ -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)
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+6
-6
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
+52
-107
@@ -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;
|
||||
|
||||
|
||||
+104
-104
@@ -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 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 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 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 PARAMS((void));
|
||||
extern void set_dollar_vars_unchanged PARAMS((void));
|
||||
extern void set_dollar_vars_changed PARAMS((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 PARAMS((WORD_LIST *, int, intmax_t *));
|
||||
extern int get_exitstat PARAMS((WORD_LIST *));
|
||||
extern int read_octal PARAMS((char *));
|
||||
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;
|
||||
|
||||
+14
-14
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+7
-7
@@ -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
|
||||
|
||||
+5
-14
@@ -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;
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+10
-10
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+8
-17
@@ -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;
|
||||
|
||||
+7
-7
@@ -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 */
|
||||
|
||||
@@ -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. */
|
||||
|
||||
+6
-6
@@ -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
|
||||
|
||||
+6
-6
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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.
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+10
-10
@@ -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",
|
||||
|
||||
+17
-17
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+3
-6
@@ -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;
|
||||
|
||||
+7
-7
@@ -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
|
||||
|
||||
+12
-12
@@ -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;
|
||||
|
||||
+10
-10
@@ -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";
|
||||
|
||||
+20
-20
@@ -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
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
-3
@@ -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:
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+12
-12
@@ -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. */
|
||||
|
||||
+2
-2
@@ -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. */
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
+34
-58
@@ -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.
|
||||
|
||||
@@ -32,29 +32,28 @@
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
+10
-19
@@ -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;
|
||||
|
||||
|
||||
+10
-10
@@ -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.
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
|
||||
#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_ */
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -24,54 +24,54 @@
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,13 +32,11 @@
|
||||
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;
|
||||
|
||||
@@ -32,13 +32,11 @@
|
||||
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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+11
-33
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -52,10 +52,7 @@
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -51,14 +51,19 @@
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
+12
-18
@@ -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;
|
||||
|
||||
+10
-31
@@ -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));
|
||||
}
|
||||
|
||||
+8
-10
@@ -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
|
||||
@@ -42,18 +42,19 @@
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,11 +32,7 @@
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+10
-18
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -26,15 +26,13 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+36
-36
@@ -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_ */
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -29,155 +29,157 @@
|
||||
/* 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 *));
|
||||
extern void xtrace_set (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_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 *));
|
||||
typedef int sh_strlist_map_func_t (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 *));
|
||||
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_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 PARAMS((WORD_LIST *, int, int, int *));
|
||||
extern WORD_LIST *strvec_to_word_list PARAMS((char **, int, 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_ */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user