25#define MAX_CMDLINE 2001
28#define MAX_TOKENS 2000
31#define MAX_TOKEN_LEN 30
40#define FILE_CREATE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)
Represents one command with arguments and redirections.
Definition yash.h:82
char * out_file
Filename for output redirection.
Definition yash.h:85
char * in_file
Filename for input redirection.
Definition yash.h:84
char * argv[MAX_ARGS]
Null-terminated array of arguments.
Definition yash.h:83
char * err_file
Filename for error redirection.
Definition yash.h:86
int background
Background execution flag.
Definition yash.h:87
Represents a full line of user input.
Definition yash.h:100
Command left
Left command.
Definition yash.h:102
Command right
Right command.
Definition yash.h:103
int is_pipeline
Flag indicating if the line is a pipeline.
Definition yash.h:101
char original[MAX_CMDLINE]
Original command line string.
Definition yash.h:104
void init_command(Command *cmd)
Initialize a Command structure to NULL/0 values.
Definition parse.c:125
#define MAX_ARGS
Reasonable cap on arguments per command.
Definition yash.h:34
pid_t foreground_pgid
Process group ID of the current foreground process.
Definition signals.c:22
struct Command Command
Represents one command with arguments and redirections.
TokenKind
Token kinds.
Definition yash.h:57
@ TK_AMP
Identifies = &
Definition yash.h:63
@ TK_WORD
Identifies = Regular text
Definition yash.h:58
@ TK_REDIR_IN
Identifies = <
Definition yash.h:59
@ TK_REDIR_ERR
Identifies = 2>
Definition yash.h:61
@ TK_PIPE
Identifies = |
Definition yash.h:62
@ TK_REDIR_OUT
Identifies = >
Definition yash.h:60
#define MAX_CMDLINE
Maximum command line length including null terminator.
Definition yash.h:25
volatile sig_atomic_t child_status_changed
Flag indicating that a child process status has changed.
Definition signals.c:21
struct Line Line
Represents a full line of user input.