#![allow(unsafe_code)]
pub mod ipc;
pub mod nfs;
pub mod arrays;
use self::arrays::*;
use errors::CoreError;
use ffi_utils::ReprC;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct AccountInfo {
pub mutations_done: u64,
pub mutations_available: u64,
}
impl ReprC for AccountInfo {
type C = *const AccountInfo;
type Error = CoreError;
unsafe fn clone_from_repr_c(repr_c: Self::C) -> Result<Self, Self::Error> {
Ok(*repr_c)
}
}
#[repr(C)]
#[derive(Clone)]
pub struct MDataInfo {
pub name: XorNameArray,
pub type_tag: u64,
pub has_enc_info: bool,
pub enc_key: SymSecretKey,
pub enc_nonce: SymNonce,
pub has_new_enc_info: bool,
pub new_enc_key: SymSecretKey,
pub new_enc_nonce: SymNonce,
}
#[no_mangle]
pub extern "C" fn is_mock_build() -> bool {
cfg!(feature = "use-mock-routing")
}
#[cfg(test)]
mod tests {
use ffi::is_mock_build;
#[test]
#[cfg(feature = "use-mock-routing")]
fn test_mock_build() {
assert_eq!(is_mock_build(), true);
}
#[test]
#[cfg(not(feature = "use-mock-routing"))]
fn test_not_mock_build() {
assert_eq!(is_mock_build(), false);
}
}