#unsafe #va-list #ffi #c

no-std va_list

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

8 releases

Uses old Rust 2015

0.1.4 Apr 3, 2022
0.1.3 Nov 18, 2018
0.1.1 Oct 21, 2018
0.1.0 Nov 11, 2016
0.0.1 Jun 7, 2015

#43 in FFI

Download history 1083/week @ 2022-06-11 1069/week @ 2022-06-18 1371/week @ 2022-06-25 13278/week @ 2022-07-02 6632/week @ 2022-07-09 1443/week @ 2022-07-16 993/week @ 2022-07-23 1260/week @ 2022-07-30 1961/week @ 2022-08-06 1489/week @ 2022-08-13 1192/week @ 2022-08-20 1408/week @ 2022-08-27 1170/week @ 2022-09-03 1876/week @ 2022-09-10 1663/week @ 2022-09-17 1163/week @ 2022-09-24

6,226 downloads per month
Used in 8 crates (6 directly)

MIT/Apache

16KB
381 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