Blame view

main.c 801 Bytes
7d87f7e2   grouille   Makefile + complè...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  // --------------------------------------------------------

  // Projet IMA3 2019 - Lecture d'une bibliothèque

  // Décompte du nombre de fautes d'orthographe dans un texte

  // Normand Quentin & Rouillé Guillaume

  // --------------------------------------------------------

  

  #include "tree.h"

  

  int main(int argc, char *argv[])

  {

    Node tree = NULL;

    int error = 0;

    FILE* fp_lib;

    FILE* fp_txt;

    fp_lib = fopen(argv[argc-2], "r");

    fp_txt = fopen(argv[argc-1], "r");

  

    init_tree(&tree);

    read_lib(fp_lib, &tree);

    read_txt(fp_txt, &tree, &error);

  

    // printf("%p\n", tree);

  

    //print_first(tree);

    //printf("\n");

    //print_tree(tree, 0);

    

    printf("erreurs : %d\n", error);

  

    free_tree(&tree);

    fclose(fp_lib);

    fclose(fp_txt);

    return EXIT_SUCCESS;

  }