physis/
iwc.rs

1// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4use std::io::Cursor;
5
6use crate::ByteSpan;
7use binrw::BinRead;
8use binrw::binrw;
9
10#[binrw]
11#[derive(Debug)]
12#[brw(little)]
13struct IwcHeader {
14    count: u16,
15    part_mask: u16,
16}
17
18#[derive(Debug)]
19pub struct Iwc {}
20
21impl Iwc {
22    /// Reads an existing ULD file
23    pub fn from_existing(buffer: ByteSpan) -> Option<Self> {
24        let mut cursor = Cursor::new(buffer);
25        IwcHeader::read(&mut cursor).ok()?;
26
27        Some(Iwc {})
28    }
29}