mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-20 23:30:41 +02:00
shared: add nm_gbytes_hash() and nm_gbytes_equal()
(cherry picked from commit 2a26562ec8)
This commit is contained in:
parent
e62dcb3c6b
commit
616c18a612
2 changed files with 14 additions and 0 deletions
|
|
@ -264,6 +264,17 @@ nm_ppdirect_equal (gconstpointer a, gconstpointer b)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
guint
|
||||
nm_gbytes_hash (gconstpointer p)
|
||||
{
|
||||
GBytes *ptr = (GBytes *) p;
|
||||
gconstpointer arr;
|
||||
gsize len;
|
||||
|
||||
arr = g_bytes_get_data (ptr, &len);
|
||||
return nm_hash_mem (792701303u, arr, len);
|
||||
}
|
||||
|
||||
guint
|
||||
nm_pgbytes_hash (gconstpointer p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -315,6 +315,9 @@ gboolean nm_ppdirect_equal (gconstpointer a, gconstpointer b);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
guint nm_gbytes_hash (gconstpointer p);
|
||||
#define nm_gbytes_equal g_bytes_equal
|
||||
|
||||
guint nm_pgbytes_hash (gconstpointer p);
|
||||
gboolean nm_pgbytes_equal (gconstpointer a, gconstpointer b);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue