forked from rogchap/v8go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv8go.h
39 lines (31 loc) · 797 Bytes
/
v8go.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
#ifndef V8GO_H
#define V8GO_H
#ifdef __cplusplus
extern "C" {
#endif
typedef void* IsolatePtr;
typedef void* ContextPtr;
typedef void* ValuePtr;
typedef struct {
const char* msg;
const char* location;
const char* stack;
} RtnError;
typedef struct {
ValuePtr value;
RtnError error;
} RtnValue;
extern void Init();
extern IsolatePtr NewIsolate();
extern void IsolateDispose(IsolatePtr ptr);
extern void TerminateExecution(IsolatePtr ptr);
extern ContextPtr NewContext(IsolatePtr prt);
extern void ContextDispose(ContextPtr ptr);
extern RtnValue RunScript(ContextPtr ctx_ptr, const char* source, const char* origin);
extern void ValueDispose(ValuePtr ptr);
const char* ValueToString(ValuePtr ptr);
const char* Version();
#ifdef __cplusplus
} // extern "C"
#endif
#endif // V8GO_H