|
|
@ -49,8 +49,103 @@ VilleIUT lire(FILE * fe) {
|
|
|
|
|- décision ( admis - 1 /attente 0 default /refusé -2 )
|
|
|
|
|- décision ( admis - 1 /attente 0 default /refusé -2 )
|
|
|
|
|- validation candidat ( 0 default / -1 refus de ce choix / 2 accepte )
|
|
|
|
|- validation candidat ( 0 default / -1 refus de ce choix / 2 accepte )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doit venir du menu car sinon pas de transport pour la part 3,
|
|
|
|
|
|
|
|
le tableau de pointeur qui contient listcandinfo et listcand,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
combien de fonctionnalité en combien de fonction ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-charger fichier
|
|
|
|
|
|
|
|
-modifier choix
|
|
|
|
|
|
|
|
-ajouter choix
|
|
|
|
|
|
|
|
-supp choix
|
|
|
|
|
|
|
|
-afficher les infos d'un cand
|
|
|
|
|
|
|
|
-tout cand d'un dep (ordre alphabétique)
|
|
|
|
|
|
|
|
-enregistrer fichier
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
charger -- recup :
|
|
|
|
|
|
|
|
-nb candi
|
|
|
|
|
|
|
|
-listcandinfo
|
|
|
|
|
|
|
|
-nb choix
|
|
|
|
|
|
|
|
-listcand
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
j'ai deux tableau 1 avec infoetu et l'autre les choix de l'etu au meme niveau que lui
|
|
|
|
|
|
|
|
tinfoetu est tableau de pointeur sur structure
|
|
|
|
|
|
|
|
tcarteetu est tableau de pointeur sur files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
quand on quitte il vide tout avec free
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
booleen listevide(Filecartecand f){
|
|
|
|
|
|
|
|
if(f.tete==NULL){return True;}
|
|
|
|
|
|
|
|
return False;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Filecartecand initial(void){
|
|
|
|
|
|
|
|
Filecartecand f; f.queue=NULL; f.tete=NULL; return f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Filecartecand enfiler(Filecartecand f, char Ville[], char dep[], int decision, int validation){
|
|
|
|
|
|
|
|
Mailloncartecand*m;
|
|
|
|
|
|
|
|
m=(Mailloncartecand*)malloc(sizeof(Mailloncartecand*));
|
|
|
|
|
|
|
|
if(m==NULL){printf("<! pb malloc in enfiler !>");exit(1);}
|
|
|
|
|
|
|
|
strcpy(m->Ville,Ville);
|
|
|
|
|
|
|
|
strcpy(m->dep,dep);
|
|
|
|
|
|
|
|
m->decision=decision;
|
|
|
|
|
|
|
|
m->validation=validation;
|
|
|
|
|
|
|
|
m->suivant=NULL;
|
|
|
|
|
|
|
|
if(listevide(f)){
|
|
|
|
|
|
|
|
f.tete=m;
|
|
|
|
|
|
|
|
f.queue=m;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
f.queue->suivant=m;
|
|
|
|
|
|
|
|
f.queue=m;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listcandinfo lireMat(FILE *fe){
|
|
|
|
|
|
|
|
listcandinfo etu;
|
|
|
|
|
|
|
|
fscanf(fe ,"%d", &etu.numetu);
|
|
|
|
|
|
|
|
fgets(etu.numetu, 31, fe);
|
|
|
|
|
|
|
|
*(etu.numetu +(strlen(etu.numetu) - 1)) = '\0';
|
|
|
|
|
|
|
|
fgets(etu.prenometu, 31, fe);
|
|
|
|
|
|
|
|
*(etu.prenometu +(strlen(etu.prenometu) - 1)) = '\0';
|
|
|
|
|
|
|
|
fscanf(fe ,"%d %d %d %d %d", &etu.note[1], &etu.note[2], &etu.note[3], &etu.[4], &etu.choix);
|
|
|
|
|
|
|
|
return etu;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int chargetableaux(char nomFich[], listcandinfo *tinfoetu[], listcanddept *tcarteetu[], int Tmax){
|
|
|
|
|
|
|
|
listcandinfo a;
|
|
|
|
|
|
|
|
listcand b;
|
|
|
|
|
|
|
|
int i=0;
|
|
|
|
|
|
|
|
FILE *fe;
|
|
|
|
|
|
|
|
fe = fopen( nomFich , "r");
|
|
|
|
|
|
|
|
if(fe==NULL){printf("<! pb in chargeFmatieres to open file !>\n");return-1;}
|
|
|
|
|
|
|
|
a = lireMat(fe);
|
|
|
|
|
|
|
|
while(!feof(fe)){
|
|
|
|
|
|
|
|
if(i==Tmax){printf("<! pb in chargeFmatieres with tMat capacity !>\n");fclose(fe);return-1;}
|
|
|
|
|
|
|
|
tinfoetu[i] = (listcandinfo*)malloc(sizeof(listcandinfo));
|
|
|
|
|
|
|
|
if(table[i]==NULL){printf("<! pb in chargeFmatieres with tMat malloc !>\n");fclose(fe);return-1;}
|
|
|
|
|
|
|
|
*tinfoetu[i]= a;
|
|
|
|
|
|
|
|
a = lireMat(fe);
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose(fe);
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Partie 3
|
|
|
|
// Partie 3
|
|
|
|