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

The file containing the exit builtin. More...

Functions

void * free_str_and_tab (char *str, char **tab)
 Free an string and his array.
 
void free_input_list (mysh_t *mysh)
 Free the input list.
 
void my_exit (mysh_t *mysh, unsigned char status, char const *message)
 Free the shell structure and exit the shell.
 
int exec_exit (mysh_t *mysh)
 The exit builtin.
 

Detailed Description

The file containing the exit builtin.

Function Documentation

◆ exec_exit()

int exec_exit ( mysh_t * mysh)

The exit builtin.

Parameters
myshThe shell structure
Returns
int 0 or the exit value if the command succeed, 1 otherwise

◆ free_input_list()

void free_input_list ( mysh_t * mysh)

Free the input list.

Parameters
myshThe shell structure
Returns
void

◆ free_str_and_tab()

void * free_str_and_tab ( char * str,
char ** tab )

Free an string and his array.

Parameters
strThe string to free
tabThe array of the string to free
Returns
void * Always NULL

◆ my_exit()

void my_exit ( mysh_t * mysh,
unsigned char status,
char const * message )

Free the shell structure and exit the shell.

Parameters
myshThe shell structure
statusThe exit status
messageThe message to display
Returns
void