--- rpl/src/interface_gnuplot.c 2010/04/07 13:45:09 1.8 +++ rpl/src/interface_gnuplot.c 2012/01/05 10:19:05 1.34 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.14 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.5 + Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,8 +20,8 @@ */ -#include "rpl.conv.h" -#include "gnuplot.conv.h" +#include "rpl-conv.h" +#include "gnuplot-conv.h" /* @@ -36,6 +36,24 @@ ================================================================================ */ +#ifdef OS2 +static unsigned char * +ajout_shell(unsigned char *commande) +{ + unsigned char *tampon; + + if ((tampon = malloc((strlen(BOURNE_SHELL) + 5 + strlen(commande) + 2) * + sizeof(unsigned char))) == NULL) + { + return(NULL); + } + + sprintf(tampon, "%s -c \"%s\"", BOURNE_SHELL, commande); + free(commande); + return(tampon); +} +#endif + void appel_gnuplot(struct_processus *s_etat_processus, unsigned char persistance) { @@ -307,6 +325,14 @@ appel_gnuplot(struct_processus *s_etat_p sprintf(commande_gnuplot, "%s", ds_gnuplot_commande); #endif +#ifdef OS2 + if ((commande_gnuplot = ajout_shell(commande_gnuplot)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } +#endif + if (((*s_etat_processus).entree_standard = popen(commande_gnuplot, "w")) == NULL) { @@ -378,6 +404,14 @@ appel_gnuplot(struct_processus *s_etat_p sprintf(commande_gnuplot, "%s", ds_gnuplot_commande_persistante); #endif +#ifdef OS2 + if ((commande_gnuplot = ajout_shell(commande_gnuplot)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } +#endif + if (((*s_etat_processus).entree_standard = popen(commande_gnuplot, "w")) == NULL) { @@ -447,6 +481,14 @@ appel_gnuplot(struct_processus *s_etat_p sprintf(commande_gnuplot, "%s", ds_gnuplot_commande); #endif +#ifdef OS2 + if ((commande_gnuplot = ajout_shell(commande_gnuplot)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } +#endif + if (((*s_etat_processus).entree_standard = popen(commande_gnuplot, "w")) == NULL) { @@ -527,6 +569,14 @@ appel_gnuplot(struct_processus *s_etat_p sprintf(commande_gnuplot, "%s", ds_gnuplot_commande); #endif +#ifdef OS2 + if ((commande_gnuplot = ajout_shell(commande_gnuplot)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } +#endif + if (((*s_etat_processus).entree_standard = popen(commande_gnuplot, "w")) == NULL) {