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