2021-08-28 07:54:01 +00:00
|
|
|
#![forbid(unsafe_code)]
|
|
|
|
#![warn(trivial_casts, unused_lifetimes, unused_qualifications)]
|
2021-09-24 14:53:35 +00:00
|
|
|
//! This library consists of all of the things fif needs to run. It only exists as a library to separate code, and to
|
|
|
|
//! make testing a bit easier. I don't recommend using this as a library for your crate, as it may have breaking
|
|
|
|
//! changes without incrementing the major version, as it's really only meant to be a place for fif's internals to live.
|
2021-08-28 07:54:01 +00:00
|
|
|
|
2021-08-28 07:59:04 +00:00
|
|
|
pub mod files;
|
2021-08-28 07:54:01 +00:00
|
|
|
pub mod findings;
|
|
|
|
pub mod formats;
|
2021-08-28 07:59:04 +00:00
|
|
|
pub mod mime_db;
|
2021-08-28 07:54:01 +00:00
|
|
|
pub mod parameters;
|
|
|
|
pub mod utils;
|
|
|
|
|
2021-08-28 07:59:04 +00:00
|
|
|
use cfg_if::cfg_if;
|
2021-09-24 13:53:02 +00:00
|
|
|
use once_cell::sync::Lazy;
|
2021-08-28 07:54:01 +00:00
|
|
|
|
2021-09-24 08:11:25 +00:00
|
|
|
use crate::findings::Findings;
|
|
|
|
use crate::mime_db::MimeDb;
|
|
|
|
|
2021-08-28 08:00:31 +00:00
|
|
|
cfg_if! {
|
|
|
|
if #[cfg(not(all(target_endian = "big", target_pointer_width = "32")))] {
|
|
|
|
// most architectures
|
|
|
|
pub use smartstring::alias::String;
|
|
|
|
} else {
|
|
|
|
// powerpc and other big endian 32-bit archs
|
|
|
|
pub use std::string::String;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-28 07:54:01 +00:00
|
|
|
cfg_if! {
|
|
|
|
if #[cfg(any(all(unix, feature = "infer-backend"), all(not(unix), not(feature = "xdg-mime-backend"))))] {
|
2021-09-24 13:53:02 +00:00
|
|
|
/// A [Lazy] holding an instance of [mime_db::MimeDb].
|
2021-09-24 14:53:35 +00:00
|
|
|
pub static MIMEDB: Lazy<mime_db::InferDb> = Lazy::new(crate::mime_db::InferDb::init);
|
2021-08-28 07:54:01 +00:00
|
|
|
} else {
|
2021-09-24 13:53:02 +00:00
|
|
|
/// A [Lazy] holding an instance of [mime_db::MimeDb].
|
2021-09-24 14:53:35 +00:00
|
|
|
pub static MIMEDB: Lazy<mime_db::XdgDb> = Lazy::new(crate::mime_db::XdgDb::init);
|
2021-08-28 07:54:01 +00:00
|
|
|
}
|
2021-08-28 07:59:04 +00:00
|
|
|
}
|