Minishell
Loading...
Searching...
No Matches
run_command.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "../include/main.h"
#include "../include/utils.h"
#include "../include/fill_command.h"
#include "../include/fill_data.h"
#include "../include/run_command.h"
#include "../include/builtins.h"
#include "../include/read_input.h"
Include dependency graph for run_command.c:

Functions

int run_command (data_t *data, run_command_t *com)
 
int decide_wich_command (data_t *data, char *input, run_command_t *comm)
 
void ask_command (data_t *data)
 
int start_program (char **env)
 

Variables

char command [PATH_MAX]
 

Function Documentation

◆ ask_command()

void ask_command ( data_t * data)

This will read the user input using getline or read with non-cannonical mode depending if the user is using a terminal or not

Parameters
dataGlobal data structure
Here is the call graph for this function:

◆ decide_wich_command()

int decide_wich_command ( data_t * data,
char * input,
run_command_t * comm )
Parameters
dataGlobal data structure
inputthe text that the user wrote
commThe current command to execute
Returns
Return 0 if everything is ok, 1 if the command is exite
Here is the call graph for this function:

◆ run_command()

int run_command ( data_t * data,
run_command_t * com )

◆ start_program()

int start_program ( char ** env)
Here is the call graph for this function:

Variable Documentation

◆ command

char command[PATH_MAX]