#include "libpspp/i18n.h"
#include "libpspp/string-map.h"
#include "output/driver.h"
-#include "output/message-item.h"
#include "output/options.h"
+#include "output/output-item.h"
#include "output/pivot-table.h"
-#include "output/table-item.h"
#include "gl/error.h"
#include "gl/progname.h"
if (lex_match_id (lexer, "SUBSCRIPTS"))
{
lex_match (lexer, T_EQUALS);
- size_t allocated_subscripts = value->n_subscripts;
+
+ struct pivot_value_ex *ex = pivot_value_ex_rw (value);
+ size_t allocated_subscripts = ex->n_subscripts;
while (lex_token (lexer) == T_STRING)
{
- if (value->n_subscripts >= allocated_subscripts)
- value->subscripts = x2nrealloc (value->subscripts,
- &allocated_subscripts,
- sizeof *value->subscripts);
+ if (ex->n_subscripts >= allocated_subscripts)
+ ex->subscripts = x2nrealloc (ex->subscripts, &allocated_subscripts,
+ sizeof *ex->subscripts);
- value->subscripts[value->n_subscripts++] = xstrdup (
- lex_tokcstr (lexer));
+ ex->subscripts[ex->n_subscripts++] = xstrdup (lex_tokcstr (lexer));
lex_get (lexer);
}
return;
{
lex_match (lexer, T_EQUALS);
- if (!value->font_style)
+ struct pivot_value_ex *ex = pivot_value_ex_rw (value);
+ if (!ex->font_style)
{
- value->font_style = xmalloc (sizeof *value->font_style);
- font_style_copy (NULL, value->font_style, &base_style->font_style);
+ ex->font_style = xmalloc (sizeof *ex->font_style);
+ font_style_copy (NULL, ex->font_style, &base_style->font_style);
}
- read_font_style (lexer, value->font_style);
+ read_font_style (lexer, ex->font_style);
return;
}
{
lex_match (lexer, T_EQUALS);
- if (!value->cell_style)
+ struct pivot_value_ex *ex = pivot_value_ex_rw (value);
+ if (!ex->cell_style)
{
- value->cell_style = xmalloc (sizeof *value->cell_style);
- *value->cell_style = base_style->cell_style;
+ ex->cell_style = xmalloc (sizeof *ex->cell_style);
+ *ex->cell_style = base_style->cell_style;
}
- read_cell_style (lexer, value->cell_style);
+ read_cell_style (lexer, ex->cell_style);
return;
}
{
value = xmalloc (sizeof *value);
*value = (struct pivot_value) {
- .type = PIVOT_VALUE_STRING,
- .string = { .s = xstrdup (lex_tokcstr (lexer)) },
+ .string = {
+ .type = PIVOT_VALUE_STRING,
+ .s = xstrdup (lex_tokcstr (lexer))
+ },
};
lex_get (lexer);
}
{
value = xmalloc (sizeof *value);
*value = (struct pivot_value) {
- .type = PIVOT_VALUE_VARIABLE,
- .variable = { .var_name = xstrdup (lex_tokcstr (lexer)) },
+ .variable = {
+ .type = PIVOT_VALUE_VARIABLE,
+ .var_name = xstrdup (lex_tokcstr (lexer))
+ },
};
lex_get (lexer);
}
m.command_name = output_get_uppercase_command_name ();
- message_item_submit (message_item_create (&m));
+ output_item_submit (message_item_create (&m));
free (m.command_name);
}