tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Format"));
tab_box (t, TAL_1, TAL_1, TAL_0, TAL_1, 0, 0, 3, parser->field_cnt);
tab_hline (t, TAL_2, 0, 3, 1);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
for (i = 0; i < parser->field_cnt; i++)
{
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("Format"));
tab_box (t, TAL_1, TAL_1, TAL_0, TAL_1, 0, 0, 1, parser->field_cnt);
tab_hline (t, TAL_2, 0, 1, 1);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
for (i = 0; i < parser->field_cnt; i++)
{
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("Record"));
tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("Columns"));
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Format"));
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
row = 1;
ll_for_each (spec, struct prt_out_spec, ll, &trns->specs)
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return;
t = tab_create (3, split_cnt + 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_vline (t, TAL_GAP, 1, 0, split_cnt);
tab_vline (t, TAL_GAP, 2, 0, split_cnt);
tab_text (t, 0, 0, TAB_NONE, _("Variable"));
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-sysfile_info_dim (struct tab_table *t, struct outp_driver *d)
+sysfile_info_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
static const int max[] = {20, 5, 35, 3, 0};
const int *p;
dict_get_encoding(d) ? dict_get_encoding(d) : _("Unknown"));
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_submit (t);
t = tab_create (4, 1 + 2 * dict_get_var_cnt (d), 1);
- tab_dim (t, sysfile_info_dim);
+ tab_dim (t, sysfile_info_dim, NULL);
tab_headers (t, 0, 0, 1, 0);
tab_text (t, 0, 0, TAB_LEFT | TAT_TITLE, _("Variable"));
tab_joint_text (t, 1, 0, 2, 0, TAB_LEFT | TAT_TITLE, _("Description"));
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-variables_dim (struct tab_table *t, struct outp_driver *d)
+variables_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
int pc;
int i;
? _("Description") : _("Label")));
if (flags & DF_DICT_INDEX)
tab_text (t, pc, 0, TAB_LEFT | TAT_TITLE, _("Position"));
- tab_dim (t, variables_dim);
+ tab_dim (t, variables_dim, NULL);
r = 1;
for (i = 0; i < n; i++)
tab_text (t, 1, 0, TAB_LEFT | TAT_TITLE, _("Value"));
display_attributes (t, set, flags, 0, 1);
tab_columns (t, TAB_COL_DOWN, 1);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_title (t, "Custom data file attributes.");
tab_submit (t);
}
t = tab_create (4, nrow + 1, 0);
tab_headers (t, 0, 0, 1, 0);
tab_columns (t, TAB_COL_DOWN, 1);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_1, TAL_1, -1, -1, 0, 0, 3, nrow);
tab_box (t, -1, -1, -1, TAL_1, 0, 0, 3, nrow);
tab_hline (t, TAL_2, 0, 3, 1);
struct tab_table *table = tab_create (7, ost->n_vars * 3 + 1, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Binomial Test"));
}
table = tab_create(4, n_cells + 2, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, var_to_string(var));
tab_text (table, 1, 0, TAB_LEFT, _("Observed N"));
int n_cells = test->hi - test->lo + 1;
table = tab_create(1 + ost->n_vars * 4, n_cells + 3, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Frequencies"));
for ( i = 0 ; i < ost->n_vars ; ++i )
struct tab_table *table;
table = tab_create (1 + ost->n_vars, 4, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Test Statistics"));
tab_headers (table, 1, 0, 1, 0);
static void display_symmetric (const struct dictionary *);
static void display_risk (const struct dictionary *);
static void display_directional (void);
-static void crosstabs_dim (struct tab_table *, struct outp_driver *);
+static void crosstabs_dim (struct tab_table *, struct outp_driver *, void *);
static void table_value_missing (struct tab_table *table, int c, int r,
unsigned char opt, const union value *v,
const struct variable *var);
tab_box (t, -1, -1, -1, TAL_GAP, 0, tab_t (t), tab_l (t) - 1,
tab_nr (t) - 1);
tab_vline (t, TAL_2, tab_l (t), 0, tab_nr (t) - 1);
- tab_dim (t, crosstabs_dim);
+ tab_dim (t, crosstabs_dim, NULL);
tab_submit (t);
}
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-crosstabs_dim (struct tab_table *t, struct outp_driver *d)
+crosstabs_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
int i;
tab_hline (t, TAL_2, 0, 1, 1);
tab_text (t, 0, 0, TAB_CENTER | TAT_TITLE, _("Source"));
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("Target"));
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
{
size_t i, y;
tab_box (t, -1, -1, -1, TAL_1, 1, 0, nc - 1, dsc->var_cnt);
tab_hline (t, TAL_2, 0, nc - 1, 1);
tab_vline (t, TAL_2, 1, 0, dsc->var_cnt);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
nc = 0;
tab_text (t, nc++, 0, TAB_LEFT | TAT_TITLE, _("Variable"));
tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
/* Outline the box */
tab_box (tbl,
tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
/* Outline the box */
tab_box (tbl,
tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
/* Outline the box */
tab_box (tbl,
tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
/* Outline the box */
tab_box (tbl,
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-full_dim (struct tab_table *t, struct outp_driver *d)
+full_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
int i = 0;
int columns = 5;
n_categories = ft->n_valid + ft->n_missing;
t = tab_create (5 + lab, n_categories + 3, 0);
tab_headers (t, 0, 0, 2, 0);
- tab_dim (t, full_dim);
+ tab_dim (t, full_dim, NULL);
if (lab)
tab_text (t, 0, 1, TAB_CENTER | TAT_TITLE, _("Value Label"));
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-condensed_dim (struct tab_table *t, struct outp_driver *d)
+condensed_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
int cum_w = MAX (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL),
MAX (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL),
tab_text (t, 2, 1, TAB_CENTER | TAT_TITLE, _("Pct"));
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Cum"));
tab_text (t, 3, 1, TAB_CENTER | TAT_TITLE, _("Pct"));
- tab_dim (t, condensed_dim);
+ tab_dim (t, condensed_dim, NULL);
r = 2;
for (f = ft->valid; f < ft->missing; f++)
calc_stats (v, stat_value);
t = tab_create (3, n_stats + n_percentiles + 2, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_1, TAL_1, -1, -1 , 0 , 0 , 2, tab_nr(t) - 1) ;
table = tab_create (columns, 2 + n_vars, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Descriptive Statistics"));
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t,
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 2, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
/* Put a frame around the entire box, and vertical lines inside */
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 1, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
/* Put a frame around the entire box, and vertical lines inside */
tab_box (t,
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 2, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
/* Put a frame around the entire box, and vertical lines inside */
tab_box (t,
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 3, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
/* Put a frame around the entire box, and vertical lines inside */
tab_box (t,
adjrsq = 1.0 - (1.0 - rsq) * (c->n_obs - 1.0) / (c->n_obs - c->n_indeps);
std_error = sqrt (pspp_linreg_mse (c));
t = tab_create (n_cols, n_rows, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
tab_hline (t, TAL_2, 0, n_cols - 1, 1);
tab_vline (t, TAL_2, 2, 0, n_rows - 1);
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
tab_hline (t, TAL_2, 0, n_cols - 1, 1);
tab_vline (t, TAL_2, 2, 0, n_rows - 1);
assert (c != NULL);
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
n_rows = 2 * (c->n_indeps + 1);
t = tab_create (n_cols, n_rows, 0);
tab_headers (t, 2, 0, 1, 0);
- tab_dim (t, tab_natural_dimensions);
+ tab_dim (t, tab_natural_dimensions, NULL);
tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
tab_hline (t, TAL_2, 0, n_cols - 1, 1);
tab_vline (t, TAL_2, 2, 0, n_rows - 1);
{
struct tab_table *tab = tab_create(1, 1, 0);
- tab_dim (tab, tab_natural_dimensions);
+ tab_dim (tab, tab_natural_dimensions, NULL);
tab_flags (tab, SOMF_NO_TITLE );
tab_text(tab, 0, 0, TAT_PRINTF, "Scale: %s", ds_cstr (&rel->scale_name));
struct tab_table *tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
tab_title (tbl, _("Reliability Statistics"));
struct tab_table *tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
tab_title (tbl, _("Item-Total Statistics"));
tbl = tab_create (n_cols, n_rows, 0);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
- tab_dim (tbl, tab_natural_dimensions);
+ tab_dim (tbl, tab_natural_dimensions, NULL);
tab_title (tbl, _("Case Processing Summary"));
const struct variable *wv = dict_get_weight (dict);
const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Frequencies"));
int i;
struct tab_table *table = tab_create (1 + t2s->n_pairs, 4, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Test Statistics"));
tab_headers (this->t,0,0,1,0);
tab_box (this->t, TAL_2, TAL_2, TAL_0, TAL_1, 0, 0, cols -1, rows -1 );
tab_hline (this->t, TAL_2,0,cols-1,1);
- tab_dim (this->t, tab_natural_dimensions);
+ tab_dim (this->t, tab_natural_dimensions, NULL);
}
void ssbox_one_sample_populate (struct ssbox *ssb,
tab_headers (self->t,0,0,3,0);
tab_box (self->t, TAL_2, TAL_2, TAL_0, TAL_0, 0, 0, cols -1, rows -1);
tab_hline (self->t, TAL_2,0,cols-1,3);
- tab_dim (self->t, tab_natural_dimensions);
+ tab_dim (self->t, tab_natural_dimensions, NULL);
}
tab_box (table, TAL_2, TAL_2, TAL_0, TAL_1, 0, 0, cols -1, rows -1 );
tab_hline (table, TAL_2, 0, cols - 1, 1);
tab_vline (table, TAL_2, 2, 0, rows - 1);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _ ("Paired Samples Correlations"));
/* column headings */
struct tab_table *table = tab_create (5, 1 + 4 * t2s->n_pairs, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Ranks"));
size_t i;
struct tab_table *table = tab_create (1 + t2s->n_pairs, exact ? 5 : 3, 0);
- tab_dim (table, tab_natural_dimensions);
+ tab_dim (table, tab_natural_dimensions, NULL);
tab_title (table, _("Test Statistics"));
/* PSPP - a program for statistical analysis.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
tab = tab_create(1, 1, 0);
- tab_dim (tab, tab_natural_dimensions);
+ tab_dim (tab, tab_natural_dimensions, NULL);
tab_flags (tab, SOMF_NO_TITLE );
tab_text(tab, 0, 0, 0, ds_cstr (lex_tokstr (lexer)));
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Set DIM_FUNC as the dimension function for table T. */
void
-tab_dim (struct tab_table *t, tab_dim_func *dim_func)
+tab_dim (struct tab_table *t, tab_dim_func *dim_func, void *aux)
{
assert (t != NULL && t->dim == NULL);
t->dim = dim_func;
+ t->dim_aux = aux;
}
/* Returns the natural width of column C in table T for driver D, that
/* Callback function to set all columns and rows to their natural
dimensions. Not really meant to be called directly. */
void
-tab_natural_dimensions (struct tab_table *t, struct outp_driver *d)
+tab_natural_dimensions (struct tab_table *t, struct outp_driver *d,
+ void *aux UNUSED)
{
int i;
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-nowrap_dim (struct tab_table *t, struct outp_driver *d)
+nowrap_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
t->w[0] = tab_natural_width (t, d, 0);
t->h[0] = d->font_height;
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
static void
-wrap_dim (struct tab_table *t, struct outp_driver *d)
+wrap_dim (struct tab_table *t, struct outp_driver *d, void *aux UNUSED)
{
t->w[0] = tab_natural_width (t, d, 0);
t->h[0] = tab_natural_height (t, d, 0);
tab_text (t, 0, 0, options & ~TAT_PRINTF, buf);
tab_flags (t, SOMF_NO_TITLE | SOMF_NO_SPACING);
- tab_dim (t, options & TAT_NOWRAP ? nowrap_dim : wrap_dim);
+ tab_dim (t, options & TAT_NOWRAP ? nowrap_dim : wrap_dim, NULL);
tab_submit (t);
free (tmp_buf);
#endif
assert (t->dim != NULL);
- t->dim (t, d);
+ t->dim (t, d, t->dim_aux);
#if DEBUGGING
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct outp_driver;
struct tab_table;
-typedef void tab_dim_func (struct tab_table *, struct outp_driver *);
+typedef void tab_dim_func (struct tab_table *, struct outp_driver *,
+ void *aux);
/* A table. */
struct tab_table
unsigned char *rh; /* Horiz rules; unsigned char[nr+1][nc]. */
unsigned char *rv; /* Vert rules; unsigned char[nr][nc+1]. */
tab_dim_func *dim; /* Calculates cell widths and heights. */
+ void *dim_aux; /* Auxiliary data for dim function. */
/* Calculated during output. */
int *w; /* Column widths; [nc]. */
tab_dim_func tab_natural_dimensions;
int tab_natural_width (struct tab_table *t, struct outp_driver *d, int c);
int tab_natural_height (struct tab_table *t, struct outp_driver *d, int r);
-void tab_dim (struct tab_table *, tab_dim_func *);
+void tab_dim (struct tab_table *, tab_dim_func *, void *aux);
/* Rules. */
void tab_hline (struct tab_table *, int style, int x1, int x2, int y);