minishell
Minishell Project for École 42
|
Subfunctions for process_command(). More...
#include "minishell.h"
Functions | |
int | get_size_execs (t_lexer_list *lexer) |
Calculates the number of consecutive NONE type lexer list nodes. | |
char ** | get_execs_array (t_lexer_list *lexer, int size) |
Creates an array of the found NONE type tokens from the lexer list. | |
Subfunctions for process_command().
char ** get_execs_array | ( | t_lexer_list * | lexer, |
int | size | ||
) |
Creates an array of the found NONE type tokens from the lexer list.
Allocates memory for an array of NONE tokens. Fills the array with the strings from the consecutive NONE type tokens in the lexer list.
lexer | A pointer to the current lexer list node. |
int | The size of the array. |
int get_size_execs | ( | t_lexer_list * | lexer | ) |
Calculates the number of consecutive NONE type lexer list nodes.
Calculates the number of command arguments based on the number of consecutive NONE type tokens in the lexer list. Each NONE token represents one of the following: a command(executable/buildin), a command option(-i –version), or a command argument(filenames, etc).
lexer | A pointer to the current lexer list node. |