From 4e457596d9faacfd6334f48b79705449129aced7 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Tue, 15 Aug 2017 02:25:45 -0700 Subject: Add info_field_printf() to reduce some sturct Info field boilerplate --- includes/info.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/info.h b/includes/info.h index 78ee935c..253c06e0 100644 --- a/includes/info.h +++ b/includes/info.h @@ -45,9 +45,11 @@ struct InfoGroup { struct InfoField { const gchar *name; - const gchar *value; + gchar *value; int update_interval; + + gboolean free_value_on_flatten; }; struct Info *info_new(void); @@ -55,7 +57,9 @@ struct Info *info_new(void); void info_add_group(struct Info *info, const gchar *group_name, ...); void info_add_computed_group(struct Info *info, const gchar *name, const gchar *value); -struct InfoField info_field(const gchar *name, const gchar *value); +struct InfoField info_field(const gchar *name, gchar *value); +struct InfoField info_field_printf(const gchar *name, const gchar *format, ...) + __attribute__((format(printf, 2, 3))); struct InfoField info_field_update(const gchar *name, int update_interval); struct InfoField info_field_last(void); -- cgit v1.2.3