]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | /* execute_cmd.h - functions from execute_cmd.c. */ |
2 | ||
d233b485 | 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 | ||
3185942a JA |
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. | |
726f6388 | 11 | |
3185942a JA |
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. | |
726f6388 | 16 | |
3185942a JA |
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 | ||
a0c0a00f CR |
26 | #if defined (ARRAY_VARS) |
27 | struct 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 | ||
d233b485 CR |
38 | /* Placeholder for later expansion to include more execution state */ |
39 | /* XXX - watch out for pid_t */ | |
40 | struct execstate | |
41 | { | |
42 | pid_t pid; | |
43 | int subshell_env; | |
44 | }; | |
45 | ||
46 | ||
47 | /* Variables delared in execute_cmd.c, used by many other files */ | |
48 | extern int return_catch_flag; | |
49 | extern int return_catch_value; | |
50 | extern volatile int last_command_exit_value; | |
51 | extern int last_command_exit_signal; | |
52 | extern int builtin_ignoring_errexit; | |
53 | extern int executing_builtin; | |
54 | extern int executing_list; | |
55 | extern int comsub_ignore_return; | |
56 | extern int subshell_level; | |
57 | extern int match_ignore_case; | |
58 | extern int executing_command_builtin; | |
59 | extern int funcnest, funcnest_max; | |
60 | extern int evalnest, evalnest_max; | |
61 | extern int sourcenest, sourcenest_max; | |
62 | extern int stdin_redir; | |
63 | extern int line_number_for_err_trap; | |
64 | ||
65 | extern char *the_printed_command_except_trap; | |
66 | ||
67 | extern char *this_command_name; | |
68 | extern SHELL_VAR *this_shell_function; | |
69 | ||
70 | /* Functions delared in execute_cmd.c, used by many other files */ | |
71 | ||
f73dda09 | 72 | extern struct fd_bitmap *new_fd_bitmap __P((int)); |
726f6388 JA |
73 | extern void dispose_fd_bitmap __P((struct fd_bitmap *)); |
74 | extern void close_fd_bitmap __P((struct fd_bitmap *)); | |
ccc6cda3 | 75 | extern int executing_line_number __P((void)); |
726f6388 JA |
76 | extern int execute_command __P((COMMAND *)); |
77 | extern int execute_command_internal __P((COMMAND *, int, int, int, struct fd_bitmap *)); | |
78 | extern int shell_execve __P((char *, char **, char **)); | |
726f6388 | 79 | extern void setup_async_signals __P((void)); |
d233b485 CR |
80 | |
81 | extern void undo_partial_redirects __P((void)); | |
82 | extern void dispose_partial_redirects __P((void)); | |
83 | extern void dispose_exec_redirects __P((void)); | |
726f6388 | 84 | |
bb70624e JA |
85 | extern int execute_shell_function __P((SHELL_VAR *, WORD_LIST *)); |
86 | ||
3185942a JA |
87 | extern struct coproc *getcoprocbypid __P((pid_t)); |
88 | extern struct coproc *getcoprocbyname __P((const char *)); | |
89 | ||
90 | extern void coproc_init __P((struct coproc *)); | |
91 | extern struct coproc *coproc_alloc __P((char *, pid_t)); | |
92 | extern void coproc_dispose __P((struct coproc *)); | |
93 | extern void coproc_flush __P((void)); | |
94 | extern void coproc_close __P((struct coproc *)); | |
95 | extern void coproc_closeall __P((void)); | |
17345e5a | 96 | extern void coproc_reap __P((void)); |
d233b485 | 97 | extern pid_t coproc_active __P((void)); |
3185942a JA |
98 | |
99 | extern void coproc_rclose __P((struct coproc *, int)); | |
100 | extern void coproc_wclose __P((struct coproc *, int)); | |
101 | extern void coproc_fdclose __P((struct coproc *, int)); | |
102 | ||
103 | extern void coproc_checkfd __P((struct coproc *, int)); | |
104 | extern void coproc_fdchk __P((int)); | |
105 | ||
17345e5a | 106 | extern void coproc_pidchk __P((pid_t, int)); |
3185942a JA |
107 | |
108 | extern void coproc_fdsave __P((struct coproc *)); | |
109 | extern void coproc_fdrestore __P((struct coproc *)); | |
110 | ||
111 | extern void coproc_setvars __P((struct coproc *)); | |
112 | extern void coproc_unsetvars __P((struct coproc *)); | |
113 | ||
726f6388 JA |
114 | #if defined (PROCESS_SUBSTITUTION) |
115 | extern void close_all_files __P((void)); | |
116 | #endif | |
117 | ||
a0c0a00f CR |
118 | #if defined (ARRAY_VARS) |
119 | extern void restore_funcarray_state __P((struct func_array_state *)); | |
120 | #endif | |
121 | ||
726f6388 | 122 | #endif /* _EXECUTE_CMD_H_ */ |