mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-30 21:35:41 +00:00
shared: add nm_hash_val() macro
A helper macro, to combine the steps for hashing one value.
This commit is contained in:
parent
2abf4652d4
commit
fe07d6a404
|
@ -209,6 +209,15 @@ guint nm_direct_hash (gconstpointer str);
|
|||
guint nm_hash_str (const char *str);
|
||||
guint nm_str_hash (gconstpointer str);
|
||||
|
||||
#define nm_hash_val(static_seed, val) \
|
||||
({ \
|
||||
NMHashState _h; \
|
||||
\
|
||||
nm_hash_init (&_h, static_seed); \
|
||||
nm_hash_update_val (&_h, val); \
|
||||
nm_hash_complete (&_h); \
|
||||
})
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* nm_pstr_*() are for hashing keys that are pointers to strings,
|
||||
|
|
Loading…
Reference in a new issue