Files
unixtract/src/formats/msd10/include.rs
T
theubusu aa2249f024 RESTRUCTURING 1
- change formats to have their own folders with mod + include files + anything they want
- change format list to be defined in formats.rs instead of in each format
- move utils to their respective formats
- some minor code changes in some formats
2026-02-17 17:28:59 +01:00

28 lines
529 B
Rust

use crate::utils::common;
use binrw::BinRead;
#[derive(BinRead)]
pub struct FileHeader {
_magic_bytes: [u8; 6],
pub section_count: u32
}
#[derive(BinRead)]
pub struct SectionEntry {
pub index: u32,
pub offset: u32,
pub size: u32,
}
#[derive(BinRead)]
pub struct HeaderEntry {
pub offset: u32,
pub size: u32,
_name_length: u8,
#[br(count = _name_length)] name_bytes: Vec<u8>,
}
impl HeaderEntry {
pub fn name(&self) -> String {
common::string_from_bytes(&self.name_bytes)
}
}