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