/* programme : commun.h auteur : Lola Chalmin, Roxane Rossetto date : 13/12/22 finalité : SAE 1.02 Algorithme */ /* Brief : */ #define TAILLE 100; typedef struct { char ville[20];//ville choisie char dptmt[20];//département choisi int dec;//décision du choix int valid;//validation du candidat }Choix; typedef struct Listchx{ Choix chx; struct Listchx * suivchx; }Maillonchx; typedef Maillonchx * Listechx; typedef struct { int nEtu;//numéro d'étudiant char nom[20];//nom de l'étudiant char prenom[20];//prénom de l'étudiant float moymat;//moyenne en maths float moyfr;//moyenne en français float moyen;//moyenne en anglais float moyspe;//moyenne en spécialité int nbchx;//nombre de choix Listechx lchx; }Candidat; typedef struct Mailloncand{ Candidat cand; struct Mailloncand * suivcand; }Mailloncand; typedef Mailloncand * Listecand; Choix lirechx (void);//permet de lire un choix selon une entrée stdin Choix lireC(FILE *fe);//ermet de lire un choix avec un FILe de type fichier.don Candidat lireCandidat(void);//permet de lire un candidat avec le clavier Candidat lireCa(FILE *fe);//permet de lire un candidat selon le fichier.don Listechx InsertTC(Listechx list, Choix m);//insertion en tête d'un maillon de type choix Listechx InsertC(Listechx list, Choix m);//insertion globale d'un maillon de type choix void AffC(Candidat c);//affichage simple d'un candidat void AffCh(Choix c);//affichage simple d'un choix void AffListeCandidat (Listecand l);//affiche complet de la liste de candidats void AffListChoix(Listechx l);//affichage complet de la liste de choix Listecand recherchenom (Listecand l, char *nom );//recherche par un nom dans une liste de candidats Listecand recherchenum (Listecand l, int num);//recherche par le numéro dans une liste de candidats Listecand Chargementlistecandidat(FILE *fe, Listecand lC, int *nbC);//chargement du fichier dans une liste de candidats Listecand Insert(Listecand list, Candidat c);//insertion en tête d'un maillon de type Candidat Listecand InsertT(Listecand list, Candidat c);//insertion globale d'un maillon de type Candidat void test (void);//fonction globale void testchgt(void); void saveC(Listecand lC, FILE *fs); void Save(Listecand lC, int nbC); void saveChx(Listechx lCh, FILE *fs);