|
|
|
@ -361,3 +361,33 @@ int saveCandidats(ListeCandidats liste, int nbCandidats) {
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int readStatus(void) {
|
|
|
|
|
int status;
|
|
|
|
|
|
|
|
|
|
FILE *fe = fopen("donnees/status.don", "r");
|
|
|
|
|
|
|
|
|
|
if(fe == NULL) {
|
|
|
|
|
perror("fopen");
|
|
|
|
|
exit(errno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fscanf(fe, "%d", &status);
|
|
|
|
|
|
|
|
|
|
fclose(fe);
|
|
|
|
|
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void saveStatus(int status) {
|
|
|
|
|
FILE *fe = fopen("donnees/status.don", "w");
|
|
|
|
|
|
|
|
|
|
if(fe == NULL) {
|
|
|
|
|
perror("fopen");
|
|
|
|
|
exit(errno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fprintf(fe, "%d", status);
|
|
|
|
|
|
|
|
|
|
fclose(fe);
|
|
|
|
|
}
|