Closed ShayBox closed 2 years ago
Those are pointers to the first of multiple, the n* variables tell you how many elements there are. I haven't tested this code but you should be able to do something like this:
let scr_res: XRRScreenResources = todo!();
let crtcs = unsafe { std::slice::from_raw_parts_mut(scr_res.crtcs, scr_res.ncrtcs as usize) };
https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html https://doc.rust-lang.org/std/slice/fn.from_raw_parts_mut.html
https://doc.servo.org/x11/xrandr/struct.XRRScreenResources.html crtcs, outputs, and modes are supposed to be multiple, it's only one with this lib, XRRScreenResources is just one example, there's others.