aboutsummaryrefslogtreecommitdiff
path: root/includes/info.h
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2019-07-06 13:30:48 -0700
committerLeandro Pereira <leandro@hardinfo.org>2019-07-06 13:30:48 -0700
commitffd5a4b3f3a474d7a35772c6f05b0491187a10b9 (patch)
tree30a6ef254f259207fa0064e4c67a5c73cd7c4c2c /includes/info.h
parent54181296ef6628dee47a528234602e80f981aada (diff)
Allow passing more flags to info_field(), info_field_update(), etc
Diffstat (limited to 'includes/info.h')
-rw-r--r--includes/info.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/info.h b/includes/info.h
index 164d1a16..20efdcb8 100644
--- a/includes/info.h
+++ b/includes/info.h
@@ -81,10 +81,18 @@ void info_group_add_fieldsv(struct InfoGroup *group, va_list ap);
struct InfoField info_field_printf(const gchar *name, const gchar *format, ...)
__attribute__((format(printf, 2, 3)));
-#define info_field_full(...) (struct InfoField) { __VA_ARGS__ }
-#define info_field(n, v) info_field_full(.name = (n), .value = (v))
-#define info_field_update(n, ui) info_field_full(.name = (n), .value = "...", .update_interval = (ui))
-#define info_field_last() (struct InfoField) {}
+#define info_field_full(...) \
+ (struct InfoField) { __VA_ARGS__ }
+
+#define info_field(n, v, ...) \
+ info_field_full(.name = (n), .value = (v), __VA_ARGS__)
+
+#define info_field_update(n, ui, ...) \
+ info_field_full(.name = (n), .value = "...", .update_interval = (ui), \
+ __VA_ARGS__)
+
+#define info_field_last() \
+ (struct InfoField) {}
static inline struct InfoField info_field_with_icon(struct InfoField field, const gchar *icon)
{