utils: add boolean value hash helper

This commit is contained in:
Dan Williams
2010-03-16 23:51:55 -07:00
parent 15351042ba
commit 4af1cc2661
2 changed files with 18 additions and 0 deletions

View File

@@ -553,6 +553,20 @@ value_hash_add_uint (GHashTable *hash,
value_hash_add (hash, key, value); 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 gboolean
nm_utils_do_sysctl (const char *path, const char *value) nm_utils_do_sysctl (const char *path, const char *value)
{ {

View File

@@ -67,6 +67,10 @@ void value_hash_add_uint (GHashTable *hash,
const char *key, const char *key,
guint32 val); 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); gboolean nm_utils_do_sysctl (const char *path, const char *value);
#endif /* NETWORK_MANAGER_UTILS_H */ #endif /* NETWORK_MANAGER_UTILS_H */