string_map_insert (&options, "box", box);
register_driver (&options, "-");
- /* Render to <base>.txt. */
- register_driver (&options, "%s.txt", output_base);
#ifdef HAVE_CAIRO
/* Render to <base>.pdf. */
register_driver (&options, "%s.pdf", output_base);
#endif
- /* Render to <base>.csv. */
+ register_driver (&options, "%s.txt", output_base);
register_driver (&options, "%s.csv", output_base);
-
- /* Render to <base>.odt. */
register_driver (&options, "%s.odt", output_base);
+ register_driver (&options, "%s.spv", output_base);
string_map_destroy (&options);
}
exit (1);
}
+static struct cell_color
+read_color (struct lexer *lexer)
+{
+ struct cell_color color;
+ if (!parse_color__ (lex_tokcstr (lexer), &color))
+ {
+ msg (SE, "%s: unknown color", lex_tokcstr (lexer));
+ exit (1);
+ }
+ lex_get (lexer);
+ return color;
+}
+
static bool
parse_value_setting (struct lexer *lexer, const char *name,
struct pivot_value **valuep)
struct table_border_style style = TABLE_BORDER_STYLE_INITIALIZER;
style.stroke = read_stroke (lexer);
if (lex_is_string (lexer))
- {
- if (!parse_color__ (lex_tokcstr (lexer), &style.color))
- {
- msg (SE, "%s: unknown color", lex_tokcstr (lexer));
- exit (1);
- }
- lex_get (lexer);
- }
+ style.color = read_color (lexer);
if (!lex_force_match (lexer, T_RPAREN))
exit (1);
}
}
+ size_t *dindexes = xcalloc (pt->n_dimensions, sizeof *dindexes);
+ for (size_t i = 0; ; i++)
+ {
+ pivot_table_put (pt, dindexes, pt->n_dimensions,
+ pivot_value_new_integer (i));
+
+ for (size_t j = 0; j < pt->n_dimensions; j++)
+ {
+ if (++dindexes[j] < pt->dimensions[j]->n_leaves)
+ goto next;
+ dindexes[j] = 0;
+ }
+ break;
+ next:;
+ }
+ free (dindexes);
+
if (!lex_force_match (lexer, T_ENDCMD))
exit (1);
return pt;