Diff for /rpl/src/instructions_o1.c between versions 1.44 and 1.45

version 1.44, 2012/01/17 14:44:08 version 1.45, 2012/02/23 13:05:08
Line 942  instruction_open(struct_processus *s_eta Line 942  instruction_open(struct_processus *s_eta
   
     struct_objet                *s_objet_argument;      struct_objet                *s_objet_argument;
     struct_objet                *s_objet_resultat;      struct_objet                *s_objet_resultat;
       struct_objet                *s_parametres_tty;
   
       struct termios              tc;
   
     uint32_t                    adresse_ipv4;      uint32_t                    adresse_ipv4;
   
Line 1019  instruction_open(struct_processus *s_eta Line 1022  instruction_open(struct_processus *s_eta
   
         printf("    { \"filetype\" \"access\" \"format\" { \"name\" "          printf("    { \"filetype\" \"access\" \"format\" { \"name\" "
                 "\"file name\" } \"protection\" } OPEN\n");                  "\"file name\" } \"protection\" } OPEN\n");
           printf("    { \"filetype\" \"access\" \"format\" { \"name\" "
                   "\"file name\" } \n"
                   "           { \"stty\" { \"stty parameters\" ... } } } OPEN\n");
         printf("    { \"sockettype\" { \"name\" \"local name\" } } OPEN\n");          printf("    { \"sockettype\" { \"name\" \"local name\" } } OPEN\n");
         printf("    { \"sockettype\" \"socketdomain\" \"protection\" } OPEN\n");          printf("    { \"sockettype\" \"socketdomain\" \"protection\" } OPEN\n");
         printf("    \"/semaphore\" OPEN\n");          printf("    \"/semaphore\" OPEN\n");
Line 1031  instruction_open(struct_processus *s_eta Line 1037  instruction_open(struct_processus *s_eta
         printf("    Socket protocol : IPV4/IPV6/UNIX\n");          printf("    Socket protocol : IPV4/IPV6/UNIX\n");
         printf("    Format          : FORMATTED/UNFORMATTED/FLOW\n");          printf("    Format          : FORMATTED/UNFORMATTED/FLOW\n");
         printf("    Protection      : READONLY/WRITEONLY/READWRITE\n\n");          printf("    Protection      : READONLY/WRITEONLY/READWRITE\n\n");
           printf("    Stty parameters : can be prefixed by 'NO'\n");
           printf("            IGNBRK, BRKINT, IGNPAR, PARMRK, INPCK, ISTRIP\n");
           printf("            INLCR, IGNCR, ICRNL, IXON, IXANY, IXOFF,\n");
           printf("            IMAXBEL, OPOST, ONLCR, OCRNL, ONOCR, ONLRET,\n");
           printf("            OFILL, HUPCL, CLOCAL, CRTSCTS, ISIG, ICANON,\n");
           printf("            ECHO, ECHOE, ECHOK, ECHONL, NOFLSH, TOSTOP,\n");
           printf("            IEXTEN, VEOF, VEOL, VERASE, VINTR, VKILL,\n");
           printf("            VQUIT, VSTART, VSTOP, VSUSP\n");
   
         printf("    Address         : { \"ADDRESS\" [ 127 0 0 1 ] }\n");          printf("    Address         : { \"ADDRESS\" [ 127 0 0 1 ] }\n");
         printf("                      { \"HOST\" \"hostname\" }\n");          printf("                      { \"HOST\" \"hostname\" }\n");
Line 1061  instruction_open(struct_processus *s_eta Line 1075  instruction_open(struct_processus *s_eta
         printf("    { \"STREAM\" \"READWRITE\" } OPEN\n");          printf("    { \"STREAM\" \"READWRITE\" } OPEN\n");
         printf("    { \"FOREIGN\" \"DATAGRAM\" } OPEN\n");          printf("    { \"FOREIGN\" \"DATAGRAM\" } OPEN\n");
         printf("    { \"LOCAL\" { \"NAME\" \"socket.sock\" } } OPEN\n");          printf("    { \"LOCAL\" { \"NAME\" \"socket.sock\" } } OPEN\n");
           printf("    { \"/dev/ttyS1\" { \"STTY\" { \"9600,8,N,1\" "
                   "\"NO ICANON\" \"IGNBRK\" } }\n");
   
         return;          return;
     }      }
Line 1121  instruction_open(struct_processus *s_eta Line 1137  instruction_open(struct_processus *s_eta
         timeout_emission = 0;          timeout_emission = 0;
         timeout_reception = 0;          timeout_reception = 0;
         drapeau = -1;          drapeau = -1;
           s_parametres_tty = NULL;
   
         for(i = 0; i < 12; options[i++] = 'N');          for(i = 0; i < 12; options[i++] = 'N');
   
Line 1973  instruction_open(struct_processus *s_eta Line 1990  instruction_open(struct_processus *s_eta
                                         (*(*l_element_courant_sous_objet)                                          (*(*l_element_courant_sous_objet)
                                         .donnee).objet;                                          .donnee).objet;
   
                 for(i = 0; i < strlen(protocole_socket); i++)                                  for(i = 0; i < strlen(protocole_socket); i++)
                 {                                  {
                     if ((protocole_socket[i] >= 'a') &&                                      if ((protocole_socket[i] >= 'a') &&
                             (protocole_socket[i] <= 'z'))                                              (protocole_socket[i] <= 'z'))
                     {                                      {
                         protocole_socket[i] -= 'a' - 'A';                                          protocole_socket[i] -= 'a' - 'A';
                     }                                      }
                 }                                  }
   
                             }                              }
                             else                              else
                             {                              {
Line 2250  instruction_open(struct_processus *s_eta Line 2266  instruction_open(struct_processus *s_eta
                                 }                                  }
                             }                              }
                         }                          }
                           else if (strcmp(argument_majuscule, "STTY") == 0)
                           {
                               if ((*(*l_element_courant_sous_objet)
                                       .donnee).type == LST)
                               {
                                   if (type_arguments == ' ')
                                   {
                                       type_arguments = 'F';
                                   }
                                   else if (type_arguments == 'S')
                                   {
                                       liberation(s_etat_processus,
                                               s_objet_argument);
                                       free(argument_majuscule);
   
                                       (*s_etat_processus).erreur_execution =
                                               d_ex_erreur_parametre_fichier;
                                       return;
                                   }
   
                                   s_parametres_tty =
                                           (*l_element_courant_sous_objet).donnee;
                               }
                           }
                         else                          else
                         {                          {
                             liberation(s_etat_processus, s_objet_argument);                              liberation(s_etat_processus, s_objet_argument);
Line 3480  instruction_open(struct_processus *s_eta Line 3520  instruction_open(struct_processus *s_eta
                 return;                  return;
             }              }
   
               if (s_parametres_tty != NULL)
               {
                   // Affectation des paramètres du port série.
   
                   if (tcgetattr(fileno(descripteur), &tc) != 0)
                   {
                       liberation(s_etat_processus, s_objet_argument);
                       liberation(s_etat_processus, s_objet_resultat);
   
                       (*s_etat_processus).erreur_systeme =
                               d_ex_erreur_fichier;
                       return;
                   }
               }
   
             strcpy((*((struct_fichier *) (*s_objet_resultat).objet)).nom, nom);              strcpy((*((struct_fichier *) (*s_objet_resultat).objet)).nom, nom);
             liberation(s_etat_processus, s_objet_argument);              liberation(s_etat_processus, s_objet_argument);
   

Removed from v.1.44  
changed lines
  Added in v.1.45


CVSweb interface <joel.bertrand@systella.fr>