cli: add property get functions - returning property value for presentation

Simplify code by using property get functions, with most of them
autogenerated based on GObject properties and GValue transforms.

Based on a patch from Jiří Klimeš
This commit is contained in:
Dan Winship
2013-03-25 10:44:15 -04:00
parent 113d358ce5
commit 9e71bb3cd5
3 changed files with 867 additions and 814 deletions

View File

@@ -202,6 +202,22 @@ set_val_arr (NmcOutputField fields_array[], guint32 idx, char **value)
fields_array[idx].value = value;
}
/*
* Free 'value' members in array of NmcOutputField
*/
void
nmc_free_output_field_values (NmcOutputField fields_array[])
{
int idx = 0;
while (fields_array && fields_array[idx].value) {
if (fields_array[idx].flags & NMC_OF_FLAG_ARRAY)
g_strfreev (fields_array[idx].value);
else
g_free (fields_array[idx].value);
idx++;
}
}
/*
* Parse comma separated fields in 'fields_str' according to 'fields_array'.
* IN: 'field_str': comma-separated fields names