JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

insanity

Amber - ⁨1⁩ year ago

parent: tbd commit: ⁨6ea28ab

⁨giterated-abi/src/vtable/plugin_initialization.rs⁩ - ⁨1682⁩ bytes
Raw
1 use crate::{
2 callback::{
3 operation::OperationHandlerCallback, setting::SettingGetterCallback,
4 value::ValueGetterCallback, CallbackPtr,
5 },
6 FfiValueMut,
7 };
8
9 use super::{operation::Operation, Object, ObjectABI, Setting, VTable, Value};
10
11 #[repr(C)]
12 pub struct HostVTable {}
13
14 #[repr(C)]
15 #[derive(Clone, Copy)]
16 pub struct InitializationVTable {
17 pub register_object:
18 unsafe extern "C" fn(state: FfiValueMut<()>, &'static str, &'static VTable<Object>),
19 pub register_operation: unsafe extern "C" fn(
20 state: FfiValueMut<()>,
21 &'static str,
22 &'static str,
23 &'static VTable<Operation>,
24 ),
25 pub register_setting: unsafe extern "C" fn(
26 state: FfiValueMut<()>,
27 &'static str,
28 &'static str,
29 &'static VTable<Setting>,
30 ),
31 pub register_value: unsafe extern "C" fn(
32 state: FfiValueMut<()>,
33 &'static str,
34 &'static str,
35 &'static VTable<Value>,
36 ),
37
38 pub operation_handler: unsafe extern "C" fn(
39 state: FfiValueMut<()>,
40 &'static str,
41 &'static str,
42 CallbackPtr<OperationHandlerCallback>,
43 ),
44
45 pub value_getter: unsafe extern "C" fn(
46 state: FfiValueMut<()>,
47 &'static str,
48 &'static str,
49 CallbackPtr<ValueGetterCallback>,
50 ),
51
52 pub setting_getter: unsafe extern "C" fn(
53 state: FfiValueMut<()>,
54 &'static str,
55 &'static str,
56 CallbackPtr<SettingGetterCallback>,
57 ),
58 }
59
60 impl ObjectABI for InitializationVTable {
61 type VTable = InitializationVTable;
62 }
63
64 unsafe impl Sync for InitializationVTable {}
65 unsafe impl Send for InitializationVTable {}
66