mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
internal: add STRCASEPREFIX
Simple macro to check the prefix of a string in a case-insensitive way. Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
parent
6d394989fd
commit
e508e04b10
@ -75,6 +75,7 @@
|
|||||||
# define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
|
# define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
|
||||||
# define STRCASENEQLEN(a, b, n) (c_strncasecmp(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 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 STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)
|
||||||
|
|
||||||
# define STREQ_NULLABLE(a, b) \
|
# define STREQ_NULLABLE(a, b) \
|
||||||
|
Loading…
Reference in New Issue
Block a user