--- rpl/src/instructions_w1.c 2013/05/28 22:09:55 1.84 +++ rpl/src/instructions_w1.c 2015/06/08 14:11:43 1.97 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.14 - Copyright (C) 1989-2013 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.22 + Copyright (C) 1989-2015 Dr. BERTRAND Joël This file is part of RPL/2. @@ -712,7 +712,8 @@ instruction_write(struct_processus *s_et free(chaine); - if (alsprintf(&commande, "insert or replace into data " + if (alsprintf(s_etat_processus, &commande, + "insert or replace into data " "(id, data) values (%lld, '%s')", (*((integer8 *) (*s_objet_argument_2).objet)), chaine_utf8) < 0) { @@ -762,8 +763,8 @@ instruction_write(struct_processus *s_et // Récupération de la position de la clef - if (alsprintf(&commande, "select key from control " - "where id = 1") < 0) + if (alsprintf(s_etat_processus, &commande, + "select key from control where id = 1") < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -939,8 +940,8 @@ instruction_write(struct_processus *s_et // Récupération de l'identifiant de la clef - if (alsprintf(&commande, "select id from key where key = " - "'%s'", clef_utf8) < 0) + if (alsprintf(s_etat_processus, &commande, + "select id from key where key = '%s'", clef_utf8) < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -985,8 +986,9 @@ instruction_write(struct_processus *s_et free(commande); - if (alsprintf(&commande, "insert into key " - "(key) values ('%s')", clef_utf8) < 0) + if (alsprintf(s_etat_processus, &commande, + "insert into key (key) values ('%s')", + clef_utf8) < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1019,8 +1021,9 @@ instruction_write(struct_processus *s_et free(commande); - if (alsprintf(&commande, "select id from key " - "where key = '%s'", clef_utf8) < 0) + if (alsprintf(s_etat_processus, &commande, + "select id from key where key = '%s'", + clef_utf8) < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1083,8 +1086,9 @@ instruction_write(struct_processus *s_et if (mise_a_jour == d_vrai) { - if (alsprintf(&commande, "update key set key = '%s' where " - "id = %lld", clef_utf8, id) < 0) + if (alsprintf(s_etat_processus, &commande, + "update key set key = '%s' where id = %lld", + clef_utf8, id) < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1119,8 +1123,8 @@ instruction_write(struct_processus *s_et // Effacement de l'enregistrement existant - if (alsprintf(&commande, "delete from data where " - "key_id = %lld", id) < 0) + if (alsprintf(s_etat_processus, &commande, + "delete from data where key_id = %lld", id) < 0) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1254,8 +1258,8 @@ instruction_write(struct_processus *s_et free(chaine); - if (alsprintf(&commande, "insert into data " - "(data, key_id, sequence) values " + if (alsprintf(s_etat_processus, &commande, + "insert into data (data, key_id, sequence) values " "('%s', %lld, %lld)", chaine_utf8, id, ordre) < 0) { (*s_etat_processus).erreur_systeme = @@ -1494,9 +1498,9 @@ instruction_write(struct_processus *s_et return; } - if ((format_chaine = conversion_majuscule((unsigned char *) - (*(*l_element_courant_format).donnee).objet)) - == NULL) + if ((format_chaine = conversion_majuscule(s_etat_processus, + (unsigned char *) (*(*l_element_courant_format) + .donnee).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -2211,8 +2215,8 @@ instruction_wflock(struct_processus *s_e do { - if ((chaine = conversion_majuscule((unsigned char *) - (*s_objet_argument_1).objet)) == NULL) + if ((chaine = conversion_majuscule(s_etat_processus, + (unsigned char *) (*s_objet_argument_1).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2426,7 +2430,8 @@ instruction_wfproc(struct_processus *s_e } } - if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus)) + != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2491,7 +2496,8 @@ instruction_wfproc(struct_processus *s_e profilage(s_etat_processus, NULL); } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; @@ -2574,7 +2580,8 @@ instruction_wfproc(struct_processus *s_e if (pthread_mutex_lock(&((*s_etat_processus) .mutex_interruptions)) != 0) { - pthread_mutex_unlock(&((*s_etat_processus).mutex)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); if ((*s_etat_processus).profilage == d_vrai) { @@ -2595,7 +2602,8 @@ instruction_wfproc(struct_processus *s_e if (pthread_mutex_unlock(&((*s_etat_processus) .mutex_interruptions)) != 0) { - pthread_mutex_unlock(&((*s_etat_processus).mutex)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); if ((*s_etat_processus).profilage == d_vrai) { @@ -2607,7 +2615,8 @@ instruction_wfproc(struct_processus *s_e return; } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2658,7 +2667,8 @@ instruction_wfproc(struct_processus *s_e scrutation_injection(s_etat_processus); - if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_lock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2680,7 +2690,8 @@ instruction_wfproc(struct_processus *s_e profilage(s_etat_processus, NULL); } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus)) + != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; @@ -2783,7 +2794,8 @@ instruction_wfdata(struct_processus *s_e } } - if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus)) + != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2843,7 +2855,8 @@ instruction_wfdata(struct_processus *s_e profilage(s_etat_processus, NULL); } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; @@ -2886,7 +2899,8 @@ instruction_wfdata(struct_processus *s_e return; } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2966,7 +2980,8 @@ instruction_wfdata(struct_processus *s_e return; } - if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_lock(&((*s_etat_processus) + .mutex_pile_processus)) != 0) { if ((*s_etat_processus).profilage == d_vrai) { @@ -2993,7 +3008,8 @@ instruction_wfdata(struct_processus *s_e profilage(s_etat_processus, NULL); } - if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) + if (pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus)) + != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return;