Maraiah/source/meta.rs

52 lines
1.8 KiB
Rust
Raw Normal View History

2019-06-14 09:12:31 -07:00
//! Meta-information of this crate.
macro_rules! meta_str {
2019-06-17 22:40:39 -07:00
($($(#[$outer:meta])* $name:ident = $cname:ident = $e:expr;)*) => {
2019-06-14 09:12:31 -07:00
$(
2019-06-17 22:40:39 -07:00
$(#[$outer])* pub const $name: &'static str = $e;
2019-06-14 09:12:31 -07:00
)*
2019-06-17 22:40:39 -07:00
pub mod ffi
{
$(
doc_comment! {
concat!("FFI variant of [`",
stringify!($name),
"`]\n\n[`",
stringify!($name),
"`]: ../constant.",
stringify!($name),
".html"),
pub const $cname: crate::ffi::NT = c_str!($e);
}
)*
}
2019-06-14 09:12:31 -07:00
}
}
meta_str!(
2019-06-17 22:40:39 -07:00
/// The authors of this crate, `:` separated.
AUTHORS = AUTHORS_C = env!("CARGO_PKG_AUTHORS");
/// The description of this crate.
DESCRIPTION = DESCRIPTION_C = env!("CARGO_PKG_DESCRIPTION");
/// The home page of this crate.
HOMEPAGE = HOMEPAGE_C = env!("CARGO_PKG_HOMEPAGE");
/// The full license text of this crate.
LICENSE_TEXT = LICENSE_TEXT_C = include_str!("../LICENSE");
/// The name of this crate.
NAME = NAME_C = env!("CARGO_PKG_NAME");
/// The repository of this crate.
REPOSITORY = REPOSITORY_C = env!("CARGO_PKG_REPOSITORY");
/// The full version of this crate.
VERSION = VERSION_C = env!("CARGO_PKG_VERSION");
/// The major version of this crate.
VERSION_MAJOR = VERSION_MAJOR_C = env!("CARGO_PKG_VERSION_MAJOR");
/// The minor version of this crate.
VERSION_MINOR = VERSION_MINOR_C = env!("CARGO_PKG_VERSION_MINOR");
/// The patch version of this crate.
VERSION_PATCH = VERSION_PATCH_C = env!("CARGO_PKG_VERSION_PATCH");
/// The pre-release version of this crate.
VERSION_PRE = VERSION_PRE_C = env!("CARGO_PKG_VERSION_PRE");
2019-06-14 09:12:31 -07:00
);
// EOF