#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(any(feature = "alloc", test))]
extern crate alloc;
#[cfg(test)]
#[macro_use]
extern crate std;
#[cfg(not(any(
feature = "alloc",
feature = "fat",
feature = "exfat",
feature = "littlefs"
)))]
compile_error!(
"fstool: enable at least one feature — `std` for the full library, or a \
backend such as `fat`, `exfat` or `littlefs` (none of which needs an \
allocator) for a slimmer one"
);
#[cfg(all(
feature = "std",
not(any(
feature = "affs",
feature = "apfs",
feature = "archive",
feature = "exfat",
feature = "ext",
feature = "f2fs",
feature = "fat",
feature = "grf",
feature = "hfs",
feature = "hfs-plus",
feature = "iso9660",
feature = "littlefs",
feature = "ntfs",
feature = "ramfs",
feature = "squashfs",
feature = "tar",
feature = "xfs",
))
))]
compile_error!(
"fstool: the `std` build needs at least one filesystem feature \
(`fat`, `ext`, … or `filesystems`); `inspect` has nothing to dispatch to otherwise"
);
#[cfg(feature = "std")]
pub mod analyze;
#[cfg(feature = "std")]
pub mod base64;
#[cfg(feature = "alloc")]
pub mod block;
#[cfg(feature = "std")]
pub mod compression;
#[cfg(feature = "ext")]
pub mod concurrent;
pub mod crc;
pub mod device;
#[cfg(feature = "alloc")]
pub mod error;
#[cfg(feature = "alloc")]
pub mod format_opts;
#[cfg(any(
feature = "alloc",
feature = "fat",
feature = "exfat",
feature = "littlefs"
))]
pub mod fs;
#[cfg(feature = "fuse")]
pub mod fuse_adapter;
#[cfg(feature = "std")]
pub mod inspect;
#[cfg(feature = "alloc")]
pub mod io;
#[cfg(feature = "std")]
pub mod macroman;
#[cfg(feature = "std")]
pub mod memconv;
#[cfg(feature = "std")]
pub mod memedit;
#[cfg(feature = "std")]
pub mod merge;
#[cfg(feature = "alloc")]
pub mod part;
#[cfg(feature = "alloc")]
pub mod path;
#[cfg(feature = "std")]
pub mod path_style;
#[cfg(feature = "std")]
pub mod repack;
#[cfg(feature = "std")]
pub mod resfork;
#[cfg(feature = "std")]
pub mod spec;
#[cfg(all(target_arch = "wasm32", feature = "wasm"))]
pub mod wasm;
#[macro_export]
#[doc(hidden)]
macro_rules! fstool_log {
($level:ident, $($arg:tt)*) => {{
#[cfg(feature = "log")]
::log::$level!($($arg)*);
#[cfg(not(feature = "log"))]
{
let _ = ::core::format_args!($($arg)*);
}
}};
}
#[cfg(feature = "alloc")]
pub use error::{Error, Result};