#libc #print #printing #allocator #macros #stdlib #println

libc-print

println! and eprintln! macros on libc without stdlib

9 releases

✓ Uses Rust 2018 edition

new 0.1.8 Sep 10, 2019
0.1.7 Dec 30, 2018
Download history 17/week @ 2019-05-28 12/week @ 2019-06-04 17/week @ 2019-06-11 70/week @ 2019-06-18 72/week @ 2019-06-25 40/week @ 2019-07-02 26/week @ 2019-07-09 23/week @ 2019-07-16 3/week @ 2019-07-30 35/week @ 2019-08-06 40/week @ 2019-08-13 79/week @ 2019-08-20 28/week @ 2019-08-27 76/week @ 2019-09-03

245 downloads per month
Used in 1 crate

Apache-2.0 OR MIT

11KB
200 lines

no_std libc print/println/eprint/eprintln

Build Status docs.rs crates.io

Implements println! and eprintln! on the libc crate without requiring the use of an allocator.

Allows you to use these macros in a #![no_std] context, or in a situation where the traditional Rust streams might not be available (ie: at process shutdown time).

By default this crate provides libc_-prefixed macros, but also allows consumers to import macros with the same name as the stdlib printing macros via the std_name module.

Usage

Exactly as you'd use println! or eprintln!.

#![no_std]

// ...

libc_println!("Hello {}!", "world");

lib.rs:

Implements println! and eprintln! on top of the libc crate without requiring the use of an allocator.

Allows you to use these macros in a #![no_std] context, or in a situation where the traditional Rust streams might not be available (ie: at process shutdown time).

[libc_writeln] and [libc_ewriteln] are provided for cases where you may not wish to pull in the overhead of the formatter code and simply wish to print C-style strings.

Usage

Exactly as you'd use println! or eprintln!.

Dependencies

~24KB