1: /*
2: ================================================================================
3: RPL/2 (R) version 4.1.36
4: Copyright (C) 1989-2025 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 *parametres, unsigned char *rpl_home)
27: {
28: char *argv[5];
29:
30: int argc;
31: int succes;
32:
33: unsigned char **resultats;
34:
35: if (parametres == NULL)
36: {
37: argc = 3;
38:
39: argv[0] = "rpl";
40: argv[1] = "-psS";
41:
42: argv[2] = script;
43: }
44: else
45: {
46: argc = 5;
47:
48: argv[0] = "rpl";
49: argv[1] = "-psS";
50:
51: argv[2] = script;
52:
53: argv[3] = "-A";
54: argv[4] = parametres;
55: }
56:
57: if ((resultats = sys_malloc(sizeof(unsigned char **))) == NULL)
58: {
59: return(NULL);
60: }
61:
62: if (rpl_home == NULL)
63: {
64: rpl_home = getenv("RPL_HOME");
65: }
66:
67: succes = rplinit(argc, argv, NULL, &resultats, rpl_home);
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>