version 1.1, 2010/01/26 15:22:44
|
version 1.75, 2025/04/15 10:17:54
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.9 |
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 47 instruction_pourcent(struct_processus *s
|
Line 47 instruction_pourcent(struct_processus *s
|
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long nombre_elements; |
integer8 nombre_elements; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 667 instruction_pourcent_ch(struct_processus
|
Line 667 instruction_pourcent_ch(struct_processus
|
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long nombre_elements; |
integer8 nombre_elements; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1293 instruction_pos(struct_processus *s_etat
|
Line 1293 instruction_pos(struct_processus *s_etat
|
|
|
unsigned char *pointeur_occurrence; |
unsigned char *pointeur_occurrence; |
|
|
unsigned long position; |
integer8 position; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1377 instruction_pos(struct_processus *s_etat
|
Line 1377 instruction_pos(struct_processus *s_etat
|
} |
} |
else |
else |
{ |
{ |
(*((integer8 *) (*s_objet_resultat).objet)) = 1 + (integer8) |
(*((integer8 *) (*s_objet_resultat).objet)) = |
(pointeur_occurrence - ((unsigned char *) |
position_caractere_de_chaine(s_etat_processus, |
(*s_objet_argument_2).objet)); |
(unsigned char *) (*s_objet_argument_2).objet, |
|
pointeur_occurrence); |
} |
} |
} |
} |
|
|
Line 1639 instruction_prompt(struct_processus *s_e
|
Line 1640 instruction_prompt(struct_processus *s_e
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
|
unsigned char *ptr_e; |
|
unsigned char *ptr_l; |
unsigned char *tampon; |
unsigned char *tampon; |
|
unsigned char *tampon2; |
|
|
|
integer8 i; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1684 instruction_prompt(struct_processus *s_e
|
Line 1690 instruction_prompt(struct_processus *s_e
|
|
|
if ((*s_objet_argument).type == CHN) |
if ((*s_objet_argument).type == CHN) |
{ |
{ |
|
if ((tampon = formateur(s_etat_processus, 0, s_objet_argument)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if ((tampon2 = transliteration(s_etat_processus, tampon, |
|
d_locale, (*s_etat_processus).localisation)) == NULL) |
|
{ |
|
free(tampon); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_erreur_transcodage; |
|
return; |
|
} |
|
|
|
free(tampon); |
|
|
if ((s_objet_resultat = allocation(s_etat_processus, CHN)) == NULL) |
if ((s_objet_resultat = allocation(s_etat_processus, CHN)) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 1693 instruction_prompt(struct_processus *s_e
|
Line 1716 instruction_prompt(struct_processus *s_e
|
flockfile(stdin); |
flockfile(stdin); |
flockfile(stdout); |
flockfile(stdout); |
|
|
(*s_objet_resultat).objet = (void *) readline((unsigned char *) |
(*s_objet_resultat).objet = (void *) readline(tampon2); |
(*s_objet_argument).objet); |
|
|
|
funlockfile(stdin); |
funlockfile(stdin); |
funlockfile(stdout); |
funlockfile(stdout); |
|
|
|
free(tampon2); |
|
|
if ((*s_objet_resultat).objet == NULL) |
if ((*s_objet_resultat).objet == NULL) |
{ |
{ |
if (((*s_objet_resultat).objet = malloc(sizeof(unsigned char))) |
if (((*s_objet_resultat).objet = malloc(sizeof(unsigned char))) |
Line 1720 instruction_prompt(struct_processus *s_e
|
Line 1744 instruction_prompt(struct_processus *s_e
|
} |
} |
|
|
free((unsigned char *) (*s_objet_resultat).objet); |
free((unsigned char *) (*s_objet_resultat).objet); |
(*s_objet_resultat).objet = tampon; |
|
|
ptr_l = tampon; |
|
i = 0; |
|
|
|
while((*ptr_l) != d_code_fin_chaine) |
|
{ |
|
if ((*ptr_l) == '\"') |
|
{ |
|
i++; |
|
} |
|
|
|
ptr_l++; |
|
} |
|
|
|
if ((tampon2 = malloc((strlen(tampon) + 1 + ((size_t) i)) * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
ptr_l = tampon; |
|
ptr_e = tampon2; |
|
|
|
while((*ptr_l) != d_code_fin_chaine) |
|
{ |
|
if ((*ptr_l) == '\"') |
|
{ |
|
(*ptr_e) = '\\'; |
|
ptr_e++; |
|
} |
|
|
|
(*ptr_e) = (*ptr_l); |
|
ptr_e++; |
|
ptr_l++; |
|
} |
|
|
|
free(tampon); |
|
(*s_objet_resultat).objet = tampon2; |
|
|
add_history((unsigned char *) (*s_objet_resultat).objet); |
add_history((unsigned char *) (*s_objet_resultat).objet); |
stifle_history(ds_longueur_historique); |
stifle_history(ds_longueur_historique); |