Update of /cvsroot/winbash/winbash/builtins
In directory usw-pr-cvs1:/tmp/cvs-serv3155/builtins
Modified Files:
alias.def bind.def command.def common.c declare.def exec.def
exit.def getopts.def return.def set.def source.def trap.def
Log Message:
renamed (almost) all members of the thread_env struct and added
some #define's for accessing these member from thr_me. the goal
is to reduce the number of places thr_me is referenced and hence
the number of diffs with the bash mainline. the hope it that this
will make patching to 1.14.7 easier.
Index: alias.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/alias.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- alias.def 9 Mar 2002 04:20:36 -0000 1.2
+++ alias.def 10 Mar 2002 21:45:13 -0000 1.3
@@ -90,7 +90,7 @@
print_alias (t);
else
{
- if (thr_me->interactive)
+ if (interactive)
builtin_error ("`%s' not found", name);
any_failed++;
}
@@ -150,7 +150,7 @@
remove_alias (alias->name);
else
{
- if (thr_me->interactive)
+ if (interactive)
builtin_error ("`%s' not an alias", list->word->word);
any_failed++;
Index: bind.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/bind.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- bind.def 10 Mar 2002 15:54:11 -0000 1.4
+++ bind.def 10 Mar 2002 21:45:14 -0000 1.5
@@ -59,7 +59,7 @@
static int query_bindings ();
extern int bash_readline_initialized;
-extern int no_line_editing;
+/*extern int no_line_editing;*/
#define BIND_RETURN(x) do { return_code = x; goto bind_exit; } while (0)
Index: command.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/command.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- command.def 9 Mar 2002 04:20:36 -0000 1.2
+++ command.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -127,7 +127,7 @@
command->value.Simple->flags |= (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION);
/* If we're in a subshell, see if we can get away without forking
again, since we've already forked to run this builtin. */
- if (thr_me->subshell_environment)
+ if (subshell_environment)
{
command->flags |= CMD_NO_FORK;
command->value.Simple->flags |= CMD_NO_FORK;
Index: common.c
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/common.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- common.c 9 Mar 2002 16:05:42 -0000 1.3
+++ common.c 10 Mar 2002 21:45:14 -0000 1.4
@@ -326,7 +326,7 @@
push_context ()
{
push_dollar_vars ();
- thr_me->variable_context++;
+ variable_context++;
}
void
@@ -334,7 +334,7 @@
{
pop_dollar_vars ();
kill_all_local_variables ();
- thr_me->variable_context--;
+ variable_context--;
}
/* Save the existing positional parameters on a stack. */
@@ -557,15 +557,15 @@
unwind_protect_int (parse_and_execute_level);
unwind_protect_jmp_buf (top_level);
unwind_protect_int (indirection_level);
- if (interact != -1 && thr_me->interactive != interact)
- unwind_protect_int (thr_me->interactive);
+ if (interact != -1 && interactive != interact)
+ unwind_protect_int (interactive);
#if defined (HISTORY)
- if (thr_me->interactive_shell)
+ if (interactive_shell)
{
- unwind_protect_int (thr_me->remember_on_history);
+ unwind_protect_int (remember_on_history);
# if defined (BANG_HISTORY)
- unwind_protect_int (thr_me->history_expansion_inhibited);
+ unwind_protect_int (history_expansion_inhibited);
# endif /* BANG_HISTORY */
}
#endif /* HISTORY */
@@ -579,14 +579,14 @@
push_stream ();
indirection_level++;
if (interact != -1)
- thr_me->interactive = interact;
-
+ interactive = interact;
+
#if defined (HISTORY)
/* We don't remember text read by the shell this way on
the history list, and we don't use !$ in shell scripts. */
- thr_me->remember_on_history = 0;
+ remember_on_history = 0;
# if defined (BANG_HISTORY)
- thr_me->history_expansion_inhibited = 1;
+ history_expansion_inhibited = 1;
# endif /* BANG_HISTORY */
#endif /* HISTORY */
@@ -623,7 +623,7 @@
case DISCARD:
dispose_command (command);
run_unwind_frame ("pe_dispose");
- thr_me->last_command_exit_value = 1;
+ last_command_exit_value = 1;
continue;
default:
@@ -682,7 +682,7 @@
/* An interrupt during non-interactive execution in an
interactive shell (e.g. via $PROMPT_COMMAND) should
not cause the shell to exit. */
- thr_me->interactive = thr_me->interactive_shell;
+ interactive = interactive_shell;
throw_to_top_level ();
}
Index: declare.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/declare.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- declare.def 9 Mar 2002 04:20:36 -0000 1.2
+++ declare.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -81,7 +81,7 @@
local_builtin (list)
register WORD_LIST *list;
{
- if (thr_me->variable_context)
+ if (variable_context)
return (declare_internal (list, 1));
else
{
@@ -151,7 +151,7 @@
register SHELL_VAR **vlist;
register int i;
- vlist = map_over (variable_in_context, thr_me->shell_variables);
+ vlist = map_over (variable_in_context, shell_variables);
if (vlist)
{
@@ -200,7 +200,7 @@
inside of a function. This means we should make local variables,
not global ones. */
- if (thr_me->variable_context)
+ if (variable_context)
make_local_variable (name);
/* If we are declaring a function, then complain about it in some way.
Index: exec.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/exec.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- exec.def 9 Mar 2002 16:05:42 -0000 1.3
+++ exec.def 10 Mar 2002 21:45:14 -0000 1.4
@@ -128,14 +128,14 @@
restore_original_signals ();
#if defined (JOB_CONTROL)
- if (thr_me->subshell_environment == 0)
+ if (subshell_environment == 0)
end_job_control ();
#endif /* JOB_CONTROL */
#if defined (__NT_VC__)
- nt_shell_execve (command, args, thr_me->export_env);
+ nt_shell_execve (command, args, export_env);
#else /* !__NT_VC__ */
- shell_execve (command, args, thr_me->export_env);
+ shell_execve (command, args, export_env);
#endif /* !__NT_VC__ */
adjust_shell_level (1);
@@ -152,8 +152,8 @@
if (command)
free (command);
- if (thr_me->subshell_environment ||
- (!thr_me->interactive && !find_variable ("no_exit_on_failed_exec")))
+ if (subshell_environment ||
+ (!interactive && !find_variable ("no_exit_on_failed_exec")))
exit (exit_value);
initialize_traps ();
Index: exit.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/exit.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- exit.def 9 Mar 2002 16:05:42 -0000 1.3
+++ exit.def 10 Mar 2002 21:45:14 -0000 1.4
@@ -43,9 +43,9 @@
exit_builtin (list)
WORD_LIST *list;
{
- if (thr_me->interactive)
+ if (interactive)
{
- fprintf (stderr, thr_me->login_shell ? "logout\n" : "exit\n");
+ fprintf (stderr, login_shell ? "logout\n" : "exit\n");
fflush (stderr);
}
@@ -63,7 +63,7 @@
logout_builtin (list)
WORD_LIST *list;
{
- if (!thr_me->login_shell && thr_me->interactive)
+ if (!login_shell && interactive)
{
builtin_error ("Not login shell: use `exit'");
return (EXECUTION_FAILURE);
@@ -85,7 +85,7 @@
#if defined (JOB_CONTROL)
int exit_immediate_okay;
- exit_immediate_okay = (!thr_me->interactive ||
+ exit_immediate_okay = (!interactive ||
last_shell_builtin == exit_builtin ||
last_shell_builtin == logout_builtin ||
last_shell_builtin == jobs_builtin);
@@ -114,13 +114,13 @@
if (list)
exit_value = get_numeric_arg (list);
else
- exit_value = thr_me->last_command_exit_value;
+ exit_value = last_command_exit_value;
/* Run our `~/.bash_logout' file if it exists, and this is a login shell. */
- if (thr_me->login_shell && sourced_logout++ == 0)
+ if (login_shell && sourced_logout++ == 0)
maybe_execute_file ("~/.bash_logout", 1);
- thr_me->last_command_exit_value = exit_value;
+ last_command_exit_value = exit_value;
/* Exit the program. */
longjmp (top_level, EXITPROG);
Index: getopts.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/getopts.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- getopts.def 9 Mar 2002 04:20:36 -0000 1.2
+++ getopts.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -241,7 +241,7 @@
bind_variable ("OPTARG", strval);
}
else
- makunbound ("OPTARG", thr_me->shell_variables);
+ makunbound ("OPTARG", shell_variables);
return (EXECUTION_SUCCESS);
}
@@ -263,7 +263,7 @@
strval[0] = '?';
strval[1] = '\0';
bind_variable (name, strval);
- makunbound ("OPTARG", thr_me->shell_variables);
+ makunbound ("OPTARG", shell_variables);
}
return (EXECUTION_SUCCESS);
}
Index: return.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/return.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- return.def 9 Mar 2002 04:20:36 -0000 1.2
+++ return.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -45,7 +45,7 @@
return_catch_value = get_numeric_arg (list);
if (!list)
- return_catch_value = thr_me->last_command_exit_value;
+ return_catch_value = last_command_exit_value;
if (return_catch_flag)
longjmp (return_catch, 1);
Index: set.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/set.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- set.def 9 Mar 2002 04:20:36 -0000 1.2
+++ set.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -30,7 +30,8 @@
extern int noclobber, no_brace_expansion, posixly_correct;
#if defined (READLINE)
-extern int rl_editing_mode, no_line_editing;
+extern int rl_editing_mode;
+/*extern int no_line_editing;*/
#endif /* READLINE */
#define USAGE_STRING "set [--abefhknotuvxldHCP] [-o option] [arg ...]"
@@ -215,7 +216,7 @@
{
rl_variable_bind ("editing-mode", option_name);
- if (thr_me->interactive)
+ if (interactive)
with_input_from_stdin ();
no_line_editing = 0;
}
@@ -225,7 +226,7 @@
if ((isemacs && STREQ (option_name, "emacs")) ||
(!isemacs && STREQ (option_name, "vi")))
{
- if (thr_me->interactive)
+ if (interactive)
with_input_from_stream (stdin, "stdin");
no_line_editing = 1;
}
@@ -500,14 +501,14 @@
/* Unless the -f option is supplied, the name refers to a
variable. */
tem = makunbound
- (name, unset_function ? thr_me->shell_functions : thr_me->shell_variables);
+ (name, unset_function ? shell_functions : shell_variables);
/* This is what Posix.2 draft 11+ says. ``If neither -f nor -v
is specified, the name refers to a variable; if a variable by
that name does not exist, a function by that name, if any,
shall be unset.'' */
if ((tem == -1) && !unset_function && !unset_variable)
- tem = makunbound (name, thr_me->shell_functions);
+ tem = makunbound (name, shell_functions);
if (tem == -1)
any_failed++;
Index: source.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/source.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- source.def 9 Mar 2002 16:05:42 -0000 1.3
+++ source.def 10 Mar 2002 21:45:14 -0000 1.4
@@ -127,7 +127,7 @@
free (filename);
/* POSIX shells exit if non-interactive and file error. */
- if (posixly_correct && !thr_me->interactive_shell)
+ if (posixly_correct && !interactive_shell)
longjmp (top_level, EXITPROG);
return (EXECUTION_FAILURE);
@@ -155,10 +155,10 @@
unwind_protect_int (return_catch_flag);
unwind_protect_jmp_buf (return_catch);
- unwind_protect_int (thr_me->interactive);
+ unwind_protect_int (interactive);
unwind_protect_int (sourcelevel);
add_unwind_protect ((Function *)xfree, filename);
- thr_me->interactive = 0;
+ interactive = 0;
sourcelevel++;
set_dollar_vars_unchanged ();
Index: trap.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/trap.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- trap.def 9 Mar 2002 04:20:36 -0000 1.2
+++ trap.def 10 Mar 2002 21:45:14 -0000 1.3
@@ -154,7 +154,7 @@
switch (sig)
{
case SIGINT:
- if (thr_me->interactive)
+ if (interactive)
signal (SIGINT, sigint_sighandler);
else
signal (SIGINT, termination_unwind_protect);
@@ -172,7 +172,7 @@
case SIGTTOU:
case SIGTSTP:
#endif /* JOB_CONTROL */
- if (thr_me->interactive)
+ if (interactive)
signal (sig, SIG_IGN);
break;
}
|