-
- FILE *fp;
- int number_pos;
-
- x->chart_cnt++;
-
- number_pos = strchr (x->chart_file_name, '#') - x->chart_file_name;
- ch->file_name = xasprintf ("%.*s%d%s",
- number_pos, x->chart_file_name,
- (int) x->chart_cnt,
- x->chart_file_name + number_pos + 1);
- fp = fopen (ch->file_name, "wb");
- if (fp == NULL)
- {
- error (0, errno, _("creating \"%s\""), ch->file_name);
- free (ch->file_name);
- ch->file_name = NULL;
- return;
- }
-
- ch->pl_params = pl_newplparams ();
- ch->lp = pl_newpl_r ("png", 0, fp, stderr, ch->pl_params);
-#endif
+ chart_init_separate (ch, "png", x->chart_file_name, ++x->chart_cnt);