Annotation of rpl/src/librpl.c, revision 1.35

1.1       bertrand    1: /*
                      2: ================================================================================
1.35    ! bertrand    3:   RPL/2 (R) version 4.1.6
1.34      bertrand    4:   Copyright (C) 1989-2012 Dr. BERTRAND Joël
1.1       bertrand    5: 
                      6:   This file is part of RPL/2.
                      7: 
                      8:   RPL/2 is free software; you can redistribute it and/or modify it
                      9:   under the terms of the CeCILL V2 License as published by the french
                     10:   CEA, CNRS and INRIA.
                     11:  
                     12:   RPL/2 is distributed in the hope that it will be useful, but WITHOUT
                     13:   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
                     14:   FITNESS FOR A PARTICULAR PURPOSE.  See the CeCILL V2 License
                     15:   for more details.
                     16:  
                     17:   You should have received a copy of the CeCILL License
                     18:   along with RPL/2. If not, write to info@cecill.info.
                     19: ================================================================================
                     20: */
                     21: 
                     22: 
1.14      bertrand   23: #include "rpl-conv.h"
1.1       bertrand   24: 
                     25: unsigned char **
1.8       bertrand   26: rpl(unsigned char *script, unsigned char *rpl_home)
1.1       bertrand   27: {
                     28:    char                        *argv[3];
                     29: 
                     30:    int                         argc;
                     31:    int                         succes;
                     32: 
                     33:    unsigned char               **resultats;
                     34: 
                     35:    argc = 3;
                     36: 
                     37:    argv[0] = "rpl";
1.7       bertrand   38:    argv[1] = "-psS";
1.1       bertrand   39: 
                     40:    argv[2] = script;
                     41: 
                     42:    if ((resultats = malloc(sizeof(unsigned char **))) == NULL)
                     43:    {
                     44:        return(NULL);
                     45:    }
                     46: 
1.8       bertrand   47:    if (rpl_home == NULL)
                     48:    {
                     49:        rpl_home = getenv("RPL_HOME");
                     50:    }
                     51: 
1.33      bertrand   52:    succes = rplinit(argc, argv, NULL, &resultats, rpl_home);
1.1       bertrand   53: 
                     54:    if (succes != EXIT_SUCCESS)
                     55:    {
                     56:        return(NULL);
                     57:    }
                     58: 
                     59:    /*
                     60:     * Formattage des valeurs renvoyées
                     61:     */
                     62: 
                     63:    return(resultats);
                     64: }
                     65: 
                     66: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>