C-Shell
A simple shell written in C.
|
The entrypoint to the program. More...
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include "internal_commands.h"
#include "main.h"
Functions | |
int | main () |
Execution starts here. | |
int | execute (int nargs, char *command, char **args) |
Executes the command. | |
int | load_settings () |
Will load configuration file(s). | |
int | loop () |
I keep looping, looping till the user exits. | |
char ** | parse_line (char *line, size_t line_size, int *nargs) |
Tokenizes the line. | |
int | print_prompt () |
Prints username@machinename. | |
int | read_line (char *buffer, int buffer_size) |
Reads a line from stdin. | |
The entrypoint to the program.
Comments can be written in Markdown.
int execute | ( | int | nargs, |
char * | command, | ||
char ** | args ) |
Executes the command.
nargs | Number of arguments to the command. |
command | The command to execute. |
args | The list of arguments to the command. |
Available commands:
int load_settings | ( | ) |
Will load configuration file(s).
Not yet implemented.
int loop | ( | ) |
I keep looping, looping till the user exits.
int main | ( | ) |
Execution starts here.
char ** parse_line | ( | char * | line, |
size_t | line_size, | ||
int * | nargs ) |
Tokenizes the line.
line | A string. |
line_size | Length of the string. |
int print_prompt | ( | ) |
Prints username@machinename.
int read_line | ( | char * | buffer, |
int | buffer_size ) |
Reads a line from stdin.
buffer | The buffer to write into. |
buffer_size | The size of the provided buffer. |