version 1.4, 2010/03/04 10:17:51
|
version 1.75, 2025/04/15 10:17:54
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.12 |
RPL/2 (R) version 4.1.36 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2025 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 265 instruction_label(struct_processus *s_et
|
Line 265 instruction_label(struct_processus *s_et
|
|
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
|
|
unsigned long nombre_labels; |
integer8 nombre_labels; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 446 instruction_label(struct_processus *s_et
|
Line 446 instruction_label(struct_processus *s_et
|
void |
void |
instruction_logger(struct_processus *s_etat_processus) |
instruction_logger(struct_processus *s_etat_processus) |
{ |
{ |
|
integer8 longueur; |
|
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
|
|
|
unsigned char *tampon; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
if ((*s_etat_processus).affichage_arguments == 'Y') |
if ((*s_etat_processus).affichage_arguments == 'Y') |
Line 490 instruction_logger(struct_processus *s_e
|
Line 494 instruction_logger(struct_processus *s_e
|
|
|
if ((*s_objet_argument).type == CHN) |
if ((*s_objet_argument).type == CHN) |
{ |
{ |
syslog(LOG_NOTICE, "%s", (unsigned char *) (*s_objet_argument).objet); |
if ((tampon = formateur_flux(s_etat_processus, |
|
(unsigned char *) (*s_objet_argument).objet, &longueur)) |
|
== NULL) |
|
{ |
|
return; |
|
} |
|
|
|
syslog(LOG_NOTICE, "%s", tampon); |
|
free(tampon); |
} |
} |
else |
else |
{ |
{ |
Line 772 instruction_lq(struct_processus *s_etat_
|
Line 784 instruction_lq(struct_processus *s_etat_
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long k; |
integer8 k; |
unsigned long nombre_reflecteurs_elementaires; |
integer8 nombre_reflecteurs_elementaires; |
|
|
void *tau; |
void *tau; |
|
|
Line 986 instruction_lq(struct_processus *s_etat_
|
Line 998 instruction_lq(struct_processus *s_etat_
|
(*((struct_matrice *) (*s_copie_argument).objet)) |
(*((struct_matrice *) (*s_copie_argument).objet)) |
.nombre_colonnes; |
.nombre_colonnes; |
|
|
if ((vecteur_reel = malloc((*((struct_matrice *) (*s_objet).objet)) |
if ((vecteur_reel = malloc(((size_t) (*((struct_matrice *) |
.nombre_lignes * sizeof(real8))) == NULL) |
(*s_objet).objet)).nombre_lignes) * sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1012 instruction_lq(struct_processus *s_etat_
|
Line 1024 instruction_lq(struct_processus *s_etat_
|
} |
} |
|
|
if (((*((struct_matrice *) (*s_objet).objet)).tableau = |
if (((*((struct_matrice *) (*s_objet).objet)).tableau = |
malloc((*((struct_matrice *) (*s_objet).objet)) |
malloc(((size_t) (*((struct_matrice *) (*s_objet).objet)) |
.nombre_lignes * sizeof(real8 *))) == NULL) |
.nombre_lignes) * sizeof(real8 *))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1023 instruction_lq(struct_processus *s_etat_
|
Line 1035 instruction_lq(struct_processus *s_etat_
|
.nombre_lignes; j++) |
.nombre_lignes; j++) |
{ |
{ |
if ((((real8 **) (*((struct_matrice *) (*s_objet).objet)) |
if ((((real8 **) (*((struct_matrice *) (*s_objet).objet)) |
.tableau)[j] = malloc((*((struct_matrice *) (*s_objet) |
.tableau)[j] = malloc(((size_t) (*((struct_matrice *) |
.objet)).nombre_lignes * sizeof(real8))) == NULL) |
(*s_objet).objet)).nombre_lignes) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1304 instruction_lq(struct_processus *s_etat_
|
Line 1317 instruction_lq(struct_processus *s_etat_
|
(*((struct_matrice *) (*s_copie_argument).objet)) |
(*((struct_matrice *) (*s_copie_argument).objet)) |
.nombre_colonnes; |
.nombre_colonnes; |
|
|
if ((vecteur_complexe = malloc((*((struct_matrice *) |
if ((vecteur_complexe = malloc(((size_t) (*((struct_matrice *) |
(*s_objet).objet)).nombre_lignes * sizeof(complex16))) |
(*s_objet).objet)).nombre_lignes) * sizeof(complex16))) |
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 1339 instruction_lq(struct_processus *s_etat_
|
Line 1352 instruction_lq(struct_processus *s_etat_
|
} |
} |
|
|
if (((*((struct_matrice *) (*s_objet).objet)).tableau = |
if (((*((struct_matrice *) (*s_objet).objet)).tableau = |
malloc((*((struct_matrice *) (*s_objet).objet)) |
malloc(((size_t) (*((struct_matrice *) (*s_objet).objet)) |
.nombre_lignes * sizeof(complex16 *))) == NULL) |
.nombre_lignes) * sizeof(complex16 *))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1350 instruction_lq(struct_processus *s_etat_
|
Line 1363 instruction_lq(struct_processus *s_etat_
|
.nombre_lignes; j++) |
.nombre_lignes; j++) |
{ |
{ |
if ((((complex16 **) (*((struct_matrice *) (*s_objet).objet)) |
if ((((complex16 **) (*((struct_matrice *) (*s_objet).objet)) |
.tableau)[j] = malloc((*((struct_matrice *) (*s_objet) |
.tableau)[j] = malloc(((size_t) (*((struct_matrice *) |
.objet)).nombre_lignes * sizeof(complex16))) == NULL) |
(*s_objet).objet)).nombre_lignes) * sizeof(complex16))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1609 instruction_lcase(struct_processus *s_et
|
Line 1623 instruction_lcase(struct_processus *s_et
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned char *ptr; |
|
unsigned char registre; |
|
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
if ((*s_etat_processus).affichage_arguments == 'Y') |
if ((*s_etat_processus).affichage_arguments == 'Y') |
Line 1620 instruction_lcase(struct_processus *s_et
|
Line 1631 instruction_lcase(struct_processus *s_et
|
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
printf("(converison d'une chaîne de caractères en minuscules)\n\n"); |
printf("(conversion d'une chaîne de caractères en minuscules)\n\n"); |
} |
} |
else |
else |
{ |
{ |
Line 1628 instruction_lcase(struct_processus *s_et
|
Line 1639 instruction_lcase(struct_processus *s_et
|
} |
} |
|
|
printf(" 1: %s\n", d_CHN); |
printf(" 1: %s\n", d_CHN); |
|
printf("-> 1: %s\n", d_CHN); |
return; |
return; |
} |
} |
else if ((*s_etat_processus).test_instruction == 'Y') |
else if ((*s_etat_processus).test_instruction == 'Y') |
Line 1661 instruction_lcase(struct_processus *s_et
|
Line 1673 instruction_lcase(struct_processus *s_et
|
} |
} |
|
|
liberation(s_etat_processus, s_objet_argument); |
liberation(s_etat_processus, s_objet_argument); |
ptr = (unsigned char *) (*s_objet_resultat).objet; |
conversion_chaine(s_etat_processus, (unsigned char *) |
|
(*s_objet_resultat).objet, 'm'); |
while((*ptr) != d_code_fin_chaine) |
|
{ |
|
registre = tolower((*ptr)); |
|
|
|
if (toupper(registre) == (*ptr)) |
|
{ |
|
(*ptr) = registre; |
|
} |
|
|
|
ptr++; |
|
} |
|
|
|
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
s_objet_resultat) == d_erreur) |
s_objet_resultat) == d_erreur) |
Line 1690 instruction_lcase(struct_processus *s_et
|
Line 1691 instruction_lcase(struct_processus *s_et
|
} |
} |
|
|
return; |
return; |
|
} |
|
|
|
|
|
/* |
|
================================================================================ |
|
Fonction 'l->t' |
|
================================================================================ |
|
Entrées : pointeur sur une structure struct_processus |
|
-------------------------------------------------------------------------------- |
|
Sorties : |
|
-------------------------------------------------------------------------------- |
|
Effets de bord : néant |
|
================================================================================ |
|
*/ |
|
|
|
void |
|
instruction_l_vers_t(struct_processus *s_etat_processus) |
|
{ |
|
logical1 last; |
|
|
|
(*s_etat_processus).erreur_execution = d_ex; |
|
|
|
if ((*s_etat_processus).affichage_arguments == 'Y') |
|
{ |
|
printf("\n L->T "); |
|
|
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
printf("(converison d'une liste en table)\n\n"); |
|
} |
|
else |
|
{ |
|
printf("(convert list to table)\n\n"); |
|
} |
|
|
|
printf(" 1: %s\n", d_LST); |
|
printf("-> 1: %s\n", d_TAB); |
|
return; |
|
} |
|
else if ((*s_etat_processus).test_instruction == 'Y') |
|
{ |
|
(*s_etat_processus).nombre_arguments = -1; |
|
return; |
|
} |
|
|
|
if (test_cfsf(s_etat_processus, 31) == d_vrai) |
|
{ |
|
last = d_vrai; |
|
cf(s_etat_processus, 31); |
|
|
|
if (empilement_pile_last(s_etat_processus, 1) == d_erreur) |
|
{ |
|
return; |
|
} |
|
} |
|
else |
|
{ |
|
last = d_faux; |
|
} |
|
|
|
instruction_list_fleche(s_etat_processus); |
|
|
|
if (((*s_etat_processus).erreur_systeme == d_es) && |
|
((*s_etat_processus).erreur_execution == d_ex)) |
|
{ |
|
instruction_fleche_table(s_etat_processus); |
|
} |
|
|
|
if (last == d_vrai) |
|
{ |
|
sf(s_etat_processus, 31); |
|
} |
|
|
|
return; |
} |
} |
|
|
// vim: ts=4 |
// vim: ts=4 |