|
C-Shell
A simple shell written in C.
|
Data Structures | |
| struct | history_list |
Macros | |
| #define | DEFAULT_HIST_ITEMS 10 |
| #define | MAX_HISTORY_ITEMS 20 |
Functions | |
| void | add_to_history (char *line) |
| Adds a line to the history. | |
| void | clear_history () |
| Clears the history. | |
| const struct history_list * | get_history () |
| Gets the history list. | |
| void | print_history (int n) |
Prints the last n commands in the history. | |
| int | read_history_from_file () |
| int | write_history_to_file () |
| #define DEFAULT_HIST_ITEMS 10 |
The default number of items to print when the user does not specify a number.
| #define MAX_HISTORY_ITEMS 20 |
| void add_to_history | ( | char * | line | ) |
Adds a line to the history.
| line | The command to add. |
allocate memory and deep copy
free the memory
allocate memory and deep copy
| void clear_history | ( | ) |
Clears the history.
free the memory
| const struct history_list * get_history | ( | ) |
Gets the history list.
| void print_history | ( | int | n | ) |
Prints the last n commands in the history.
| n | The number of commands to print. |
| int read_history_from_file | ( | ) |
| int write_history_to_file | ( | ) |