1#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(clippy::too_many_arguments)]
6#![allow(clippy::missing_transmute_annotations)]
7
8#[macro_use]
9mod helper;
10pub mod types;
11
12mod events;
13mod scripting;
14
15mod runtime;
16
17use std::ffi::c_char;
18use std::os::raw::c_void;
19
20pub use events::Events;
21pub use omp_codegen::main;
22pub use runtime::{Runtime, __terminate_event_chain};
23pub use scripting::actors;
24pub use scripting::checkpoints;
25pub use scripting::classes;
26pub use scripting::core;
27pub use scripting::dialogs;
28pub use scripting::gangzones;
29pub use scripting::menus;
30pub use scripting::models;
31pub use scripting::objects;
32pub use scripting::pickups;
33pub use scripting::players;
34pub use scripting::textdraws;
35pub use scripting::textlabels;
36pub use scripting::vehicles;
37
38pub use helper::gen_uid;
39
40#[doc(hidden)]
41pub fn init_functions() {
42 load_function!(Component_Create);
43 core::load_functions();
44 models::load_functions();
45 players::load_functions();
46 actors::load_functions();
47 checkpoints::load_functions();
48 classes::load_functions();
49 dialogs::load_functions();
50 gangzones::load_functions();
51 menus::load_functions();
52 objects::load_functions();
53 pickups::load_functions();
54 textdraws::load_functions();
55 textlabels::load_functions();
56 vehicles::load_functions();
57 events::load_event_functions();
58}
59
60#[repr(C)]
61#[derive(Clone, Copy, Debug)]
62pub struct ComponentVersion {
63 pub major: u8, pub minor: u8, pub patch: u8, pub prerel: u16, }
68
69impl ComponentVersion {
70 pub fn new(major: u8, minor: u8, patch: u8, prerel: u16) -> Self {
71 ComponentVersion {
72 major,
73 minor,
74 patch,
75 prerel,
76 }
77 }
78}
79pub static mut OMPRS_Component_Create: Option<
80 unsafe extern "C" fn(
81 uid: u64,
82 name: *const c_char,
83 version: ComponentVersion,
84 onReadyCB: *const c_void,
85 onResetCB: *const c_void,
86 onFreeCB: *const c_void,
87 ) -> *const c_void,
88> = None;