version 1.97, 2015/11/26 11:44:39
|
version 1.111, 2019/10/31 15:40:18
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.24 |
RPL/2 (R) version 4.1.32 |
Copyright (C) 1989-2015 Dr. BERTRAND Joël |
Copyright (C) 1989-2019 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 869 instruction_read(struct_processus *s_eta
|
Line 869 instruction_read(struct_processus *s_eta
|
|
|
logical1 device; |
logical1 device; |
logical1 format_degenere; |
logical1 format_degenere; |
|
logical1 format_oriente_ligne; |
logical1 indicateur_48; |
logical1 indicateur_48; |
logical1 presence_chaine; |
logical1 presence_chaine; |
logical1 presence_indicateur; |
logical1 presence_indicateur; |
Line 2072 instruction_read(struct_processus *s_eta
|
Line 2073 instruction_read(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if (strncmp("LENGTH*(", format_chaine, 8) != 0) |
if (strcmp("LINE*(*)", format_chaine) == 0) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
format_degenere = d_vrai; |
liberation(s_etat_processus, s_objet_resultat); |
format_oriente_ligne = d_vrai; |
free(format_chaine); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_format_fichier; |
|
return; |
|
} |
} |
|
else |
longueur = (integer8) strlen(format_chaine); |
|
|
|
if (format_chaine[longueur - 1] != ')') |
|
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
format_oriente_ligne = d_faux; |
liberation(s_etat_processus, s_objet_resultat); |
|
free(format_chaine); |
|
|
|
(*s_etat_processus).erreur_execution = |
if (strncmp("LENGTH*(", format_chaine, 8) != 0) |
d_ex_erreur_format_fichier; |
{ |
return; |
liberation(s_etat_processus, s_objet_argument_1); |
} |
liberation(s_etat_processus, s_objet_resultat); |
|
free(format_chaine); |
|
|
format_chaine[longueur] = d_code_fin_chaine; |
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_format_fichier; |
|
return; |
|
} |
|
|
if (format_chaine[8] == '*') |
longueur = (integer8) strlen(format_chaine); |
{ |
|
format_degenere = d_vrai; |
|
} |
|
else |
|
{ |
|
// Détermination de la longueur |
|
format_degenere = d_faux; |
|
|
|
if (sscanf(&(format_chaine[8]), "%lld", &longueur) != 1) |
if (format_chaine[longueur - 1] != ')') |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_resultat); |
liberation(s_etat_processus, s_objet_resultat); |
Line 2117 instruction_read(struct_processus *s_eta
|
Line 2105 instruction_read(struct_processus *s_eta
|
d_ex_erreur_format_fichier; |
d_ex_erreur_format_fichier; |
return; |
return; |
} |
} |
|
|
|
format_chaine[longueur] = d_code_fin_chaine; |
|
|
|
if (format_chaine[8] == '*') |
|
{ |
|
format_degenere = d_vrai; |
|
} |
|
else |
|
{ |
|
// Détermination de la longueur |
|
format_degenere = d_faux; |
|
|
|
if (sscanf(&(format_chaine[8]), "%lld", &longueur) |
|
!= 1) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_resultat); |
|
free(format_chaine); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_format_fichier; |
|
return; |
|
} |
|
} |
} |
} |
|
|
free(format_chaine); |
free(format_chaine); |
Line 2163 instruction_read(struct_processus *s_eta
|
Line 2175 instruction_read(struct_processus *s_eta
|
} |
} |
} |
} |
} |
} |
|
else |
|
{ |
|
// Évite un warning de gcc. |
|
longueur_questure = 0; |
|
index = 0; |
|
timeout = 0; |
|
} |
|
|
do |
do |
{ |
{ |
Line 2194 instruction_read(struct_processus *s_eta
|
Line 2213 instruction_read(struct_processus *s_eta
|
|
|
tampon3[index++] = (unsigned char) c; |
tampon3[index++] = (unsigned char) c; |
} |
} |
|
|
|
if (format_oriente_ligne == d_vrai) |
|
{ |
|
if (c == '\n') |
|
{ |
|
break; |
|
} |
|
} |
} while(c != EOF); |
} while(c != EOF); |
|
|
if (device == d_faux) |
if (device == d_faux) |
Line 3515 instruction_read(struct_processus *s_eta
|
Line 3542 instruction_read(struct_processus *s_eta
|
} |
} |
else |
else |
{ // FLOW |
{ // FLOW |
#if 0 |
|
longueur_questure = 256; |
longueur_questure = 256; |
|
|
do |
do |
{ |
{ |
if ((tampon_lecture = malloc((longueur_questure + 1) * |
if ((tampon_lecture = malloc((((size_t) longueur_questure) + 1) |
sizeof(unsigned char))) == NULL) |
* sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 3549 instruction_read(struct_processus *s_eta
|
Line 3575 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_unix); |
longueur_adresse = sizeof(adresse_unix); |
longueur_effective = recvfrom((*((struct_socket *) |
longueur_effective = recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, |
(*s_objet_argument_1).objet)).socket, |
tampon_lecture, longueur_questure, |
tampon_lecture, (long unsigned int) |
|
longueur_questure, |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
&adresse_unix, &longueur_adresse); |
&adresse_unix, &longueur_adresse); |
} |
} |
Line 3559 instruction_read(struct_processus *s_eta
|
Line 3586 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv4); |
longueur_adresse = sizeof(adresse_ipv4); |
longueur_effective = recvfrom((*((struct_socket *) |
longueur_effective = recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, |
(*s_objet_argument_1).objet)).socket, |
tampon_lecture, longueur_questure, |
tampon_lecture, (long unsigned int) |
|
longueur_questure, |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
&adresse_ipv4, &longueur_adresse); |
&adresse_ipv4, &longueur_adresse); |
} |
} |
Line 3570 instruction_read(struct_processus *s_eta
|
Line 3598 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv6); |
longueur_adresse = sizeof(adresse_ipv6); |
longueur_effective = recvfrom((*((struct_socket *) |
longueur_effective = recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, |
(*s_objet_argument_1).objet)).socket, |
tampon_lecture, longueur_questure, |
tampon_lecture, (long unsigned int) |
|
longueur_questure, |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
&adresse_ipv6, &longueur_adresse); |
&adresse_ipv6, &longueur_adresse); |
# else |
# else |
Line 3698 instruction_read(struct_processus *s_eta
|
Line 3727 instruction_read(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if (((*s_objet_type).objet = malloc(longueur_enregistrement * |
if (((*s_objet_type).objet = malloc((size_t) longueur_enregistrement |
sizeof(unsigned char))) == NULL) |
* sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 3782 instruction_read(struct_processus *s_eta
|
Line 3811 instruction_read(struct_processus *s_eta
|
longueur_adresse = 0; |
longueur_adresse = 0; |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
(long unsigned int) longueur_effective, MSG_DONTWAIT, |
NULL, &longueur_adresse); |
NULL, &longueur_adresse); |
|
|
(*s_objet_adresse).objet = NULL; |
(*s_objet_adresse).objet = NULL; |
Line 3793 instruction_read(struct_processus *s_eta
|
Line 3822 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv4); |
longueur_adresse = sizeof(adresse_ipv4); |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
(long unsigned int) longueur_effective, MSG_DONTWAIT, |
(struct sockaddr *) &adresse_ipv4, &longueur_adresse); |
(struct sockaddr *) &adresse_ipv4, &longueur_adresse); |
|
|
if (((*s_objet_adresse).objet = |
if (((*s_objet_adresse).objet = |
Line 3873 instruction_read(struct_processus *s_eta
|
Line 3902 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv6); |
longueur_adresse = sizeof(adresse_ipv6); |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
(long unsigned int) longueur_effective, MSG_DONTWAIT, |
(struct sockaddr *) &adresse_ipv6, &longueur_adresse); |
(struct sockaddr *) &adresse_ipv6, &longueur_adresse); |
|
|
if (((*s_objet_adresse).objet = |
if (((*s_objet_adresse).objet = |
Line 3954 instruction_read(struct_processus *s_eta
|
Line 3983 instruction_read(struct_processus *s_eta
|
longueur_adresse = 0; |
longueur_adresse = 0; |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
(long unsigned int) longueur_effective, MSG_DONTWAIT, |
NULL, &longueur_adresse); |
NULL, &longueur_adresse); |
} |
} |
|
|
Line 3965 instruction_read(struct_processus *s_eta
|
Line 3994 instruction_read(struct_processus *s_eta
|
{ |
{ |
return; |
return; |
} |
} |
#endif |
|
} |
} |
} |
} |
else |
else |