/* * File: parser.h * Author: Arthur Brandao * * Created on 31 octobre 2018 */ #ifndef PARSER_H #define PARSER_H /* --- Include --- */ #include "constante.h" #include "str.h" /* --- Structure --- */ typedef struct{ char* cmd; //La commande en string char* name; //Le nom de la commande int argc; //Le nombre d'argument char** argv; //Les arguments int input; //Descripteur de fichier d'entré int output; //Descripteur de fichier de sortie int error; //Descripteur de fihier d'erreur boolean erase[2]; //Si on efface le fichier int next; //Lien avec la prochaine commande }Command; typedef struct{ Command** cmd; //Tableau avec toutes les commandes int length; //Taille du tableau boolean bck; //Si l'ensemble de commande se fait en fond }CommandTab; /* --- Fonctions --- */ int parse_line(CommandTab*, char*); int parse_command(Command*); int parse_all_command(CommandTab*); void clean_command(CommandTab*); #endif /* PARSER_H */