(path_ptr: *const u8, data_ptr: *const u8)
| 2003 | |
| 2004 | #[no_mangle] |
| 2005 | pub extern "C" fn bloom_write_file(path_ptr: *const u8, data_ptr: *const u8) -> f64 { |
| 2006 | let path = str_from_header(path_ptr); |
| 2007 | let data = str_from_header(data_ptr); |
| 2008 | match std::fs::write(path, data.as_bytes()) { |
| 2009 | Ok(_) => 1.0, |
| 2010 | Err(_) => 0.0, |
| 2011 | } |
| 2012 | } |
| 2013 | |
| 2014 | #[no_mangle] |
| 2015 | pub extern "C" fn bloom_file_exists(path_ptr: *const u8) -> f64 { |
no test coverage detected