#include #include #include #include"mars_types.h" /* importe les types utilisés dans le programme */ #include"options.h" /* Inclus les options du programme */ int verif_instru(char* instru, char* arg1, char* arg2){ /* vérifie les instructions */ printf("%s %s %s", instru, arg1, arg2); } int ouvrir_fichier(char* path){ union mars_instruction toto; FILE* fluxouverture; char instru[4]; char arg1[4], arg2[4]; int c=0; int i; int ligne=0; char buffer[4]; char verifarg1[1], verifarg2[1]; int flagverif1, flagverif2; char previnstru[4]; // contient l'instruction ayant été "mal interprétée" à cause d'une instruction mauvaise int errinstru; // flag qui aide le prog à savoir si l'instruction précédente était mauvaise buffer[0]='\0'; fluxouverture=fopen(path, "r"); if (fluxouverture == NULL){ perror("fopen"); return EXIT_FAILURE; } if (fluxouverture){ while (!feof(fluxouverture)){ instru[0]='\0'; arg1[0]='\0'; arg2[0]='\0'; printf("\n"); fscanf(fluxouverture, "%4s %4s %4s", instru, arg1, arg2); for (i=0; i