From bb33c30ad89e28d5ff9f4d8073d4f9ee068f484d Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 8 Mar 2025 01:50:15 -0700 Subject: libfmt: Add %v for libobj to implement --- libfmt/libobj.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libfmt/libobj.c (limited to 'libfmt/libobj.c') diff --git a/libfmt/libobj.c b/libfmt/libobj.c new file mode 100644 index 0000000..e4b833b --- /dev/null +++ b/libfmt/libobj.c @@ -0,0 +1,17 @@ +/* libfmt/libobj.c - Integrate pico-fmt with libobj + * + * Copyright (C) 2025 Luke T. Shumaker + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#include + +static void libfmt_conv_formatter(struct fmt_state *state) { + lo_interface fmt_formatter obj = va_arg(*state->args, lo_interface fmt_formatter); + LO_CALL(obj, format, state); +} + +[[gnu::constructor]] +static void libfmt_install_formatter(void) { + fmt_install('v', libfmt_conv_formatter); +} -- cgit v1.2.3-2-g168b