|
|
|
@ -1,5 +1,32 @@
|
|
|
|
|
#include "../includes/main.h"
|
|
|
|
|
|
|
|
|
|
// l'initialisation est temporaire, je ne savais pas comment tu voulais la faire
|
|
|
|
|
|
|
|
|
|
// initialisation des travaux
|
|
|
|
|
Offre *initTabTravaux(void)
|
|
|
|
|
{
|
|
|
|
|
Offre *tabTravaux;
|
|
|
|
|
|
|
|
|
|
tabTravaux = (Offre *)malloc(TMAXTRAV* sizeof(Offre));
|
|
|
|
|
if (!tabTravaux)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mmalloc tableau tabTravaux\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialisation de chaque élément du tableau
|
|
|
|
|
tabTravaux[0] = newOffre("Electricite");
|
|
|
|
|
tabTravaux[1] = newOffre("Finitions");
|
|
|
|
|
tabTravaux[2] = newOffre("Fondation");
|
|
|
|
|
tabTravaux[3] = newOffre("Murs");
|
|
|
|
|
tabTravaux[4] = newOffre("Peinture");
|
|
|
|
|
tabTravaux[5] = newOffre("Plomberie");
|
|
|
|
|
tabTravaux[6] = newOffre("Sols");
|
|
|
|
|
tabTravaux[7] = newOffre("Structure");
|
|
|
|
|
|
|
|
|
|
return (tabTravaux);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------devis---------------*/
|
|
|
|
|
|
|
|
|
|
// Chargement d'une chaine de caracteres depuis un fichier
|
|
|
|
@ -64,33 +91,6 @@ Devis loadDevis(FILE *devisFile, Offre *tabTravaux)
|
|
|
|
|
return (d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// l'initialisation est temporaire, je ne savais pas comment tu voulais la faire -> à partir du file
|
|
|
|
|
|
|
|
|
|
// initialisation des travaux
|
|
|
|
|
Offre *initTabTravaux(void)
|
|
|
|
|
{
|
|
|
|
|
Offre *tabTravaux;
|
|
|
|
|
|
|
|
|
|
tabTravaux = (Offre *)malloc(TMAXTRAV * sizeof(Offre));
|
|
|
|
|
if (!tabTravaux)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mmalloc tableau tabTravaux\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialisation de chaque élément du tableau
|
|
|
|
|
tabTravaux[0] = newOffre("Electricite");
|
|
|
|
|
tabTravaux[1] = newOffre("Finitions");
|
|
|
|
|
tabTravaux[2] = newOffre("Fondation");
|
|
|
|
|
tabTravaux[3] = newOffre("Murs");
|
|
|
|
|
tabTravaux[4] = newOffre("Peinture");
|
|
|
|
|
tabTravaux[5] = newOffre("Plomberie");
|
|
|
|
|
tabTravaux[6] = newOffre("Sols");
|
|
|
|
|
tabTravaux[7] = newOffre("Structure");
|
|
|
|
|
|
|
|
|
|
return (tabTravaux);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Chagement des ofrres depuis le fichier devis.txt
|
|
|
|
|
Offre *loadOffre(void)
|
|
|
|
|
{
|
|
|
|
@ -178,4 +178,4 @@ Precedence *loadPrec(int *tmax, int *tlog)
|
|
|
|
|
}
|
|
|
|
|
fclose(prec);
|
|
|
|
|
return tabP;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|