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

libc-print

println! and eprintln! macros on libc without stdlib

12 releases

✓ Uses Rust 2018 edition

0.1.11 Sep 19, 2019
0.1.10 Sep 19, 2019
0.1.7 Dec 30, 2018
Download history 49/week @ 2019-10-06 83/week @ 2019-10-13 85/week @ 2019-10-20 138/week @ 2019-10-27 53/week @ 2019-11-03 72/week @ 2019-11-10 130/week @ 2019-11-17 69/week @ 2019-11-24 159/week @ 2019-12-01 165/week @ 2019-12-08 63/week @ 2019-12-15 182/week @ 2019-12-22 90/week @ 2019-12-29 66/week @ 2020-01-05 249/week @ 2020-01-12

447 downloads per month
Used in 1 crate

Apache-2.0 OR MIT

10KB
186 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

~25KB