|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include "saeAnnexe.h"
|
|
|
|
|
#include "../partie1/saeP1.h"
|
|
|
|
|
|
|
|
|
|
void menu(void){
|
|
|
|
|
printf("#--------------------------------------------------------------------#\n");
|
|
|
|
@ -16,11 +17,47 @@ void menu(void){
|
|
|
|
|
printf("Choisissez votre session : ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int loadIUT(char* tiut[]){
|
|
|
|
|
break//A FAIRE !
|
|
|
|
|
int loadIUT(VilleIUT** tiut){
|
|
|
|
|
FILE* f=fopen("Etudiants.bin","rb");
|
|
|
|
|
MaillonDep* m;
|
|
|
|
|
if(f==NULL){
|
|
|
|
|
perror("fopen");
|
|
|
|
|
exit(errno);
|
|
|
|
|
}
|
|
|
|
|
int tlogi;
|
|
|
|
|
fread(tlogi,sizeof(int),1,f);
|
|
|
|
|
for(int i=0; i<tlogi; i++){
|
|
|
|
|
fread(tiut[i]->Ville,sizeof(char),31,f);
|
|
|
|
|
}
|
|
|
|
|
for(i=0; i<tlogi; i++){
|
|
|
|
|
int nbIUTs,
|
|
|
|
|
fread(nbIUTs,sizeof(int),1,f);
|
|
|
|
|
if(nbIUTs){
|
|
|
|
|
tiut[i]->ldept=(MaillonDep*)malloc(sizeof(MaillonDep));
|
|
|
|
|
if(tiut[i]->ldept==NULL){
|
|
|
|
|
perror("malloc");
|
|
|
|
|
exit(errno);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m=tiut[i]->ldept;
|
|
|
|
|
for(int j=0; j<nbIUTs; j++){
|
|
|
|
|
fread(m->departement,sizeof(char),31,f);
|
|
|
|
|
fread(m->nbp,sizeof(int),1,f);
|
|
|
|
|
fread(m->resp,sizeof(char),51,f);
|
|
|
|
|
if(j<nbIUTs-1){
|
|
|
|
|
m->suivant=(MaillonDep*)malloc(sizeof(MaillonDep));
|
|
|
|
|
if(m->suivant==NULL){
|
|
|
|
|
perror("malloc");
|
|
|
|
|
exit(errno);
|
|
|
|
|
}
|
|
|
|
|
m=m->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tlogi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int rechercheTabStr(char* tab[],int lTab,char* mot){
|
|
|
|
|
int rechercheTabStr(char* tab[],int lTab,char* mot){/////////////////////////////////////// N O N /////////////////////////////
|
|
|
|
|
if(!lTab){
|
|
|
|
|
fprintf(stderr,"Erreur, Pas d'éléments dans le tableau !");
|
|
|
|
|
return -1;
|
|
|
|
|