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>
Mon, 14 Feb 2022 18:48:53 +0000 (10:48 -0800)
commitc0b7829fe14226fdbb9088c832c7ca1be89a9397
tree07fb981e4a65d8c2ea9e07d2d8e756e1f5f2090b
parent31b9615ae94d1c52849699854ca015ee3c47c7c6
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