/* ================================================================================ RPL/2 (R) version 4.1.32 Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" unsigned char ** rpl(unsigned char *script, unsigned char *parametres, unsigned char *rpl_home) { char *argv[5]; int argc; int succes; unsigned char **resultats; if (parametres == NULL) { argc = 3; argv[0] = "rpl"; argv[1] = "-psS"; argv[2] = script; } else { argc = 5; argv[0] = "rpl"; argv[1] = "-psS"; argv[2] = script; argv[3] = "-A"; argv[4] = parametres; } if ((resultats = sys_malloc(sizeof(unsigned char **))) == NULL) { return(NULL); } if (rpl_home == NULL) { rpl_home = getenv("RPL_HOME"); } succes = rplinit(argc, argv, NULL, &resultats, rpl_home); if (succes != EXIT_SUCCESS) { return(NULL); } /* * Formattage des valeurs renvoyées */ return(resultats); } // vim: ts=4