#![cfg_attr(target_os = "macos", allow(clippy::too_many_arguments))]
pub mod error;
pub mod model;
pub mod stdio;
mod store;
#[cfg(target_os = "macos")]
mod bridge;
#[cfg(target_os = "macos")]
mod builder;
#[cfg(target_os = "macos")]
mod session;
#[cfg(not(target_os = "macos"))]
mod unsupported;
pub use crate::error::Error;
pub use crate::model::{BootSpec, BuildPlan, BuildStep, CachePolicy, Shell};
pub use crate::stdio::{Stdio, UNATTACHED, is_tty, lend};
pub use crate::store::{
INITFS_REFERENCE, INITFS_VERSION, KERNEL_IN_ARCHIVE, KERNEL_URL, KERNEL_VERSION, Store, StoreError,
};
#[cfg(target_os = "macos")]
pub use crate::builder::Builder;
#[cfg(target_os = "macos")]
pub use crate::session::Session;
#[cfg(not(target_os = "macos"))]
pub use crate::unsupported::{Builder, Session};
#[cfg(target_os = "macos")]
const FAILED: i32 = -1;
#[cfg(target_os = "macos")]
use crate::bridge::ffi;
#[cfg(target_os = "macos")]
fn checked(code: i32) -> Result<i32, String> {
if code == FAILED {
return Err(ffi::czbridge_last_error());
}
Ok(code)
}