Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add C ffi for parsing XMB files #2

Open
ScanMountGoat opened this issue Feb 13, 2021 · 0 comments
Open

add C ffi for parsing XMB files #2

ScanMountGoat opened this issue Feb 13, 2021 · 0 comments

Comments

@ScanMountGoat
Copy link
Member

ScanMountGoat commented Feb 13, 2021

The XMB data from BinRead can be mapped into types compatible with C. This can also be easily converted to classes in C#.

#[repr(C)]
struct Entry {
    name: CString,
    parent_index: i32,
    properties: FfiVec<Property>
}

#[repr(C)]
struct Property {
    name: CString,
    value: CString
}

#[repr(C)]
struct Xmb {
    entries: FfiVec<Entry>
}

#[repr(C)]
pub struct FfiVec<T: Sized> {
    ptr: *mut T,
    size: usize,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant