wl_array_for_each

Macro wl_array_for_each 

Source
macro_rules! wl_array_for_each {
    ($pos:ident: *const $T:ty, $array:expr, $body:block) => { ... };
    ($pos:ident: *mut $T:ty, $array:expr, $body:block) => { ... };
}
Expand description

Roughly equivalent to the wl_array_for_each(pos, array) C macro.

It can only be invoked inside an unsafe block.

The following Rust code:

let a: *const wl_array = /*...*/;
unsafe {
    wl_array_for_each!(p: *mut c_int, a, {
        // ...
    });
}

is roughly equivalent to the following C code:

const struct wl_array *a = /*...*/;
int *p;
wl_array_for_each(p, a) {
    // ...
}