tools/nolibc/stdio: add a minimal [vf]printf() implementation
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Feb 2022 16:23:33 +0000 (17:23 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 24 Feb 2022 17:56:45 +0000 (09:56 -0800)
commitf35e25da0d0c283e31200a627c624fdd7f293c0d
tree87ecb15a12992eba389cf5f418850ef74f1fa79e
parent8b9b08843e8721abdc83bf4445d26bdafbc36bf2
tools/nolibc/stdio: add a minimal [vf]printf() implementation

This adds a minimal vfprintf() implementation as well as the commonly
used fprintf() and printf() that rely on it.

For now the function supports:
  - formats: %s, %c, %u, %d, %x
  - modifiers: %l and %ll
  - unknown chars are considered as modifiers and are ignored

It is designed to remain minimalist, despite this printf() is 549 bytes
on x86_64. It would be wise not to add too many formats.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/stdio.h