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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
// Generated by gir (https://github.com/gtk-rs/gir @ 73df75128d55)
// from ../gir-files (@ 8be196040235)
// DO NOT EDIT

#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(
  clippy::approx_constant,
  clippy::type_complexity,
  clippy::unreadable_literal,
  clippy::upper_case_acronyms
)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[allow(unused_imports)]
use libc::{
  c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
  intptr_t, size_t, ssize_t, uintptr_t, FILE,
};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Enums
pub type JSCCheckSyntaxMode = c_int;
pub const JSC_CHECK_SYNTAX_MODE_SCRIPT: JSCCheckSyntaxMode = 0;
pub const JSC_CHECK_SYNTAX_MODE_MODULE: JSCCheckSyntaxMode = 1;

pub type JSCCheckSyntaxResult = c_int;
pub const JSC_CHECK_SYNTAX_RESULT_SUCCESS: JSCCheckSyntaxResult = 0;
pub const JSC_CHECK_SYNTAX_RESULT_RECOVERABLE_ERROR: JSCCheckSyntaxResult = 1;
pub const JSC_CHECK_SYNTAX_RESULT_IRRECOVERABLE_ERROR: JSCCheckSyntaxResult = 2;
pub const JSC_CHECK_SYNTAX_RESULT_UNTERMINATED_LITERAL_ERROR: JSCCheckSyntaxResult = 3;
pub const JSC_CHECK_SYNTAX_RESULT_OUT_OF_MEMORY_ERROR: JSCCheckSyntaxResult = 4;
pub const JSC_CHECK_SYNTAX_RESULT_STACK_OVERFLOW_ERROR: JSCCheckSyntaxResult = 5;

pub type JSCOptionType = c_int;
pub const JSC_OPTION_BOOLEAN: JSCOptionType = 0;
pub const JSC_OPTION_INT: JSCOptionType = 1;
pub const JSC_OPTION_UINT: JSCOptionType = 2;
pub const JSC_OPTION_SIZE: JSCOptionType = 3;
pub const JSC_OPTION_DOUBLE: JSCOptionType = 4;
pub const JSC_OPTION_STRING: JSCOptionType = 5;
pub const JSC_OPTION_RANGE_STRING: JSCOptionType = 6;

pub type JSCTypedArrayType = c_int;
pub const JSC_TYPED_ARRAY_NONE: JSCTypedArrayType = 0;
pub const JSC_TYPED_ARRAY_INT8: JSCTypedArrayType = 1;
pub const JSC_TYPED_ARRAY_INT16: JSCTypedArrayType = 2;
pub const JSC_TYPED_ARRAY_INT32: JSCTypedArrayType = 3;
pub const JSC_TYPED_ARRAY_INT64: JSCTypedArrayType = 4;
pub const JSC_TYPED_ARRAY_UINT8: JSCTypedArrayType = 5;
pub const JSC_TYPED_ARRAY_UINT8_CLAMPED: JSCTypedArrayType = 6;
pub const JSC_TYPED_ARRAY_UINT16: JSCTypedArrayType = 7;
pub const JSC_TYPED_ARRAY_UINT32: JSCTypedArrayType = 8;
pub const JSC_TYPED_ARRAY_UINT64: JSCTypedArrayType = 9;
pub const JSC_TYPED_ARRAY_FLOAT32: JSCTypedArrayType = 10;
pub const JSC_TYPED_ARRAY_FLOAT64: JSCTypedArrayType = 11;

// Constants
pub const JSC_MAJOR_VERSION: c_int = 2;
pub const JSC_MICRO_VERSION: c_int = 1;
pub const JSC_MINOR_VERSION: c_int = 38;
pub const JSC_OPTIONS_USE_DFG: &[u8] = b"useDFGJIT\0";
pub const JSC_OPTIONS_USE_FTL: &[u8] = b"useFTLJIT\0";
pub const JSC_OPTIONS_USE_JIT: &[u8] = b"useJIT\0";
pub const JSC_OPTIONS_USE_LLINT: &[u8] = b"useLLInt\0";

