version 1.65, 2018/12/22 10:13:10
|
version 1.70, 2019/01/01 09:02:58
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.29 |
RPL/2 (R) version 4.1.30 |
Copyright (C) 1989-2018 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 38
|
Line 38
|
static int |
static int |
fonction_comparaison(const void *argument_1, const void *argument_2) |
fonction_comparaison(const void *argument_1, const void *argument_2) |
{ |
{ |
/* |
return(strcmp((unsigned char *) argument_1, |
uprintf("%p->%s\n",(unsigned char *) (**((struct_objet **) argument_2)).objet, (unsigned char *) (**((struct_objet **) argument_2)).objet); |
|
uprintf("%p->%s\n",(unsigned char *) (**((struct_objet **) argument_1)).objet, (unsigned char *) (**((struct_objet **) argument_1)).objet); |
|
*/ |
|
return(strcmp((unsigned char *) (**((struct_objet **) argument_1)).objet, |
|
(unsigned char *) (**((struct_objet **) argument_2)).objet)); |
(unsigned char *) (**((struct_objet **) argument_2)).objet)); |
} |
} |
|
|
Line 54 instruction_get(struct_processus *s_etat
|
Line 50 instruction_get(struct_processus *s_etat
|
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
|
|
|
struct_objet **s_enregistrement; |
struct_objet *s_objet_1; |
struct_objet *s_objet_1; |
struct_objet *s_objet_2; |
struct_objet *s_objet_2; |
struct_objet *s_objet_3; |
struct_objet *s_objet_3; |
Line 98 instruction_get(struct_processus *s_etat
|
Line 95 instruction_get(struct_processus *s_etat
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n\n", |
" %s, %s, %s\n\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
printf(" 2: %s\n", d_REC); |
printf(" 2: %s\n", d_REC); |
printf(" 1: %s\n", d_CHN); |
printf(" 1: %s\n", d_CHN); |
Line 109 instruction_get(struct_processus *s_etat
|
Line 106 instruction_get(struct_processus *s_etat
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n\n", |
" %s, %s, %s\n\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
printf(" 2: %s, %s\n", d_LST, d_NOM); |
printf(" 2: %s, %s\n", d_LST, d_NOM); |
printf(" 1: %s\n", d_INT); |
printf(" 1: %s\n", d_INT); |
Line 120 instruction_get(struct_processus *s_etat
|
Line 117 instruction_get(struct_processus *s_etat
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n", |
" %s, %s, %s\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
return; |
return; |
} |
} |
Line 560 instruction_get(struct_processus *s_etat
|
Line 557 instruction_get(struct_processus *s_etat
|
|
|
s_objet_noms = (*((struct_record *) (*s_objet_2).objet)).noms; |
s_objet_noms = (*((struct_record *) (*s_objet_2).objet)).noms; |
|
|
int i; |
if ((s_enregistrement = bsearch((unsigned char *) (*s_objet_1).objet, |
for(i = 0; i < (*((struct_tableau *) (*s_objet_noms).objet)).nombre_elements; uprintf("%d->%p (%s)\n", i, |
|
(unsigned char *) (*(*((struct_tableau *) (*s_objet_noms).objet)).elements[i]).objet, |
|
(unsigned char *) (*(*((struct_tableau *) (*s_objet_noms).objet)).elements[i]).objet), i++); |
|
|
|
s_objet_element = bsearch((unsigned char *) (*s_objet_1).objet, |
|
(*((struct_tableau *) (*s_objet_noms).objet)).elements, |
(*((struct_tableau *) (*s_objet_noms).objet)).elements, |
(size_t) (*((struct_tableau *) (*s_objet_noms).objet)) |
(size_t) (*((struct_tableau *) (*s_objet_noms).objet)) |
.nombre_elements, sizeof(struct_objet *), fonction_comparaison); |
.nombre_elements, sizeof(struct_objet *), fonction_comparaison)) |
|
== NULL) |
uprintf("%d\n", s_objet_element - (*((struct_tableau *) (*s_objet_2).objet)).elements[0]); |
|
|
|
/* |
|
l_element_courant = (*s_objet_1).objet; |
|
s_objet_element = s_objet_2; |
|
|
|
|
|
while(l_element_courant != NULL) |
|
{ |
{ |
if ((*(*l_element_courant).donnee).type != INT) |
liberation(s_etat_processus, s_objet_1); |
{ |
liberation(s_etat_processus, s_objet_2); |
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if ((*s_objet_element).type != TBL) |
|
{ |
|
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_element_inexistant; |
|
return; |
|
} |
|
|
|
indice_i = (*((integer8 *) (*(*l_element_courant).donnee).objet)); |
(*s_etat_processus).erreur_execution = d_ex_element_inexistant; |
|
return; |
|
} |
|
|
if ((indice_i < 1) || (indice_i > (*((struct_tableau *) |
indice_i = s_enregistrement - (*((struct_tableau *) |
(*s_objet_element).objet)).nombre_elements)) |
(*s_objet_noms).objet)).elements; |
{ |
|
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_element_inexistant; |
// Récupération de l'objet dans le tableau données |
return; |
|
} |
|
|
|
s_objet_element = (*((struct_tableau *) (*s_objet_element) |
|
.objet)).elements[indice_i - 1]; |
|
l_element_courant = (*l_element_courant).suivant; |
|
} |
|
if ((s_objet_resultat = copie_objet(s_etat_processus, |
if ((s_objet_resultat = copie_objet(s_etat_processus, |
s_objet_element, 'P')) == NULL) |
(*((struct_tableau *) (*(*((struct_record *) |
|
(*s_objet_2).objet)).donnees).objet)).elements[indice_i], 'P')) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
*/ |
|
} |
} |
/* |
/* |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
Line 1300 instruction_get(struct_processus *s_etat
|
Line 1262 instruction_get(struct_processus *s_etat
|
return; |
return; |
} |
} |
} |
} |
|
else if ((*s_objet_3).type == REC) |
|
{ |
|
if ((*s_objet_1).type != CHN) |
|
{ |
|
if (variable_partagee == d_vrai) |
|
{ |
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.pointeur_variable_partagee_courante).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
s_objet_noms = (*((struct_record *) (*s_objet_3).objet)).noms; |
|
|
|
if ((s_enregistrement = bsearch((unsigned char *) |
|
(*s_objet_1).objet, (*((struct_tableau *) |
|
(*s_objet_noms).objet)).elements, |
|
(size_t) (*((struct_tableau *) (*s_objet_noms).objet)) |
|
.nombre_elements, sizeof(struct_objet *), |
|
fonction_comparaison)) == NULL) |
|
{ |
|
if (variable_partagee == d_vrai) |
|
{ |
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.pointeur_variable_partagee_courante).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_element_inexistant; |
|
return; |
|
} |
|
|
|
indice_i = s_enregistrement - (*((struct_tableau *) |
|
(*s_objet_noms).objet)).elements; |
|
|
|
// Récupération de l'objet dans le tableau données |
|
|
|
if ((s_objet_resultat = copie_objet(s_etat_processus, |
|
(*((struct_tableau *) (*(*((struct_record *) |
|
(*s_objet_3).objet)).donnees).objet)).elements[indice_i], |
|
'P')) == NULL) |
|
{ |
|
if (variable_partagee == d_vrai) |
|
{ |
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.pointeur_variable_partagee_courante).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
} |
else |
else |
{ |
{ |
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
Line 1489 instruction_geti(struct_processus *s_eta
|
Line 1523 instruction_geti(struct_processus *s_eta
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n", |
" %s, %s, %s\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
return; |
return; |
} |
} |