]> git.ipfire.org Git - thirdparty/bash.git/blame - execute_cmd.h
fixes for HAVE_SELECT/HAVE_PSELECT; change some warning messages for nameref loops...
[thirdparty/bash.git] / execute_cmd.h
CommitLineData
726f6388
JA
1/* execute_cmd.h - functions from execute_cmd.c. */
2
ec157dfe 3/* Copyright (C) 1993-2017 Free Software Foundation, Inc.
726f6388
JA
4
5 This file is part of GNU Bash, the Bourne Again SHell.
6
2e4498b3
CR
7 Bash is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 Bash is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Bash. If not, see <http://www.gnu.org/licenses/>.
19*/
726f6388
JA
20
21#if !defined (_EXECUTE_CMD_H_)
22#define _EXECUTE_CMD_H_
23
24#include "stdc.h"
25
25340ead
CR
26#if defined (ARRAY_VARS)
27struct func_array_state
28 {
29 ARRAY *funcname_a;
30 SHELL_VAR *funcname_v;
31 ARRAY *source_a;
32 SHELL_VAR *source_v;
33 ARRAY *lineno_a;
34 SHELL_VAR *lineno_v;
35 };
36#endif
37
d155fbc5
CR
38/* Placeholder for later expansion to include more execution state */
39/* XXX - watch out for pid_t */
40struct execstate
41 {
42 pid_t pid;
43 int subshell_env;
44 };
45
46
3a7c642e 47/* Variables declared in execute_cmd.c, used by many other files */
ec157dfe
CR
48extern int return_catch_flag;
49extern int return_catch_value;
50extern volatile int last_command_exit_value;
51extern int last_command_exit_signal;
52extern int builtin_ignoring_errexit;
53extern int executing_builtin;
54extern int executing_list;
6711d2dc 55extern int retain_fifos;
ec157dfe
CR
56extern int comsub_ignore_return;
57extern int subshell_level;
58extern int match_ignore_case;
59extern int executing_command_builtin;
60extern int funcnest, funcnest_max;
61extern int evalnest, evalnest_max;
62extern int sourcenest, sourcenest_max;
63extern int stdin_redir;
64extern int line_number_for_err_trap;
65
66extern char *the_printed_command_except_trap;
67
68extern char *this_command_name;
69extern SHELL_VAR *this_shell_function;
70
3a7c642e 71/* Functions declared in execute_cmd.c, used by many other files */
ec157dfe 72
8f576ade
CR
73extern struct fd_bitmap *new_fd_bitmap PARAMS((int));
74extern void dispose_fd_bitmap PARAMS((struct fd_bitmap *));
75extern void close_fd_bitmap PARAMS((struct fd_bitmap *));
76extern int executing_line_number PARAMS((void));
77extern int execute_command PARAMS((COMMAND *));
78extern int execute_command_internal PARAMS((COMMAND *, int, int, int, struct fd_bitmap *));
79extern int shell_execve PARAMS((char *, char **, char **));
80extern void setup_async_signals PARAMS((void));
81extern void async_redirect_stdin PARAMS((void));
f698849a 82
8f576ade
CR
83extern void undo_partial_redirects PARAMS((void));
84extern void dispose_partial_redirects PARAMS((void));
85extern void dispose_exec_redirects PARAMS((void));
726f6388 86
8f576ade 87extern int execute_shell_function PARAMS((SHELL_VAR *, WORD_LIST *));
bb70624e 88
8f576ade
CR
89extern struct coproc *getcoprocbypid PARAMS((pid_t));
90extern struct coproc *getcoprocbyname PARAMS((const char *));
fdf670ea 91
8f576ade
CR
92extern void coproc_init PARAMS((struct coproc *));
93extern struct coproc *coproc_alloc PARAMS((char *, pid_t));
94extern void coproc_dispose PARAMS((struct coproc *));
95extern void coproc_flush PARAMS((void));
96extern void coproc_close PARAMS((struct coproc *));
97extern void coproc_closeall PARAMS((void));
98extern void coproc_reap PARAMS((void));
99extern pid_t coproc_active PARAMS((void));
fdf670ea 100
8f576ade
CR
101extern void coproc_rclose PARAMS((struct coproc *, int));
102extern void coproc_wclose PARAMS((struct coproc *, int));
103extern void coproc_fdclose PARAMS((struct coproc *, int));
fdf670ea 104
8f576ade
CR
105extern void coproc_checkfd PARAMS((struct coproc *, int));
106extern void coproc_fdchk PARAMS((int));
8e1a6eaa 107
8f576ade 108extern void coproc_pidchk PARAMS((pid_t, int));
fdf670ea 109
8f576ade
CR
110extern void coproc_fdsave PARAMS((struct coproc *));
111extern void coproc_fdrestore PARAMS((struct coproc *));
fdf670ea 112
8f576ade
CR
113extern void coproc_setvars PARAMS((struct coproc *));
114extern void coproc_unsetvars PARAMS((struct coproc *));
fdf670ea 115
726f6388 116#if defined (PROCESS_SUBSTITUTION)
8f576ade 117extern void close_all_files PARAMS((void));
726f6388
JA
118#endif
119
71574d7e 120#if defined (ARRAY_VARS)
8f576ade 121extern void restore_funcarray_state PARAMS((struct func_array_state *));
71574d7e 122#endif
25340ead 123
726f6388 124#endif /* _EXECUTE_CMD_H_ */