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
extern "C" {
fn pci_lookup_method(name: &str) -> i32;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_abs() {
//{
//
// pacc = pci_alloc();
// pacc->error = die;
// pci_filter_init(pacc, &filter);
//
//
// pci_init(pacc);
// if (opt_map_mode)
// {
// if (need_topology)
// die("Bus mapping mode does not recognize bus topology");
// map_the_bus();
// }
// else
// {
// scan_devices();
// sort_them();
// if (need_topology)
// grow_tree();
// if (opt_tree)
// show_forest(opt_filter ? &filter : NULL);
// else
// show();
// }
// show_kernel_cleanup();
// pci_cleanup(pacc);
//
//}
let is_found = unsafe { pci_lookup_method("linux-sysfs\x00") };
dbg!(is_found);
}
}