diff --git a/README.md b/README.md index 74126dc..b0c9334 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,45 @@ -# SAE 1.01 - Implémentation d'un besoin client +===================================== +SAÉ 1.01 - Implémentation d'un besoin client +===================================== -__1A - Groupe 7/8:__ -- Rémi LAVERGNE -- Julien ABADIE -- Louis GERMAIN +Par: +Rémi LAVERGNE - Julien ABADIE - Louis GERMAIN +Groupe 7/8 - 1A 2023-2024 + +**Répartition du Travail** +----------------------- + +Rémi LAVERGNE : / +Louis GERMAIN : / +Julien ABADIE : / + +**Composition des fichiers sources** +-------------------------------- + +- *main.c* >> Juste la fonction main, se lançant lors de l'exécution du programme. +- *main.h* >> Tous les prototypes des fonctions réalisées, ainsi que les inclusions de module et déclaration de constantes. + + +- *articles.txt* >> Fichier texte composé de x colonnes, +- *clients.txt* >> Fichier texte composé de x colonnes dans l'ordre qui suit : + identifiant | mot de passe | cagnotte | suspendu (0=actif ; 1=suspendu) | rôle (0=client ; 1=administrateur) + + +**Fonctionnement** +------------ + + + +Jeu de données +============== + +articles.txt +``` +/ +``` + +clients.txt +``` +/ +``` \ No newline at end of file diff --git a/src/traitement.c b/src/traitement.c index 0b0952d..3492cbd 100644 --- a/src/traitement.c +++ b/src/traitement.c @@ -48,7 +48,6 @@ int chargeArticles(int reference[], float weight[], float volume[], float unitPr if(article==NULL) { errorHandling(-4); - exit(1); } int ref, tL=0; @@ -98,8 +97,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su client = fopen("clients.txt","r"); if(client==NULL) { - printf("ERREUR: Echec de l'ouverture en lecture de 'clients.txt'.\n"); - exit(1); + errorHandling(-4); } int id, passwd, sus, tL=0, adm; @@ -110,7 +108,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su { if(tL == tmaxArticles) { - printf("Tableau trop petit.\n"); + errorHandling(-3); return tL; } @@ -166,14 +164,10 @@ void sauvegardeArticles(int reference[], float weight[], float volume[], float u article = fopen("articles.txt","w"); if(article==NULL) { - printf("ERREUR: Echec de l'ouverture en écriture de 'articles.txt'.\n"); - exit(1); + errorHandling(-5); } - - int i; - for(i=0; i