-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine.h
54 lines (39 loc) · 902 Bytes
/
engine.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
53
54
#ifndef _ENGINE_H
#define _ENGINE_H
#include <string.h>
#include "box.h"
#include "queue.h"
#define MAX_BOXS 10000
typedef enum {
ENG_NUL = 1 << 0,
ENG_INI = 1 << 1,
ENG_RUN = 1 << 2,
ENG_SUS = 1 << 3,
ENG_DES = 1 << 4,
} EngStat;
typedef struct {
unsigned int box_size;
Box * box_list[MAX_BOXS];
TaskQueue task_queue;
lua_State * lua_state;
EngStat status;
} Engine;
Engine *
engine_init();
void
engine_new_box(Engine *eng, const char *box_guid);
void
engine_drop_box(Engine *eng, const char *box_guid);
void
engine_load_comctx(Engine *eng, const char *file_name);
void
engine_load_boxctx(Engine *eng, const char *box_guid, const char *file_name);
void
engine_call_func(Engine *eng, const char *box_guid, const char *func_name);
void
engine_schedule(Engine *eng);
void
engine_suspend(Engine *eng);
void
engine_destroy(Engine *eng);
#endif