C-Shell
A simple shell written in C.
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1
9#ifndef MAIN_H
10#define MAIN_H
11
12// macros here
13
14#define cls printf("\033[2J\033[1;1H"); // Clears the screen. Requires support for ANSI escape sequences.
15#define LINE_BUFFER_SIZE 1024
16#define MAXHOSTNAMELEN 32
17#define C_SHELL_TOK_DELIM " \t\r\n"
18
19// global variables here
20
21// structs here
22
23// functions here
24
38int execute(int nargs, char *command, char **args);
39
45int load_settings();
46
50int loop();
51
59char **parse_line(char *line, size_t line_size, int *nargs);
60
64int print_prompt();
65
73int read_line(char *buffer, int buffer_size);
74
75#endif
int print_prompt()
Prints username@machinename.
Definition main.c:141
int read_line(char *buffer, int buffer_size)
Reads a line from stdin.
Definition main.c:148
int loop()
I keep looping, looping till the user exits.
Definition main.c:96
int load_settings()
Will load configuration file(s).
Definition main.c:92
int execute(int nargs, char *command, char **args)
Executes the command.
Definition main.c:37
char ** parse_line(char *line, size_t line_size, int *nargs)
Tokenizes the line.
Definition main.c:123