From adaa3396edd425312065a134aec99991bd7b9cdd Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Mon, 14 Apr 2025 15:25:36 -0400 Subject: Add mpc sources --- mpc/format.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 mpc/format.h (limited to 'mpc/format.h') diff --git a/mpc/format.h b/mpc/format.h new file mode 100644 index 0000000..e7aefeb --- /dev/null +++ b/mpc/format.h @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright The Music Player Daemon Project + +#ifndef MPC_FORMAT_H +#define MPC_FORMAT_H + +#include "Compiler.h" + +struct mpd_song; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Pretty-print an object into a string using the given format + * specification. + * + * @param format the format string + * @param object the object + * @param getter a getter function that extracts a value from the object + * @return the resulting string to be freed by free(); NULL if + * no format string group produced any output + */ +gcc_malloc +char * +format_object(const char *format, const void *object, + const char *(*getter)(const void *object, const char *name)); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3