1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![no_std]

#[cfg(feature = "alloc")]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

mod cxx_auto_artifact_info;
mod cxx_auto_entry;
mod error;
mod ffi {
    pub(crate) mod ctypes;
}
mod gen {
    pub(crate) mod ctypes;
}
mod processing;

#[cfg(feature = "alloc")]
pub use crate::{cxx_auto_artifact_info::CxxAutoArtifactInfo, cxx_auto_entry::CxxAutoEntry, error::*};
#[cfg(feature = "alloc")]
pub use indexmap;

pub mod ctypes {
    pub use crate::ffi::ctypes::{
        c_char,
        c_int,
        c_long,
        c_longlong,
        c_off_t,
        c_schar,
        c_short,
        c_time_t,
        c_uchar,
        c_uint,
        c_ulong,
        c_ulonglong,
        c_ushort,
        c_void,
    };
}

/// # Errors
///
/// Will return `Err` if auto-generation of the C++ bindings fails.
#[cfg(feature = "std")]
pub fn process_artifacts(
    project_dir: &std::path::Path,
    out_dir: &std::path::Path,
    cfg_dir: &std::path::Path,
) -> BoxResult<()> {
    let out_dir = &out_dir.join("src");
    crate::processing::process_src_auto_module(project_dir, out_dir, cfg_dir)?;
    Ok(())
}