libsysprof-gtk: add getter for values array

This commit is contained in:
Christian Hergert
2023-06-23 22:27:52 -07:00
parent a75e8f1dae
commit e254fcdffb
2 changed files with 17 additions and 0 deletions

View File

@ -475,3 +475,17 @@ sysprof_normalized_series_set_series (SysprofNormalizedSeries *self,
sysprof_series_set_model (SYSPROF_SERIES (self), G_LIST_MODEL (series));
}
}
const float *
sysprof_normalized_series_get_values (SysprofNormalizedSeries *self,
guint *n_values)
{
g_return_val_if_fail (SYSPROF_IS_NORMALIZED_SERIES (self), NULL);
if (self->values == NULL || self->values->len == 0)
return NULL;
*n_values = self->values->len;
return &g_array_index (self->values, float, 0);
}

View File

@ -59,5 +59,8 @@ void sysprof_normalized_series_set_series (SysprofNormalizedSeries
SYSPROF_AVAILABLE_IN_ALL
float sysprof_normalized_series_value_at (SysprofNormalizedSeries *self,
guint position);
SYSPROF_AVAILABLE_IN_ALL
const float *sysprof_normalized_series_get_values (SysprofNormalizedSeries *self,
guint *n_values);
G_END_DECLS