1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

iovec-util: add new iovec_memcmp() helper

This commit is contained in:
Lennart Poettering 2023-11-21 13:11:45 +01:00
parent 39f586873d
commit bf38e4c0c1

View File

@ -58,3 +58,14 @@ char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *f
char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value);
void iovec_array_free(struct iovec *iovec, size_t n_iovec);
static inline int iovec_memcmp(const struct iovec *a, const struct iovec *b) {
if (a == b)
return 0;
return memcmp_nn(a ? a->iov_base : NULL,
a ? a->iov_len : 0,
b ? b->iov_base : NULL,
b ? b->iov_len : 0);
}