d@0
|
1 /*
|
d@0
|
2 * Copyright (c) 2003, 2007-8 Matteo Frigo
|
d@0
|
3 * Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology
|
d@0
|
4 *
|
d@0
|
5 * This program is free software; you can redistribute it and/or modify
|
d@0
|
6 * it under the terms of the GNU General Public License as published by
|
d@0
|
7 * the Free Software Foundation; either version 2 of the License, or
|
d@0
|
8 * (at your option) any later version.
|
d@0
|
9 *
|
d@0
|
10 * This program is distributed in the hope that it will be useful,
|
d@0
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
d@0
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
d@0
|
13 * GNU General Public License for more details.
|
d@0
|
14 *
|
d@0
|
15 * You should have received a copy of the GNU General Public License
|
d@0
|
16 * along with this program; if not, write to the Free Software
|
d@0
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
d@0
|
18 *
|
d@0
|
19 */
|
d@0
|
20
|
d@0
|
21 #include "api.h"
|
d@0
|
22
|
d@0
|
23 static planner *plnr = 0;
|
d@0
|
24
|
d@0
|
25 /* create the planner for the rest of the API */
|
d@0
|
26 planner *X(the_planner)(void)
|
d@0
|
27 {
|
d@0
|
28 if (!plnr) {
|
d@0
|
29 plnr = X(mkplanner)();
|
d@0
|
30 X(configure_planner)(plnr);
|
d@0
|
31 }
|
d@0
|
32
|
d@0
|
33 return plnr;
|
d@0
|
34 }
|
d@0
|
35
|
d@0
|
36 void X(cleanup)(void)
|
d@0
|
37 {
|
d@0
|
38 if (plnr) {
|
d@0
|
39 X(planner_destroy)(plnr);
|
d@0
|
40 plnr = 0;
|
d@0
|
41 }
|
d@0
|
42 }
|
d@0
|
43
|
d@0
|
44 void X(set_timelimit)(double tlim)
|
d@0
|
45 {
|
d@0
|
46 /* PLNR is not necessarily initialized when this function is
|
d@0
|
47 called, so use X(the_planner)() */
|
d@0
|
48 X(the_planner)()->timelimit = tlim;
|
d@0
|
49 }
|