commit bash-20080327 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:21:08 -05:00
parent d356441fc6
commit 6fbe76202c
38 changed files with 2713 additions and 126 deletions
+1448
View File
File diff suppressed because it is too large Load Diff
+52
View File
@@ -15430,3 +15430,55 @@ builtins/printf.def
lib/readline/doc/rltech.texi
- documented rest of readline's state flags, including RL_STATE_CALLBACK
- documented rl_save_state and rl_restore_state
3/27
----
lib/readline/{rlprivate.h,{display,readline,rltty,terminal,text}.c}
- rename readline_echoing_p to _rl_echoing_p for namespace consistency
lib/readline/{rlprivate.h,{callback,readline,util}.c}
- rename readline_top_level to _rl_top_level for namespace consistency
builtins/ulimit.def
- new -b (socket buffer size) and -T (number of threads) options
array.c
- fix bug in calculation of the array element assignment string length:
use length of `is' instead of `indstr'. Reported as ubuntu bug
#202885 by John McCabe-Dansted
builtins/setattr.def
- new function, show_all_var_attributes, displays attributes and
values for all shell variables (or shell functions) in a reusable
format
builtins/common.h
- new extern declaration for show_all_var_attributes
builtins/declare.def
- change `declare -p' to print out all variable attributes and values,
and `declare -fp' to print out all function attributes and
definitions. Inspired by request from John Love-Jensen
<eljay@adobe.com>
doc/{bash.1,bashref.texi}
- document new -b and -T options to ulimit
- tighten up language describing AND and OR lists
- add description of new behavior of `declare -p'
3/28
----
pcomplete.c
- rename curcs -> pcomp_curcs
- new global completion variable, pcomp_curcmd, the current command
name being completed
builtins/complete.def
- new builtin, compopt, allows completion options for command names
supplied as arguments or the current completion being executed to
be modified. Suggested by Mika Fischer <mf+ubuntu@zoopnet.de>
3/30
----
doc/{bash.1,bashref.texi},lib/readline/doc/rluser.texi
- document new compopt builtin
+56
View File
@@ -15426,3 +15426,59 @@ builtins/printf.def
to be written overflows the buffer, realloc the buffer and use
vsnprintf again. This should reduce the memory used by printf.
Idea from Yuya Katayama <yuya999@gmail.com>
lib/readline/doc/rltech.texi
- documented rest of readline's state flags, including RL_STATE_CALLBACK
- documented rl_save_state and rl_restore_state
3/27
----
lib/readline/{rlprivate.h,{display,readline,rltty,terminal,text}.c}
- rename readline_echoing_p to _rl_echoing_p for namespace consistency
lib/readline/{rlprivate.h,{callback,readline,util}.c}
- rename readline_top_level to _rl_top_level for namespace consistency
builtins/ulimit.def
- new -b (socket buffer size) and -T (number of threads) options
array.c
- fix bug in calculation of the array element assignment string length:
use length of `is' instead of `indstr'. Reported as ubuntu bug
#202885 by John McCabe-Dansted
builtins/setattr.def
- new function, show_all_var_attributes, displays attributes and
values for all shell variables (or shell functions) in a reusable
format
builtins/common.h
- new extern declaration for show_all_var_attributes
builtins/declare.def
- change `declare -p' to print out all variable attributes and values,
and `declare -fp' to print out all function attributes and
definitions. Inspired by request from John Love-Jensen
<eljay@adobe.com>
doc/{bash.1,bashref.texi}
- document new -b and -T options to ulimit
- tighten up language describing AND and OR lists
- add description of new behavior of `declare -p'
3/28
----
pcomplete.c
- rename curcs -> pcomp_curcs
- new global completion variable, pcomp_curcmd, the current command
name being completed
builtins/complete.def
- new builtin, compopt, allows completion options for command names
supplied as arguments or the current completion being executed to
be modified. Suggested by Mika Fischer <mf+ubuntu@zoopnet.de>
3/30
----
doc/{bash.1,bashref.texi}
- document new compopt builtin
+1 -1
View File
@@ -693,7 +693,7 @@ int quoted;
is = inttostr (element_index(ae), indstr, sizeof(indstr));
valstr = element_value (ae) ? sh_double_quote (element_value(ae))
: (char *)NULL;
elen = STRLEN (indstr) + 8 + STRLEN (valstr);
elen = STRLEN (is) + 8 + STRLEN (valstr);
RESIZE_MALLOCED_BUFFER (result, rlen, (elen + 1), rsize, rsize);
result[rlen++] = '[';
+26 -16
View File
@@ -329,7 +329,7 @@ int starsub, quoted;
ARRAY *a2;
ARRAY_ELEMENT *h, *p;
arrayind_t i;
char *ifs, sep[2], *t;
char *ifs, *sep, *t;
p = a ? array_head (a) : 0;
if (p == 0 || array_empty (a) || start > array_max_index(a))
@@ -354,20 +354,31 @@ int starsub, quoted;
a2 = array_slice(a, h, p);
if (mflags & MATCH_QUOTED)
array_quote (a2);
if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))
array_quote(a2);
else
array_quote_escapes (a2);
array_quote_escapes(a2);
if (starsub && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) {
ifs = getifs();
sep[0] = ifs ? *ifs : '\0';
} else
/* ${array[*]} */
sep = ifs_firstchar ((int *)NULL);
} else if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) {
/* ${array[@]} */
sep = ifs_firstchar ((int *)NULL);
ifs = getifs ();
if (ifs == 0 || *ifs == 0) {
sep[0] = ' ';
sep[1] = '\0';
}
} else {
sep = xmalloc (2);
sep[0] = ' ';
sep[1] = '\0';
sep[1] = '\0';
}
t = array_to_string (a2, sep, 0);
array_dispose(a2);
free (sep);
return t;
}
@@ -380,7 +391,7 @@ int mflags;
{
ARRAY *a2;
ARRAY_ELEMENT *e;
char *t, *ifs, sifs[2];
char *t, *sifs;
if (a == 0 || array_head(a) == 0 || array_empty(a))
return ((char *)NULL);
@@ -393,14 +404,13 @@ int mflags;
}
if (mflags & MATCH_QUOTED)
array_quote (a2);
array_quote(a2);
else
array_quote_escapes (a2);
array_quote_escapes(a2);
if (mflags & MATCH_STARSUB) {
ifs = getifs();
sifs[0] = ifs ? *ifs : '\0';
sifs[1] = '\0';
sifs = ifs_firstchar((int *)NULL);
t = array_to_string (a2, sifs, 0);
free(sifs);
} else
t = array_to_string (a2, " ", 0);
array_dispose (a2);
@@ -618,8 +628,8 @@ ARRAY *a;
}
/*
* Return a string that is the concatenation of all the elements in A,
* separated by SEP.
* Return a string that is the concatenation of the elements in A from START
* to END, separated by SEP.
*/
static char *
array_to_string_internal (start, end, sep, quoted)
+1
View File
@@ -142,6 +142,7 @@ extern int describe_command __P((char *, int));
/* Functions from setattr.def */
extern int set_or_show_attributes __P((WORD_LIST *, int, int));
extern int show_all_var_attributes __P((int, int));
extern int show_var_attributes __P((SHELL_VAR *, int, int));
extern int show_name_attributes __P((char *, int));
extern void set_var_attribute __P((char *, int, int));
+164
View File
@@ -0,0 +1,164 @@
/* common.h -- extern declarations for functions defined in common.c. */
/* Copyright (C) 1993-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
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 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (__COMMON_H)
# define __COMMON_H
#include "stdc.h"
#define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c)
/* Flag values for parse_and_execute () */
#define SEVAL_NONINT 0x001
#define SEVAL_INTERACT 0x002
#define SEVAL_NOHIST 0x004
#define SEVAL_NOFREE 0x008
#define SEVAL_RESETLINE 0x010
/* Flags for describe_command, shared between type.def and command.def */
#define CDESC_ALL 0x001 /* type -a */
#define CDESC_SHORTDESC 0x002 /* command -V */
#define CDESC_REUSABLE 0x004 /* command -v */
#define CDESC_TYPE 0x008 /* type -t */
#define CDESC_PATH_ONLY 0x010 /* type -p */
#define CDESC_FORCE_PATH 0x020 /* type -ap or type -P */
#define CDESC_NOFUNCS 0x040 /* type -f */
#define CDESC_ABSPATH 0x080 /* convert to absolute path, no ./ */
/* Flags for get_job_by_name */
#define JM_PREFIX 0x01 /* prefix of job name */
#define JM_SUBSTRING 0x02 /* substring of job name */
#define JM_EXACT 0x04 /* match job name exactly */
#define JM_STOPPED 0x08 /* match stopped jobs only */
#define JM_FIRSTMATCH 0x10 /* return first matching job */
/* Flags for remember_args and value of changed_dollar_vars */
#define ARGS_NONE 0x0
#define ARGS_INVOC 0x01
#define ARGS_FUNC 0x02
#define ARGS_SETBLTIN 0x04
/* Functions from common.c */
extern void builtin_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
extern void builtin_usage __P((void));
extern void no_args __P((WORD_LIST *));
extern int no_options __P((WORD_LIST *));
/* common error message functions */
extern void sh_needarg __P((char *));
extern void sh_neednumarg __P((char *));
extern void sh_notfound __P((char *));
extern void sh_invalidopt __P((char *));
extern void sh_invalidoptname __P((char *));
extern void sh_invalidid __P((char *));
extern void sh_invalidnum __P((char *));
extern void sh_invalidsig __P((char *));
extern void sh_erange __P((char *, char *));
extern void sh_badpid __P((char *));
extern void sh_badjob __P((char *));
extern void sh_readonly __P((const char *));
extern void sh_nojobs __P((char *));
extern void sh_restricted __P((char *));
extern void sh_notbuiltin __P((char *));
extern void sh_wrerror __P((void));
extern int sh_chkwrite __P((int));
extern char **make_builtin_argv __P((WORD_LIST *, int *));
extern void remember_args __P((WORD_LIST *, int));
extern int dollar_vars_changed __P((void));
extern void set_dollar_vars_unchanged __P((void));
extern void set_dollar_vars_changed __P((void));
extern intmax_t get_numeric_arg __P((WORD_LIST *, int));
extern int get_exitstat __P((WORD_LIST *));
extern int read_octal __P((char *));
/* Keeps track of the current working directory. */
extern char *the_current_working_directory;
extern char *get_working_directory __P((char *));
extern void set_working_directory __P((char *));
#if defined (JOB_CONTROL)
extern int get_job_by_name __P((const char *, int));
extern int get_job_spec __P((WORD_LIST *));
#endif
extern int display_signal_list __P((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 __P((char *, int));
extern sh_builtin_func_t *find_shell_builtin __P((char *));
extern sh_builtin_func_t *builtin_address __P((char *));
extern sh_builtin_func_t *find_special_builtin __P((char *));
extern void initialize_shell_builtins __P((void));
/* Functions from exit.def */
extern void bash_logout __P((void));
/* Functions from getopts.def */
extern void getopts_reset __P((int));
/* Functions from set.def */
extern int minus_o_option_value __P((char *));
extern void list_minus_o_opts __P((int, int));
extern char **get_minus_o_opts __P((void));
extern int set_minus_o_option __P((int, char *));
extern void set_shellopts __P((void));
extern void parse_shellopts __P((char *));
extern void initialize_shell_options __P((int));
extern void reset_shell_options __P((void));
/* Functions from shopt.def */
extern void reset_shopt_options __P((void));
extern char **get_shopt_options __P((void));
extern int shopt_setopt __P((char *, int));
extern int shopt_listopt __P((char *, int));
extern int set_login_shell __P((int));
/* Functions from type.def */
extern int describe_command __P((char *, int));
/* Functions from setattr.def */
extern int set_or_show_attributes __P((WORD_LIST *, int, int));
extern int show_var_attributes __P((SHELL_VAR *, int, int));
extern int show_name_attributes __P((char *, int));
extern void set_var_attribute __P((char *, int, int));
/* Functions from pushd.def */
extern char *get_dirstack_from_string __P((char *));
extern char *get_dirstack_element __P((intmax_t, int));
extern void set_dirstack_element __P((intmax_t, int, char *));
extern WORD_LIST *get_directory_stack __P((int));
/* Functions from evalstring.c */
extern int parse_and_execute __P((char *, const char *, int));
extern void parse_and_execute_cleanup __P((void));
/* Functions from evalfile.c */
extern int maybe_execute_file __P((const char *, int));
extern int source_file __P((const char *, int));
extern int fc_execute_file __P((const char *));
#endif /* !__COMMON_H */
+161 -9
View File
@@ -1,5 +1,5 @@
This file is complete.def, from which is created complete.c.
It implements the builtins "complete" and "compgen" in Bash.
It implements the builtins "complete", "compgen", and "compopt" in Bash.
Copyright (C) 1999-2008 Free Software Foundation, Inc.
@@ -25,9 +25,11 @@ $BUILTIN complete
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION complete_builtin
$SHORT_DOC complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
For each NAME, specify how arguments are to be completed by Readline.
If no options are supplied, existing completion specifications are printed
in a way that allows them to be reused as input.
Specify how arguments are to be completed by Readline.
For each NAME, specify how arguments are to be completed. If no options
are supplied, existing completion specifications are printed in a way that
allows them to be reused as input.
Options:
-p print existing completion specifications in a reusable format
@@ -72,6 +74,7 @@ static int remove_cmd_completions __P((WORD_LIST *));
static int print_one_completion __P((char *, COMPSPEC *));
static int print_compitem __P((BUCKET_CONTENTS *));
static void print_compopts __P((const char *, COMPSPEC *, int));
static void print_all_completions __P((void));
static int print_cmd_completions __P((WORD_LIST *));
@@ -425,6 +428,14 @@ remove_cmd_completions (list)
printf ("-o %s ", f); \
} while (0)
#define XPRINTCOMPOPT(a, f) \
do { \
if (copts & a) \
printf ("-o %s ", f); \
else \
printf ("+o %s ", f); \
} while (0)
static int
print_one_completion (cmd, cs)
char *cmd;
@@ -489,11 +500,44 @@ print_one_completion (cmd, cs)
/* simple arguments that don't require quoting */
PRINTARG (cs->funcname, "-F");
printf ("%s\n", x);
printf ("%s\n", cmd);
return (0);
}
static void
print_compopts (cmd, cs, full)
const char *cmd;
COMPSPEC *cs;
int full;
{
int copts;
printf ("compopt ");
copts = cs->options;
if (full)
{
XPRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
XPRINTCOMPOPT (COPT_DEFAULT, "default");
XPRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
XPRINTCOMPOPT (COPT_FILENAMES, "filenames");
XPRINTCOMPOPT (COPT_NOSPACE, "nospace");
XPRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
}
else
{
PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
PRINTCOMPOPT (COPT_DEFAULT, "default");
PRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
PRINTCOMPOPT (COPT_FILENAMES, "filenames");
PRINTCOMPOPT (COPT_NOSPACE, "nospace");
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
}
printf ("%s\n", cmd);
}
static int
print_compitem (item)
BUCKET_CONTENTS *item;
@@ -540,10 +584,11 @@ $BUILTIN compgen
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION compgen_builtin
$SHORT_DOC compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]
Display the possible completions depending on the options. Intended
to be used from within a shell function generating possible completions.
If the optional WORD argument is supplied, matches against WORD are
generated.
Display the possible completions depending on the options.
Intended to be used from within a shell function generating possible
completions. If the optional WORD argument is supplied, matches against
WORD are generated.
$END
int
@@ -628,3 +673,110 @@ compgen_builtin (list)
compspec_dispose (cs);
return (rval);
}
$BUILTIN compopt
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION compopt_builtin
$SHORT_DOC compopt [-o|+o option] [name ...]
Modify or display completion options.
Modify the completion options for each NAME, or, if no NAMEs are supplied,
the completion currently begin executed. If no OPTIONs are givenm, print
the completion options for each NAME or the current completion specification.
Options:
-o option Set completion option OPTION for each NAME
Using `+o' instead of `-o' turns off the specified option.
Arguments:
Each NAME refers to a command for which a completion specification must
have previously been defined using the `complete' builtin. If no NAMEs
are supplied, compopt must be called by a function currently generating
completions, and the options for that currently-executing completion
generator are modified.
$END
int
compopt_builtin (list)
WORD_LIST *list;
{
int opts_on, opts_off, *opts, opt, oind, ret;
WORD_LIST *l;
COMPSPEC *cs;
opts_on = opts_off = 0;
ret = EXECUTION_SUCCESS;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "+o:")) != EOF)
{
opts = (list_opttype == '-') ? &opts_on : &opts_off;
switch (opt)
{
case 'o':
oind = find_compopt (list_optarg);
if (oind < 0)
{
sh_invalidoptname (list_optarg);
return (EX_USAGE);
}
*opts |= compopts[oind].optflag;
break;
default:
builtin_usage ();
return (EX_USAGE);
}
}
list = loptend;
if (list == 0)
{
if (RL_ISSTATE (RL_STATE_COMPLETING) == 0 || pcomp_curcs == 0)
{
builtin_error (_("not currently executing completion function"));
return (EXECUTION_FAILURE);
}
cs = pcomp_curcs;
if (opts_on == 0 && opts_off == 0)
{
print_compopts (pcomp_curcmd, cs, 1);
return (sh_chkwrite (ret));
}
/* Set the compspec options */
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
/* And change the readline variables the options control */
pcomp_set_readline_variables (opts_on, 1);
pcomp_set_readline_variables (opts_off, 0);
return (ret);
}
for (l = list; l; l = l->next)
{
cs = progcomp_search (l->word->word);
if (cs == 0)
{
builtin_error (_("%s: no completion specification"), l->word->word);
ret = EXECUTION_FAILURE;
continue;
}
if (opts_on == 0 && opts_off == 0)
{
print_compopts (l->word->word, cs, 1);
continue; /* XXX -- fill in later */
}
/* Set the compspec options */
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
}
return (ret);
}
+154 -5
View File
@@ -1,5 +1,5 @@
This file is complete.def, from which is created complete.c.
It implements the builtins "complete" and "compgen" in Bash.
It implements the builtins "complete", "compgen", and "compopt" in Bash.
Copyright (C) 1999-2008 Free Software Foundation, Inc.
@@ -25,14 +25,15 @@ $BUILTIN complete
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION complete_builtin
$SHORT_DOC complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
For each NAME, specify how arguments are to be completed by Readline.
Specify how arguments are to be completed by Readline.
If no options are supplied, existing completion specifications are printed
in a way that allows them to be reused as input.
Options:
-p print existing completion specifications in a reusable format
-r remove a completion specification for each NAME, or, if no NAMEs
are supplied, all completion specifications
-r remove a completion specification for each NAME, or, if no
NAMEs are supplied, all completion specifications
When completion is attempted, the actions are applied in the order the
uppercase-letter options are listed above.
@@ -72,6 +73,7 @@ static int remove_cmd_completions __P((WORD_LIST *));
static int print_one_completion __P((char *, COMPSPEC *));
static int print_compitem __P((BUCKET_CONTENTS *));
static void print_compopts __P((const char *, COMPSPEC *, int));
static void print_all_completions __P((void));
static int print_cmd_completions __P((WORD_LIST *));
@@ -425,6 +427,14 @@ remove_cmd_completions (list)
printf ("-o %s ", f); \
} while (0)
#define XPRINTCOMPOPT(a, f) \
do { \
if (copts & a) \
printf ("-o %s ", f); \
else \
printf ("+o %s ", f); \
} while (0)
static int
print_one_completion (cmd, cs)
char *cmd;
@@ -489,11 +499,44 @@ print_one_completion (cmd, cs)
/* simple arguments that don't require quoting */
PRINTARG (cs->funcname, "-F");
printf ("%s\n", x);
printf ("%s\n", cmd);
return (0);
}
static void
print_compopts (cmd, cs, full)
const char *cmd;
COMPSPEC *cs;
int full;
{
int copts;
printf ("compopt ");
copts = cs->options;
if (full)
{
XPRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
XPRINTCOMPOPT (COPT_DEFAULT, "default");
XPRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
XPRINTCOMPOPT (COPT_FILENAMES, "filenames");
XPRINTCOMPOPT (COPT_NOSPACE, "nospace");
XPRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
}
else
{
PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
PRINTCOMPOPT (COPT_DEFAULT, "default");
PRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
PRINTCOMPOPT (COPT_FILENAMES, "filenames");
PRINTCOMPOPT (COPT_NOSPACE, "nospace");
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
}
printf ("%s\n", cmd);
}
static int
print_compitem (item)
BUCKET_CONTENTS *item;
@@ -628,3 +671,109 @@ compgen_builtin (list)
compspec_dispose (cs);
return (rval);
}
$BUILTIN compopt
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION compopt_builtin
$SHORT_DOC compopt [-o|+o option] [name ...]
Modify or display completion options.
Modify the completion options for each NAME, or, if no NAMEs are supplied,
the completion currently begin executed.
Options:
-o option Set completion option OPTION for each NAME
Using `+o' instead of `-o' turns off the specified option.
Arguments:
Each NAME refers to a command for which a completion specification must
have previously been defined using the `complete' builtin. If no NAMEs
are supplied, compopt must be called by a function currently generating
completions, and the options for that currently-executing completion
generator are modified.
$END
int
compopt_builtin (list)
WORD_LIST *list;
{
int opts_on, opts_off, *opts, opt, oind, ret;
WORD_LIST *l;
COMPSPEC *cs;
opts_on = opts_off = 0;
ret = EXECUTION_SUCCESS;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "+o:")) != EOF)
{
opts = (list_opttype == '-') ? &opts_on : &opts_off;
switch (opt)
{
case 'o':
oind = find_compopt (list_optarg);
if (oind < 0)
{
sh_invalidoptname (list_optarg);
return (EX_USAGE);
}
*opts |= compopts[oind].optflag;
break;
default:
builtin_usage ();
return (EX_USAGE);
}
}
list = loptend;
if (list == 0)
{
if (RL_ISSTATE (RL_STATE_COMPLETING) == 0 || pcomp_curcs == 0)
{
builtin_error (_("not currently executing completion function"));
return (EXECUTION_FAILURE);
}
cs = pcomp_curcs;
if (opts_on == 0 && opts_off == 0)
{
print_compopts (pcomp_curcmd, cs, 1);
return (sh_chkwrite (ret));
}
/* Set the compspec options */
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
/* And change the readline variables the options control */
pcomp_set_readline_variables (opts_on, 1);
pcomp_set_readline_variables (opts_off, 0);
return (ret);
}
for (l = list; l; l = l->next)
{
cs = progcomp_search (l->word->word);
if (cs == 0)
{
builtin_error (_("%s: no completion specification"), l->word->word);
ret = EXECUTION_FAILURE;
continue;
}
if (opts_on == 0 && opts_off == 0)
{
print_compopts (l->word->word, cs, 1);
continue; /* XXX -- fill in later */
}
/* Set the compspec options */
pcomp_set_compspec_options (cs, opts_on, 1);
pcomp_set_compspec_options (cs, opts_off, 0);
}
return (ret);
}
+2
View File
@@ -192,6 +192,8 @@ declare_internal (list, local_var)
free (vlist);
}
}
else if (pflag && (flags_on == 0 || flags_on == att_function))
show_all_var_attributes (flags_on == 0, nodefs);
else if (flags_on == 0)
return (set_builtin ((WORD_LIST *)NULL));
else
+4 -2
View File
@@ -28,14 +28,12 @@ Declare variables and give them attributes. If no NAMEs are given,
display the attributes and values of all variables.
Options:
-f restrict action or display to function names and definitions
-F restrict display to function names only (plus line number and
source file when debugging)
-p display the attributes and value of each NAME
Options which set attributes:
-a to make NAMEs arrays (if supported)
-i to make NAMEs have the `integer' attribute
-r to make NAMEs readonly
@@ -194,6 +192,10 @@ declare_internal (list, local_var)
free (vlist);
}
}
else if (pflag && (flags_on == 0 || flags_on == att_function))
{
show_all_var_attributes (flags_on == 0, nodefs);
}
else if (flags_on == 0)
return (set_builtin ((WORD_LIST *)NULL));
else
+24
View File
@@ -288,6 +288,30 @@ set_or_show_attributes (list, attribute, nodefs)
: EXECUTION_FAILURE));
}
/* Show all variable variables (v == 1) or functions (v == 0) with
attributes. */
int
show_all_var_attributes (v, nodefs)
int v, nodefs;
{
SHELL_VAR **variable_list, *var;
int any_failed;
register int i;
variable_list = v ? all_shell_variables () : all_shell_functions ();
if (variable_list == 0)
return (EXECUTION_SUCCESS);
for (i = any_failed = 0; var = variable_list[i]; i++)
{
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
if (any_failed = sh_chkwrite (any_failed))
break;
}
free (variable_list);
return (any_failed == 0 ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
/* Show the attributes for shell variable VAR. If NODEFS is non-zero,
don't show function definitions along with the name. If PATTR is
non-zero, it indicates we're being called from `export' or `readonly'.
+24 -2
View File
@@ -57,7 +57,6 @@ Marks each NAME for automatic export to the environment of subsequently
executed commands. If VALUE is supplied, assign VALUE before exporting.
Options:
-f refer to shell functions
-n remove the export property from each NAME
-p display a list of all exported variables and functions
@@ -85,7 +84,6 @@ changed by subsequent assignment. If VALUE is supplied, assign VALUE
before marking as read-only.
Options:
-a refer to array variables
-f refer to shell functions
-p display a list of all readonly variables and functions
@@ -290,6 +288,30 @@ set_or_show_attributes (list, attribute, nodefs)
: EXECUTION_FAILURE));
}
/* Show all variable variables (v == 1) or functions (v == 0) with
attributes. */
int
show_all_var_attributes (v, nodefs)
int v, nodefs;
{
SHELL_VAR **variable_list;
int any_failed;
register int i;
variable_list = v ? all_shell_variables () : all_shell_functions ();
if (variable_list == 0)
return (EXECUTION_SUCCESS);
for (i = any_failed = 0; var = variable_list[i]; i++)
{
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
if (any_failed = sh_chkwrite (any_failed))
break;
}
free (variable_list);
return (any_failed == 0 ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
/* Show the attributes for shell variable VAR. If NODEFS is non-zero,
don't show function definitions along with the name. If PATTR is
non-zero, it indicates we're being called from `export' or `readonly'.
+7 -1
View File
@@ -32,6 +32,7 @@ Options:
-S use the `soft' resource limit
-H use the `hard' resource limit
-a all current limits are reported
-b the socket buffer size
-c the maximum size of core files created
-d the maximum size of a process's data segment
-e the maximum scheduling priority (`nice')
@@ -199,12 +200,17 @@ typedef struct {
} RESOURCE_LIMITS;
static RESOURCE_LIMITS limits[] = {
#ifdef RLIMIT_PTHREAD
{ 'T', RLIMIT_PTHREAD, 1, "number of threads", (char *)NULL },
#endif
#ifdef RLIMIT_SBSIZE
{ 'b', RLIMIT_SBSIZE, 1, "socket buffer size", "bytes" },
#endif
#ifdef RLIMIT_CORE
{ 'c', RLIMIT_CORE, 512, "core file size", "blocks" },
#endif
#ifdef RLIMIT_DATA
{ 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" },
#endif
#ifdef RLIMIT_NICE
{ 'e', RLIMIT_NICE, 1, "scheduling priority", (char *)NULL },
+5 -4
View File
@@ -53,9 +53,11 @@ If LIMIT is given, it is the new value of the specified resource; the
special LIMIT values `soft', `hard', and `unlimited' stand for the
current soft limit, the current hard limit, and no limit, respectively.
Otherwise, the current value of the specified resource is printed. If
no option is given, then -f is assumed. Values are in 1024-byte
increments, except for -t, which is in seconds, -p, which is in increments
of 512 bytes, and -u, which is an unscaled number of processes.
no option is given, then -f is assumed.
Values are in 1024-byte increments, except for -t, which is in seconds,
-p, which is in increments of 512 bytes, and -u, which is an unscaled
number of processes.
$END
#if !defined (_MINIX)
@@ -202,7 +204,6 @@ static RESOURCE_LIMITS limits[] = {
#endif
#ifdef RLIMIT_DATA
{ 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" },
#endif
#ifdef RLIMIT_NICE
{ 'e', RLIMIT_NICE, 1, "scheduling priority", (char *)NULL },
+39 -11
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Fri Feb 22 21:45:32 EST 2008
.\" Last Change: Thu Mar 27 22:15:12 EDT 2008
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2008 February 22" "GNU Bash-3.2"
.TH BASH 1 "2008 March 27" "GNU Bash-3.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -594,11 +594,9 @@ are executed sequentially; the shell waits for each
command to terminate in turn. The return status is the
exit status of the last command executed.
.PP
The control operators
.B &&
and
.B \(bv\(bv
denote AND lists and OR lists, respectively.
AND and OR lists are sequences of one of more pipelines separated by the
\fB&&\fP and \fB\(bv\(bv\fP control operators, respectively.
AND and OR lists are executed with left associativity.
An AND list has the form
.RS
.PP
@@ -620,7 +618,8 @@ An OR list has the form
.I command2
is executed if and only if
.I command1
returns a non-zero exit status. The return status of
returns a non-zero exit status.
The return status of
AND and OR lists is the exit status of the last command
executed in the list.
.SS Compound Commands
@@ -6495,6 +6494,19 @@ a \fIname\fP for which no specification exists, or
an error occurs adding a completion specification.
.RE
.TP
\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP]
Modify completion options for each \fIname\fP according to the
\fIoption\fPs, or for the
currently-execution completion if no \fIname\fPs are supplied.
If no \fIoption\fPs are given, display the completion options for each
\fIname\fP or the current completion.
The possible values of \fIoption\fP are those valid for the \fBcomplete\fP
builtin described above.
.PP
The return value is true unless an invalid option is supplied, an attempt
is made to modify the options for a \fIname\fP for which no completion
specification exists, or an output error occurs.
.TP
\fBcontinue\fP [\fIn\fP]
Resume the next iteration of the enclosing
.BR for ,
@@ -6528,7 +6540,15 @@ option will display the attributes and values of each
.IR name .
When
.B \-p
is used, additional options are ignored.
is used with \fIname\fP arguments, additional options are ignored.
When
.B \-p
is supplied without \fIname\fP arguments, it will display the attributes
and values of all variables having the attributes specified by the
additional options.
If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display
the attributes and values of all shell variables. The \fB\-f\fP option
will restrict the display to shell functions.
The
.B \-F
option inhibits the display of function definitions; only the
@@ -8609,7 +8629,7 @@ option suppresses shell function lookup, as with the \fBcommand\fP builtin.
returns true if any of the arguments are found, false if
none are found.
.TP
\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\fP [\fIlimit\fP]]
\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]]
Provides control over the resources available to the shell and to
processes started by it, on systems that allow such control.
The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
@@ -8640,6 +8660,9 @@ Other options are interpreted as follows:
.B \-a
All current limits are reported
.TP
.B \-b
The maximum socket buffer size
.TP
.B \-c
The maximum size of core files created
.TP
@@ -8688,6 +8711,9 @@ The maximum amount of virtual memory available to the shell
.TP
.B \-x
The maximum number of file locks
.TP
.B \-T
The maximum number of threads
.PD
.PP
If
@@ -8703,7 +8729,9 @@ which is in seconds,
.BR \-p ,
which is in units of 512-byte blocks,
and
.B \-n
.BR \-T ,
.BR \-b ,
.BR \-n ,
and
.BR \-u ,
which are unscaled values.
+53 -19
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Wed Dec 5 22:08:48 EST 2007
.\" Last Change: Thu Mar 27 22:15:12 EDT 2008
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2007 December 5" "GNU Bash-3.2"
.TH BASH 1 "2008 March 27" "GNU Bash-3.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -50,8 +50,8 @@ bash \- GNU Bourne-Again SHell
[options]
[file]
.SH COPYRIGHT
.if n Bash is Copyright (C) 1989-2007 by the Free Software Foundation, Inc.
.if t Bash is Copyright \(co 1989-2007 by the Free Software Foundation, Inc.
.if n Bash is Copyright (C) 1989-2008 by the Free Software Foundation, Inc.
.if t Bash is Copyright \(co 1989-2008 by the Free Software Foundation, Inc.
.SH DESCRIPTION
.B Bash
is an \fBsh\fR-compatible command language interpreter that
@@ -594,11 +594,9 @@ are executed sequentially; the shell waits for each
command to terminate in turn. The return status is the
exit status of the last command executed.
.PP
The control operators
.B &&
and
.B \(bv\(bv
denote AND lists and OR lists, respectively.
AND and OR lists are sequences of one of more pipelines separated by the
\fB&&\fP and \fB\(bv\(bv\fP control operators, respectively.
AND and OR lists are executed with left associativity.
An AND list has the form
.RS
.PP
@@ -620,7 +618,8 @@ An OR list has the form
.I command2
is executed if and only if
.I command1
returns a non-zero exit status. The return status of
returns a non-zero exit status.
The return status of
AND and OR lists is the exit status of the last command
executed in the list.
.SS Compound Commands
@@ -1188,7 +1187,7 @@ expand to nothing (i.e., they are removed).
Expands to the number of positional parameters in decimal.
.TP
.B ?
Expands to the status of the most recently executed foreground
Expands to the exit status of the most recently executed foreground
pipeline.
.TP
.B \-
@@ -1249,13 +1248,13 @@ Expands to the full file name used to invoke this instance of
.BR bash .
.TP
.B BASHPID
Expands to the process id of the current bash process.
Expands to the process id of the current \fBbash\fP process.
This differs from \fB$$\fP under certain circumstances, such as subshells
that do not require bash to be re-initialized.
that do not require \fBbash\fP to be re-initialized.
.TP
.B BASH_ARGC
An array variable whose values are the number of parameters in each
frame of the current bash execution call stack.
frame of the current \fBbash\fP execution call stack.
The number of
parameters to the current subroutine (shell function or script executed
with \fB.\fP or \fBsource\fP) is at the top of the stack.
@@ -1269,7 +1268,7 @@ option to the
builtin below)
.TP
.B BASH_ARGV
An array variable containing all of the parameters in the current bash
An array variable containing all of the parameters in the current \fBbash\fP
execution call stack. The final parameter of the last subroutine call
is at the top of the stack; the first parameter of the initial call is
at the bottom. When a subroutine is executed, the parameters supplied
@@ -6495,6 +6494,19 @@ a \fIname\fP for which no specification exists, or
an error occurs adding a completion specification.
.RE
.TP
\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP]
Modify completion options for each \fIname\fP according to the
\fIoption\fPs, or for the
currently-execution completion if no \fIname\fPs are supplied. If no
\fIoption\fPs are given, display the completion options for each \fIname\fP
or the current completion.
The possible values of \fIoption\fP are those valid for the \fBcomplete\fP
builtin described above.
.PP
The return value is true unless an invalid option is supplied, an attempt
is made to modify the options for a \fIname\fP for which no completion
specification exists, or an output error occurs.
.TP
\fBcontinue\fP [\fIn\fP]
Resume the next iteration of the enclosing
.BR for ,
@@ -6528,7 +6540,15 @@ option will display the attributes and values of each
.IR name .
When
.B \-p
is used, additional options are ignored.
is used with \fIname\fP arguments, additional options are ignored.
When
.B \-p
is supplied without \fIname\fP arguments, it will display the attributes
and values of all variables having the attributes specified by the
additional options.
If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display
the attributes and values of all shell variables. The \fB\-f\fP option
will restrict the display to shell functions.
The
.B \-F
option inhibits the display of function definitions; only the
@@ -8068,7 +8088,7 @@ table exists before trying to execute it. If a hashed command no
longer exists, a normal path search is performed.
.TP 8
.B checkjobs
If set, bash lists the status of any stopped and running jobs before
If set, \fBbash\fP lists the status of any stopped and running jobs before
exiting an interactive shell. If any jobs are running, this causes
the exit to be deferred until a second exit is attempted without an
intervening command (see \fBJOB CONTROL\fP above). The shell always
@@ -8090,6 +8110,12 @@ attempts to save all lines of a multiple-line
command in the same history entry. This allows
easy re-editing of multi-line commands.
.TP 8
.B compat31
If set,
.B bash
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's =~ operator.
.TP 8
.B dotglob
If set,
.B bash
@@ -8603,7 +8629,7 @@ option suppresses shell function lookup, as with the \fBcommand\fP builtin.
returns true if any of the arguments are found, false if
none are found.
.TP
\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\fP [\fIlimit\fP]]
\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]]
Provides control over the resources available to the shell and to
processes started by it, on systems that allow such control.
The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
@@ -8634,6 +8660,9 @@ Other options are interpreted as follows:
.B \-a
All current limits are reported
.TP
.B \-b
The maximum socket buffer size
.TP
.B \-c
The maximum size of core files created
.TP
@@ -8682,6 +8711,9 @@ The maximum amount of virtual memory available to the shell
.TP
.B \-x
The maximum number of file locks
.TP
.B \-T
The maximum number of threads
.PD
.PP
If
@@ -8697,7 +8729,9 @@ which is in seconds,
.BR \-p ,
which is in units of 512-byte blocks,
and
.B \-n
.BR \-T ,
.BR \-b ,
.BR \-n ,
and
.BR \-u ,
which are unscaled values.
+25 -6
View File
@@ -681,8 +681,11 @@ Commands separated by a @samp{;} are executed sequentially; the shell
waits for each command to terminate in turn. The return status is the
exit status of the last command executed.
The control operators @samp{&&} and @samp{||}
denote @sc{and} lists and @sc{or} lists, respectively.
@sc{and} and @sc{or} lists are sequences of one or more pipelines
separated by the control operators @samp{&&} and @samp{||},
respectively. @sc{and} and @sc{or} lists are executed with left
associativity.
An @sc{and} list has the form
@example
@var{command1} && @var{command2}
@@ -3262,7 +3265,16 @@ are given, then display the values of variables instead.
The @option{-p} option will display the attributes and values of each
@var{name}.
When @option{-p} is used, additional options are ignored.
When @option{-p} is used with @var{name} arguments, additional options
are ignored.
When @option{-p} is supplied without @var{name} arguments, @code{declare}
will display the attributes and values of all variables having the
attributes specified by the additional options.
If no other options are supplied with @option{-p}, @code{declare} will
display the attributes and values of all shell variables. The @option{-f}
option will restrict the display to shell functions.
The @option{-F} option inhibits the display of function definitions;
only the function name and attributes are printed.
If the @code{extdebug} shell option is enabled using @code{shopt}
@@ -3596,7 +3608,7 @@ builtin command.
@item ulimit
@btindex ulimit
@example
ulimit [-acdefilmnpqrstuvxSH] [@var{limit}]
ulimit [-abcdefilmnpqrstuvxHST] [@var{limit}]
@end example
@code{ulimit} provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
@@ -3611,6 +3623,9 @@ Change and report the hard limit associated with a resource.
@item -a
All current limits are reported.
@item -b
The maximum socket buffer size.
@item -c
The maximum size of core files created.
@@ -3659,6 +3674,9 @@ The maximum amount of virtual memory available to the process.
@item -x
The maximum number of file locks.
@item -T
The maximum number of threads.
@end table
If @var{limit} is given, it is the new value of the specified resource;
@@ -7049,8 +7067,9 @@ the @code{bind} builtin.
@item
Bash provides a programmable word completion mechanism
(@pxref{Programmable Completion}), and two builtin commands,
@code{complete} and @code{compgen}, to manipulate it.
(@pxref{Programmable Completion}), and builtin commands
@code{complete}, @code{compgen}, and @code{compopt}, to
manipulate it.
@item
Bash has command history (@pxref{Bash History Facilities}) and the
+27 -4
View File
@@ -681,8 +681,11 @@ Commands separated by a @samp{;} are executed sequentially; the shell
waits for each command to terminate in turn. The return status is the
exit status of the last command executed.
The control operators @samp{&&} and @samp{||}
denote @sc{and} lists and @sc{or} lists, respectively.
@sc{and} and @sc{or} lists are sequences of one or more pipelines
separated by the control operators @samp{&&} and @samp{||},
respectively. @sc{and} and @sc{or} lists are executed with left
associativity.
An @sc{and} list has the form
@example
@var{command1} && @var{command2}
@@ -3262,7 +3265,16 @@ are given, then display the values of variables instead.
The @option{-p} option will display the attributes and values of each
@var{name}.
When @option{-p} is used, additional options are ignored.
When @option{-p} is used with @var{name} arguments, additional options
are ignored.
When @option{-p} is supplied without @var{name} arguments, @code{declare}
will display the attributes and values of all variables having the
attributes specified by the additional options.
If no other options are supplied with @option{-p}, @code{declare} will
display the attributes and values of all shell variables. The @option{-f}
option will restrict the display to shell functions.
The @option{-F} option inhibits the display of function definitions;
only the function name and attributes are printed.
If the @code{extdebug} shell option is enabled using @code{shopt}
@@ -3596,7 +3608,7 @@ builtin command.
@item ulimit
@btindex ulimit
@example
ulimit [-acdefilmnpqrstuvxSH] [@var{limit}]
ulimit [-abcdefilmnpqrstuvxHST] [@var{limit}]
@end example
@code{ulimit} provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
@@ -3611,6 +3623,9 @@ Change and report the hard limit associated with a resource.
@item -a
All current limits are reported.
@item -b
The maximum socket buffer size.
@item -c
The maximum size of core files created.
@@ -3659,6 +3674,9 @@ The maximum amount of virtual memory available to the process.
@item -x
The maximum number of file locks.
@item -T
The maximum number of threads.
@end table
If @var{limit} is given, it is the new value of the specified resource;
@@ -4060,6 +4078,11 @@ attempts to save all lines of a multiple-line
command in the same history entry. This allows
easy re-editing of multi-line commands.
@item compat31
If set, Bash
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's =~ operator.
@item dotglob
If set, Bash includes filenames beginning with a `.' in
the results of filename expansion.
+3 -3
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2008 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Fri Feb 22 21:45:01 EST 2008
@set LASTCHANGE Thu Mar 27 22:19:20 EDT 2008
@set EDITION 3.2
@set VERSION 3.2
@set UPDATED 22 February 2008
@set UPDATED-MONTH February 2008
@set UPDATED 27 March 2008
@set UPDATED-MONTH March 2008
+4 -4
View File
@@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2007 Free Software Foundation, Inc.
Copyright (C) 1988-2008 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Fri Dec 14 23:10:36 EST 2007
@set LASTCHANGE Fri Feb 22 21:45:01 EST 2008
@set EDITION 3.2
@set VERSION 3.2
@set UPDATED 14 December 2007
@set UPDATED-MONTH December 2007
@set UPDATED 27 March 2008
@set UPDATED-MONTH March 2008
+3 -3
View File
@@ -115,13 +115,13 @@ rl_callback_read_char ()
abort ();
}
memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t));
jcode = setjmp (readline_top_level);
memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t));
jcode = setjmp (_rl_top_level);
if (jcode)
{
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t));
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
return;
}
+2 -2
View File
@@ -506,7 +506,7 @@ rl_redisplay ()
int _rl_wrapped_multicolumn = 0;
#endif
if (readline_echoing_p == 0)
if (_rl_echoing_p == 0)
return;
/* Block keyboard interrupts because this function manipulates global
@@ -2464,7 +2464,7 @@ _rl_redisplay_after_sigwinch ()
void
_rl_clean_up_for_exit ()
{
if (readline_echoing_p)
if (_rl_echoing_p)
{
_rl_move_vert (_rl_vis_botlin);
_rl_vis_botlin = 0;
+19 -1
View File
@@ -1574,7 +1574,7 @@ the matches.
Any function specified with @option{-F} is invoked first.
The function may use any of the shell facilities, including the
@code{compgen} builtin described below
@code{compgen} and @code{compopt} builtins described below
(@pxref{Programmable Completion Builtins}), to generate the matches.
It must put the possible completions in the @env{COMPREPLY} array
variable.
@@ -1847,4 +1847,22 @@ a @var{name} for which no specification exists, or
an error occurs adding a completion specification.
@end table
@item compopt
@btindex compopt
@example
@code{compopt} [-o @var{option}] [+o @var{option}] [@var{name}]
@end example
Modify completion options for each @var{name} according to the
@var{option}s, or for the currently-execution completion if no @var{name}s
are supplied.
If no @var{option}s are given, display the completion options for each
@var{name} or the current completion.
The possible values of @var{option} are those valid for the @code{complete}
builtin described above.
The return value is true unless an invalid option is supplied, an attempt
is made to modify the options for a @var{name} for which no completion
specification exists, or an output error occurs.
@end ifset
-1
View File
@@ -1,7 +1,6 @@
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename rluser.info
@comment %**end of header (This is for running Texinfo on a region.)
@setchapternewpage odd
@ignore
This file documents the end user interface to the GNU command line
+5 -5
View File
@@ -163,7 +163,7 @@ int rl_done;
rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL;
/* Top level environment for readline_internal (). */
procenv_t readline_top_level;
procenv_t _rl_top_level;
/* The streams we interact with. */
FILE *_rl_in_stream, *_rl_out_stream;
@@ -176,7 +176,7 @@ FILE *rl_outstream = (FILE *)NULL;
set to 1 if there is a controlling terminal, we can get its attributes,
and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings
for the code that sets it. */
int readline_echoing_p = 0;
int _rl_echoing_p = 0;
/* Current prompt. */
char *rl_prompt = (char *)NULL;
@@ -371,7 +371,7 @@ readline_internal_setup ()
/* If we're not echoing, we still want to at least print a prompt, because
rl_redisplay will not do it for us. If the calling application has a
custom redisplay function, though, let that function handle it. */
if (readline_echoing_p == 0 && rl_redisplay_function == rl_redisplay)
if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay)
{
if (rl_prompt && rl_already_prompted == 0)
{
@@ -484,7 +484,7 @@ readline_internal_charloop ()
#endif
lk = _rl_last_command_was_kill;
code = setjmp (readline_top_level);
code = setjmp (_rl_top_level);
if (code)
{
@@ -492,7 +492,7 @@ readline_internal_charloop ()
_rl_want_redisplay = 0;
/* If we get here, we're not being called from something dispatched
from _rl_callback_read_char(), which sets up its own value of
readline_top_level (saving and restoring the old, of course), so
_rl_top_level (saving and restoring the old, of course), so
we can just return here. */
if (RL_ISSTATE (RL_STATE_CALLBACK))
return (0);
+3 -4
View File
@@ -149,12 +149,9 @@ extern int rl_visible_stats;
extern int rl_line_buffer_len;
extern int rl_arg_sign;
extern int rl_visible_prompt_length;
extern int readline_echoing_p;
extern int rl_key_sequence_length;
extern int rl_byte_oriented;
extern _rl_keyseq_cxt *_rl_kscxt;
/* display.c */
extern int rl_display_fixed;
@@ -400,6 +397,7 @@ extern int _rl_history_saved_point;
extern _rl_arg_cxt _rl_argcxt;
/* readline.c */
extern int _rl_echoing_p;
extern int _rl_horizontal_scroll_mode;
extern int _rl_mark_modified_lines;
extern int _rl_bell_preference;
@@ -415,7 +413,8 @@ extern FILE *_rl_in_stream;
extern FILE *_rl_out_stream;
extern int _rl_last_command_was_kill;
extern int _rl_eof_char;
extern procenv_t readline_top_level;
extern procenv_t _rl_top_level;
extern _rl_keyseq_cxt *_rl_kscxt;
/* search.c */
extern _rl_search_cxt *_rl_nscxt;
+5 -5
View File
@@ -201,7 +201,7 @@ set_tty_settings (tty, tiop)
ioctl (tty, TIOCSETN, &(tiop->sgttyb));
tiop->flags &= ~SGTTY_SET;
}
readline_echoing_p = 1;
_rl_echoing_p = 1;
#if defined (TIOCLSET)
if (tiop->flags & LFLAG_SET)
@@ -235,7 +235,7 @@ prepare_terminal_settings (meta_flag, oldtio, tiop)
int meta_flag;
TIOTYPE oldtio, *tiop;
{
readline_echoing_p = (oldtio.sgttyb.sg_flags & ECHO);
_rl_echoing_p = (oldtio.sgttyb.sg_flags & ECHO);
/* Copy the original settings to the structure we're going to use for
our settings. */
@@ -513,7 +513,7 @@ prepare_terminal_settings (meta_flag, oldtio, tiop)
int meta_flag;
TIOTYPE oldtio, *tiop;
{
readline_echoing_p = (oldtio.c_lflag & ECHO);
_rl_echoing_p = (oldtio.c_lflag & ECHO);
tiop->c_lflag &= ~(ICANON | ECHO);
@@ -576,7 +576,7 @@ void
rl_prep_terminal (meta_flag)
int meta_flag;
{
readline_echoing_p = 1;
_rl_echoing_p = 1;
}
void
@@ -609,7 +609,7 @@ rl_prep_terminal (meta_flag)
#else
if (errno == ENOTTY || errno == EINVAL)
#endif
readline_echoing_p = 1; /* XXX */
_rl_echoing_p = 1; /* XXX */
_rl_release_sigint ();
return;
+2 -2
View File
@@ -350,7 +350,7 @@ rl_reset_screen_size ()
void
rl_resize_terminal ()
{
if (readline_echoing_p)
if (_rl_echoing_p)
{
_rl_get_screen_size (fileno (rl_instream), 1);
if (CUSTOM_REDISPLAY_FUNC ())
@@ -653,7 +653,7 @@ rl_crlf ()
int
rl_ding ()
{
if (readline_echoing_p)
if (_rl_echoing_p)
{
switch (_rl_bell_preference)
{
+1 -1
View File
@@ -949,7 +949,7 @@ rl_newline (count, key)
if (rl_erase_empty_line && rl_point == 0 && rl_end == 0)
return 0;
if (readline_echoing_p)
if (_rl_echoing_p)
_rl_update_final ();
return 0;
}
+1 -1
View File
@@ -109,7 +109,7 @@ _rl_abort_internal ()
_rl_pop_executing_macro ();
rl_last_func = (rl_command_func_t *)NULL;
longjmp (readline_top_level, 1);
longjmp (_rl_top_level, 1);
return (0);
}
+13 -6
View File
@@ -1,7 +1,7 @@
/* pcomplete.c - functions to generate lists of matches for programmable
completion. */
/* Copyright (C) 1999-2005 Free Software Foundation, Inc.
/* Copyright (C) 1999-2008 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -164,7 +164,8 @@ ITEMLIST it_stopped = { LIST_DYNAMIC, it_init_stopped, (STRINGLIST *)0 };
ITEMLIST it_users = { LIST_DYNAMIC }; /* unused */
ITEMLIST it_variables = { LIST_DYNAMIC, it_init_variables, (STRINGLIST *)0 };
COMPSPEC *curcs;
COMPSPEC *pcomp_curcs;
const char *pcomp_curcmd;
#ifdef DEBUG
/* Debugging code */
@@ -1380,7 +1381,7 @@ pcomp_set_compspec_options (cs, flags, set_or_unset)
COMPSPEC *cs;
int flags, set_or_unset;
{
if (cs == 0 || (cs = curcs) == 0)
if (cs == 0 && ((cs = pcomp_curcs) == 0))
return;
if (set_or_unset)
cs->options |= flags;
@@ -1400,6 +1401,7 @@ programmable_completions (cmd, word, start, end, foundp)
COMPSPEC *cs, *oldcs;
STRINGLIST *ret;
char **rmatches, *t;
const char *oldcmd;
/* We look at the basename of CMD if the full command does not have
an associated COMPSPEC. */
@@ -1419,8 +1421,11 @@ programmable_completions (cmd, word, start, end, foundp)
cs = compspec_copy (cs);
oldcs = curcs;
curcs = cs;
oldcs = pcomp_curcs;
oldcmd = pcomp_curcmd;
pcomp_curcs = cs;
pcomp_curcmd = cmd;
/* Signal the caller that we found a COMPSPEC for this command, and pass
back any meta-options associated with the compspec. */
@@ -1429,7 +1434,9 @@ programmable_completions (cmd, word, start, end, foundp)
ret = gen_compspec_completions (cs, cmd, word, start, end);
curcs = oldcs;
pcomp_curcs = oldcs;
pcomp_curcmd = oldcmd;
compspec_dispose (cs);
if (ret)
+6 -5
View File
@@ -1,7 +1,7 @@
/* pcomplete.c - functions to generate lists of matches for programmable
completion. */
/* Copyright (C) 1999-2005 Free Software Foundation, Inc.
/* Copyright (C) 1999-2008 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -1376,15 +1376,16 @@ pcomp_set_readline_variables (flags, nval)
/* Set or unset FLAGS in the options word of the current compspec.
SET_OR_UNSET is 1 for setting, 0 for unsetting. */
void
pcomp_set_compspec_options (flags, set_or_unset)
pcomp_set_compspec_options (cs, flags, set_or_unset)
COMPSPEC *cs;
int flags, set_or_unset;
{
if (curcs == 0)
if (cs == 0 && ((cs = curcs) == 0))
return;
if (set_or_unset)
curcs->options |= flags;
cs->options |= flags;
else
curcs->options &= ~flags;
cs->options &= ~flags;
}
/* The driver function for the programmable completion code. Returns a list
+2 -1
View File
@@ -124,7 +124,8 @@ extern ITEMLIST it_stopped;
extern ITEMLIST it_users;
extern ITEMLIST it_variables;
extern COMPSPEC *curcs;
extern COMPSPEC *pcomp_curcs;
extern const char *pcomp_curcmd;
/* Functions from pcomplib.c */
extern COMPSPEC *compspec_create __P((void));
+1 -1
View File
@@ -153,5 +153,5 @@ extern STRINGLIST *gen_compspec_completions __P((COMPSPEC *, const char *, const
extern char **programmable_completions __P((const char *, const char *, int, int, int *));
extern void pcomp_set_readline_variables __P((int, int));
extern void pcomp_set_compspec_options __P((int, int));
extern void pcomp_set_compspec_options __P((COMPSPEC *, int, int));
#endif /* _PCOMPLETE_H_ */
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/bash/bash-current
BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+2
View File
@@ -109,6 +109,8 @@ typedef struct _vlist {
#define att_assoc 0x0000040 /* variable is an associative array */
#define att_trace 0x0000080 /* function is traced with DEBUG trap */
#define user_attrs (att_exported|att_readonly|att_integer|att_local|att_trace)
#define attmask_user 0x0000fff
/* Internal attributes used for bookkeeping */
+367
View File
@@ -0,0 +1,367 @@
/* variables.h -- data structures for shell variables. */
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
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 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_VARIABLES_H_)
#define _VARIABLES_H_
#include "stdc.h"
#include "array.h"
/* Shell variables and functions are stored in hash tables. */
#include "hashlib.h"
#include "conftypes.h"
/* A variable context. */
typedef struct var_context {
char *name; /* empty or NULL means global context */
int scope; /* 0 means global context */
int flags;
struct var_context *up; /* previous function calls */
struct var_context *down; /* down towards global context */
HASH_TABLE *table; /* variables at this scope */
} VAR_CONTEXT;
/* Flags for var_context->flags */
#define VC_HASLOCAL 0x01
#define VC_HASTMPVAR 0x02
#define VC_FUNCENV 0x04 /* also function if name != NULL */
#define VC_BLTNENV 0x08 /* builtin_env */
#define VC_TEMPENV 0x10 /* temporary_env */
#define VC_TEMPFLAGS (VC_FUNCENV|VC_BLTNENV|VC_TEMPENV)
/* Accessing macros */
#define vc_isfuncenv(vc) (((vc)->flags & VC_FUNCENV) != 0)
#define vc_isbltnenv(vc) (((vc)->flags & VC_BLTNENV) != 0)
#define vc_istempenv(vc) (((vc)->flags & (VC_TEMPFLAGS)) == VC_TEMPENV)
#define vc_istempscope(vc) (((vc)->flags & (VC_TEMPENV|VC_BLTNENV)) != 0)
#define vc_haslocals(vc) (((vc)->flags & VC_HASLOCAL) != 0)
#define vc_hastmpvars(vc) (((vc)->flags & VC_HASTMPVAR) != 0)
/* What a shell variable looks like. */
typedef struct variable *sh_var_value_func_t __P((struct variable *));
typedef struct variable *sh_var_assign_func_t __P((struct variable *, char *, arrayind_t));
/* For the future */
union _value {
char *s; /* string value */
intmax_t i; /* int value */
COMMAND *f; /* function */
ARRAY *a; /* array */
HASH_TABLE *h; /* associative array */
double d; /* floating point number */
#if defined (HAVE_LONG_DOUBLE)
long double ld; /* long double */
#endif
struct variable *v; /* possible indirect variable use */
void *opaque; /* opaque data for future use */
};
typedef struct variable {
char *name; /* Symbol that the user types. */
char *value; /* Value that is returned. */
char *exportstr; /* String for the environment. */
sh_var_value_func_t *dynamic_value; /* Function called to return a `dynamic'
value for a variable, like $SECONDS
or $RANDOM. */
sh_var_assign_func_t *assign_func; /* Function called when this `special
variable' is assigned a value in
bind_variable. */
int attributes; /* export, readonly, array, invisible... */
int context; /* Which context this variable belongs to. */
} SHELL_VAR;
typedef struct _vlist {
SHELL_VAR **list;
int list_size; /* allocated size */
int list_len; /* current number of entries */
} VARLIST;
/* The various attributes that a given variable can have. */
/* First, the user-visible attributes */
#define att_exported 0x0000001 /* export to environment */
#define att_readonly 0x0000002 /* cannot change */
#define att_array 0x0000004 /* value is an array */
#define att_function 0x0000008 /* value is a function */
#define att_integer 0x0000010 /* internal representation is int */
#define att_local 0x0000020 /* variable is local to a function */
#define att_assoc 0x0000040 /* variable is an associative array */
#define att_trace 0x0000080 /* function is traced with DEBUG trap */
#define user_attrs (att_exported|att_readonly|att_array|att_integer|att_local|att_assoc|att_trace)
#define attmask_user 0x0000fff
/* Internal attributes used for bookkeeping */
#define att_invisible 0x0001000 /* cannot see */
#define att_nounset 0x0002000 /* cannot unset */
#define att_noassign 0x0004000 /* assignment not allowed */
#define att_imported 0x0008000 /* came from environment */
#define att_special 0x0010000 /* requires special handling */
#define attmask_int 0x00ff000
/* Internal attributes used for variable scoping. */
#define att_tempvar 0x0100000 /* variable came from the temp environment */
#define att_propagate 0x0200000 /* propagate to previous scope */
#define attmask_scope 0x0f00000
#define exported_p(var) ((((var)->attributes) & (att_exported)))
#define readonly_p(var) ((((var)->attributes) & (att_readonly)))
#define array_p(var) ((((var)->attributes) & (att_array)))
#define function_p(var) ((((var)->attributes) & (att_function)))
#define integer_p(var) ((((var)->attributes) & (att_integer)))
#define local_p(var) ((((var)->attributes) & (att_local)))
#define assoc_p(var) ((((var)->attributes) & (att_assoc)))
#define trace_p(var) ((((var)->attributes) & (att_trace)))
#define invisible_p(var) ((((var)->attributes) & (att_invisible)))
#define non_unsettable_p(var) ((((var)->attributes) & (att_nounset)))
#define noassign_p(var) ((((var)->attributes) & (att_noassign)))
#define imported_p(var) ((((var)->attributes) & (att_imported)))
#define specialvar_p(var) ((((var)->attributes) & (att_special)))
#define tempvar_p(var) ((((var)->attributes) & (att_tempvar)))
/* Acessing variable values: rvalues */
#define value_cell(var) ((var)->value)
#define function_cell(var) (COMMAND *)((var)->value)
#define array_cell(var) (ARRAY *)((var)->value)
#define var_isnull(var) ((var)->value == 0)
#define var_isset(var) ((var)->value != 0)
/* Assigning variable values: lvalues */
#define var_setvalue(var, str) ((var)->value = (str))
#define var_setfunc(var, func) ((var)->value = (char *)(func))
#define var_setarray(var, arr) ((var)->value = (char *)(arr))
/* Make VAR be auto-exported. */
#define set_auto_export(var) \
do { (var)->attributes |= att_exported; array_needs_making = 1; } while (0)
#define SETVARATTR(var, attr, undo) \
((undo == 0) ? ((var)->attributes |= (attr)) \
: ((var)->attributes &= ~(attr)))
#define VSETATTR(var, attr) ((var)->attributes |= (attr))
#define VUNSETATTR(var, attr) ((var)->attributes &= ~(attr))
#define VGETFLAGS(var) ((var)->attributes)
#define VSETFLAGS(var, flags) ((var)->attributes = (flags))
#define VCLRFLAGS(var) ((var)->attributes = 0)
/* Macros to perform various operations on `exportstr' member of a SHELL_VAR. */
#define CLEAR_EXPORTSTR(var) (var)->exportstr = (char *)NULL
#define COPY_EXPORTSTR(var) ((var)->exportstr) ? savestring ((var)->exportstr) : (char *)NULL
#define SET_EXPORTSTR(var, value) (var)->exportstr = (value)
#define SAVE_EXPORTSTR(var, value) (var)->exportstr = (value) ? savestring (value) : (char *)NULL
#define FREE_EXPORTSTR(var) \
do { if ((var)->exportstr) free ((var)->exportstr); } while (0)
#define CACHE_IMPORTSTR(var, value) \
(var)->exportstr = savestring (value)
#define INVALIDATE_EXPORTSTR(var) \
do { \
if ((var)->exportstr) \
{ \
free ((var)->exportstr); \
(var)->exportstr = (char *)NULL; \
} \
} while (0)
/* Stuff for hacking variables. */
typedef int sh_var_map_func_t __P((SHELL_VAR *));
/* Where we keep the variables and functions */
extern VAR_CONTEXT *global_variables;
extern VAR_CONTEXT *shell_variables;
extern HASH_TABLE *shell_functions;
extern HASH_TABLE *temporary_env;
extern int variable_context;
extern char *dollar_vars[];
extern char **export_env;
extern void initialize_shell_variables __P((char **, int));
extern SHELL_VAR *set_if_not __P((char *, char *));
extern void sh_set_lines_and_columns __P((int, int));
extern void set_pwd __P((void));
extern void set_ppid __P((void));
extern void make_funcname_visible __P((int));
extern SHELL_VAR *var_lookup __P((const char *, VAR_CONTEXT *));
extern SHELL_VAR *find_function __P((const char *));
extern FUNCTION_DEF *find_function_def __P((const char *));
extern SHELL_VAR *find_variable __P((const char *));
extern SHELL_VAR *find_variable_internal __P((const char *, int));
extern SHELL_VAR *find_tempenv_variable __P((const char *));
extern SHELL_VAR *copy_variable __P((SHELL_VAR *));
extern SHELL_VAR *make_local_variable __P((const char *));
extern SHELL_VAR *bind_variable __P((const char *, char *, int));
extern SHELL_VAR *bind_function __P((const char *, COMMAND *));
extern void bind_function_def __P((const char *, FUNCTION_DEF *));
extern SHELL_VAR **map_over __P((sh_var_map_func_t *, VAR_CONTEXT *));
SHELL_VAR **map_over_funcs __P((sh_var_map_func_t *));
extern SHELL_VAR **all_shell_variables __P((void));
extern SHELL_VAR **all_shell_functions __P((void));
extern SHELL_VAR **all_visible_variables __P((void));
extern SHELL_VAR **all_visible_functions __P((void));
extern SHELL_VAR **all_exported_variables __P((void));
extern SHELL_VAR **local_exported_variables __P((void));
extern SHELL_VAR **all_local_variables __P((void));
#if defined (ARRAY_VARS)
extern SHELL_VAR **all_array_variables __P((void));
#endif
extern char **all_variables_matching_prefix __P((const char *));
extern char **make_var_array __P((HASH_TABLE *));
extern char **add_or_supercede_exported_var __P((char *, int));
extern char *get_variable_value __P((SHELL_VAR *));
extern char *get_string_value __P((const char *));
extern char *sh_get_env_value __P((const char *));
extern char *make_variable_value __P((SHELL_VAR *, char *, int));
extern SHELL_VAR *bind_variable_value __P((SHELL_VAR *, char *, int));
extern SHELL_VAR *bind_int_variable __P((char *, char *));
extern SHELL_VAR *bind_var_to_int __P((char *, intmax_t));
extern int assign_in_env __P((WORD_DESC *));
extern int unbind_variable __P((const char *));
extern int unbind_func __P((const char *));
extern int unbind_function_def __P((const char *));
extern int makunbound __P((const char *, VAR_CONTEXT *));
extern int kill_local_variable __P((const char *));
extern void delete_all_variables __P((HASH_TABLE *));
extern void delete_all_contexts __P((VAR_CONTEXT *));
extern VAR_CONTEXT *new_var_context __P((char *, int));
extern void dispose_var_context __P((VAR_CONTEXT *));
extern VAR_CONTEXT *push_var_context __P((char *, int, HASH_TABLE *));
extern void pop_var_context __P((void));
extern VAR_CONTEXT *push_scope __P((int, HASH_TABLE *));
extern void pop_scope __P((int));
extern void push_context __P((char *, int, HASH_TABLE *));
extern void pop_context __P((void));
extern void push_dollar_vars __P((void));
extern void pop_dollar_vars __P((void));
extern void dispose_saved_dollar_vars __P((void));
extern void push_args __P((WORD_LIST *));
extern void pop_args __P((void));
extern void adjust_shell_level __P((int));
extern void non_unsettable __P((char *));
extern void dispose_variable __P((SHELL_VAR *));
extern void dispose_used_env_vars __P((void));
extern void dispose_function_env __P((void));
extern void dispose_builtin_env __P((void));
extern void merge_temporary_env __P((void));
extern void merge_builtin_env __P((void));
extern void kill_all_local_variables __P((void));
extern void set_var_read_only __P((char *));
extern void set_func_read_only __P((const char *));
extern void set_var_auto_export __P((char *));
extern void set_func_auto_export __P((const char *));
extern void sort_variables __P((SHELL_VAR **));
extern void maybe_make_export_env __P((void));
extern void update_export_env_inplace __P((char *, int, char *));
extern void put_command_name_into_env __P((char *));
extern void put_gnu_argv_flags_into_env __P((intmax_t, char *));
extern void print_var_list __P((SHELL_VAR **));
extern void print_func_list __P((SHELL_VAR **));
extern void print_assignment __P((SHELL_VAR *));
extern void print_var_value __P((SHELL_VAR *, int));
extern void print_var_function __P((SHELL_VAR *));
#if defined (ARRAY_VARS)
extern SHELL_VAR *make_new_array_variable __P((char *));
extern SHELL_VAR *make_local_array_variable __P((char *));
extern void set_pipestatus_array __P((int *, int));
#endif
extern void set_pipestatus_from_exit __P((int));
/* The variable in NAME has just had its state changed. Check to see if it
is one of the special ones where something special happens. */
extern void stupidly_hack_special_variables __P((char *));
extern int get_random_number __P((void));
/* The `special variable' functions that get called when a particular
variable is set. */
extern void sv_ifs __P((char *));
extern void sv_path __P((char *));
extern void sv_mail __P((char *));
extern void sv_globignore __P((char *));
extern void sv_ignoreeof __P((char *));
extern void sv_strict_posix __P((char *));
extern void sv_optind __P((char *));
extern void sv_opterr __P((char *));
extern void sv_locale __P((char *));
#if defined (READLINE)
extern void sv_comp_wordbreaks __P((char *));
extern void sv_terminal __P((char *));
extern void sv_hostfile __P((char *));
extern void sv_winsize __P((char *));
#endif
#if defined (__CYGWIN__)
extern void sv_home __P((char *));
#endif
#if defined (HISTORY)
extern void sv_histsize __P((char *));
extern void sv_histignore __P((char *));
extern void sv_history_control __P((char *));
# if defined (BANG_HISTORY)
extern void sv_histchars __P((char *));
# endif
extern void sv_histtimefmt __P((char *));
#endif /* HISTORY */
#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
extern void sv_tz __P((char *));
#endif
#endif /* !_VARIABLES_H_ */