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

The file containing the alias functions. More...

Functions

void print_alias (mysh_t *mysh, char *alias)
 Search the alias in the list and print the value.
 
int display_alias (mysh_t *mysh)
 Check if the alias has an error.
 
int replace_alias (mysh_t *mysh)
 Replace the alias if it already exists.
 
void add_alias (mysh_t *mysh)
 Add an alias to the list.
 
int exec_alias (mysh_t *mysh)
 The alias builtin.
 

Detailed Description

The file containing the alias functions.

Function Documentation

◆ add_alias()

void add_alias ( mysh_t * mysh)

Add an alias to the list.

Parameters
myshThe shell structure
Returns
void

◆ display_alias()

int display_alias ( mysh_t * mysh)

Check if the alias has an error.

Parameters
myshThe shell structure
aliasThe alias structure
Returns
int 1 if the command argument are less than 3, 0 otherwise

◆ exec_alias()

int exec_alias ( mysh_t * mysh)

The alias builtin.

Parameters
myshThe shell structure
Returns
int Always 0

◆ print_alias()

void print_alias ( mysh_t * mysh,
char * alias )

Search the alias in the list and print the value.

Parameters
myshThe shell structure
aliasThe alias name to search
Returns
void

◆ replace_alias()

int replace_alias ( mysh_t * mysh)

Replace the alias if it already exists.

Parameters
myshThe shell structure
aliasThe alias structure
Returns
int 1 if the alias is replaced, 0 otherwise