Vuo 2.4.4
Loading...
Searching...
No Matches
VuoMathExpression.c
Go to the documentation of this file.
1
10#include <string.h>
11
12#include "VuoMathExpression.h"
13
15#ifdef VUO_COMPILER
17 "title" : "Math Expression",
18 "description" : "A mathematical expression that can be used for calculations.",
19 "keywords" : [ ],
20 "version" : "1.0.0",
21 "dependencies" : [
22 "c",
23 "VuoMathExpressionParser"
24 ]
25 });
26#endif
28
40{
42 json_object *o = NULL;
43
44 if (json_object_object_get_ex(js, "expression", &o))
45 {
47
48 VuoMathExpressionError error = NULL;
50 free(error);
51 }
52 else
53 {
54 me.expression = VuoText_make("");
55 me.parser = NULL;
56 }
57
58 return me;
59}
60
77{
78 json_object *js = json_object_new_object();
79
80 json_object_object_add(js, "expression", VuoText_getJson(me.expression));
81
82 if (me.parser)
83 {
85 json_object_object_add(js, "inputVariables", VuoList_VuoText_getJson(inputVariables));
86 VuoRelease(inputVariables);
87
89 json_object_object_add(js, "outputVariables", VuoList_VuoText_getJson(outputVariables));
90 VuoRelease(outputVariables);
91 }
92
93 return js;
94}
95