mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 20:45:32 +00:00
utils: add boolean value hash helper
This commit is contained in:
parent
15351042ba
commit
4af1cc2661
|
@ -553,6 +553,20 @@ value_hash_add_uint (GHashTable *hash,
|
|||
value_hash_add (hash, key, value);
|
||||
}
|
||||
|
||||
void
|
||||
value_hash_add_bool (GHashTable *hash,
|
||||
const char *key,
|
||||
gboolean val)
|
||||
{
|
||||
GValue *value;
|
||||
|
||||
value = g_slice_new0 (GValue);
|
||||
g_value_init (value, G_TYPE_BOOLEAN);
|
||||
g_value_set_boolean (value, val);
|
||||
|
||||
value_hash_add (hash, key, value);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_utils_do_sysctl (const char *path, const char *value)
|
||||
{
|
||||
|
|
|
@ -67,6 +67,10 @@ void value_hash_add_uint (GHashTable *hash,
|
|||
const char *key,
|
||||
guint32 val);
|
||||
|
||||
void value_hash_add_bool (GHashTable *hash,
|
||||
const char *key,
|
||||
gboolean val);
|
||||
|
||||
gboolean nm_utils_do_sysctl (const char *path, const char *value);
|
||||
|
||||
#endif /* NETWORK_MANAGER_UTILS_H */
|
||||
|
|
Loading…
Reference in a new issue