#include "size_max.h"
#include <data/case.h>
#include <data/dictionary.h>
+#include <data/data-out.h>
#include <data/format.h>
#include <data/procedure.h>
#include <data/variable.h>
#include <output/output.h>
#include <output/table.h>
+#include "minmax.h"
+
#include "gettext.h"
#define _(msgid) gettext (msgid)
/* Parses and executes the LIST procedure. */
int
-cmd_list (struct dataset *ds)
+cmd_list (struct lexer *lexer, struct dataset *ds)
{
struct variable casenum_var;
bool ok;
- if (!parse_list (ds, &cmd, NULL))
+ if (!parse_list (lexer, ds, &cmd, NULL))
return CMD_FAILURE;
/* Fill in defaults. */
struct variable *v = cmd.v_variables[i];
memset (&prc->header[prc->header_rows - 1][x], '-',
- max (v->print.w, (int) strlen (v->name)));
+ MAX (v->print.w, (int) strlen (v->name)));
if ((int) strlen (v->name) < v->print.w)
x += v->print.w - strlen (v->name);
memcpy (&prc->header[0][x], v->name, strlen (v->name));
outp_open_page (d);
max_width = n_chars_width (d);
- largest_page_width = max (largest_page_width, max_width);
+ largest_page_width = MAX (largest_page_width, max_width);
prc = d->prc = xmalloc (sizeof *prc);
prc->type = 0;
for (width = cmd.n_variables - 1, column = 0; column < cmd.n_variables; column++)
{
struct variable *v = cmd.v_variables[column];
- width += max (v->print.w, (int) strlen (v->name));
+ width += MAX (v->print.w, (int) strlen (v->name));
}
if (width <= max_width)
{
{
struct variable *v = cmd.v_variables[column];
int trial_width = (width - v->print.w
- + max (v->print.w, (int) strlen (v->name)));
+ + MAX (v->print.w, (int) strlen (v->name)));
if (trial_width > max_width)
{
for (prc->header_rows = 0, column = 0;
column < prc->n_vertical;
column++)
- prc->header_rows = max (prc->header_rows,
+ prc->header_rows = MAX (prc->header_rows,
strlen (cmd.v_variables[column]->name));
prc->header_rows++;
continue;
int width;
if (prc->type == 0 && column >= prc->n_vertical)
- width = max ((int) strlen (v->name), v->print.w);
+ width = MAX ((int) strlen (v->name), v->print.w);
else
width = v->print.w;
if (fmt_is_string (v->print.type) || v->fv != -1)
{
- data_out (ds_put_uninit(&line_buffer, v->print.w),
- &v->print, case_data (c, v->fv));
+ data_out (case_data (c, v->fv), &v->print,
+ ds_put_uninit (&line_buffer, v->print.w));
}
else
{
union value case_idx_value;
case_idx_value.f = case_idx;
- data_out (ds_put_uninit(&line_buffer,v->print.w),
- &v->print, &case_idx_value);
+ data_out (&case_idx_value, &v->print,
+ ds_put_uninit (&line_buffer,v->print.w));
}
ds_put_char(&line_buffer, ' ');
char buf[256];
if (fmt_is_string (v->print.type) || v->fv != -1)
- data_out (buf, &v->print, case_data (c, v->fv));
+ data_out (case_data (c, v->fv), &v->print, buf);
else
{
union value case_idx_value;
case_idx_value.f = case_idx;
- data_out (buf, &v->print, &case_idx_value);
+ data_out (&case_idx_value, &v->print, buf);
}
fputs (" <TD>", x->file);