diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-09-07 10:44:33 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-10-05 16:14:22 +0400 |
commit | 85e33a2818f46ee023c8729252c797f125744d20 (patch) | |
tree | ad0ca1ff77c10c4c6e462987217fb7631c0e55f4 /include | |
parent | a95db58f210ddf5ed61f25cfcb89063cda86ea3c (diff) | |
download | qemu-85e33a2818f46ee023c8729252c797f125744d20.zip qemu-85e33a2818f46ee023c8729252c797f125744d20.tar.gz qemu-85e33a2818f46ee023c8729252c797f125744d20.tar.bz2 |
cutils: add qemu_pstrcmp0()
A char** variant of g_strcmp0().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/cutils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 47aaa3b..7071bfe 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -169,4 +169,16 @@ bool test_buffer_is_zero_next_accel(void); int uleb128_encode_small(uint8_t *out, uint32_t n); int uleb128_decode_small(const uint8_t *in, uint32_t *n); +/** + * qemu_pstrcmp0: + * @str1: a non-NULL pointer to a C string (*str1 can be NULL) + * @str2: a non-NULL pointer to a C string (*str2 can be NULL) + * + * Compares *str1 and *str2 with g_strcmp0(). + * + * Returns: an integer less than, equal to, or greater than zero, if + * *str1 is <, == or > than *str2. + */ +int qemu_pstrcmp0(const char **str1, const char **str2); + #endif |