Minishell
Loading...
Searching...
No Matches
split_input.c File Reference
#include <stdlib.h>
#include "../../include/main.h"
#include "../../include/utils.h"
Include dependency graph for split_input.c:

Functions

char * get_command_input (data_t *data, int *command, redirection_t *type)
 
int split_commands (data_t *data)
 

Variables

const char redirect_chars [4] = {'<', '>', '|', ';'}
 

Function Documentation

◆ get_command_input()

char * get_command_input ( data_t * data,
int * command,
redirection_t * type )

Help split the commands to save them in the linked list by returning an array of strings that are each word in a single command. it does this by iterating over the strings till it find a redirect_char

Parameters
dataGlobal data structure
commandIndex if the current command count
typeContains the variable where the command type is saved
Returns
returns the input but with just the command we want
Here is the call graph for this function:

◆ split_commands()

int split_commands ( data_t * data)
Here is the call graph for this function:

Variable Documentation

◆ redirect_chars

const char redirect_chars[4] = {'<', '>', '|', ';'}