diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-02 20:44:59 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-02 20:44:59 -0600 |
commit | ff88c4cc9bfdc91c3af390ab6a7588f5a8ade40a (patch) | |
tree | ae18e6d4576fa594be94e8278877fbdedfa1d4ba /libfmt/libobj.c | |
parent | 13b8cafb7e28784f037ecd24876c225ddcf48d76 (diff) | |
parent | 8cc87f8c1f25c9d3fec00561237891650a91b47a (diff) |
Diffstat (limited to 'libfmt/libobj.c')
-rw-r--r-- | libfmt/libobj.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 <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); +} |