utils: add boolean value hash helper
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user