1mod read;
4pub mod write;
5
6use std::ffi::{c_void, CStr};
7use mumu::parser::interpreter::Interpreter;
8
9#[export_name = "Cargo_lock"] pub unsafe extern "C" fn cargo_lock(
11 interp_ptr: *mut c_void,
12 extra_str: *const c_void,
13) -> i32 {
14 if interp_ptr.is_null() {
15 return 1;
16 }
17 let interp_ref = &mut *(interp_ptr as *mut Interpreter);
18 let verbose = interp_ref.is_verbose();
19
20 if verbose {
21 eprintln!("[file] Cargo.lock => loading 'file' plugin...");
22 if !extra_str.is_null() {
23 let c_str = CStr::from_ptr(extra_str as *const i8);
24 eprintln!("[file] Extra arg => '{}'", c_str.to_string_lossy());
25 }
26 }
27
28 read::register_file_read(interp_ref);
30
31 write::register_file_write(interp_ref);
33
34 0
35}