capstone_sys/opt/rustwide/workdir/
common.rs

1// Contains code common to the build script and main crate
2//
3// Needs to be included with include! macro
4
5#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
6/// Information specific to architecture
7pub 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
15impl CapstoneArchInfo<'_> {
16    /// Get the name of the C header
17    pub fn header_name(&self) -> &str {
18        self.header_name
19    }
20
21    /// Get the arch name used in Capstone types
22    pub fn cs_name(&self) -> &str {
23        self.cs_name
24    }
25}
26
27pub static ARCH_INCLUDES: &[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    CapstoneArchInfo {
81        header_name: "bpf.h",
82        cs_name: "bpf"
83    }
84];
85
86pub static BINDINGS_FILE: &str = "capstone.rs";
87pub static BINDINGS_IMPL_FILE: &str = "capstone_archs_impl.rs";