1 // src/lib.rs
2 
3 #![allow(non_upper_case_globals)]
4 #![allow(non_camel_case_types)]
5 #![allow(non_snake_case)]
6 
7 #[cfg(all(feature = "bindgen", not(feature = "bindgen-source")))]
8 include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
9 #[cfg(any(not(feature = "bindgen"), feature = "bindgen-source"))]
10 include!("bindings.rs");
11 
12 #[cfg(feature = "vendored-libbpf")]
13 macro_rules! header {
14     ($file:literal) => {
15         ($file, include_str!(concat!("../libbpf/src/", $file)))
16     };
17 }
18 
19 /// Vendored libbpf headers
20 ///
21 /// Tuple format is: (header filename, header contents)
22 #[cfg(feature = "vendored-libbpf")]
23 pub const API_HEADERS: [(&str, &str); 10] = [
24     header!("bpf.h"),
25     header!("libbpf.h"),
26     header!("btf.h"),
27     header!("bpf_helpers.h"),
28     header!("bpf_helper_defs.h"),
29     header!("bpf_tracing.h"),
30     header!("bpf_endian.h"),
31     header!("bpf_core_read.h"),
32     header!("libbpf_common.h"),
33     header!("usdt.bpf.h"),
34 ];
35