42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
command.c File Reference

The file containing the command functions. More...

Functions

builtin_tget_builtin_command (int index)
 Get the builtin command.
 
char * check_command_exist (mysh_t *mysh, char *command)
 Check if the command exists.
 
void analyse_command (mysh_t *mysh)
 Select the command to execute.
 
void command (mysh_t *mysh, input_command_t *input)
 Execute the command.
 

Detailed Description

The file containing the command functions.

Function Documentation

◆ analyse_command()

void analyse_command ( mysh_t * mysh)

Select the command to execute.

Parameters
myshThe shell structure
Returns
void

◆ check_command_exist()

char * check_command_exist ( mysh_t * mysh,
char * command )

Check if the command exists.

Parameters
myshThe shell structure
commandThe command
Returns
char * The path of the command if it exists, NULL otherwise

◆ command()

void command ( mysh_t * mysh,
input_command_t * input )

Execute the command.

Parameters
myshThe shell structure
inputThe input command
Returns
void

◆ get_builtin_command()

builtin_t * get_builtin_command ( int index)

Get the builtin command.

Parameters
indexThe index of the command
Returns
builtin_t * The builtin command selected