ironring: split lib and bin code

This commit is contained in:
Dece 2020-04-18 17:43:55 +02:00
parent 026797d935
commit 72cc3fecb6
4 changed files with 26 additions and 11 deletions

View file

@ -4,7 +4,12 @@ version = "0.1.0"
authors = ["Dece <shgck@pistache.land>"] authors = ["Dece <shgck@pistache.land>"]
edition = "2018" edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib]
name = "rir"
crate-type = ["lib", "cdylib"]
[[bin]]
name = "ironring"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"

8
ffi_tests.py Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env python3
"""Import hash from the rir dynamic lib."""
import sys
from ctypes import cdll
lib = cdll.LoadLibrary(sys.argv[1])
#print(lib.name_hashes.hash("/chr/c0000.anibnd.dcx"))

View file

@ -5,16 +5,7 @@ use std::process;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand}; use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
mod name_hashes; use rir::{name_hashes, unpackers};
mod parsers {
pub mod bhd;
}
mod unpackers {
pub mod bhd;
}
mod utils {
pub mod fs;
}
fn main() { fn main() {
let default_namefilepath: &str = &get_default_namefilepath(); let default_namefilepath: &str = &get_default_namefilepath();

11
src/lib.rs Normal file
View file

@ -0,0 +1,11 @@
pub mod name_hashes;
pub mod parsers {
pub mod bhd;
}
pub mod unpackers {
pub mod bhd;
}
pub mod utils {
pub mod fs;
}