1#[macro_export]
5macro_rules! entry {
6 ($($entry:ident => $body:stmt;)*) => {
8 $(
9 $crate::entry!(@internal $entry $body);
10 )*
11 };
12
13 (@internal initialize $body:stmt) => {
17 #[inline]
18 #[no_mangle]
19 unsafe extern "C" fn initialize() {
20 $body
21 }
22 };
23
24 (@internal opcontrol $body:stmt) => {
26 #[inline]
27 #[no_mangle]
28 unsafe extern "C" fn opcontrol() {
29 $body
30 }
31 };
32
33 (@internal autonomous $body:stmt) => {
35 #[inline]
36 #[no_mangle]
37 unsafe extern "C" fn autonomous() {
38 $body
39 }
40 };
41
42 (@internal disabled $body:stmt) => {
44 #[inline]
45 #[no_mangle]
46 unsafe extern "C" fn disabled() {
47 $body
48 }
49 };
50
51 (@internal $invalid:ident $body:stmt) => {
53 compile_error!(concat!("entry macro error: entrypoint `", stringify!($invalid), "` does not exist"));
54 };
55}