1use zerocopy::{IntoBytes, TryFromBytes};
9
10pub type BoolAlias = bool;
11
12pub type Int8Alias = i8;
13
14pub type Int16Alias = i16;
15
16pub type Int32Alias = i32;
17
18pub type Int64Alias = i64;
19
20pub type Uint8Alias = u8;
21
22pub type Uint16Alias = u16;
23
24pub type Uint32Alias = u32;
25
26pub type Uint64Alias = u64;
27
28pub const CONST_FROM_ALIAS: u8 = 0xff;
31
32#[repr(i16)]
33#[derive(Clone, Copy, Debug, Eq, Hash, IntoBytes, PartialEq, TryFromBytes)]
34pub enum Enum {
35 Member = 0,
36}
37
38impl Enum {
39 pub fn from_raw(raw: i16) -> Option<Self> {
40 match raw {
41 0 => Some(Self::Member),
42
43 _ => None,
44 }
45 }
46}
47
48impl From<Enum> for i16 {
49 fn from(val: Enum) -> Self {
50 val as Self
51 }
52}
53
54pub type EnumAlias = Enum;
55
56#[repr(u16)]
57#[derive(Clone, Copy, Debug, Eq, Hash, IntoBytes, PartialEq, TryFromBytes)]
58pub enum Bits {
59 One = 1,
60}
61
62impl Bits {
63 pub fn from_raw(raw: u16) -> Option<Self> {
64 match raw {
65 1 => Some(Self::One),
66
67 _ => None,
68 }
69 }
70}
71
72impl From<Bits> for u16 {
73 fn from(val: Bits) -> Self {
74 val as Self
75 }
76}
77
78pub type BitsAlias = Bits;
79
80#[repr(C)]
81#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromBytes)]
82pub struct Struct {
83 pub x: u64,
84 pub y: u64,
85 pub e: EnumAlias,
86}
87
88pub type StructAlias = Struct;
89
90pub type ArrayAlias = [u32; 4];
91
92pub type NestedArrayAlias = [[Struct; 8]; 4];
93
94pub type AliasWithOneLineComment = bool;
96
97pub type AliasWithManyLineComment = u8;