|
minishell
Minishell Project for École 42
|
Variable expansion. More...
#include "minishell.h"
Functions | |
| int | expand_var (t_shell *shell, char **str, t_expander *exp, int pos) |
| Expand variables. | |
| bool | expander (t_shell *shell) |
| Starting point of variable expansion. | |
Variable expansion.
| int expand_var | ( | t_shell * | shell, |
| char ** | str, | ||
| t_expander * | exp, | ||
| int | pos | ||
| ) |
Expand variables.
This function is expanding variables. It iterates through the command string, identifies variables and replaces them with the corresponding values.
| [in] | shell | A pointer to the shell struct. |
| [in,out] | str | A pointer to the command string. |
| [in,out] | exp | A pointer to the expander struct. |
| [in] | pos | The current position in the result string. |
| bool expander | ( | t_shell * | shell | ) |
Starting point of variable expansion.
This function is the starting point for expanding variables.It iterates through each command and applies variable expansion if needed or just copies from the input.
| [in,out] | shell | A pointer to the shell struct. |