/rust/registry/src/index.crates.io-6f17d22bba15001f/capstone-sys-0.13.0/common.rs
Line | Count | Source (jump to first uncovered line) |
1 | | // Contains code common to the build script and main crate |
2 | | // |
3 | | // Needs to be included with include! macro |
4 | | |
5 | 0 | #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] |
6 | | /// Information specific to architecture |
7 | | pub struct CapstoneArchInfo<'a> { |
8 | | /// name of C header |
9 | | header_name: &'a str, |
10 | | |
11 | | /// name used within capstone C library |
12 | | cs_name: &'a str, |
13 | | } |
14 | | |
15 | | impl<'a> CapstoneArchInfo<'a> { |
16 | | /// Get the name of the C header |
17 | 0 | pub fn header_name(&self) -> &str { |
18 | 0 | self.header_name |
19 | 0 | } |
20 | | |
21 | | /// Get the arch name used in Capstone types |
22 | 0 | pub fn cs_name(&self) -> &str { |
23 | 0 | self.cs_name |
24 | 0 | } |
25 | | } |
26 | | |
27 | | pub static ARCH_INCLUDES: &'static [CapstoneArchInfo<'static>] = &[ |
28 | | CapstoneArchInfo { |
29 | | header_name: "arm.h", |
30 | | cs_name: "arm", |
31 | | }, |
32 | | CapstoneArchInfo { |
33 | | header_name: "arm64.h", |
34 | | cs_name: "arm64", |
35 | | }, |
36 | | CapstoneArchInfo { |
37 | | header_name: "evm.h", |
38 | | cs_name: "evm", |
39 | | }, |
40 | | CapstoneArchInfo { |
41 | | header_name: "m680x.h", |
42 | | cs_name: "m680x", |
43 | | }, |
44 | | CapstoneArchInfo { |
45 | | header_name: "m68k.h", |
46 | | cs_name: "m68k", |
47 | | }, |
48 | | CapstoneArchInfo { |
49 | | header_name: "mips.h", |
50 | | cs_name: "mips", |
51 | | }, |
52 | | CapstoneArchInfo { |
53 | | header_name: "ppc.h", |
54 | | cs_name: "ppc", |
55 | | }, |
56 | | CapstoneArchInfo { |
57 | | header_name: "riscv.h", |
58 | | cs_name: "riscv", |
59 | | }, |
60 | | CapstoneArchInfo { |
61 | | header_name: "sparc.h", |
62 | | cs_name: "sparc", |
63 | | }, |
64 | | CapstoneArchInfo { |
65 | | header_name: "systemz.h", |
66 | | cs_name: "sysz", |
67 | | }, |
68 | | CapstoneArchInfo { |
69 | | header_name: "tms320c64x.h", |
70 | | cs_name: "tms320c64x", |
71 | | }, |
72 | | CapstoneArchInfo { |
73 | | header_name: "x86.h", |
74 | | cs_name: "x86", |
75 | | }, |
76 | | CapstoneArchInfo { |
77 | | header_name: "xcore.h", |
78 | | cs_name: "xcore", |
79 | | }, |
80 | | ]; |
81 | | |
82 | | pub static BINDINGS_FILE: &'static str = "capstone.rs"; |
83 | | pub static BINDINGS_IMPL_FILE: &'static str = "capstone_archs_impl.rs"; |