[libvirt] [PATCH 1/6] internal: introduce a family of NULLSTR macros

Ján Tomko jtomko at redhat.com
Tue Feb 12 16:40:35 UTC 2019


NULLSTR_EMPTY, the quiet child,
NULLSTR_STAR, the famous one and
NULLSTR_MINUS, the grumpy one.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/internal.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/internal.h b/src/internal.h
index 3f3e567ac9..7c11f57e33 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -245,6 +245,21 @@
  */
 # 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:
  *
-- 
2.20.1




More information about the libvir-list mailing list