File:  [local] / rpl / src / librpl.c
Revision 1.21: download - view: text, annotated - select for diffs - revision graph
Thu Apr 21 16:01:00 2011 UTC (13 years ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Merge entre la branche 4_0 et HEAD.

    1: /*
    2: ================================================================================
    3:   RPL/2 (R) version 4.1.0.prerelease.0
    4:   Copyright (C) 1989-2011 Dr. BERTRAND Joël
    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: 
   23: #include "rpl-conv.h"
   24: 
   25: unsigned char **
   26: rpl(unsigned char *script, unsigned char *rpl_home)
   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";
   38:     argv[1] = "-psS";
   39: 
   40:     argv[2] = script;
   41: 
   42:     if ((resultats = malloc(sizeof(unsigned char **))) == NULL)
   43:     {
   44:         return(NULL);
   45:     }
   46: 
   47:     if (rpl_home == NULL)
   48:     {
   49:         rpl_home = getenv("RPL_HOME");
   50:     }
   51: 
   52:     succes = rplinit(argc, argv, &resultats, rpl_home);
   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>