summaryrefslogtreecommitdiff
path: root/libfmt/libobj.c
blob: e4b833b925dac6cafcae6f5cd716c5e36ba99e6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* libfmt/libobj.c - Integrate pico-fmt with libobj
 *
 * Copyright (C) 2025  Luke T. Shumaker <lukeshu@lukeshu.com>
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

#include <libfmt/fmt.h>

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);
}