Guest User

Untitled

a guest
Apr 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include "Codage_Decodage.h"
  5. #include "analyse_syntax.h"
  6.  
  7.  
  8.  
  9.  
  10. int main(int argc, char *argv[])
  11. {
  12. /* Test de codage
  13. char clef[]="chute";
  14. cript_decript(clef, "test.txt", "test2.txt");*/
  15.  
  16.  
  17. int pos;
  18.  
  19. /*vérification si la balise -k a été saisie*/
  20.  
  21. char baliseclef[]= "-k";
  22. pos = analyse(argc,argv,baliseclef);
  23.  
  24. if (pos == -1)
  25. {
  26. printf("ERROR: command line\n");
  27. exit(EXIT_FAILURE) ;
  28. }
  29. char *clef = argv[pos+1];
  30.  
  31.  
  32. /*vérification si la balise -o a été saisie*/
  33.  
  34. char baliseficho[]= "-o";
  35. pos = analyse(argc,argv,baliseficho);
  36.  
  37. if (pos == -1)
  38. {
  39. printf("ERROR: command line\n");
  40. exit(EXIT_FAILURE) ;
  41. }
  42. char *fichierOUT = argv[pos+1];
  43.  
  44. /*vérification si la balise -i a été saisie*/
  45.  
  46. char balisefichi[]= "-i";
  47. pos = analyse(argc,argv,balisefichi);
  48.  
  49. if (pos == -1)
  50. {
  51. printf("ERROR: command line\n");
  52. exit(EXIT_FAILURE) ;
  53. }
  54.  
  55. char *fichierIN = argv[pos+1];
  56.  
  57. /* criptage à partir du script*/
  58.  
  59. cript_decript(clef,fichierIN,fichierOUT);
  60.  
  61. return 0;
  62. }
Add Comment
Please, Sign In to add comment