va_list-rs Build Status Build status

A way to use C va_list from Rust.

Example:

```Rust extern crate libc;

[macrouse] extern crate valist;

use libc::{cchar, cint};

// Here we declare the C function with valist that we'll use. extern "C" { fn vprintf(f: *const cchar, v: valist::valist) -> c_int; }

fn main() { // You just have to call this macro and it'll return you the valist. unsafe { tovalist!(|v: valist::valist| { // And now you can just give the valist to the C function: vprintf(b"%d %d %s\n\0".asptr() as *const cchar, v); }, 1, 2, b"salut!\0".as_ptr()); // We pass the arguments after the closure. } } ```