blob: 3e0f336b7fd389fcb74bf6fd797768d2db3d8c7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/* fornax - distributed network
*
* by team teso
*
* scripting branching routines
*/
#include <stdlib.h>
#include "../../shared/common.h"
#include "condition.h"
#include "branch.h"
branch *
br_create (void)
{
branch * new = xcalloc (1, sizeof (branch));
return (new);
}
void
br_free (branch *br)
{
elem_list_free (br->b_true);
elem_list_free (br->b_false);
cond_free (br->cond);
free (br);
return;
}
branch *
br_set_condition (branch *br, condition *cond)
{
br->cond = cond;
return (br);
}
branch *
br_set_block_if (branch *br, element **bl)
{
br->b_true = bl;
return (br);
}
branch *
br_set_block_else (branch *br, element **bl)
{
br->b_false = bl;
return (br);
}
|