diff options
Diffstat (limited to 'libfmt/include')
-rw-r--r-- | libfmt/include/libfmt/fmt.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libfmt/include/libfmt/fmt.h b/libfmt/include/libfmt/fmt.h new file mode 100644 index 0000000..4dba82f --- /dev/null +++ b/libfmt/include/libfmt/fmt.h @@ -0,0 +1,23 @@ +/* libfmt/fmt.h - Support for pico-fmt + * + * Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _LIBFMT_FMT_H_ +#define _LIBFMT_FMT_H_ + +#include <pico/fmt_printf.h> +#include <pico/fmt_install.h> + +#include <libobj/obj.h> + +/** + * An object that implements fmt_formatter can be printed using + * `printf("%v", boxed_obj)`. + */ +#define fmt_formatter_LO_IFACE \ + LO_FUNC(void, format, struct fmt_state *) +LO_INTERFACE(fmt_formatter) + +#endif /* _LIBFMT_FMT_H_ */ |