mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 14:00:15 +01:00
shared: add nm_strv_ptrarray_cmp() helper
This commit is contained in:
parent
684b0ec061
commit
d550eef02d
1 changed files with 14 additions and 0 deletions
|
|
@ -1879,6 +1879,20 @@ nm_strv_ptrarray_contains (const GPtrArray *strv,
|
|||
return nm_strv_ptrarray_find_first (strv, str) >= 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
nm_strv_ptrarray_cmp (const GPtrArray *a,
|
||||
const GPtrArray *b)
|
||||
{
|
||||
/* _nm_utils_strv_cmp_n() will treat NULL and empty arrays the same.
|
||||
* That means, an empty strv array can both be represented by NULL
|
||||
* and an array of length zero.
|
||||
* If you need to distinguish between these case, do that yourself. */
|
||||
return _nm_utils_strv_cmp_n ((const char *const*) nm_g_ptr_array_pdata (a),
|
||||
nm_g_ptr_array_len (a),
|
||||
(const char *const*) nm_g_ptr_array_pdata (b),
|
||||
nm_g_ptr_array_len (b));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
int nm_utils_getpagesize (void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue