|
myshell 2.0.0
|
Internal utilities. More...
Functions | |
| variable * | get_variable (std::string_view name) |
| Get a pointer to an internal variable with the given name. | |
| void | set_variable (const std::string &name, const std::string &value) |
| Set the value of an internal variable with the given name. | |
| void | msh_init () |
| Initialize the shell. | |
| void | msh_exit () |
| Perform necessary operations before exiting the shell. | |
Variables | |
| std::vector< variable > | variables |
| The internal variable table. | |
| const std::map< TokenType, int > | token_flags |
| The internal token flags table. | |
Internal utilities.
| variable * get_variable | ( | std::string_view | name | ) |
Get a pointer to an internal variable with the given name.
| name | Name of the variable. |
nullptr otherwise | void msh_exit | ( | ) |
Perform necessary operations before exiting the shell.
Saves the history to the file specified by MSH_HISTORY_PATH.
| void msh_init | ( | ) |
Initialize the shell.
This function should be called before any other shell functions.
Sets up necessary handlers, job control, and copies the current process environment variables internally.
Sets the SHELL and VERSION to default values specified in msh_internal.h
| void set_variable | ( | const std::string & | name, |
| const std::string & | value ) |
Set the value of an internal variable with the given name.
| name | Name of the variable. |
| value | Value to set. |
| const std::map<TokenType, int> token_flags |
The internal token flags table.
Maps token types to their corresponding flags.
We ignore masks in the program name. However, this behavior is unnatural.