X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Foutput%2Fcharts%2Fpiechart.c;h=ad3b2eafd7926e88dfa56f3ba16362f92ea0d60d;hb=refs%2Fheads%2Fctables7;hp=0467c8338fcc3b37be8c34fae15fcbfc6d934db6;hpb=97fb55e07cac602cbca57ce8005de5c8a67a73cc;p=pspp diff --git a/src/output/charts/piechart.c b/src/output/charts/piechart.c index 0467c8338f..ad3b2eafd7 100644 --- a/src/output/charts/piechart.c +++ b/src/output/charts/piechart.c @@ -23,7 +23,7 @@ #include "libpspp/cast.h" #include "libpspp/str.h" #include "data/variable.h" -#include "output/chart-item-provider.h" +#include "output/chart-provider.h" #include "gl/xalloc.h" @@ -34,14 +34,14 @@ /* Creates and returns a chart that will render a piechart with the of VAR and the N_SLICES described in SLICES. */ -struct chart_item * +struct chart * piechart_create (const struct variable *var, const struct freq *slices, int n_slices) { struct piechart *pie; int i; pie = xmalloc (sizeof *pie); - chart_item_init (&pie->chart_item, &piechart_class, var_to_string (var)); + chart_init (&pie->chart, &piechart_class, var_to_string (var)); pie->slices = xnmalloc (n_slices, sizeof *pie->slices); for (i = 0; i < n_slices; i++) { @@ -50,7 +50,7 @@ piechart_create (const struct variable *var, const struct freq *slices, int n_sl ds_init_empty (&dst->label); - if ( var_is_value_missing (var, &src->values[0], MV_ANY)) + if (var_is_value_missing (var, &src->values[0])) ds_assign_cstr (&dst->label, _("*MISSING*")); else var_append_value_name (var, &src->values[0], &dst->label); @@ -63,13 +63,13 @@ piechart_create (const struct variable *var, const struct freq *slices, int n_sl dst->magnitude = src->count; } pie->n_slices = n_slices; - return &pie->chart_item; + return &pie->chart; } static void -piechart_destroy (struct chart_item *chart_item) +piechart_destroy (struct chart *chart) { - struct piechart *pie = to_piechart (chart_item); + struct piechart *pie = to_piechart (chart); int i; for (i = 0; i < pie->n_slices; i++) @@ -81,7 +81,7 @@ piechart_destroy (struct chart_item *chart_item) free (pie); } -const struct chart_item_class piechart_class = +const struct chart_class piechart_class = { piechart_destroy };