Annotation of rpl/src/librpl.c, revision 1.48
1.1 bertrand 1: /*
2: ================================================================================
1.47 bertrand 3: RPL/2 (R) version 4.1.16
1.43 bertrand 4: Copyright (C) 1989-2013 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.48 ! bertrand 26: rpl(unsigned char *script, unsigned char *parametres, unsigned char *rpl_home)
1.1 bertrand 27: {
1.48 ! bertrand 28: char *argv[5];
1.1 bertrand 29:
30: int argc;
31: int succes;
32:
33: unsigned char **resultats;
34:
1.48 ! bertrand 35: if (parametres == NULL)
! 36: {
! 37: argc = 3;
! 38:
! 39: argv[0] = "rpl";
! 40: argv[1] = "-psS";
1.1 bertrand 41:
1.48 ! bertrand 42: argv[2] = script;
! 43: }
! 44: else
! 45: {
! 46: argc = 5;
1.1 bertrand 47:
1.48 ! bertrand 48: argv[0] = "rpl";
! 49: argv[1] = "-psS";
! 50:
! 51: argv[2] = script;
! 52:
! 53: argv[3] = "-A";
! 54: argv[4] = parametres;
! 55: }
1.1 bertrand 56:
57: if ((resultats = malloc(sizeof(unsigned char **))) == NULL)
58: {
59: return(NULL);
60: }
61:
1.8 bertrand 62: if (rpl_home == NULL)
63: {
64: rpl_home = getenv("RPL_HOME");
65: }
66:
1.33 bertrand 67: succes = rplinit(argc, argv, NULL, &resultats, rpl_home);
1.1 bertrand 68:
69: if (succes != EXIT_SUCCESS)
70: {
71: return(NULL);
72: }
73:
74: /*
75: * Formattage des valeurs renvoyées
76: */
77:
78: return(resultats);
79: }
80:
81: // vim: ts=4
CVSweb interface <joel.bertrand@systella.fr>