- coeff = c->coeff + i;
- fprintf (fp, "%s.name = \"%s\";\n\t", varlist[i]->name,
- varlist[i]->name);
- fprintf (fp, "%s.n_vals = %d;\n\t", varlist[i]->name,
- varlist[i]->obs_vals->n_categories);
-
- for (j = 0; j < varlist[i]->obs_vals->n_categories; j++)
+ int n_categories = cat_get_n_categories (varlist[i]);
+ int j;
+
+ fprintf (fp, "%s.name = \"%s\";\n\t",
+ var_get_name (varlist[i]),
+ var_get_name (varlist[i]));
+ fprintf (fp, "%s.n_vals = %d;\n\t",
+ var_get_name (varlist[i]),
+ n_categories);
+
+ for (j = 0; j < n_categories; j++)