From: Ján Tomko Date: Tue, 12 Feb 2019 16:01:09 +0000 (+0100) Subject: internal: introduce a family of NULLSTR macros X-Git-Tag: v5.1.0-rc1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd5519deb75e9ff8adcd56d34cbe82dd6a341bcb;p=thirdparty%2Flibvirt.git internal: introduce a family of NULLSTR macros NULLSTR_EMPTY, the quiet child, NULLSTR_STAR, the famous one and NULLSTR_MINUS, the grumpy one. Signed-off-by: Ján Tomko Reviewed-by: Andrea Bolognani --- 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: *