hirofa_quickjs_sys/
static-functions.rs1unsafe extern "C" {
2 fn JS_ValueGetTag_real(v: JSValue) -> i32;
3 #[cfg(feature = "bellard")]
4 fn JS_DupValue_real(ctx: *mut JSContext, v: JSValue);
5 #[cfg(feature = "bellard")]
6 fn JS_DupValueRT_real(rt: *mut JSRuntime, v: JSValue);
7 #[cfg(feature = "bellard")]
8 fn JS_FreeValue_real(ctx: *mut JSContext, v: JSValue);
9 #[cfg(feature = "bellard")]
10 fn JS_FreeValueRT_real(rt: *mut JSRuntime, v: JSValue);
11 fn JS_NewBool_real(ctx: *mut JSContext, v: bool) -> JSValue;
12 fn JS_NewInt32_real(ctx: *mut JSContext, v: i32) -> JSValue;
13
14 #[cfg(feature = "bellard")]
15 fn JS_NewFloat64_real(ctx: *mut JSContext, v: f64) -> JSValue;
16
17 fn JS_VALUE_IS_NAN_real(v: JSValue) -> bool;
18 fn JS_VALUE_GET_FLOAT64_real(v: JSValue) -> f64;
19 fn JS_VALUE_GET_NORM_TAG_real(v: JSValue) -> ::std::os::raw::c_int;
20 fn JS_IsNumber_real(v: JSValue) -> bool;
21 #[cfg(feature = "bellard")]
22 fn JS_IsBigInt_real(ctx: *mut JSContext, v: JSValue) -> bool;
23 #[cfg(feature = "quickjs-ng")]
24 fn JS_IsBigInt_real(v: JSValue) -> bool;
25 fn JS_IsBool_real(v: JSValue) -> bool;
26 fn JS_IsNull_real(v: JSValue) -> bool;
27 fn JS_IsUndefined_real(v: JSValue) -> bool;
28 fn JS_IsException_real(v: JSValue) -> bool;
29 fn JS_IsUninitialized_real(v: JSValue) -> bool;
30 fn JS_IsString_real(v: JSValue) -> bool;
31 fn JS_IsSymbol_real(v: JSValue) -> bool;
32 fn JS_IsObject_real(v: JSValue) -> bool;
33 fn JS_ToUint32_real(ctx: *mut JSContext, pres: u32, val: JSValue) -> u32;
34 #[cfg(feature = "bellard")]
35 fn JS_SetProperty_real(
36 ctx: *mut JSContext,
37 this_obj: JSValue,
38 prop: JSAtom,
39 val: JSValue,
40 ) -> ::std::os::raw::c_int;
41 fn JS_NewCFunction_real(
42 ctx: *mut JSContext,
43 func: *mut JSCFunction,
44 name: *const ::std::os::raw::c_char,
45 length: ::std::os::raw::c_int,
46 ) -> JSValue;
47 fn JS_NewCFunctionMagic_real(
48 ctx: *mut JSContext,
49 func: *mut JSCFunctionMagic,
50 name: *const ::std::os::raw::c_char,
51 length: ::std::os::raw::c_int,
52 cproto: JSCFunctionEnum,
53 magic: ::std::os::raw::c_int,
54 ) -> JSValue;
55}
56
57pub unsafe fn JS_ValueGetTag(v: JSValue) -> i32 {
58 unsafe { JS_ValueGetTag_real(v) }
59}
60
61#[cfg(feature = "bellard")]
63pub unsafe fn JS_DupValue(ctx: *mut JSContext, v: JSValue) {
64 unsafe {
65 JS_DupValue_real(ctx, v);
66 }
67}
68
69#[cfg(feature = "bellard")]
71pub unsafe fn JS_DupValueRT(rt: *mut JSRuntime, v: JSValue) {
72 unsafe {
73 JS_DupValueRT_real(rt, v);
74 }
75}
76
77#[cfg(feature = "bellard")]
79pub unsafe fn JS_FreeValue(ctx: *mut JSContext, v: JSValue) {
80 unsafe {
81 JS_FreeValue_real(ctx, v);
82 }
83}
84
85#[cfg(feature = "bellard")]
87pub unsafe fn JS_FreeValueRT(rt: *mut JSRuntime, v: JSValue) {
88 unsafe {
89 JS_FreeValueRT_real(rt, v);
90 }
91}
92
93pub unsafe fn JS_NewBool(ctx: *mut JSContext, v: bool) -> JSValue {
95 unsafe { JS_NewBool_real(ctx, v) }
96}
97
98pub unsafe fn JS_NewInt32(ctx: *mut JSContext, v: i32) -> JSValue {
100 unsafe { JS_NewInt32_real(ctx, v) }
101}
102
103#[cfg(feature = "bellard")]
105pub unsafe fn JS_NewFloat64(ctx: *mut JSContext, v: f64) -> JSValue {
106 unsafe { JS_NewFloat64_real(ctx, v) }
107}
108
109pub unsafe fn JS_VALUE_IS_NAN(v: JSValue) -> bool {
111 unsafe { JS_VALUE_IS_NAN_real(v) }
112}
113
114pub unsafe fn JS_VALUE_GET_FLOAT64(v: JSValue) -> f64 {
116 unsafe { JS_VALUE_GET_FLOAT64_real(v) }
117}
118
119pub unsafe fn JS_VALUE_GET_NORM_TAG(v: JSValue) -> ::std::os::raw::c_int {
121 unsafe { JS_VALUE_GET_NORM_TAG_real(v) }
122}
123
124pub unsafe fn JS_IsNumber(v: JSValue) -> bool {
126 unsafe { JS_IsNumber_real(v) }
127}
128
129#[cfg(feature = "bellard")]
131pub unsafe fn JS_IsBigInt(ctx: *mut JSContext, v: JSValue) -> bool {
132 unsafe { JS_IsBigInt_real(ctx, v) }
133}
134#[cfg(feature = "quickjs-ng")]
135pub unsafe fn JS_IsBigInt(v: JSValue) -> bool {
136 unsafe { JS_IsBigInt_real(v) }
137}
138pub unsafe fn JS_IsBool(v: JSValue) -> bool {
140 unsafe { JS_IsBool_real(v) }
141}
142
143pub unsafe fn JS_IsNull(v: JSValue) -> bool {
145 unsafe { JS_IsNull_real(v) }
146}
147
148pub unsafe fn JS_IsUndefined(v: JSValue) -> bool {
150 unsafe { JS_IsUndefined_real(v) }
151}
152
153pub unsafe fn JS_IsException(v: JSValue) -> bool {
155 unsafe { JS_IsException_real(v) }
156}
157
158pub unsafe fn JS_IsUninitialized(v: JSValue) -> bool {
160 unsafe { JS_IsUninitialized_real(v) }
161}
162
163pub unsafe fn JS_IsString(v: JSValue) -> bool {
165 unsafe { JS_IsString_real(v) }
166}
167
168pub unsafe fn JS_IsSymbol(v: JSValue) -> bool {
170 unsafe { JS_IsSymbol_real(v) }
171}
172
173pub unsafe fn JS_IsObject(v: JSValue) -> bool {
175 unsafe { JS_IsObject_real(v) }
176}
177
178pub unsafe fn JS_ToUint32(ctx: *mut JSContext, pres: u32, val: JSValue) -> u32 {
180 unsafe { JS_ToUint32_real(ctx, pres, val) }
181}
182
183#[cfg(feature = "bellard")]
185pub unsafe fn JS_SetProperty(
186 ctx: *mut JSContext,
187 this_obj: JSValue,
188 prop: JSAtom,
189 val: JSValue,
190) -> ::std::os::raw::c_int {
191 unsafe { JS_SetProperty_real(ctx, this_obj, prop, val) }
192}
193
194pub unsafe fn JS_NewCFunction(
196 ctx: *mut JSContext,
197 func: *mut JSCFunction,
198 name: *const ::std::os::raw::c_char,
199 length: ::std::os::raw::c_int,
200) -> JSValue {
201 unsafe { JS_NewCFunction_real(ctx, func, name, length) }
202}
203
204pub unsafe fn JS_NewCFunctionMagic(
206 ctx: *mut JSContext,
207 func: *mut JSCFunctionMagic,
208 name: *const ::std::os::raw::c_char,
209 length: ::std::os::raw::c_int,
210 cproto: JSCFunctionEnum,
211 magic: ::std::os::raw::c_int,
212) -> JSValue {
213 unsafe { JS_NewCFunctionMagic_real(ctx, func, name, length, cproto, magic) }
214}