all: rename nm_utils_strdict_*() to nm_strdict_*()
This commit is contained in:
@@ -2569,12 +2569,10 @@ nm_ovsdb_set_external_ids(NMOvsdb * self,
|
||||
gs_unref_hashtable GHashTable *exid_old = NULL;
|
||||
gs_unref_hashtable GHashTable *exid_new = NULL;
|
||||
|
||||
exid_old = s_exid_old
|
||||
? nm_utils_strdict_clone(_nm_setting_ovs_external_ids_get_data(s_exid_old))
|
||||
: NULL;
|
||||
exid_new = s_exid_new
|
||||
? nm_utils_strdict_clone(_nm_setting_ovs_external_ids_get_data(s_exid_new))
|
||||
: NULL;
|
||||
exid_old =
|
||||
s_exid_old ? nm_strdict_clone(_nm_setting_ovs_external_ids_get_data(s_exid_old)) : NULL;
|
||||
exid_new =
|
||||
s_exid_new ? nm_strdict_clone(_nm_setting_ovs_external_ids_get_data(s_exid_new)) : NULL;
|
||||
|
||||
ovsdb_call_method(self,
|
||||
NULL,
|
||||
|
@@ -469,7 +469,7 @@ nm_dhcp_client_set_state(NMDhcpClient *self,
|
||||
gs_free const char **keys = NULL;
|
||||
guint i, nkeys;
|
||||
|
||||
keys = nm_utils_strdict_get_keys(options, TRUE, &nkeys);
|
||||
keys = nm_strdict_get_keys(options, TRUE, &nkeys);
|
||||
for (i = 0; i < nkeys; i++) {
|
||||
_LOGD("option %-20s => '%s'", keys[i], (char *) g_hash_table_lookup(options, keys[i]));
|
||||
}
|
||||
|
@@ -1026,7 +1026,7 @@ global_dns_config_seal_domains(NMGlobalDnsConfig *dns_config)
|
||||
if (g_hash_table_size(dns_config->domains) == 0)
|
||||
nm_clear_pointer(&dns_config->domains, g_hash_table_unref);
|
||||
else
|
||||
dns_config->domain_list = nm_utils_strdict_get_keys(dns_config->domains, TRUE, NULL);
|
||||
dns_config->domain_list = nm_strdict_get_keys(dns_config->domains, TRUE, NULL);
|
||||
}
|
||||
|
||||
static NMGlobalDnsConfig *
|
||||
|
@@ -87,7 +87,7 @@ nm_dhcp_config_set_options(NMDhcpConfig *self, GHashTable *options)
|
||||
priv = NM_DHCP_CONFIG_GET_PRIVATE(self);
|
||||
|
||||
nm_g_variant_unref(priv->options);
|
||||
priv->options = g_variant_ref_sink(nm_utils_strdict_to_variant_asv(options));
|
||||
priv->options = g_variant_ref_sink(nm_strdict_to_variant_asv(options));
|
||||
_notify(self, PROP_OPTIONS);
|
||||
}
|
||||
|
||||
|
@@ -848,7 +848,7 @@ _unhandled_specs_from_hashtable(GHashTable *hash)
|
||||
GSList * list = NULL;
|
||||
guint i, l;
|
||||
|
||||
keys = nm_utils_strdict_get_keys(hash, TRUE, &l);
|
||||
keys = nm_strdict_get_keys(hash, TRUE, &l);
|
||||
for (i = l; i > 0;) {
|
||||
i--;
|
||||
list = g_slist_prepend(list, g_strdup(keys[i]));
|
||||
|
@@ -189,7 +189,7 @@ _unmanaged_specs(GHashTable *eni_ifaces)
|
||||
GSList * specs = NULL;
|
||||
guint i, len;
|
||||
|
||||
keys = nm_utils_strdict_get_keys(eni_ifaces, TRUE, &len);
|
||||
keys = nm_strdict_get_keys(eni_ifaces, TRUE, &len);
|
||||
for (i = len; i > 0;) {
|
||||
i--;
|
||||
specs = g_slist_prepend(specs,
|
||||
|
@@ -2999,7 +2999,7 @@ nm_lldp_neighbor_get_attr_names(NMLldpNeighbor *neighbor)
|
||||
|
||||
g_return_val_if_fail(NM_IS_LLDP_NEIGHBOR(neighbor), NULL);
|
||||
|
||||
keys = nm_utils_strdict_get_keys(neighbor->attrs, TRUE, NULL);
|
||||
keys = nm_strdict_get_keys(neighbor->attrs, TRUE, NULL);
|
||||
|
||||
return nm_strv_make_deep_copied_nonnull(keys);
|
||||
}
|
||||
|
@@ -2483,7 +2483,7 @@ write_hash_of_string(GKeyFile *file, NMSetting *setting, const char *key, const
|
||||
|
||||
hash = g_value_get_boxed(value);
|
||||
|
||||
keys = nm_utils_strdict_get_keys(hash, TRUE, &l);
|
||||
keys = nm_strdict_get_keys(hash, TRUE, &l);
|
||||
for (i = 0; i < l; i++) {
|
||||
gs_free char *to_free = NULL;
|
||||
const char * property, *data;
|
||||
|
@@ -527,7 +527,7 @@ _nm_ip_address_get_attribute_names(const NMIPAddress *address, gboolean sorted,
|
||||
{
|
||||
nm_assert(address);
|
||||
|
||||
return nm_utils_strdict_get_keys(address->attributes, sorted, out_length);
|
||||
return nm_strdict_get_keys(address->attributes, sorted, out_length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1134,7 +1134,7 @@ _nm_ip_route_get_attribute_names(const NMIPRoute *route, gboolean sorted, guint
|
||||
{
|
||||
nm_assert(route);
|
||||
|
||||
return nm_utils_strdict_get_keys(route->attributes, sorted, out_length);
|
||||
return nm_strdict_get_keys(route->attributes, sorted, out_length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -211,7 +211,7 @@ nm_setting_ovs_external_ids_get_data_keys(NMSettingOvsExternalIDs *setting, guin
|
||||
return priv->data_keys;
|
||||
}
|
||||
|
||||
priv->data_keys = nm_utils_strdict_get_keys(priv->data, TRUE, out_len);
|
||||
priv->data_keys = nm_strdict_get_keys(priv->data, TRUE, out_len);
|
||||
|
||||
/* don't return %NULL, but hijack the @data_keys fields as a pseudo
|
||||
* empty strv array. */
|
||||
|
@@ -322,7 +322,7 @@ nm_sriov_vf_get_attribute_names(const NMSriovVF *vf)
|
||||
g_return_val_if_fail(vf, NULL);
|
||||
g_return_val_if_fail(vf->refcount > 0, NULL);
|
||||
|
||||
return nm_utils_strdict_get_keys(vf->attributes, TRUE, NULL);
|
||||
return nm_strdict_get_keys(vf->attributes, TRUE, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -904,7 +904,7 @@ vfs_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
"index",
|
||||
g_variant_new_uint32(nm_sriov_vf_get_index(vf)));
|
||||
|
||||
attr_names = nm_utils_strdict_get_keys(vf->attributes, TRUE, NULL);
|
||||
attr_names = nm_strdict_get_keys(vf->attributes, TRUE, NULL);
|
||||
if (attr_names) {
|
||||
for (name = attr_names; *name; name++) {
|
||||
g_variant_builder_add(&vf_builder,
|
||||
|
@@ -320,7 +320,7 @@ nm_tc_qdisc_get_attribute_names(NMTCQdisc *qdisc)
|
||||
{
|
||||
g_return_val_if_fail(qdisc, NULL);
|
||||
|
||||
return nm_utils_strdict_get_keys(qdisc->attributes, TRUE, NULL);
|
||||
return nm_strdict_get_keys(qdisc->attributes, TRUE, NULL);
|
||||
}
|
||||
|
||||
GHashTable *
|
||||
@@ -594,7 +594,7 @@ nm_tc_action_get_attribute_names(NMTCAction *action)
|
||||
|
||||
g_return_val_if_fail(action, NULL);
|
||||
|
||||
names = nm_utils_strdict_get_keys(action->attributes, TRUE, NULL);
|
||||
names = nm_strdict_get_keys(action->attributes, TRUE, NULL);
|
||||
return nm_strv_make_deep_copied_nonnull(names);
|
||||
}
|
||||
|
||||
|
@@ -232,7 +232,7 @@ nm_setting_user_get_keys(NMSettingUser *setting, guint *out_len)
|
||||
return priv->keys;
|
||||
}
|
||||
|
||||
priv->keys = nm_utils_strdict_get_keys(priv->data, TRUE, out_len);
|
||||
priv->keys = nm_strdict_get_keys(priv->data, TRUE, out_len);
|
||||
|
||||
/* don't return %NULL, but hijack the @keys fields as a pseudo
|
||||
* empty strv array. */
|
||||
|
@@ -241,7 +241,7 @@ nm_setting_vpn_get_data_keys(NMSettingVpn *setting, guint *out_length)
|
||||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_VPN(setting), NULL);
|
||||
|
||||
return nm_utils_strdict_get_keys(NM_SETTING_VPN_GET_PRIVATE(setting)->data, TRUE, out_length);
|
||||
return nm_strdict_get_keys(NM_SETTING_VPN_GET_PRIVATE(setting)->data, TRUE, out_length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ foreach_item_helper(NMSettingVpn *self, GHashTable **p_hash, NMVpnIterFunc func,
|
||||
nm_assert(NM_IS_SETTING_VPN(self));
|
||||
nm_assert(func);
|
||||
|
||||
keys = nm_strv_make_deep_copied(nm_utils_strdict_get_keys(*p_hash, TRUE, &len));
|
||||
keys = nm_strv_make_deep_copied(nm_strdict_get_keys(*p_hash, TRUE, &len));
|
||||
if (len == 0u) {
|
||||
nm_assert(!keys);
|
||||
return;
|
||||
@@ -408,9 +408,7 @@ nm_setting_vpn_get_secret_keys(NMSettingVpn *setting, guint *out_length)
|
||||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_VPN(setting), NULL);
|
||||
|
||||
return nm_utils_strdict_get_keys(NM_SETTING_VPN_GET_PRIVATE(setting)->secrets,
|
||||
TRUE,
|
||||
out_length);
|
||||
return nm_strdict_get_keys(NM_SETTING_VPN_GET_PRIVATE(setting)->secrets, TRUE, out_length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -960,7 +958,7 @@ vpn_secrets_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
|
||||
g_variant_builder_init(&builder, G_VARIANT_TYPE("a{ss}"));
|
||||
|
||||
keys = nm_utils_strdict_get_keys(priv->secrets, TRUE, &len);
|
||||
keys = nm_strdict_get_keys(priv->secrets, TRUE, &len);
|
||||
for (i = 0; i < len; i++) {
|
||||
const char * key = keys[i];
|
||||
NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
|
||||
|
@@ -1090,7 +1090,7 @@ _nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * s
|
||||
return nm_g_variant_new_au((const guint32 *) tmp_array->data, tmp_array->len);
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT:
|
||||
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_HASH_TABLE));
|
||||
return nm_utils_strdict_to_variant_ass(g_value_get_boxed(&prop_value));
|
||||
return nm_strdict_to_variant_ass(g_value_get_boxed(&prop_value));
|
||||
}
|
||||
|
||||
return nm_assert_unreachable_val(NULL);
|
||||
@@ -3326,7 +3326,7 @@ _nm_setting_option_get_all(NMSetting * setting,
|
||||
return len;
|
||||
|
||||
if (G_UNLIKELY(!gendata->names)) {
|
||||
gendata->names = nm_utils_strdict_get_keys(hash, TRUE, NULL);
|
||||
gendata->names = nm_strdict_get_keys(hash, TRUE, NULL);
|
||||
}
|
||||
|
||||
if (out_values) {
|
||||
|
@@ -622,7 +622,7 @@ nm_g_variant_singleton_aaLsvI(void)
|
||||
/*****************************************************************************/
|
||||
|
||||
GHashTable *
|
||||
nm_utils_strdict_clone(GHashTable *src)
|
||||
nm_strdict_clone(GHashTable *src)
|
||||
{
|
||||
GHashTable * dst;
|
||||
GHashTableIter iter;
|
||||
@@ -644,7 +644,7 @@ nm_utils_strdict_clone(GHashTable *src)
|
||||
* Returns a floating reference.
|
||||
*/
|
||||
GVariant *
|
||||
nm_utils_strdict_to_variant_ass(GHashTable *strdict)
|
||||
nm_strdict_to_variant_ass(GHashTable *strdict)
|
||||
{
|
||||
gs_free NMUtilsNamedValue *values_free = NULL;
|
||||
NMUtilsNamedValue values_prepared[20];
|
||||
@@ -665,7 +665,7 @@ nm_utils_strdict_to_variant_ass(GHashTable *strdict)
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *
|
||||
nm_utils_strdict_to_variant_asv(GHashTable *strdict)
|
||||
nm_strdict_to_variant_asv(GHashTable *strdict)
|
||||
{
|
||||
gs_free NMUtilsNamedValue *values_free = NULL;
|
||||
NMUtilsNamedValue values_prepared[20];
|
||||
|
@@ -609,10 +609,10 @@ gboolean nm_utils_gbytes_equal_mem(GBytes *bytes, gconstpointer mem_data, gsize
|
||||
|
||||
GVariant *nm_utils_gbytes_to_variant_ay(GBytes *bytes);
|
||||
|
||||
GHashTable *nm_utils_strdict_clone(GHashTable *src);
|
||||
GHashTable *nm_strdict_clone(GHashTable *src);
|
||||
|
||||
GVariant *nm_utils_strdict_to_variant_ass(GHashTable *strdict);
|
||||
GVariant *nm_utils_strdict_to_variant_asv(GHashTable *strdict);
|
||||
GVariant *nm_strdict_to_variant_ass(GHashTable *strdict);
|
||||
GVariant *nm_strdict_to_variant_asv(GHashTable *strdict);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -1971,7 +1971,7 @@ gpointer *nm_utils_hash_values_to_array(GHashTable * hash,
|
||||
guint * out_len);
|
||||
|
||||
static inline const char **
|
||||
nm_utils_strdict_get_keys(const GHashTable *hash, gboolean sorted, guint *out_length)
|
||||
nm_strdict_get_keys(const GHashTable *hash, gboolean sorted, guint *out_length)
|
||||
{
|
||||
return (const char **) nm_utils_hash_keys_to_array((GHashTable *) hash,
|
||||
sorted ? nm_strcmp_p_with_data : NULL,
|
||||
|
@@ -921,7 +921,7 @@ _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info,
|
||||
nm_assert(property_info->property_type->set_fcn == _set_fcn_optionlist);
|
||||
|
||||
strdict = g_value_get_boxed(&val);
|
||||
keys = nm_utils_strdict_get_keys(strdict, TRUE, NULL);
|
||||
keys = nm_strdict_get_keys(strdict, TRUE, NULL);
|
||||
if (!keys)
|
||||
return NULL;
|
||||
|
||||
|
@@ -364,7 +364,7 @@ reader_read_all_connections_from_fw(Reader *reader, const char *sysfs_dir)
|
||||
gs_free const char ** keys = NULL;
|
||||
|
||||
ibft = nmi_ibft_read(sysfs_dir);
|
||||
keys = nm_utils_strdict_get_keys(ibft, TRUE, &length);
|
||||
keys = nm_strdict_get_keys(ibft, TRUE, &length);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
|
@@ -294,7 +294,7 @@ static gconstpointer _metagen_dhcp_config_get_fcn(NMC_META_GENERIC_INFO_GET_FCN_
|
||||
if (!table)
|
||||
goto arr_out;
|
||||
|
||||
arr2 = (char **) nm_utils_strdict_get_keys(table, TRUE, &n);
|
||||
arr2 = (char **) nm_strdict_get_keys(table, TRUE, &n);
|
||||
if (!n)
|
||||
goto arr_out;
|
||||
|
||||
|
Reference in New Issue
Block a user