initial stuff, just copying structs from C

This commit is contained in:
lif 2018-09-19 00:17:13 -07:00
commit 78927e9f9c
4 changed files with 60 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
**/*.rs.bk

4
Cargo.lock generated Normal file
View File

@ -0,0 +1,4 @@
[[package]]
name = "one-rust"
version = "0.1.0"

6
Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "one-rust"
version = "0.1.0"
authors = ["lifning <lifning+git@pm.me>"]
[dependencies]

48
src/main.rs Normal file
View File

@ -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);
}