format.h (730B)
1 // SPDX-License-Identifier: GPL-2.0-or-later 2 // Copyright The Music Player Daemon Project 3 4 #ifndef MPC_FORMAT_H 5 #define MPC_FORMAT_H 6 7 #include "Compiler.h" 8 9 struct mpd_song; 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /** 16 * Pretty-print an object into a string using the given format 17 * specification. 18 * 19 * @param format the format string 20 * @param object the object 21 * @param getter a getter function that extracts a value from the object 22 * @return the resulting string to be freed by free(); NULL if 23 * no format string group produced any output 24 */ 25 gcc_malloc 26 char * 27 format_object(const char *format, const void *object, 28 const char *(*getter)(const void *object, const char *name)); 29 30 #ifdef __cplusplus 31 } 32 #endif 33 34 #endif