minishell
Minishell Project for École 42
|
Utility functions for handling the exit command. More...
#include "minishell.h"
Functions | |
void | child (t_shell *shell, char **args, int number) |
Handles the exit command when executed within a child process. | |
void | handle_child (t_shell *shell, char **args, int number) |
Handles the exit command when executed within a child process. | |
void | parent (t_shell *shell, char **args, int number) |
Handles the exit command when executed within the parent process. | |
int | handle_parent (t_shell *shell, char **args, int number) |
Handles the exit command when executed within the parent process. | |
Utility functions for handling the exit command.
void child | ( | t_shell * | shell, |
char ** | args, | ||
int | number | ||
) |
Handles the exit command when executed within a child process.
This function is called when the exit command is executed within a child process. It handles the termination of the child process based on the provided arguments, including the exit status.
[in] | shell | A pointer to the shell struct. |
[in] | args | An array of strings containing the arguments. |
[in] | number | The number of arguments in the array. |
void handle_child | ( | t_shell * | shell, |
char ** | args, | ||
int | number | ||
) |
Handles the exit command when executed within a child process.
This function is called when the exit command is executed within a child process. It handles the termination of the child process based on the provided arguments, including the exit status.
[in] | shell | A pointer to the shell struct. |
[in] | args | An array of strings containing the arguments. |
[in] | number | The number of arguments in the array. |
int handle_parent | ( | t_shell * | shell, |
char ** | args, | ||
int | number | ||
) |
Handles the exit command when executed within the parent process.
This function is called when the exit command is executed within the parent process. It handles the termination of the shell or reports an error when provided with invalid arguments.
[in] | shell | A pointer to the shell struct. |
[in] | args | An array of strings containing the arguments. |
[in] | number | The number of arguments in the array. |
void parent | ( | t_shell * | shell, |
char ** | args, | ||
int | number | ||
) |
Handles the exit command when executed within the parent process.
This function is called when the exit command is executed within the parent process. It handles the termination of the shell or reports an error when provided with invalid arguments.
[in] | shell | A pointer to the shell. |
[in] | args | An array of strings containing the arguments. |
[in] | number | The number of arguments in the array. |