/working/functions.h
C++ Header | 47 lines | 30 code | 15 blank | 2 comment | 0 complexity | a9db56c78dd76bffeee5f1106083d4d0 MD5 | raw file
1#ifndef __FUNCTIONS__ 2#define __FUNCTIONS__ 3 4#include <stdio.h> 5#include <sys/types.h> 6#include <sys/wait.h> 7#include <sys/times.h> 8#include <unistd.h> 9#include <signal.h> 10#include <string.h> 11#include <stdlib.h> 12#define TRUE 1 13#define FALSE 0 14#define MAXLINE 1024 15 16typedef struct listOfCommands listOfCommands; 17 18// éléments de la liste composés : des différents arg c-a-d le nom du prog plus autre chose + la présence du pipe + présence background + présence redirect + pointeur vers le prochain élém de la liste 19struct listOfCommands 20{ 21 char **arg; 22 int numArg; 23 int pipe; 24 int bg; 25 int redirect; 26 listOfCommands *nxt; 27}; 28// pointeur vers le 1er élément de la liste, d'ou le nom de commandLine 29typedef listOfCommands* commandLine; 30 31 32commandLine analyseCommandLine(char * line); 33listOfCommands* commandLineInitialisation(listOfCommands * listOfCommands); 34listOfCommands* addArg(listOfCommands *listOfCommands, char *newArg); 35void printListOfCommands(listOfCommands* commandLine); 36listOfCommands* deleteElement(listOfCommands* commandLine); 37 38#endif 39 40 41 42 43 44 45 46 47