]> xenbits.xensource.com Git - libvirt.git/commitdiff
internal: introduce a family of NULLSTR macros
authorJán Tomko <jtomko@redhat.com>
Tue, 12 Feb 2019 16:01:09 +0000 (17:01 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Feb 2019 13:09:37 +0000 (14:09 +0100)
NULLSTR_EMPTY, the quiet child,
NULLSTR_STAR, the famous one and
NULLSTR_MINUS, the grumpy one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/internal.h

index 3f3e567ac99880f4b4b2e668363016a3a731c221..7c11f57e33865e7613c458d3effc8f1a59586c28 100644 (file)
  */
 # define EMPTYSTR(s) ((s) ? (s) : "-")
 
+/*
+ * Turn a NULL string into an empty string
+ */
+# define NULLSTR_EMPTY(s) ((s) ? (s) : "")
+
+/*
+ * Turn a NULL string into a star
+ */
+# define NULLSTR_STAR(s) ((s) ? (s) : "*")
+
+/*
+ * Turn a NULL string into a minus sign
+ */
+# define NULLSTR_MINUS(s) ((s) ? (s) : "-")
+
 /**
  * SWAP:
  *