-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathcommon.h
More file actions
76 lines (66 loc) · 2.97 KB
/
common.h
File metadata and controls
76 lines (66 loc) · 2.97 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// common.h
#ifndef SKCOMMON_H
#define SKCOMMON_H
#include <node.h>
#include <string>
namespace skbinding {
v8::Local<v8::String> FromUtf8(v8::Isolate*, const char*);
void AddFunction(v8::Isolate*, v8::Local<v8::Object>, const char*,
v8::FunctionCallback callback);
v8::Local<v8::Value> CallGlobalStaticMethod(v8::Isolate*, const char*,
const char*, int,
v8::Local<v8::Value> argv[]);
void* SKTryCatch(v8::Isolate*, v8::Local<v8::Function>, v8::Local<v8::Value>,
int, v8::Local<v8::Value>[],
std::function<void*(v8::Isolate*, v8::Local<v8::Value>)>,
std::function<void(v8::Isolate*)>);
void SKTryCatchVoid(v8::Isolate*, v8::Local<v8::Function>, v8::Local<v8::Value>,
int, v8::Local<v8::Value>[],
std::function<void(v8::Isolate*)>,
std::function<void(v8::Isolate*)>);
void CallJSVoidFunction(v8::Isolate*, v8::Local<v8::Object>, const char*, int,
v8::Local<v8::Value>[]);
void* CallJSFunction(v8::Isolate*, v8::Local<v8::Object>, const char*, int,
v8::Local<v8::Value>[]);
void* CallJSNullableFunction(v8::Isolate*, v8::Local<v8::Object>, const char*,
int, v8::Local<v8::Value>[]);
double CallJSNumberFunction(v8::Isolate*, v8::Local<v8::Object>, const char*,
int, v8::Local<v8::Value>[]);
char* CallJSStringFunction(v8::Isolate*, v8::Local<v8::Object>, const char*,
int, v8::Local<v8::Value>[]);
char* CallJSNullableStringFunction(v8::Isolate*, v8::Local<v8::Object>,
const char*, int, v8::Local<v8::Value>[]);
void NatTryCatch(v8::Isolate*, std::function<void(v8::Isolate*)>);
void RunWithGC(const v8::FunctionCallbackInfo<v8::Value>&);
void UnsafeAsyncRunWithGC(const v8::FunctionCallbackInfo<v8::Value>&);
void GetErrorObject(const v8::FunctionCallbackInfo<v8::Value>&);
char* ToSKString(v8::Isolate*, v8::Local<v8::Value>);
void Print(v8::Isolate*, const char*, v8::Local<v8::Value>);
v8::Local<v8::Value> JSONStringify(v8::Isolate*, v8::Local<v8::Value>);
bool JSCheckFunction(v8::Isolate*, v8::Local<v8::Object>, const char*);
struct SkipException : std::exception {
explicit SkipException(void* exc) : m_skipException(exc) {}
virtual const char* what() const noexcept override;
const char* name() const noexcept;
void* m_skipException;
};
} // namespace skbinding
#define SKError void*
#define SKObstack void*
#define CJSON void*
#define CJArray void*
#define CJObject void*
#define PartialCJObj void*
#define PartialCJArr void*
#define SKException void*
#define SKContext void*
#define SKNonEmptyIterator void*
#define SKResource void*
#define SKLazyCompute void*
#define SKIdentifier void*
#define SKService void*
#define SKNotifier void*
#define SKReducer void*
#define SKMapper void*
#define SKMergeState void*
#endif // SKCOMMON_H