initial stuff, just copying structs from C
This commit is contained in:
commit
78927e9f9c
|
@ -0,0 +1,2 @@
|
|||
/target
|
||||
**/*.rs.bk
|
|
@ -0,0 +1,4 @@
|
|||
[[package]]
|
||||
name = "one-rust"
|
||||
version = "0.1.0"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "one-rust"
|
||||
version = "0.1.0"
|
||||
authors = ["lifning <lifning+git@pm.me>"]
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1,48 @@
|
|||
use std::io::{Read, Seek};
|
||||
|
||||
struct OneJod<R: Read + Seek> {
|
||||
read_handle: R,
|
||||
header: OneJodHead,
|
||||
}
|
||||
|
||||
impl<R> OneJod<R>
|
||||
where
|
||||
R: Read + Seek,
|
||||
{
|
||||
fn honk() {
|
||||
println!("honk");
|
||||
}
|
||||
}
|
||||
|
||||
struct OneJodHead {
|
||||
magic: [u8; 16],
|
||||
_unknown1: u32,
|
||||
category: [u8; 32],
|
||||
file_count: u32,
|
||||
reserved: [u8; 128],
|
||||
}
|
||||
|
||||
impl OneJodHead {
|
||||
fn category(&self) -> &str { category }
|
||||
fn category_mut(&mut self) -> &mut str { category }
|
||||
}
|
||||
|
||||
struct OneJodEntry {
|
||||
_unknown1: u32,
|
||||
id: u32,
|
||||
size_cmp: u32,
|
||||
_unknown2: u32,
|
||||
size_dec: u32,
|
||||
id_again: u32,
|
||||
offset: u32,
|
||||
file_name: [u8; 188],
|
||||
}
|
||||
|
||||
impl OneJodEntry {
|
||||
fn asdf() { }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = String::from("56");
|
||||
println!("Hello, world! {}", x);
|
||||
}
|
Loading…
Reference in New Issue