// Flags
pub type JSCValuePropertyFlags = c_uint;
pub const JSC_VALUE_PROPERTY_CONFIGURABLE: JSCValuePropertyFlags = 1;
pub const JSC_VALUE_PROPERTY_ENUMERABLE: JSCValuePropertyFlags = 2;
pub const JSC_VALUE_PROPERTY_WRITABLE: JSCValuePropertyFlags = 4;

// Callbacks
pub type JSCClassDeletePropertyFunction =
  Option<unsafe extern "C" fn(*mut JSCClass, *mut JSCContext, gpointer, *const c_char) -> gboolean>;
pub type JSCClassEnumeratePropertiesFunction =
  Option<unsafe extern "C" fn(*mut JSCClass, *mut JSCContext, gpointer) -> *mut *mut c_char>;
pub type JSCClassGetPropertyFunction = Option<
  unsafe extern "C" fn(*mut JSCClass, *mut JSCContext, gpointer, *const c_char) -> *mut JSCValue,
>;
pub type JSCClassHasPropertyFunction =
  Option<unsafe extern "C" fn(*mut JSCClass, *mut JSCContext, gpointer, *const c_char) -> gboolean>;
pub type JSCClassSetPropertyFunction = Option<
  unsafe extern "C" fn(
    *mut JSCClass,
    *mut JSCContext,
    gpointer,
    *const c_char,
    *mut JSCValue,
  ) -> gboolean,
>;
pub type JSCExceptionHandler =
  Option<unsafe extern "C" fn(*mut JSCContext, *mut JSCException, gpointer)>;
pub type JSCOptionsFunc =
  Option<unsafe extern "C" fn(*const c_char, JSCOptionType, *const c_char, gpointer) -> gboolean>;

// Records
#[repr(C)]
pub struct _JSCClassClass {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCClassClass = *mut _JSCClassClass;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCClassVTable {
  pub get_property: JSCClassGetPropertyFunction,
  pub set_property: JSCClassSetPropertyFunction,
  pub has_property: JSCClassHasPropertyFunction,
  pub delete_property: JSCClassDeletePropertyFunction,
  pub enumerate_properties: JSCClassEnumeratePropertiesFunction,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCClassVTable {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCClassVTable @ {self:p}"))
      .field("get_property", &self.get_property)
      .field("set_property", &self.set_property)
      .field("has_property", &self.has_property)
      .field("delete_property", &self.delete_property)
      .field("enumerate_properties", &self.enumerate_properties)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCContextClass {
  pub parent_class: gobject::GObjectClass,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCContextClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCContextClass @ {self:p}"))
      .field("parent_class", &self.parent_class)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[repr(C)]
pub struct _JSCContextPrivate {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCContextPrivate = *mut _JSCContextPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCExceptionClass {
  pub parent_class: gobject::GObjectClass,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCExceptionClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCExceptionClass @ {self:p}"))
      .field("parent_class", &self.parent_class)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[repr(C)]
pub struct _JSCExceptionPrivate {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCExceptionPrivate = *mut _JSCExceptionPrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCValueClass {
  pub parent_class: gobject::GObjectClass,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCValueClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCValueClass @ {self:p}"))
      .field("parent_class", &self.parent_class)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[repr(C)]
pub struct _JSCValuePrivate {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCValuePrivate = *mut _JSCValuePrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCVirtualMachineClass {
  pub parent_class: gobject::GObjectClass,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCVirtualMachineClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCVirtualMachineClass @ {self:p}"))
      .field("parent_class", &self.parent_class)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[repr(C)]
pub struct _JSCVirtualMachinePrivate {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCVirtualMachinePrivate = *mut _JSCVirtualMachinePrivate;

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCWeakValueClass {
  pub parent_class: gobject::GObjectClass,
  pub _jsc_reserved0: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved1: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved2: Option<unsafe extern "C" fn()>,
  pub _jsc_reserved3: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for JSCWeakValueClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCWeakValueClass @ {self:p}"))
      .field("parent_class", &self.parent_class)
      .field("_jsc_reserved0", &self._jsc_reserved0)
      .field("_jsc_reserved1", &self._jsc_reserved1)
      .field("_jsc_reserved2", &self._jsc_reserved2)
      .field("_jsc_reserved3", &self._jsc_reserved3)
      .finish()
  }
}

#[repr(C)]
pub struct _JSCWeakValuePrivate {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type JSCWeakValuePrivate = *mut _JSCWeakValuePrivate;

// Classes
#[repr(C)]
pub struct JSCClass {
  _data: [u8; 0],
  _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

impl ::std::fmt::Debug for JSCClass {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCClass @ {self:p}")).finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCContext {
  pub parent: gobject::GObject,
  pub priv_: *mut JSCContextPrivate,
}

impl ::std::fmt::Debug for JSCContext {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCContext @ {self:p}"))
      .field("parent", &self.parent)
      .finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCException {
  pub parent: gobject::GObject,
  pub priv_: *mut JSCExceptionPrivate,
}

impl ::std::fmt::Debug for JSCException {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCException @ {self:p}"))
      .field("parent", &self.parent)
      .finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCValue {
  pub parent: gobject::GObject,
  pub priv_: *mut JSCValuePrivate,
}

impl ::std::fmt::Debug for JSCValue {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCValue @ {self:p}"))
      .field("parent", &self.parent)
      .finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCVirtualMachine {
  pub parent: gobject::GObject,
  pub priv_: *mut JSCVirtualMachinePrivate,
}

impl ::std::fmt::Debug for JSCVirtualMachine {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCVirtualMachine @ {self:p}"))
      .field("parent", &self.parent)
      .finish()
  }
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct JSCWeakValue {
  pub parent: gobject::GObject,
  pub priv_: *mut JSCWeakValuePrivate,
}

impl ::std::fmt::Debug for JSCWeakValue {
  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
    f.debug_struct(&format!("JSCWeakValue @ {self:p}"))
      .field("parent", &self.parent)
      .finish()
  }
}

#[link(name = "javascriptcoregtk-4.1")]
extern "C" {

  //=========================================================================
  // JSCClass
  //=========================================================================
  pub fn jsc_class_get_type() -> GType;
  pub fn jsc_class_add_constructor(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_params: c_uint,
    ...
  ) -> *mut JSCValue;
  pub fn jsc_class_add_constructor_variadic(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
  ) -> *mut JSCValue;
  pub fn jsc_class_add_constructorv(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_parameters: c_uint,
    parameter_types: *mut GType,
  ) -> *mut JSCValue;
  pub fn jsc_class_add_method(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_params: c_uint,
    ...
  );
  pub fn jsc_class_add_method_variadic(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
  );
  pub fn jsc_class_add_methodv(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_parameters: c_uint,
    parameter_types: *mut GType,
  );
  pub fn jsc_class_add_property(
    jsc_class: *mut JSCClass,
    name: *const c_char,
    property_type: GType,
    getter: gobject::GCallback,
    setter: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
  );
  pub fn jsc_class_get_name(jsc_class: *mut JSCClass) -> *const c_char;
  pub fn jsc_class_get_parent(jsc_class: *mut JSCClass) -> *mut JSCClass;

  //=========================================================================
  // JSCContext
  //=========================================================================
  pub fn jsc_context_get_type() -> GType;
  pub fn jsc_context_new() -> *mut JSCContext;
  pub fn jsc_context_new_with_virtual_machine(vm: *mut JSCVirtualMachine) -> *mut JSCContext;
  pub fn jsc_context_get_current() -> *mut JSCContext;
  pub fn jsc_context_check_syntax(
    context: *mut JSCContext,
    code: *const c_char,
    length: ssize_t,
    mode: JSCCheckSyntaxMode,
    uri: *const c_char,
    line_number: c_uint,
    exception: *mut *mut JSCException,
  ) -> JSCCheckSyntaxResult;
  pub fn jsc_context_clear_exception(context: *mut JSCContext);
  pub fn jsc_context_evaluate(
    context: *mut JSCContext,
    code: *const c_char,
    length: ssize_t,
  ) -> *mut JSCValue;
  pub fn jsc_context_evaluate_in_object(
    context: *mut JSCContext,
    code: *const c_char,
    length: ssize_t,
    object_instance: gpointer,
    object_class: *mut JSCClass,
    uri: *const c_char,
    line_number: c_uint,
    object: *mut *mut JSCValue,
  ) -> *mut JSCValue;
  pub fn jsc_context_evaluate_with_source_uri(
    context: *mut JSCContext,
    code: *const c_char,
    length: ssize_t,
    uri: *const c_char,
    line_number: c_uint,
  ) -> *mut JSCValue;
  pub fn jsc_context_get_exception(context: *mut JSCContext) -> *mut JSCException;
  pub fn jsc_context_get_global_object(context: *mut JSCContext) -> *mut JSCValue;
  pub fn jsc_context_get_value(context: *mut JSCContext, name: *const c_char) -> *mut JSCValue;
  pub fn jsc_context_get_virtual_machine(context: *mut JSCContext) -> *mut JSCVirtualMachine;
  pub fn jsc_context_pop_exception_handler(context: *mut JSCContext);
  pub fn jsc_context_push_exception_handler(
    context: *mut JSCContext,
    handler: JSCExceptionHandler,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
  );
  pub fn jsc_context_register_class(
    context: *mut JSCContext,
    name: *const c_char,
    parent_class: *mut JSCClass,
    vtable: *mut JSCClassVTable,
    destroy_notify: glib::GDestroyNotify,
  ) -> *mut JSCClass;
  pub fn jsc_context_set_value(context: *mut JSCContext, name: *const c_char, value: *mut JSCValue);
  pub fn jsc_context_throw(context: *mut JSCContext, error_message: *const c_char);
  pub fn jsc_context_throw_exception(context: *mut JSCContext, exception: *mut JSCException);
  pub fn jsc_context_throw_printf(context: *mut JSCContext, format: *const c_char, ...);
  pub fn jsc_context_throw_with_name(
    context: *mut JSCContext,
    error_name: *const c_char,
    error_message: *const c_char,
  );
  pub fn jsc_context_throw_with_name_printf(
    context: *mut JSCContext,
    error_name: *const c_char,
    format: *const c_char,
    ...
  );

  //=========================================================================
  // JSCException
  //=========================================================================
  pub fn jsc_exception_get_type() -> GType;
  pub fn jsc_exception_new(context: *mut JSCContext, message: *const c_char) -> *mut JSCException;
  pub fn jsc_exception_new_printf(
    context: *mut JSCContext,
    format: *const c_char,
    ...
  ) -> *mut JSCException;
  //pub fn jsc_exception_new_vprintf(context: *mut JSCContext, format: *const c_char, args: /*Unimplemented*/va_list) -> *mut JSCException;
  pub fn jsc_exception_new_with_name(
    context: *mut JSCContext,
    name: *const c_char,
    message: *const c_char,
  ) -> *mut JSCException;
  pub fn jsc_exception_new_with_name_printf(
    context: *mut JSCContext,
    name: *const c_char,
    format: *const c_char,
    ...
  ) -> *mut JSCException;
  //pub fn jsc_exception_new_with_name_vprintf(context: *mut JSCContext, name: *const c_char, format: *const c_char, args: /*Unimplemented*/va_list) -> *mut JSCException;
  pub fn jsc_exception_get_backtrace_string(exception: *mut JSCException) -> *const c_char;
  pub fn jsc_exception_get_column_number(exception: *mut JSCException) -> c_uint;
  pub fn jsc_exception_get_line_number(exception: *mut JSCException) -> c_uint;
  pub fn jsc_exception_get_message(exception: *mut JSCException) -> *const c_char;
  pub fn jsc_exception_get_name(exception: *mut JSCException) -> *const c_char;
  pub fn jsc_exception_get_source_uri(exception: *mut JSCException) -> *const c_char;
  pub fn jsc_exception_report(exception: *mut JSCException) -> *mut c_char;
  pub fn jsc_exception_to_string(exception: *mut JSCException) -> *mut c_char;

  //=========================================================================
  // JSCValue
  //=========================================================================
  pub fn jsc_value_get_type() -> GType;
  pub fn jsc_value_new_array(
    context: *mut JSCContext,
    first_item_type: GType,
    ...
  ) -> *mut JSCValue;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_new_array_buffer(
    context: *mut JSCContext,
    data: gpointer,
    size: size_t,
    destroy_notify: glib::GDestroyNotify,
    user_data: gpointer,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_array_from_garray(
    context: *mut JSCContext,
    array: *mut glib::GPtrArray,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_array_from_strv(
    context: *mut JSCContext,
    strv: *const *const c_char,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_boolean(context: *mut JSCContext, value: gboolean) -> *mut JSCValue;
  #[cfg(feature = "v2_28")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_28")))]
  pub fn jsc_value_new_from_json(context: *mut JSCContext, json: *const c_char) -> *mut JSCValue;
  pub fn jsc_value_new_function(
    context: *mut JSCContext,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_params: c_uint,
    ...
  ) -> *mut JSCValue;
  pub fn jsc_value_new_function_variadic(
    context: *mut JSCContext,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_functionv(
    context: *mut JSCContext,
    name: *const c_char,
    callback: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
    return_type: GType,
    n_parameters: c_uint,
    parameter_types: *mut GType,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_null(context: *mut JSCContext) -> *mut JSCValue;
  pub fn jsc_value_new_number(context: *mut JSCContext, number: c_double) -> *mut JSCValue;
  pub fn jsc_value_new_object(
    context: *mut JSCContext,
    instance: gpointer,
    jsc_class: *mut JSCClass,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_string(context: *mut JSCContext, string: *const c_char) -> *mut JSCValue;
  pub fn jsc_value_new_string_from_bytes(
    context: *mut JSCContext,
    bytes: *mut glib::GBytes,
  ) -> *mut JSCValue;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_new_typed_array(
    context: *mut JSCContext,
    type_: JSCTypedArrayType,
    length: size_t,
  ) -> *mut JSCValue;
  pub fn jsc_value_new_undefined(context: *mut JSCContext) -> *mut JSCValue;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_array_buffer_get_data(value: *mut JSCValue, size: *mut size_t) -> gpointer;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_array_buffer_get_size(value: *mut JSCValue) -> size_t;
  pub fn jsc_value_constructor_call(
    value: *mut JSCValue,
    first_parameter_type: GType,
    ...
  ) -> *mut JSCValue;
  pub fn jsc_value_constructor_callv(
    value: *mut JSCValue,
    n_parameters: c_uint,
    parameters: *mut *mut JSCValue,
  ) -> *mut JSCValue;
  pub fn jsc_value_function_call(
    value: *mut JSCValue,
    first_parameter_type: GType,
    ...
  ) -> *mut JSCValue;
  pub fn jsc_value_function_callv(
    value: *mut JSCValue,
    n_parameters: c_uint,
    parameters: *mut *mut JSCValue,
  ) -> *mut JSCValue;
  pub fn jsc_value_get_context(value: *mut JSCValue) -> *mut JSCContext;
  pub fn jsc_value_is_array(value: *mut JSCValue) -> gboolean;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_is_array_buffer(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_boolean(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_constructor(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_function(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_null(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_number(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_object(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_string(value: *mut JSCValue) -> gboolean;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_is_typed_array(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_is_undefined(value: *mut JSCValue) -> gboolean;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_new_typed_array_with_buffer(
    array_buffer: *mut JSCValue,
    type_: JSCTypedArrayType,
    offset: size_t,
    length: ssize_t,
  ) -> *mut JSCValue;
  pub fn jsc_value_object_define_property_accessor(
    value: *mut JSCValue,
    property_name: *const c_char,
    flags: JSCValuePropertyFlags,
    property_type: GType,
    getter: gobject::GCallback,
    setter: gobject::GCallback,
    user_data: gpointer,
    destroy_notify: glib::GDestroyNotify,
  );
  pub fn jsc_value_object_define_property_data(
    value: *mut JSCValue,
    property_name: *const c_char,
    flags: JSCValuePropertyFlags,
    property_value: *mut JSCValue,
  );
  pub fn jsc_value_object_delete_property(value: *mut JSCValue, name: *const c_char) -> gboolean;
  pub fn jsc_value_object_enumerate_properties(value: *mut JSCValue) -> *mut *mut c_char;
  pub fn jsc_value_object_get_property(value: *mut JSCValue, name: *const c_char) -> *mut JSCValue;
  pub fn jsc_value_object_get_property_at_index(
    value: *mut JSCValue,
    index: c_uint,
  ) -> *mut JSCValue;
  pub fn jsc_value_object_has_property(value: *mut JSCValue, name: *const c_char) -> gboolean;
  pub fn jsc_value_object_invoke_method(
    value: *mut JSCValue,
    name: *const c_char,
    first_parameter_type: GType,
    ...
  ) -> *mut JSCValue;
  pub fn jsc_value_object_invoke_methodv(
    value: *mut JSCValue,
    name: *const c_char,
    n_parameters: c_uint,
    parameters: *mut *mut JSCValue,
  ) -> *mut JSCValue;
  pub fn jsc_value_object_is_instance_of(value: *mut JSCValue, name: *const c_char) -> gboolean;
  pub fn jsc_value_object_set_property(
    value: *mut JSCValue,
    name: *const c_char,
    property: *mut JSCValue,
  );
  pub fn jsc_value_object_set_property_at_index(
    value: *mut JSCValue,
    index: c_uint,
    property: *mut JSCValue,
  );
  pub fn jsc_value_to_boolean(value: *mut JSCValue) -> gboolean;
  pub fn jsc_value_to_double(value: *mut JSCValue) -> c_double;
  pub fn jsc_value_to_int32(value: *mut JSCValue) -> i32;
  #[cfg(feature = "v2_28")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_28")))]
  pub fn jsc_value_to_json(value: *mut JSCValue, indent: c_uint) -> *mut c_char;
  pub fn jsc_value_to_string(value: *mut JSCValue) -> *mut c_char;
  pub fn jsc_value_to_string_as_bytes(value: *mut JSCValue) -> *mut glib::GBytes;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_buffer(value: *mut JSCValue) -> *mut JSCValue;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_data(value: *mut JSCValue, length: *mut size_t) -> gpointer;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_length(value: *mut JSCValue) -> size_t;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_offset(value: *mut JSCValue) -> size_t;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_size(value: *mut JSCValue) -> size_t;
  #[cfg(feature = "v2_38")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
  pub fn jsc_value_typed_array_get_type(value: *mut JSCValue) -> JSCTypedArrayType;

  //=========================================================================
  // JSCVirtualMachine
  //=========================================================================
  pub fn jsc_virtual_machine_get_type() -> GType;
  pub fn jsc_virtual_machine_new() -> *mut JSCVirtualMachine;

  //=========================================================================
  // JSCWeakValue
  //=========================================================================
  pub fn jsc_weak_value_get_type() -> GType;
  pub fn jsc_weak_value_new(value: *mut JSCValue) -> *mut JSCWeakValue;
  pub fn jsc_weak_value_get_value(weak_value: *mut JSCWeakValue) -> *mut JSCValue;

  //=========================================================================
  // Other functions
  //=========================================================================
  pub fn jsc_get_major_version() -> c_uint;
  pub fn jsc_get_micro_version() -> c_uint;
  pub fn jsc_get_minor_version() -> c_uint;
  pub fn jsc_options_foreach(function: JSCOptionsFunc, user_data: gpointer);
  pub fn jsc_options_get_boolean(option: *const c_char, value: *mut gboolean) -> gboolean;
  pub fn jsc_options_get_double(option: *const c_char, value: *mut c_double) -> gboolean;
  pub fn jsc_options_get_int(option: *const c_char, value: *mut c_int) -> gboolean;
  pub fn jsc_options_get_option_group() -> *mut glib::GOptionGroup;
  pub fn jsc_options_get_range_string(option: *const c_char, value: *mut *mut c_char) -> gboolean;
  pub fn jsc_options_get_size(option: *const c_char, value: *mut size_t) -> gboolean;
  pub fn jsc_options_get_string(option: *const c_char, value: *mut *mut c_char) -> gboolean;
  pub fn jsc_options_get_uint(option: *const c_char, value: *mut c_uint) -> gboolean;
  pub fn jsc_options_set_boolean(option: *const c_char, value: gboolean) -> gboolean;
  pub fn jsc_options_set_double(option: *const c_char, value: c_double) -> gboolean;
  pub fn jsc_options_set_int(option: *const c_char, value: c_int) -> gboolean;
  pub fn jsc_options_set_range_string(option: *const c_char, value: *const c_char) -> gboolean;
  pub fn jsc_options_set_size(option: *const c_char, value: size_t) -> gboolean;
  pub fn jsc_options_set_string(option: *const c_char, value: *const c_char) -> gboolean;
  pub fn jsc_options_set_uint(option: *const c_char, value: c_uint) -> gboolean;

}