/working/functions.h
http://fatalblueshell.googlecode.com/ · C++ Header · 47 lines · 30 code · 15 blank · 2 comment · 0 complexity · a9db56c78dd76bffeee5f1106083d4d0 MD5 · raw file
- #ifndef __FUNCTIONS__
- #define __FUNCTIONS__
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <sys/times.h>
- #include <unistd.h>
- #include <signal.h>
- #include <string.h>
- #include <stdlib.h>
- #define TRUE 1
- #define FALSE 0
- #define MAXLINE 1024
- typedef struct listOfCommands listOfCommands;
- // é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
- struct listOfCommands
- {
- char **arg;
- int numArg;
- int pipe;
- int bg;
- int redirect;
- listOfCommands *nxt;
- };
- // pointeur vers le 1er élément de la liste, d'ou le nom de commandLine
- typedef listOfCommands* commandLine;
- commandLine analyseCommandLine(char * line);
- listOfCommands* commandLineInitialisation(listOfCommands * listOfCommands);
- listOfCommands* addArg(listOfCommands *listOfCommands, char *newArg);
- void printListOfCommands(listOfCommands* commandLine);
- listOfCommands* deleteElement(listOfCommands* commandLine);
- #endif