Blame view

fonction.h 1.67 KB
fdefda76   DUVAL   commit final
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  #ifndef FONCTION_H_INCLUDED

  #define FONCTION_H_INCLUDED

  #define TABLE_SIZE 100

  #define LINE_MAX 1000

  #include <stdio.h>

  #include <stdlib.h>

  #include <string.h>

  

  

      typedef struct Oeuvres Oeuvres;

      struct Oeuvres

      {

          char title[LINE_MAX];

          char annee[LINE_MAX];

          char commentaire[LINE_MAX];

          Oeuvres *suivant;

  

      };

  

  

      typedef Oeuvres *ptoeuvres;

  

  

      typedef struct Realisateur Realisateur;

      struct Realisateur

      {

          char nom[LINE_MAX];

          char prenom[LINE_MAX];

          ptoeuvres filmographie;

          Realisateur *suivant;

      };

  

      typedef Realisateur *ptrealisateur;

      typedef ptrealisateur tableReal[TABLE_SIZE];

  

  

      int hash(char *word);

      void initTable(tableReal table);

      int hashNum(char nom[LINE_MAX],char prenom[LINE_MAX]);

  

  

      int findEnd(char line[LINE_MAX]);

  

      void initOeuvre(ptoeuvres oe);

  

      int readPartOfLine(int a,int b,char line[LINE_MAX],char part[LINE_MAX]);

      void readElement(char element[LINE_MAX],ptoeuvres film);

      void readFile(FILE *file, tableReal database);

  

      ptrealisateur findReal(tableReal table,char nom[LINE_MAX],char prenom[LINE_MAX]);

  

      void afficherFilm(ptoeuvres oe);

      void afficherTable(tableReal table);

      void afficherReal(tableReal table,char nom[LINE_MAX],char prenom[LINE_MAX]);

  

      void addReal(tableReal table,char nom[LINE_MAX],char prenom[LINE_MAX]);

      void addFilm(tableReal table,char nom[LINE_MAX],char prenom[LINE_MAX] );

  

      int eraseFilm(ptrealisateur real,char title[LINE_MAX]);

      void eraseReal(tableReal table,char nom[LINE_MAX],char prenom[LINE_MAX]);

  

  

  

  

  

  #endif // FONCTION_H_INCLUDED