use super::*;
#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
pub(crate) struct BlendSdnaField {
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) clean_name: String,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) raw_name: String,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) type_name: String,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) offset: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) byte_size: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) is_pointer: bool,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) pointer_depth: u8,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) total_elements: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) element_size: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) sdna_struct_index: Option<usize>,
}
#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
pub(crate) struct BlendSdnaStruct {
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) type_name: String,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) byte_size: usize,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) fields: Vec<BlendSdnaField>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) field_by_name: HashMap<String, usize>,
}
#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
pub struct BlendSdnaTable {
#[get(type(copy))]
pub(crate) pointer_size_bytes: u8,
#[get(type(copy))]
pub(crate) is_little_endian: bool,
#[get(type(copy))]
pub(crate) struct_count: usize,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) names: Vec<String>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) types: Vec<String>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) type_lengths: Vec<u16>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) structs: Vec<BlendSdnaStruct>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) struct_by_name: HashMap<String, usize>,
}
#[derive(Clone, Copy, Data, Debug, Eq, PartialEq)]
pub(crate) struct BlendFileBlock {
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) code: [u8; 4],
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) kind: BlendBlockKind,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) old_address: u64,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) sdna_index: u32,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) count: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) payload_start: usize,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) payload_end: usize,
}
#[derive(Clone, Data, Debug)]
pub(crate) struct BlendArchiveView<'a> {
#[get(pub(crate), type(copy))]
#[set(skip)]
#[get_mut(skip)]
pub(crate) data: &'a [u8],
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) header: BlendHeader,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) sdna: BlendSdnaTable,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) blocks: Vec<BlendFileBlock>,
#[get(pub(crate))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) address_to_block: HashMap<u64, usize>,
}
#[derive(Clone, Copy, Data, Debug)]
pub(crate) struct BlendStructView<'a> {
#[get(pub(crate), type(copy))]
#[set(skip)]
#[get_mut(skip)]
pub(crate) archive: &'a BlendArchiveView<'a>,
#[get(pub(crate), type(copy))]
#[set(pub(crate))]
#[get_mut(skip)]
pub(crate) struct_index: usize,
#[get(pub(crate), type(copy))]
#[set(skip)]
#[get_mut(skip)]
pub(crate) bytes: &'a [u8],
}