-
Notifications
You must be signed in to change notification settings - Fork 1
/
scene_action.h
53 lines (43 loc) · 1.42 KB
/
scene_action.h
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
#pragma once
/*
This is scene action file - handles execution of different scene actions
*/
#include "resolver.h"
#include "stack.h"
//#include <json-c/json.h>
typedef struct env_t
{
char* name;
char* value;
variant_stack_t* compiled_value;
} env_t;
typedef struct method_stack_item_t
{
char* stack_name;
char* name;
char* value;
} method_stack_item_t;
typedef enum ActionType_e
{
A_SCRIPT,
A_SCENE,
A_COMMAND,
A_ENABLE,
A_DISABLE
} ActionType;
typedef struct action_t
{
ActionType type;
char* url;
char* path;
variant_stack_t* environment;
} action_t;
action_t* scene_action_create(ActionType type, const char* record);
void scene_action_add_environment(action_t* action, const char* name, const char* value);
void scene_action_del_environment(action_t* action, const char* name);
void scene_action_add_method_stack_item(action_t* action, const char* stack_name, const char* name, const char* value);
void scene_action_del_method_stack_item(action_t* action, const char* stack_name, const char* name);
void scene_action_exec(action_t* action);
void scene_action_delete(void* arg);
void scene_action_for_each_environment(action_t* action, void (*visitor)(env_t*, void*), void* arg);
void scene_action_for_each_method_stack_item(action_t* action, void (*visitor)(method_stack_item_t*, void*), void* arg);