1#include <expr_run.h>
2#include <stdio.h>
3
4
5
6
7int main(int argc, char *argv[]) {
9
10
11
12
13 int32_t result = 0;
16 .ptr = &result
17 };
18
19
20
21 if (
ecs_expr_run(world,
"10 + 20", &result_value, NULL) == NULL) {
22 printf("expression failed to run\n");
23 return -1;
24 }
25
26 printf("result = %d\n", result);
27
29
30
31
32}
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
FLECS_API const char * ecs_expr_run(ecs_world_t *world, const char *ptr, ecs_value_t *value, const ecs_expr_eval_desc_t *desc)
Run expression.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
int ecs_fini(ecs_world_t *world)
Delete a world.
ecs_world_t * ecs_init_w_args(int argc, char *argv[])
Create a new world with arguments.