|
C-Shell
A simple shell written in C.
|
#include <stddef.h>Macros | |
| #define | C_SHELL_TOK_DELIM " \t\r\n" |
| #define | JOB_DELIM ";" |
| #define | PIPE_DELIM "|" |
Functions | |
| struct command * | parse_command (char *command, size_t command_len) |
| Parse a command string into a command struct. | |
| struct job * | parse_job (char *job_str) |
| Parse a command string containing pipes into a job struct. The string should not have any semicolons. | |
| struct job * | parse_line_to_jobs (char *line) |
| Parse a line into a list of jobs. | |
| #define C_SHELL_TOK_DELIM " \t\r\n" |
| #define JOB_DELIM ";" |
| #define PIPE_DELIM "|" |
| struct command * parse_command | ( | char * | command, |
| size_t | command_len ) |
Parse a command string into a command struct.
| command | The command string |
| command_len | The length of the command string |
| struct job * parse_job | ( | char * | job_str | ) |
Parse a command string containing pipes into a job struct. The string should not have any semicolons.
| job_str | The command string |
Using '\0' instead of ' ' will cause a segfault with strlen.
| struct job * parse_line_to_jobs | ( | char * | line | ) |
Parse a line into a list of jobs.
| line | The line to parse |