#unsafe #arguments #c

va_list

Provides a rust implementation of the 'va_list' type for a small set of ABIs. Allowing rust implementations of functions like vprintf.

9 releases

Uses old Rust 2015

0.2.0 Jul 4, 2024
0.1.4 Apr 3, 2022
0.1.3 Nov 18, 2018
0.1.1 Oct 21, 2018
0.0.1 Jun 7, 2015

#35 in FFI

Download history 5550/week @ 2024-07-11 7533/week @ 2024-07-18 9038/week @ 2024-07-25 8958/week @ 2024-08-01 8618/week @ 2024-08-08 9066/week @ 2024-08-15 7307/week @ 2024-08-22 8163/week @ 2024-08-29 7511/week @ 2024-09-05 6135/week @ 2024-09-12 6152/week @ 2024-09-19 6038/week @ 2024-09-26 4857/week @ 2024-10-03 4840/week @ 2024-10-10 6906/week @ 2024-10-17 6599/week @ 2024-10-24

25,119 downloads per month
Used in 18 crates (7 directly)

MIT/Apache

13KB
303 lines

Rust implementation of C's va_list type

Overview

This crate provides a rust VaListtype, which is binary-compatible for the C va_list type. It is intended to allow rust code to provide the complex logic of variable argument functions.

Example

extern crate va_list;
use va_list::VaList;

extern "C" print_ints_va(count: u32, mut args: VaList)
{
	for i in (0 .. count) {
		println!("{}: {}", i, args.get::<i32>());
	}
}

Status

  • x86-64 linux/ELF ABI (aka System-V) : Tested in the wild, works relatively well
  • x86 linux/ELF ABI (sys-v) : Unit tested only

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps