You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.5 KiB

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
typedef struct
{
char dept[31];
int nbP;
char respAd[31];
} Departement;
typedef struct maillonDept
{
Departement d;
struct maillonDept *suiv;
} MaillonDept,*ListeDept;
typedef struct
{
char nom[31];
ListeDept lDept;
} VilleIUT;
typedef struct
{
char ville[31];
char dep[31];
int decisionResp;
int decisionCand;
} Choix;
typedef struct
{
int numeroC;
char nom[31];
char prenom[31];
float notes[4];
float moyenne;
int nombreChoix;
Choix **tChoix;
} Candidat;
typedef struct maillonCand
{
Candidat *c;
struct maillonCand *suiv;
} MaillonCandidat, *ListeCand;
typedef struct
{
MaillonCandidat *t;
MaillonCandidat *q;
} FileCand;
/* Fonctions de Chargement et sauvegarde*/
Candidat ** chargementCandidats(int *tMax);
Candidat * lireCandidat(FILE *flot);
Choix * lireChoix(FILE *flot);
void sauvegarder(Candidat *tCand[], int tMax);
/* Fonctions d'affichage*/
void afficherCandidat(Candidat *c);
void afficherChoix(Choix *c);
void afficherCandChoix(Candidat *tCand[],int tMax);
void afficherCandDep(Candidat *tCand[], int tMax);
/* Fonctions de réallocation */
Candidat ** reallocationCand(Candidat *tCand[], int tMax);
Choix ** reallocationChoix(Choix *tChoix[], int nbChoix);
/* Fonctions de tri */
void triCandidats(Candidat *tCand[], int tMax);
int plusGrandCand(Candidat *tCand[], int tMax);
void echangerCand(Candidat *tCand[], int i, int j);
void triChoix(Choix *tChoix[], int nombreChoix);
int plusGrandChoix(Choix *tChoix[], int nombreChoix);
void echangerChoix(Choix *tChoix[], int i, int j);
/* Fonctions de recherche */
int rechercherChoix(Choix *tChoix[], int nombreChoix, char ville[], char dep[], int *trouve);
int rechercherCandidat(Candidat *tCand[], int tMax, int numeroC, int *trouve);
/* Fonctions d'insertion/suppresion/maj*/
Choix ** insererChoix(Choix *tChoix[], int *nombreChoix);
Choix ** supprimerChoix(Choix *tChoix[], int *nombreChoix);
void miseAJourChoixCand(Choix *tChoix[], int nombreChoix);
void miseAJourChoixResp(Choix *tChoix[], int pos);
Candidat ** creerCandidat(Candidat *tCand[], int *tMax);
/* Fonctions de file d'attente */
FileCand filenouv(void);
FileCand adjq(FileCand f, Candidat *c);
FileCand supt(FileCand f);
FileCand supCand(FileCand f, int numeroC);
Candidat * tete(FileCand f);
int longueurFile(FileCand f);
int positionFileAttente(FileCand f, int numeroC);
/* Fonctions globale, menus*/
void globale(void);
void menuCandidat(Candidat *tCand[], int tMax);
void clearpage(void);