capstone_git/
lib.rs

1#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
2#![cfg_attr(not(feature = "std"), no_std)]
3// derive Default on enums was not stable until 1.62.0
4#![allow(clippy::derivable_impls)]
5
6// The `vec` macro cannot be imported directly since it conflicts with the `vec` module
7#[allow(unused_imports)]
8#[macro_use]
9extern crate alloc;
10
11#[cfg(all(test, not(feature = "std")))]
12#[macro_use]
13extern crate std;
14
15#[cfg(all(test, not(feature = "std")))]
16#[global_allocator]
17static ALLOCATOR: std::alloc::System = std::alloc::System;
18
19// Define first so macros are available
20#[macro_use]
21mod constants;
22
23pub mod arch;
24mod capstone;
25mod error;
26mod ffi;
27mod instruction;
28
29#[cfg(test)]
30mod test;
31
32pub use crate::capstone::*;
33pub use crate::constants::*;
34pub use crate::error::*;
35pub use crate::instruction::*;
36
37/// Contains items that you probably want to always import
38///
39/// For example:
40///
41/// ```
42/// use capstone::prelude::*;
43/// ```
44pub mod prelude {
45    pub use crate::arch::{
46        self, ArchDetail, BuildsCapstone, BuildsCapstoneEndian, BuildsCapstoneExtraMode,
47        BuildsCapstoneSyntax, DetailsArchInsn,
48    };
49    pub use crate::{
50        Capstone, CsResult, InsnDetail, InsnGroupId, InsnGroupIdInt, InsnId, InsnIdInt, RegId,
51        RegIdInt,
52    };
53}