From: Pino Toscano Date: Wed, 28 Mar 2018 11:40:20 +0000 (+0200) Subject: internal: add STRCASEPREFIX X-Git-Tag: v4.3.0-rc1~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e508e04b108709af0ca2c4d6728440b0edc3cc4b;p=thirdparty%2Flibvirt.git internal: add STRCASEPREFIX Simple macro to check the prefix of a string in a case-insensitive way. Signed-off-by: Pino Toscano --- diff --git a/src/internal.h b/src/internal.h index 5895030415..1760e3b69c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -75,6 +75,7 @@ # define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0) # define STRCASENEQLEN(a, b, n) (c_strncasecmp(a, b, n) != 0) # define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0) +# define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0) # define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL) # define STREQ_NULLABLE(a, b) \