1 /* shell.h -- The data structures used by the shell */
3 /* Copyright (C) 1993 Free Software Foundation, Inc.
5 This file is part of GNU Bash, the Bourne Again SHell.
7 Bash is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with Bash; see the file COPYING. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
25 #include "variables.h"
28 #include "unwind_prot.h"
29 #include "dispose_cmd.h"
34 extern int EOF_Reached;
37 #define REDIRECT_BOTH -2
38 #define IS_DESCRIPTOR -1
40 #define NO_VARIABLE -1
42 /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
44 extern jmp_buf top_level, catch;
46 #define NOT_JUMPED 0 /* Not returning from a longjmp. */
47 #define FORCE_EOF 1 /* We want to stop parsing. */
48 #define DISCARD 2 /* Discard current command. */
49 #define EXITPROG 3 /* Unconditionally exit the program now. */
51 /* Values that can be returned by execute_command (). */
52 #define EXECUTION_FAILURE 1
53 #define EXECUTION_SUCCESS 0
55 /* Usage messages by builtins result in a return status of 2. */
58 /* Special exit status used when the shell is asked to execute a
59 binary file as a shell script. */
60 #define EX_BINARY_FILE 126
62 #define EX_NOTFOUND 127
64 /* The list of characters that are quoted in double-quotes with a
65 backslash. Other characters following a backslash cause nothing
67 #define slashify_in_quotes "\\`$\""
68 #define slashify_in_here_document "\\`$"
70 /* Constants which specify how to handle backslashes and quoting in
71 expand_word_internal (). Q_DOUBLE_QUOTES means to use the function
72 slashify_in_quotes () to decide whether the backslash should be
73 retained. Q_HERE_DOCUMENT means slashify_in_here_document () to
74 decide whether to retain the backslash. Q_KEEP_BACKSLASH means
75 to unconditionally retain the backslash. */
76 #define Q_DOUBLE_QUOTES 0x1
77 #define Q_HERE_DOCUMENT 0x2
78 #define Q_KEEP_BACKSLASH 0x4
80 extern char **shell_environment;
81 extern WORD_LIST *rest_of_args;
83 /* Generalized global variables. */
84 extern int executing, login_shell;
86 /* Structure to pass around that holds a bitmap of file descriptors
87 to close, and the size of that structure. Used in execute_cmd.c. */
93 #define FD_BITMAP_SIZE 32
98 /* Information about the current user. */
103 char *shell; /* shell from the password file */
107 extern struct user_info current_user;