Livl Shell  0.1
Livl Shell is an intermediate reimplementation of the bash shell in C language.
Functions
command_sequence.h File Reference

File containing the command sequence functions to manage the command sequence (commands and operators). More...

#include "command.h"
#include "scheduler.h"
#include "operator.h"
#include "redirection.h"
#include "constants.h"
Include dependency graph for command_sequence.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void command_sequence_init (char *input)
 Initialize the command sequence module. More...
 
void process_token (char *token, char **commands, char **operators, char **currentCommand, int *cmdIndex, int *opIndex)
 Checks if the given token is a command or an operator. More...
 
void store_command (char **commands, char **currentCommand, int *cmdIndex)
 Stores the current command in the commands array. More...
 
void free_command_sequence (CommandSequence *sequence)
 

Detailed Description

File containing the command sequence functions to manage the command sequence (commands and operators).

Author
Julien & Franck
Date
24 Dec 2023

Function Documentation

◆ command_sequence_init()

void command_sequence_init ( char *  input)

Initialize the command sequence module.

Parameters
inputThe input string parsed

◆ free_command_sequence()

void free_command_sequence ( CommandSequence sequence)

Free the memory allocated for a command sequence Each command in the sequence is also freed

Parameters
sequencethe command sequence to free

◆ process_token()

void process_token ( char *  token,
char **  commands,
char **  operators,
char **  currentCommand,
int *  cmdIndex,
int *  opIndex 
)

Checks if the given token is a command or an operator.

Parameters
tokenThe token to be checked
commandsThe array of commands
operatorsThe array of operators
currentCommandThe current command
cmdIndexThe index of the current command
opIndexThe index of the current operator

◆ store_command()

void store_command ( char **  commands,
char **  currentCommand,
int *  cmdIndex 
)

Stores the current command in the commands array.

Parameters
commandsThe array of commands
currentCommandThe current command
cmdIndexThe index of the current command