#c #unsafe

va_list

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

10 releases

Uses old Rust 2015

0.2.1 May 28, 2025
0.2.0 Jul 4, 2024
0.1.4 Apr 3, 2022
0.1.3 Nov 18, 2018
0.0.1 Jun 7, 2015

#31 in FFI

Download history 11161/week @ 2025-09-23 10507/week @ 2025-09-30 13292/week @ 2025-10-07 10504/week @ 2025-10-14 9328/week @ 2025-10-21 12603/week @ 2025-10-28 14010/week @ 2025-11-04 10948/week @ 2025-11-11 9708/week @ 2025-11-18 12886/week @ 2025-11-25 11840/week @ 2025-12-02 11828/week @ 2025-12-09 16838/week @ 2025-12-16 8084/week @ 2025-12-23 7860/week @ 2025-12-30 10858/week @ 2026-01-06

46,237 downloads per month
Used in 20 crates (10 directly)

MIT/Apache

15KB
327 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 ELF (aka System-V)
    • Linux: CI tested, and used in the wild
  • aarch64 ELF: Minimal testing
    • Unix (not macos)
  • cdecl32 32-bit: Minimal testing
    • Unix x86/arm32
    • Windows
  • cdecl 64-bit: CI tested
    • macos amd64
    • Windows
    • Unix riscv64
    • unix loongarch64

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