]> xenbits.xensource.com Git - libvirt.git/commitdiff
internal: add STRCASEPREFIX
authorPino Toscano <ptoscano@redhat.com>
Wed, 28 Mar 2018 11:40:20 +0000 (13:40 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sun, 1 Apr 2018 10:43:42 +0000 (12:43 +0200)
Simple macro to check the prefix of a string in a case-insensitive way.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
src/internal.h

index 5895030415968d72200599e8a59bbf01ffc2d5a3..1760e3b69cb47004f7bf511bfbc8683a1e8ad5eb 100644 (file)
@@ -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) \