Commit ecec03c8 authored by Thomas Haller's avatar Thomas Haller

cli: merge branch 'th/cli-meta-3'

parents 8b52e506 275ab5fb
......@@ -1314,8 +1314,8 @@ split_required_fields_for_con_show (const char *input,
else if (!strcasecmp (*iter, CON_SHOW_DETAIL_GROUP_ACTIVE))
group_active = TRUE;
else {
char *allowed1 = nmc_get_allowed_fields ((const NMMetaAbstractInfo *const*) nm_meta_setting_infos_editor_p (), NULL);
char *allowed2 = nmc_get_allowed_fields ((const NMMetaAbstractInfo *const*) nmc_fields_con_active_details_groups, NULL);
char *allowed1 = nm_meta_abstract_infos_get_names_str ((const NMMetaAbstractInfo *const*) nm_meta_setting_infos_editor_p (), NULL);
char *allowed2 = nm_meta_abstract_infos_get_names_str ((const NMMetaAbstractInfo *const*) nmc_fields_con_active_details_groups, NULL);
g_set_error (error, NMCLI_ERROR, 0, _("invalid field '%s'; allowed fields: %s and %s, or %s,%s"),
*iter, allowed1, allowed2, CON_SHOW_DETAIL_GROUP_PROFILE, CON_SHOW_DETAIL_GROUP_ACTIVE);
g_free (allowed1);
......@@ -2907,7 +2907,7 @@ get_valid_properties_string (const NMMetaSettingValidPartItem *const*array,
gchar *new;
const char *arg_name;
arg_name = setting_info->properties[j].property_name;
arg_name = setting_info->properties[j]->property_name;
/* If required, expand the alias too */
if (!postfix && setting_info->alias) {
......@@ -3319,7 +3319,7 @@ _meta_property_needs_bond_hack (const NMMetaPropertyInfo *property_info)
if (!property_info)
g_return_val_if_reached (FALSE);
return property_info->property_typ_data
&& property_info->property_typ_data->subtype.nested.data == &nm_meta_property_typ_data_bond;
&& property_info->property_typ_data->nested == &nm_meta_property_typ_data_bond;
}
......@@ -3353,20 +3353,9 @@ _meta_abstract_get (const NMMetaAbstractInfo *abstract_info,
const char **out_prompt,
const char **out_def_hint)
{
/* _meta_property_needs_bond_hack () */
if (abstract_info->meta_type == &nm_meta_type_nested_property_info) {
const NMMetaNestedPropertyTypeInfo *info = (const NMMetaNestedPropertyTypeInfo *) abstract_info;
NM_SET_OUT (out_setting_info, info->parent_info->setting_info);
NM_SET_OUT (out_setting_name, info->parent_info->setting_info->general->setting_name);
NM_SET_OUT (out_property_name, info->parent_info->property_name);
NM_SET_OUT (out_option, info->field_name);
NM_SET_OUT (out_inf_flags, info->inf_flags);
NM_SET_OUT (out_prompt, info->prompt);
NM_SET_OUT (out_def_hint, info->def_hint);
} else {
const NMMetaPropertyInfo *info = (const NMMetaPropertyInfo *) abstract_info;
NM_SET_OUT (out_option, info->property_alias);
NM_SET_OUT (out_setting_info, info->setting_info);
NM_SET_OUT (out_setting_name, info->setting_info->general->setting_name);
NM_SET_OUT (out_property_name, info->property_name);
......@@ -3374,7 +3363,6 @@ _meta_abstract_get (const NMMetaAbstractInfo *abstract_info,
NM_SET_OUT (out_inf_flags, info->inf_flags);
NM_SET_OUT (out_prompt, info->prompt);
NM_SET_OUT (out_def_hint, info->def_hint);
}
}
static const OptionInfo *_meta_abstract_get_option_info (const NMMetaAbstractInfo *abstract_info);
......@@ -3397,11 +3385,11 @@ enable_options (const gchar *setting_name, const gchar *property, const gchar *
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if ( bi->inf_flags & NM_META_PROPERTY_INF_FLAG_DONT_ASK
&& bi->field_name
&& g_strv_contains (opts, bi->field_name))
if ( bi->base.inf_flags & NM_META_PROPERTY_INF_FLAG_DONT_ASK
&& bi->base.property_alias
&& g_strv_contains (opts, bi->base.property_alias))
_dynamic_options_set ((const NMMetaAbstractInfo *) bi, PROPERTY_INF_FLAG_ENABLED, PROPERTY_INF_FLAG_ENABLED);
}
return;
......@@ -3446,7 +3434,9 @@ disable_options (const gchar *setting_name, const gchar *property)
setting_info = nm_meta_setting_info_editor_find_by_name (setting_name, FALSE);
if (!setting_info)
g_return_if_reached ();
property_infos = nm_property_infos_for_setting_type (setting_info->general->meta_type);
property_infos = setting_info->properties;
if (!property_infos)
return;
}
for (p = 0; property_infos[p]; p++) {
......@@ -3456,7 +3446,7 @@ disable_options (const gchar *setting_name, const gchar *property)
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
_dynamic_options_set ((const NMMetaAbstractInfo *) bi, PROPERTY_INF_FLAG_DISABLED, PROPERTY_INF_FLAG_DISABLED);
}
......@@ -3482,7 +3472,9 @@ reset_options (void)
const NMMetaPropertyInfo *const*property_infos;
guint p;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -3490,7 +3482,7 @@ reset_options (void)
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
_dynamic_options_set ((const NMMetaAbstractInfo *) bi, PROPERTY_INF_FLAG_ALL, 0);
}
......@@ -4062,7 +4054,9 @@ complete_property_name (NmCli *nmc, NMConnection *connection,
if (!nm_connection_get_setting_by_name (connection, nm_meta_setting_infos_editor[s].general->setting_name))
continue;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -4070,12 +4064,12 @@ complete_property_name (NmCli *nmc, NMConnection *connection,
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if ( !bi->field_name
|| !g_str_has_prefix (bi->field_name, prefix))
if ( !bi->base.property_alias
|| !g_str_has_prefix (bi->base.property_alias, prefix))
continue;
g_print ("%s\n", bi->field_name);
g_print ("%s\n", bi->base.property_alias);
}
} else {
if (!property_info->is_cli_option)
......@@ -4256,7 +4250,9 @@ nmc_read_connection_properties (NmCli *nmc,
type_settings, slv_settings, NULL))
continue;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -4264,9 +4260,9 @@ nmc_read_connection_properties (NmCli *nmc,
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if (!nm_streq0 (bi->field_name, option))
if (!nm_streq0 (bi->base.property_alias, option))
continue;
if (chosen) {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
......@@ -4420,7 +4416,9 @@ nmcli_con_add_tab_completion (const char *text, int start, int end)
const NMMetaPropertyInfo *const*property_infos;
guint p;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -4428,10 +4426,10 @@ nmcli_con_add_tab_completion (const char *text, int start, int end)
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if ( bi->prompt
&& g_str_has_prefix (rl_prompt, bi->prompt)) {
if ( bi->base.prompt
&& g_str_has_prefix (rl_prompt, bi->base.prompt)) {
goto next;
}
}
......@@ -4513,7 +4511,9 @@ questionnaire_mandatory (NmCli *nmc, NMConnection *connection)
const NMMetaPropertyInfo *const*property_infos;
guint p;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -4521,11 +4521,11 @@ questionnaire_mandatory (NmCli *nmc, NMConnection *connection)
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if (!option_relevant (connection, (const NMMetaAbstractInfo *) bi))
continue;
if ( (bi->inf_flags & NM_META_PROPERTY_INF_FLAG_REQD)
if ( (bi->base.inf_flags & NM_META_PROPERTY_INF_FLAG_REQD)
|| (_dynamic_options_get ((const NMMetaAbstractInfo *) bi) & PROPERTY_INF_FLAG_ENABLED))
ask_option (nmc, connection, (const NMMetaAbstractInfo *) bi);
}
......@@ -4584,13 +4584,15 @@ again:
&& s != s_asking)
continue;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
if (_meta_property_needs_bond_hack (property_info)) {
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if (!option_relevant (connection, (const NMMetaAbstractInfo *) bi))
continue;
......@@ -4755,7 +4757,9 @@ read_properties:
const NMMetaPropertyInfo *const*property_infos;
guint p;
property_infos = nm_property_infos_for_setting_type (s);
property_infos = nm_meta_setting_infos_editor[s].properties;
if (!property_infos)
continue;
for (p = 0; property_infos[p]; p++) {
const NMMetaPropertyInfo *property_info = property_infos[p];
......@@ -4763,12 +4767,12 @@ read_properties:
guint i;
for (i = 0; i < nm_meta_property_typ_data_bond.nested_len; i++) {
const NMMetaNestedPropertyTypeInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
const NMMetaNestedPropertyInfo *bi = &nm_meta_property_typ_data_bond.nested[i];
if (!option_relevant (connection, (const NMMetaAbstractInfo *) bi))
continue;
if (bi->inf_flags & NM_META_PROPERTY_INF_FLAG_REQD) {
g_string_printf (nmc->return_text, _("Error: '%s' argument is required."), bi->field_name);
if (bi->base.inf_flags & NM_META_PROPERTY_INF_FLAG_REQD) {
g_string_printf (nmc->return_text, _("Error: '%s' argument is required."), bi->base.property_alias);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
......
......@@ -77,7 +77,7 @@ complete_field_setting (GHashTable *h, NMMetaSettingType setting_type)
for (i = 0; i < setting_info->properties_num; i++) {
g_hash_table_add (h, g_strdup_printf ("%s.%s",
setting_info->general->setting_name,
setting_info->properties[i].property_name));
setting_info->properties[i]->property_name));
}
}
......
......@@ -56,19 +56,11 @@ _meta_type_nmc_generic_info_get_nested (const NMMetaAbstractInfo *abstract_info,
gpointer *out_to_free)
{
const NmcMetaGenericInfo *info;
guint n;
info = (const NmcMetaGenericInfo *) abstract_info;
if (out_len) {
n = 0;
if (info->nested) {
for (; info->nested[n]; n++) {
}
}
*out_len = n;
}
*out_to_free = NULL;
NM_SET_OUT (out_len, NM_PTRARRAY_LEN (info->nested));
return (const NMMetaAbstractInfo *const*) info->nested;
}
......@@ -764,224 +756,10 @@ nmc_free_output_field_values (NmcOutputField fields_array[])
/*****************************************************************************/
typedef struct {
guint idx;
gsize self_offset_plus_1;
gsize sub_offset_plus_1;
} OutputSelectionItem;
static NmcOutputSelection *
_output_selection_pack (const NMMetaAbstractInfo *const* fields_array,
GArray *array,
GString *str)
{
NmcOutputSelection *result;
guint i;
guint len;
len = array ? array->len : 0;
/* re-organize the collected output data in one buffer that can be freed using
* g_free(). This makes allocation more complicated, but saves us from special
* handling for free. */
result = g_malloc0 (sizeof (NmcOutputSelection) + (len * sizeof (NmcOutputSelectionItem)) + (str ? str->len : 0));
*((guint *) &result->num) = len;
if (len > 0) {
char *pdata = &((char *) result)[sizeof (NmcOutputSelection) + (len * sizeof (NmcOutputSelectionItem))];
if (str)
memcpy (pdata, str->str, str->len);
for (i = 0; i < len; i++) {
const OutputSelectionItem *a = &g_array_index (array, OutputSelectionItem, i);
NmcOutputSelectionItem *p = (NmcOutputSelectionItem *) &result->items[i];
p->info = fields_array[a->idx];
p->idx = a->idx;
if (a->self_offset_plus_1 > 0)
p->self_selection = &pdata[a->self_offset_plus_1 - 1];
if (a->sub_offset_plus_1 > 0)
p->sub_selection = &pdata[a->sub_offset_plus_1 - 1];
}
}
return result;
}
static gboolean
_output_selection_select_one (const NMMetaAbstractInfo *const* fields_array,
const char *fields_prefix,
const char *fields_str,
gboolean validate_nested,
GArray **p_array,
GString **p_str,
GError **error)
{
guint i, j;
const char *i_name;
const char *right;
gboolean found = FALSE;
const NMMetaAbstractInfo *fields_array_failure = NULL;
gs_free char *fields_str_clone = NULL;
nm_assert (fields_str);
nm_assert (p_array);
nm_assert (p_str);
nm_assert (!error || !*error);
right = strchr (fields_str, '.');
if (right) {
fields_str_clone = g_strdup (fields_str);
fields_str_clone[right - fields_str] = '\0';
i_name = fields_str_clone;
right = &fields_str_clone[right - fields_str + 1];
} else
i_name = fields_str;
if (!fields_array)
goto not_found;
for (i = 0; fields_array[i]; i++) {
const NMMetaAbstractInfo *fi = fields_array[i];
if (g_ascii_strcasecmp (i_name, nm_meta_abstract_info_get_name (fi, FALSE)) != 0)
continue;
if (!right || !validate_nested) {
found = TRUE;
break;
}
if (fi->meta_type == &nm_meta_type_setting_info_editor) {
const NMMetaSettingInfoEditor *fi_s = (const NMMetaSettingInfoEditor *) fi;
for (j = 0; j < fi_s->properties_num; j++) {
if (g_ascii_strcasecmp (right, fi_s->properties[j].property_name) == 0) {
found = TRUE;
break;
}
}
} else if (fi->meta_type == &nmc_meta_type_generic_info) {
const NmcMetaGenericInfo *fi_g = (const NmcMetaGenericInfo *) fi;
for (j = 0; fi_g->nested && fi_g->nested[j]; j++) {
if (g_ascii_strcasecmp (right, nm_meta_abstract_info_get_name ((const NMMetaAbstractInfo *) fi_g->nested[j], FALSE)) == 0) {
found = TRUE;
break;
}
}
}
fields_array_failure = fields_array[i];
break;
}
if (!found) {
not_found:
if ( !right
&& !fields_prefix
&& ( !g_ascii_strcasecmp (i_name, "all")
|| !g_ascii_strcasecmp (i_name, "common")))
g_set_error (error, NMCLI_ERROR, 0, _("field '%s' has to be alone"), i_name);
else {
gs_free char *allowed_fields = NULL;
if (fields_array_failure) {
gs_free char *p = NULL;
if (fields_prefix) {
p = g_strdup_printf ("%s.%s", fields_prefix,
nm_meta_abstract_info_get_name (fields_array_failure, FALSE));
}
allowed_fields = nmc_get_allowed_fields_nested (fields_array_failure, p);
} else
allowed_fields = nmc_get_allowed_fields (fields_array, NULL);
g_set_error (error, NMCLI_ERROR, 1, _("invalid field '%s%s%s%s%s'; %s%s%s"),
fields_prefix ?: "", fields_prefix ? "." : "",
i_name, right ? "." : "", right ?: "",
NM_PRINT_FMT_QUOTED (allowed_fields, "allowed fields: ", allowed_fields, "", "no fields"));
}
return FALSE;
}
{
GString *str;
OutputSelectionItem s = {
.idx = i,
};
if (!*p_str)
*p_str = g_string_sized_new (64);
str = *p_str;
s.self_offset_plus_1 = str->len + 1;
if (fields_prefix) {
g_string_append (str, fields_prefix);
g_string_append_c (str, '.');
}
g_string_append_len (str, i_name, strlen (i_name) + 1);
if (right) {
s.sub_offset_plus_1 = str->len + 1;
g_string_append_len (str, right, strlen (right) + 1);
}
if (!*p_array)
*p_array = g_array_new (FALSE, FALSE, sizeof (OutputSelectionItem));
g_array_append_val (*p_array, s);
}
return TRUE;
}
static NmcOutputSelection *
_output_selection_create_all (const NMMetaAbstractInfo *const* fields_array)
{
gs_unref_array GArray *array = NULL;
guint i;
if (fields_array) {
array = g_array_new (FALSE, FALSE, sizeof (OutputSelectionItem));
for (i = 0; fields_array[i]; i++) {
OutputSelectionItem s = {
.idx = i,
};
g_array_append_val (array, s);
}
}
return _output_selection_pack (fields_array, array, NULL);
}
static NmcOutputSelection *
_output_selection_create_one (const NMMetaAbstractInfo *const* fields_array,
const char *fields_prefix,
const char *fields_str, /* one field selector (contains not commas) and is alrady stripped of spaces. */
gboolean validate_nested,
GError **error)
{
gs_unref_array GArray *array = NULL;
nm_auto_free_gstring GString *str = NULL;
g_return_val_if_fail (!error || !*error, NULL);
nm_assert (fields_str && !strchr (fields_str, ','));
if (!_output_selection_select_one (fields_array,
fields_prefix,
fields_str,
validate_nested,
&array,
&str,
error))
return NULL;
return _output_selection_pack (fields_array, array, str);
}
#define PRINT_DATA_COL_PARENT_NIL (G_MAXUINT)
typedef struct {
const NmcOutputSelectionItem *selection_item;
const NMMetaSelectionItem *selection_item;
guint parent_idx;
guint self_idx;
bool is_leaf;
......@@ -991,7 +769,7 @@ static gboolean
_output_selection_append (GArray *cols,
const char *fields_prefix,
guint parent_idx,
const NmcOutputSelectionItem *selection_item,
const NMMetaSelectionItem *selection_item,
GPtrArray *gfree_keeper,
GError **error)
{
......@@ -999,8 +777,8 @@ _output_selection_append (GArray *cols,
guint col_idx;
guint i;
const NMMetaAbstractInfo *const*nested;
NmcOutputSelection *selection;
const NmcOutputSelectionItem *si;
NMMetaSelectionResultList *selection;
const NMMetaSelectionItem *si;
col_idx = cols->len;
......@@ -1022,7 +800,7 @@ _output_selection_append (GArray *cols,
if (parent_idx != PRINT_DATA_COL_PARENT_NIL) {
si = g_array_index (cols, PrintDataCol, parent_idx).selection_item;
allowed_fields = nmc_get_allowed_fields_nested (si->info, si->self_selection);
allowed_fields = nm_meta_abstract_info_get_nested_names_str (si->info, si->self_selection);
}
if (!allowed_fields) {
g_set_error (error, NMCLI_ERROR, 1, _("invalid field '%s%s%s'; no such field"),
......@@ -1037,13 +815,13 @@ _output_selection_append (GArray *cols,
return FALSE;
}
selection = _output_selection_create_one (nested, selection_item->self_selection,
selection = nm_meta_selection_create_parse_one (nested, selection_item->self_selection,
selection_item->sub_selection, FALSE, error);
if (!selection)
return FALSE;
nm_assert (selection->num == 1);
} else if (nested) {
selection = _output_selection_create_all (nested);
selection = nm_meta_selection_create_all (nested);
nm_assert (selection && selection->num > 0);
} else
selection = NULL;
......@@ -1069,47 +847,6 @@ _output_selection_append (GArray *cols,
/*****************************************************************************/
NmcOutputSelection *
nmc_output_selection_create (const NMMetaAbstractInfo *const* fields_array,
const char *fields_prefix,
const char *fields_str, /* a comma separated list of selectors */
gboolean validate_nested,
GError **error)
{
gs_unref_array GArray *array = NULL;
nm_auto_free_gstring GString *str = NULL;
gs_free char *fields_str_clone = NULL;
char *fields_str_cur;
char *fields_str_next;
g_return_val_if_fail (!error || !*error, NULL);
if (!fields_str)
return _output_selection_create_all (fields_array);
fields_str_clone = g_strdup (fields_str);
for (fields_str_cur = fields_str_clone; fields_str_cur; fields_str_cur = fields_str_next) {
fields_str_cur = nm_str_skip_leading_spaces (fields_str_cur);
fields_str_next = strchr (fields_str_cur, ',');
if (fields_str_next)
*fields_str_next++ = '\0';
g_strchomp (fields_str_cur);
if (!fields_str_cur[0])
continue;
if (!_output_selection_select_one (fields_array,
fields_prefix,
fields_str_cur,
validate_nested,
&array,
&str,
error))
return NULL;
}
return _output_selection_pack (fields_array, array, str);
}
/**
* _output_selection_parse:
* @fields: a %NULL terminated array of meta-data fields
......@@ -1133,12 +870,12 @@ _output_selection_parse (const NMMetaAbstractInfo *const*fields,
GPtrArray **out_gfree_keeper,
GError **error)
{
NmcOutputSelection *selection;
NMMetaSelectionResultList *selection;
gs_unref_ptrarray GPtrArray *gfree_keeper = NULL;
gs_unref_array GArray *cols = NULL;
guint i;
selection = nmc_output_selection_create (fields, NULL, fields_str, FALSE, error);
selection = nm_meta_selection_create_parse_list (fields, NULL, fields_str, FALSE, error);
if (!selection)
return FALSE;
......@@ -1153,7 +890,7 @@ _output_selection_parse (const NMMetaAbstractInfo *const*fields,
cols = g_array_new (FALSE, TRUE, sizeof (PrintDataCol));
for (i = 0; i < selection->num; i++) {
const NmcOutputSelectionItem *si = &selection->items[i];
const NMMetaSelectionItem *si = &selection->items[i];
if (!_output_selection_append (cols, NULL, PRINT_DATA_COL_PARENT_NIL,
si, gfree_keeper, error))
......@@ -1194,7 +931,7 @@ parse_output_fields (const char *fields_str,
GPtrArray **out_group_fields,
GError **error)
{
gs_free NmcOutputSelection *selection = NULL;
gs_free NMMetaSelectionResultList *selection = NULL;
GArray *array;
GPtrArray *group_fields = NULL;
guint i;
......@@ -1202,7 +939,7 @@ parse_output_fields (const char *fields_str,
g_return_val_if_fail (!error || !*error, NULL);
g_return_val_if_fail (!out_group_fields || !*out_group_fields, NULL);
selection = nmc_output_selection_create (fields_array, NULL, fields_str, TRUE, error);