/working/functions.h

http://fatalblueshell.googlecode.com/ · C++ Header · 47 lines · 30 code · 15 blank · 2 comment · 0 complexity · a9db56c78dd76bffeee5f1106083d4d0 MD5 · raw file

  1. #ifndef __FUNCTIONS__
  2. #define __FUNCTIONS__
  3. #include <stdio.h>
  4. #include <sys/types.h>
  5. #include <sys/wait.h>
  6. #include <sys/times.h>
  7. #include <unistd.h>
  8. #include <signal.h>
  9. #include <string.h>
  10. #include <stdlib.h>
  11. #define TRUE 1
  12. #define FALSE 0
  13. #define MAXLINE 1024
  14. typedef struct listOfCommands listOfCommands;
  15. // é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
  16. struct listOfCommands
  17. {
  18. char **arg;
  19. int numArg;
  20. int pipe;
  21. int bg;
  22. int redirect;
  23. listOfCommands *nxt;
  24. };
  25. // pointeur vers le 1er élément de la liste, d'ou le nom de commandLine
  26. typedef listOfCommands* commandLine;
  27. commandLine analyseCommandLine(char * line);
  28. listOfCommands* commandLineInitialisation(listOfCommands * listOfCommands);
  29. listOfCommands* addArg(listOfCommands *listOfCommands, char *newArg);
  30. void printListOfCommands(listOfCommands* commandLine);
  31. listOfCommands* deleteElement(listOfCommands* commandLine);
  32. #endif