int row = i + 1;
tab_text (t, 0, row, TAB_LEFT, f->name);
- tab_text (t, 1, row, TAT_PRINTF, "%d", f->record);
- tab_text (t, 2, row, TAT_PRINTF, "%3d-%3d",
- f->first_column, f->first_column + f->format.w - 1);
+ tab_text_format (t, 1, row, 0, "%d", f->record);
+ tab_text_format (t, 2, row, 0, "%3d-%3d",
+ f->first_column, f->first_column + f->format.w - 1);
tab_text (t, 3, row, TAB_LEFT | TAB_FIX,
fmt_to_string (&f->format, fmt_string));
}
switch (spec->type)
{
case PRT_LITERAL:
- tab_text (t, 0, row, TAB_LEFT | TAB_FIX | TAT_PRINTF, "\"%.*s\"",
- (int) ds_length (&spec->string), ds_data (&spec->string));
+ tab_text_format (t, 0, row, TAB_LEFT | TAB_FIX, "\"%.*s\"",
+ (int) ds_length (&spec->string),
+ ds_data (&spec->string));
width = ds_length (&spec->string);
break;
case PRT_VAR:
default:
NOT_REACHED ();
}
- tab_text (t, 1, row, TAT_PRINTF, "%d", spec->record);
- tab_text (t, 2, row, TAT_PRINTF, "%3d-%3d",
- spec->first_column, spec->first_column + width - 1);
+ tab_text_format (t, 1, row, 0, "%d", spec->record);
+ tab_text_format (t, 2, row, 0, "%3d-%3d",
+ spec->first_column, spec->first_column + width - 1);
row++;
}
const char *val_lab;
const struct fmt_spec *print = var_get_print_format (v);
- tab_text (t, 0, i + 1, TAB_LEFT | TAT_PRINTF, "%s", var_get_name (v));
+ tab_text_format (t, 0, i + 1, TAB_LEFT, "%s", var_get_name (v));
data_out (case_data (c, v), print, temp_buf);
temp_buf[print->w] = 0;
- tab_text (t, 1, i + 1, TAT_PRINTF, "%.*s", print->w, temp_buf);
+ tab_text_format (t, 1, i + 1, 0, "%.*s", print->w, temp_buf);
val_lab = var_lookup_value_label (v, case_data (c, v));
if (val_lab)
tab_text (t, 1, 1, TAB_LEFT, label);
}
tab_text (t, 0, 2, TAB_LEFT, _("Created:"));
- tab_text (t, 1, 2, TAB_LEFT | TAT_PRINTF, "%s %s by %s",
- info.creation_date, info.creation_time, info.product);
+ tab_text_format (t, 1, 2, TAB_LEFT, "%s %s by %s",
+ info.creation_date, info.creation_time, info.product);
tab_text (t, 0, 3, TAB_LEFT, _("Integer Format:"));
tab_text (t, 1, 3, TAB_LEFT,
info.integer_format == INTEGER_MSB_FIRST ? _("Big Endian.")
: info.float_format == FLOAT_Z_LONG ? _("IBM 390 Hex Long.")
: _("Unknown."));
tab_text (t, 0, 5, TAB_LEFT, _("Variables:"));
- tab_text (t, 1, 5, TAB_LEFT | TAT_PRINTF, "%zu", dict_get_var_cnt (d));
+ tab_text_format (t, 1, 5, TAB_LEFT, "%zu", dict_get_var_cnt (d));
tab_text (t, 0, 6, TAB_LEFT, _("Cases:"));
- tab_text (t, 1, 6, TAB_LEFT | TAT_PRINTF,
- info.case_cnt == -1 ? _("Unknown") : "%ld",
- (long int) info.case_cnt);
+ tab_text_format (t, 1, 6, TAB_LEFT,
+ info.case_cnt == -1 ? _("Unknown") : "%ld",
+ (long int) info.case_cnt);
tab_text (t, 0, 7, TAB_LEFT, _("Type:"));
tab_text (t, 1, 7, TAB_LEFT, _("System File."));
tab_text (t, 0, 8, TAB_LEFT, _("Weight:"));
? var_get_name (weight_var) : _("Not weighted.")));
}
tab_text (t, 0, 9, TAB_LEFT, _("Mode:"));
- tab_text (t, 1, 9, TAB_LEFT | TAT_PRINTF,
- _("Compression %s."), info.compressed ? _("on") : _("off"));
+ tab_text_format (t, 1, 9, TAB_LEFT,
+ _("Compression %s."), info.compressed ? _("on") : _("off"));
tab_text (t, 0, 10, TAB_LEFT, _("Charset:"));
- tab_text (t, 1, 10, TAB_LEFT | TAT_PRINTF,
- dict_get_encoding(d) ? dict_get_encoding(d) : _("Unknown"));
+ tab_text_format (t, 1, 10, TAB_LEFT,
+ dict_get_encoding(d) ? dict_get_encoding(d) : _("Unknown"));
tab_dim (t, tab_natural_dimensions, NULL, NULL);
for (i = 0; i < n_values; i++)
{
if (n_values > 1)
- tab_text (t, c, r, TAB_LEFT | TAT_PRINTF, "%s[%d]",
- name, i + 1);
+ tab_text_format (t, c, r, TAB_LEFT, "%s[%d]", name, i + 1);
else
tab_text (t, c, r, TAB_LEFT, name);
tab_text (t, c + 1, r, TAB_LEFT, attribute_get_value (attr, i));
/* Put the name, var label, and position into the first row. */
tab_text (t, 0, r, TAB_LEFT, var_get_name (v));
if (flags & DF_DICT_INDEX)
- tab_text (t, pc, r, TAT_PRINTF, "%zu", var_get_dict_index (v) + 1);
+ tab_text_format (t, pc, r, 0, "%zu", var_get_dict_index (v) + 1);
if (flags & DF_VARIABLE_LABELS && var_has_label (v))
{
if (fmt_equal (print, write))
{
char str[FMT_STRING_LEN_MAX + 1];
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Format: %s"), fmt_to_string (print, str));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Format: %s"), fmt_to_string (print, str));
r++;
}
else
{
char str[FMT_STRING_LEN_MAX + 1];
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Print Format: %s"), fmt_to_string (print, str));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Print Format: %s"),
+ fmt_to_string (print, str));
r++;
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Write Format: %s"), fmt_to_string (write, str));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Write Format: %s"),
+ fmt_to_string (write, str));
r++;
}
}
enum measure m = var_get_measure (v);
enum alignment a = var_get_alignment (v);
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Measure: %s"),
- m == MEASURE_NOMINAL ? _("Nominal")
- : m == MEASURE_ORDINAL ? _("Ordinal")
- : _("Scale"));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Measure: %s"),
+ m == MEASURE_NOMINAL ? _("Nominal")
+ : m == MEASURE_ORDINAL ? _("Ordinal")
+ : _("Scale"));
r++;
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Display Alignment: %s"),
- a == ALIGN_LEFT ? _("Left")
- : a == ALIGN_CENTRE ? _("Center")
- : _("Right"));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Display Alignment: %s"),
+ a == ALIGN_LEFT ? _("Left")
+ : a == ALIGN_CENTRE ? _("Center")
+ : _("Right"));
r++;
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT | TAT_PRINTF,
- _("Display Width: %d"), var_get_display_width (v));
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Display Width: %d"),
+ var_get_display_width (v));
r++;
}
char fmt_string[FMT_STRING_LEN_MAX + 1];
fmt_to_string (var_get_print_format (var), fmt_string);
- tab_text (t, 1, row, TAB_RIGHT | TAT_PRINTF, "%zu", j + 1);
+ tab_text_format (t, 1, row, TAB_RIGHT, "%zu", j + 1);
tab_text (t, 2, row, TAB_LEFT, var_get_name (var));
tab_text (t, 3, row, TAB_LEFT, fmt_string);
row++;
tab_text (table, 4, 0, TAB_CENTER, _("Observed Prop."));
tab_text (table, 5, 0, TAB_CENTER, _("Test Prop."));
- tab_text (table, 6, 0, TAB_CENTER | TAT_PRINTF,
- _("Exact Sig. (%d-tailed)"),
- bst->p == 0.5 ? 2: 1);
+ tab_text_format (table, 6, 0, TAB_CENTER,
+ _("Exact Sig. (%d-tailed)"),
+ bst->p == 0.5 ? 2 : 1);
tab_vline (table, TAL_2, 2, 0, tab_nr (table) -1);
tab_submit (table);
{
tab_double (summary, i * 2 + 1, 0, TAB_RIGHT, n[i],
&proc->weight_format);
- tab_text (summary, i * 2 + 2, 0, TAB_RIGHT | TAT_PRINTF, "%.1f%%",
- n[i] / n[2] * 100.);
+ tab_text_format (summary, i * 2 + 2, 0, TAB_RIGHT, "%.1f%%",
+ n[i] / n[2] * 100.);
}
tab_next_row (summary);
tab_title (risk, _("Risk estimate."));
tab_offset (risk, pt->n_vars - 2, 0);
- tab_joint_text (risk, 2, 0, 3, 0, TAB_CENTER | TAT_TITLE | TAT_PRINTF,
- _("95%% Confidence Interval"));
+ tab_joint_text_format (risk, 2, 0, 3, 0, TAB_CENTER | TAT_TITLE,
+ _("95%% Confidence Interval"));
tab_text (risk, 0, 1, TAB_LEFT | TAT_TITLE, _("Statistic"));
tab_text (risk, 1, 1, TAB_RIGHT | TAT_TITLE, _("Value"));
tab_text (risk, 2, 1, TAB_RIGHT | TAT_TITLE, _("Lower"));
else
string = var_get_name (pt->vars[1]);
- tab_text (direct, j, 0, TAB_LEFT | TAT_PRINTF,
- gettext (stats_names[j][k]), string);
+ tab_text_format (direct, j, 0, TAB_LEFT,
+ gettext (stats_names[j][k]), string);
}
}
}
nc = 0;
tab_text (t, nc++, i + 1, TAB_LEFT, var_get_name (dv->v));
- tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->valid);
+ tab_text_format (t, nc++, i + 1, 0, "%g", dv->valid);
if (dsc->format == DSC_SERIAL)
- tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->missing);
+ tab_text_format (t, nc++, i + 1, 0, "%g", dv->missing);
for (j = 0; j < DSC_N_STATS; j++)
if (dsc->show_stats & (1ul << j))
TAB_LEFT,
n, wfmt);
- tab_text (tbl, heading_columns + 1,
- heading_rows + j + v * ll_count (&fctr->result_list),
- TAB_RIGHT | TAT_PRINTF,
- "%g%%", n * 100.0 / result->metrics[v].n);
+ tab_text_format (tbl, heading_columns + 1,
+ heading_rows + j + v * ll_count (&fctr->result_list),
+ TAB_RIGHT,
+ "%g%%", n * 100.0 / result->metrics[v].n);
/* Total Missing */
tab_double (tbl, heading_columns + 2,
result->metrics[v].n - n,
wfmt);
- tab_text (tbl, heading_columns + 3,
- heading_rows + j + v * ll_count (&fctr->result_list),
- TAB_RIGHT | TAT_PRINTF,
- "%g%%",
- (result->metrics[v].n - n) * 100.0 / result->metrics[v].n
- );
+ tab_text_format (tbl, heading_columns + 3,
+ heading_rows + j + v * ll_count (&fctr->result_list),
+ TAB_RIGHT,
+ "%g%%",
+ (result->metrics[v].n - n) * 100.0 / result->metrics[v].n
+ );
/* Total Valid + Missing */
tab_double (tbl, heading_columns + 4,
result->metrics[v].n,
wfmt);
- tab_text (tbl, heading_columns + 5,
- heading_rows + j + v * ll_count (&fctr->result_list),
- TAB_RIGHT | TAT_PRINTF,
- "%g%%",
- (result->metrics[v].n) * 100.0 / result->metrics[v].n
- );
+ tab_text_format (tbl, heading_columns + 5,
+ heading_rows + j + v * ll_count (&fctr->result_list),
+ TAB_RIGHT,
+ "%g%%",
+ ((result->metrics[v].n) * 100.0
+ / result->metrics[v].n));
++j;
}
TAB_LEFT,
_("Mean"));
- tab_text (tbl, n_cols - 4,
- heading_rows + row_var_start + 1 + i * DESCRIPTIVE_ROWS,
- TAB_LEFT | TAT_PRINTF,
- _("%g%% Confidence Interval for Mean"),
- cmd.n_cinterval[0]);
+ tab_text_format (tbl, n_cols - 4,
+ heading_rows + row_var_start + 1 + i * DESCRIPTIVE_ROWS,
+ TAB_LEFT,
+ _("%g%% Confidence Interval for Mean"),
+ cmd.n_cinterval[0]);
tab_text (tbl, n_cols - 3,
heading_rows + row_var_start + 1 + i * DESCRIPTIVE_ROWS,
_("Upper Bound"));
tab_text (tbl, n_cols - 4,
- heading_rows + row_var_start + 3 + i * DESCRIPTIVE_ROWS,
- TAB_LEFT | TAT_PRINTF,
- _("5%% Trimmed Mean"));
+ heading_rows + row_var_start + 3 + i * DESCRIPTIVE_ROWS,
+ TAB_LEFT, _("5% Trimmed Mean"));
tab_text (tbl, n_cols - 4,
heading_rows + row_var_start + 4 + i * DESCRIPTIVE_ROWS,
for ( e = 1; e <= cmd.st_n; ++e )
{
- tab_text (tbl, n_cols - 3,
- heading_rows + row_var_start + row_result_start + e - 1,
- TAB_RIGHT | TAT_PRINTF,
- _("%d"), e);
-
- tab_text (tbl, n_cols - 3,
- heading_rows + row_var_start + row_result_start + cmd.st_n + e - 1,
- TAB_RIGHT | TAT_PRINTF,
- _("%d"), e);
+ tab_text_format (tbl, n_cols - 3,
+ heading_rows + row_var_start + row_result_start + e - 1,
+ TAB_RIGHT,
+ "%d", e);
+
+ tab_text_format (tbl, n_cols - 3,
+ heading_rows + row_var_start + row_result_start + cmd.st_n + e - 1,
+ TAB_RIGHT,
+ "%d", e);
}
for (i = 0 ; i < n_percentiles; ++i )
{
- tab_text (tbl, n_cols - n_percentiles + i, 1,
- TAB_CENTER | TAT_TITLE | TAT_PRINTF,
- _("%g"),
- subc_list_double_at (&percentile_list, i)
- );
+ tab_text_format (tbl, n_cols - n_percentiles + i, 1,
+ TAB_CENTER | TAT_TITLE,
+ _("%g"),
+ subc_list_double_at (&percentile_list, i));
}
tab_vline (t, TAL_0, 7, 0, 0);
tab_hline (t, TAL_1, 6, 7, 1);
- tab_joint_text (t, 6, 0, 7, 0, TAB_CENTER | TAT_TITLE | TAT_PRINTF,
- _("%g%% Confidence Interval for Mean"), confidence*100.0);
+ tab_joint_text_format (t, 6, 0, 7, 0, TAB_CENTER | TAT_TITLE,
+ _("%g%% Confidence Interval for Mean"),
+ confidence*100.0);
tab_text (t, 6, 1, TAB_CENTER | TAT_TITLE, _("Lower Bound"));
tab_text (t, 7, 1, TAB_CENTER | TAT_TITLE, _("Upper Bound"));
for (i = 0; i < cmd.sbc_contrast; ++i )
{
- tab_text (t, 1, i + 2, TAB_CENTER | TAT_PRINTF, "%d", i + 1);
+ tab_text_format (t, 1, i + 2, TAB_CENTER, "%d", i + 1);
if ( bad_contrast[i] )
tab_text (t, count + 2, i + 2, TAB_RIGHT, "?" );
else
- tab_text (t, count + 2, i + 2, TAB_RIGHT | TAT_PRINTF, "%g",
- subc_list_double_at (&cmd.dl_contrast[i], count)
- );
+ tab_text_format (t, count + 2, i + 2, TAB_RIGHT, "%g",
+ subc_list_double_at (&cmd.dl_contrast[i], count));
}
}
_("Does not assume equal"));
}
- tab_text (t, 2, (v * lines_per_variable) + i + 1,
- TAB_CENTER | TAT_TITLE | TAT_PRINTF, "%d", i + 1);
+ tab_text_format (t, 2, (v * lines_per_variable) + i + 1,
+ TAB_CENTER | TAT_TITLE, "%d", i + 1);
- tab_text (t, 2, (v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
- TAB_CENTER | TAT_TITLE | TAT_PRINTF, "%d", i + 1);
+ tab_text_format (t, 2,
+ (v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
+ TAB_CENTER | TAT_TITLE, "%d", i + 1);
if ( bad_contrast[i])
if ( rank_specs[i].rfunc == NORMAL ||
rank_specs[i].rfunc == PROPORTION )
- tab_output_text (TAT_PRINTF,
- _("%s into %s(%s of %s using %s BY %s)"),
- var_get_name (src_vars[v]),
- var_get_name (rank_specs[i].destvars[v]),
- function_name[rank_specs[i].rfunc],
- var_get_name (src_vars[v]),
- fraction_name(),
- ds_cstr (&varlist)
- );
+ tab_output_text_format (0,
+ _("%s into %s(%s of %s using %s BY %s)"),
+ var_get_name (src_vars[v]),
+ var_get_name (rank_specs[i].destvars[v]),
+ function_name[rank_specs[i].rfunc],
+ var_get_name (src_vars[v]),
+ fraction_name(),
+ ds_cstr (&varlist));
else
- tab_output_text (TAT_PRINTF,
- _("%s into %s(%s of %s BY %s)"),
- var_get_name (src_vars[v]),
- var_get_name (rank_specs[i].destvars[v]),
- function_name[rank_specs[i].rfunc],
- var_get_name (src_vars[v]),
- ds_cstr (&varlist)
- );
+ tab_output_text_format (0,
+ _("%s into %s(%s of %s BY %s)"),
+ var_get_name (src_vars[v]),
+ var_get_name (rank_specs[i].destvars[v]),
+ function_name[rank_specs[i].rfunc],
+ var_get_name (src_vars[v]),
+ ds_cstr (&varlist));
ds_destroy (&varlist);
}
else
{
if ( rank_specs[i].rfunc == NORMAL ||
rank_specs[i].rfunc == PROPORTION )
- tab_output_text (TAT_PRINTF,
- _("%s into %s(%s of %s using %s)"),
- var_get_name (src_vars[v]),
- var_get_name (rank_specs[i].destvars[v]),
- function_name[rank_specs[i].rfunc],
- var_get_name (src_vars[v]),
- fraction_name()
- );
+ tab_output_text_format (0,
+ _("%s into %s(%s of %s using %s)"),
+ var_get_name (src_vars[v]),
+ var_get_name (rank_specs[i].destvars[v]),
+ function_name[rank_specs[i].rfunc],
+ var_get_name (src_vars[v]),
+ fraction_name());
else
- tab_output_text (TAT_PRINTF,
- _("%s into %s(%s of %s)"),
- var_get_name (src_vars[v]),
- var_get_name (rank_specs[i].destvars[v]),
- function_name[rank_specs[i].rfunc],
- var_get_name (src_vars[v])
- );
+ tab_output_text_format (0,
+ _("%s into %s(%s of %s)"),
+ var_get_name (src_vars[v]),
+ var_get_name (rank_specs[i].destvars[v]),
+ function_name[rank_specs[i].rfunc],
+ var_get_name (src_vars[v]));
}
}
}
/* Degrees of freedom */
- tab_text (t, 3, 1, TAB_RIGHT | TAT_PRINTF, "%g", c->dfm);
- tab_text (t, 3, 2, TAB_RIGHT | TAT_PRINTF, "%g", c->dfe);
- tab_text (t, 3, 3, TAB_RIGHT | TAT_PRINTF, "%g", c->dft);
+ tab_text_format (t, 3, 1, TAB_RIGHT, "%g", c->dfm);
+ tab_text_format (t, 3, 2, TAB_RIGHT, "%g", c->dfe);
+ tab_text_format (t, 3, 3, TAB_RIGHT, "%g", c->dft);
/* Mean Squares */
tab_double (t, 4, 1, TAB_RIGHT, msm, NULL);
tab_dim (tab, tab_natural_dimensions, NULL, NULL);
tab_flags (tab, SOMF_NO_TITLE );
- tab_text(tab, 0, 0, TAT_PRINTF, "Scale: %s", ds_cstr (&rel->scale_name));
+ tab_text_format (tab, 0, 0, 0, "Scale: %s", ds_cstr (&rel->scale_name));
tab_submit(tab);
}
tab_text (tbl, heading_columns, 0, TAB_CENTER | TAT_TITLE,
_("N"));
- tab_text (tbl, heading_columns + 1, 0, TAB_CENTER | TAT_TITLE | TAT_PRINTF,
- _("%%"));
+ tab_text (tbl, heading_columns + 1, 0, TAB_CENTER | TAT_TITLE, _("%"));
total = n_missing + n_valid;
tab_text (ssb->t, 0, i * 2 + 1, TAB_LEFT,
var_get_name (proc->vars[i]));
- tab_text (ssb->t, 1, i * 2 + 1, TAB_LEFT | TAT_PRINTF,
- "%s%s", prefix[0], val_lab[0]);
- tab_text (ssb->t, 1, i * 2 + 1+ 1, TAB_LEFT | TAT_PRINTF,
- "%s%s", prefix[1], val_lab[1]);
+ tab_text_format (ssb->t, 1, i * 2 + 1, TAB_LEFT,
+ "%s%s", prefix[0], val_lab[0]);
+ tab_text_format (ssb->t, 1, i * 2 + 1+ 1, TAB_LEFT,
+ "%s%s", prefix[1], val_lab[1]);
/* Fill in the group statistics */
for (count = 0; count < 2; count++)
struct pair *p = &proc->pairs[i];
int j;
- tab_text (ssb->t, 0, i * 2 + 1, TAB_LEFT | TAT_PRINTF, _("Pair %d"), i);
+ tab_text_format (ssb->t, 0, i * 2 + 1, TAB_LEFT, _("Pair %d"), i);
for (j=0; j < 2; j++)
{
/* Titles */
tab_text (self->t, 9, 2, TAB_CENTER | TAT_TITLE, _("Lower"));
tab_text (self->t, 10, 2, TAB_CENTER | TAT_TITLE, _("Upper"));
- tab_joint_text (self->t, 9, 1, 10, 1, TAB_CENTER | TAT_PRINTF,
- _("%g%% Confidence Interval of the Difference"),
- proc->criteria * 100.0);
+ tab_joint_text_format (self->t, 9, 1, 10, 1, TAB_CENTER,
+ _("%g%% Confidence Interval of the Difference"),
+ proc->criteria * 100.0);
}
/* Populate the independent samples trbox */
tab_hline (self->t, TAL_1, 5, 6, 2);
tab_vline (self->t, TAL_GAP, 6, 0, 1);
- tab_joint_text (self->t, 5, 1, 6, 1, TAB_CENTER | TAT_PRINTF,
- _("%g%% Confidence Interval of the Difference"),
- proc->criteria*100.0);
+ tab_joint_text_format (self->t, 5, 1, 6, 1, TAB_CENTER,
+ _("%g%% Confidence Interval of the Difference"),
+ proc->criteria*100.0);
tab_text (self->t, 2, 2, TAB_CENTER | TAT_TITLE, _("Mean"));
tab_text (self->t, 3, 2, TAB_CENTER | TAT_TITLE, _("Std. Deviation"));
double t;
double df = n - 1;
- tab_text (trb->t, 0, i + 3, TAB_LEFT | TAT_PRINTF, _("Pair %d"), i);
- tab_text (trb->t, 1, i + 3, TAB_LEFT | TAT_PRINTF, "%s - %s",
- var_get_name (pair->v[0]),
- var_get_name (pair->v[1]));
+ tab_text_format (trb->t, 0, i + 3, TAB_LEFT, _("Pair %d"), i);
+ tab_text_format (trb->t, 1, i + 3, TAB_LEFT, "%s - %s",
+ var_get_name (pair->v[0]),
+ var_get_name (pair->v[1]));
tab_double (trb->t, 2, i + 3, TAB_RIGHT, pair->mean_diff, NULL);
tab_double (trb->t, 3, i + 3, TAB_RIGHT, pair->std_dev_diff, NULL);
tab_hline (self->t, TAL_1, 1, hsize - 1, 1);
tab_vline (self->t, TAL_2, 1, 0, vsize - 1);
- tab_joint_text (self->t, 1, 0, hsize - 1, 0, TAB_CENTER | TAT_PRINTF,
- _("Test Value = %f"), proc->testval);
+ tab_joint_text_format (self->t, 1, 0, hsize - 1, 0, TAB_CENTER,
+ _("Test Value = %f"), proc->testval);
tab_box (self->t, -1, -1, -1, TAL_1, 1, 1, hsize - 1, vsize - 1);
- tab_joint_text (self->t, 5, 1, 6, 1, TAB_CENTER | TAT_PRINTF,
- _("%g%% Confidence Interval of the Difference"),
- proc->criteria * 100.0);
+ tab_joint_text_format (self->t, 5, 1, 6, 1, TAB_CENTER,
+ _("%g%% Confidence Interval of the Difference"),
+ proc->criteria * 100.0);
tab_vline (self->t, TAL_GAP, 6, 1, 1);
tab_hline (self->t, TAL_1, 5, 6, 2);
sqrt (1 - pow2 (pair->correlation)));
/* row headings */
- tab_text (table, 0, i + 1, TAB_LEFT | TAT_TITLE | TAT_PRINTF,
- _("Pair %d"), i);
- tab_text (table, 1, i + 1, TAB_LEFT | TAT_TITLE | TAT_PRINTF,
- _("%s & %s"),
- var_get_name (pair->v[0]),
- var_get_name (pair->v[1]));
+ tab_text_format (table, 0, i + 1, TAB_LEFT | TAT_TITLE,
+ _("Pair %d"), i);
+ tab_text_format (table, 1, i + 1, TAB_LEFT | TAT_TITLE,
+ _("%s & %s"),
+ var_get_name (pair->v[0]),
+ var_get_name (pair->v[1]));
/* row data */
tab_double (table, 2, i + 1, TAB_RIGHT, pair->n, &proc->weight_format);
}
}
-/* Formats text TEXT and arguments ARGS as indicated in OPT in
- TABLE's pool and returns the resultant string. */
-static struct substring
-text_format (struct tab_table *table, int opt, const char *text, va_list args)
-{
- assert (table != NULL && text != NULL);
-
- return ss_cstr (opt & TAT_PRINTF
- ? pool_vasprintf (table->container, text, args)
- : pool_strdup (table->container, text));
-}
-
/* Set the title of table T to TITLE, which is formatted as if
passed to printf(). */
void
}
-/* Sets cell (C,R) in TABLE, with options OPT, to have text value
- TEXT. */
-void
-tab_text (struct tab_table *table, int c, int r, unsigned opt, const char *text, ...)
+static void
+do_tab_text (struct tab_table *table, int c, int r, unsigned opt, char *text)
{
- va_list args;
-
- assert (table != NULL && text != NULL);
-
assert (c >= 0 );
assert (r >= 0 );
assert (c < tab_nc (table));
assert (r < tab_nr (table));
-
#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
|| c + table->col_ofs >= tab_nc (table)
}
#endif
- va_start (args, text);
- table->cc[c + r * table->cf] = text_format (table, opt, text, args);
+ table->cc[c + r * table->cf] = ss_cstr (text);
table->ct[c + r * table->cf] = opt;
- va_end (args);
}
-/* Joins cells (X1,X2)-(Y1,Y2) inclusive in TABLE, and sets them with
- options OPT to have text value TEXT. */
+/* Sets cell (C,R) in TABLE, with options OPT, to have text value
+ TEXT. */
void
-tab_joint_text (struct tab_table *table, int x1, int y1, int x2, int y2,
- unsigned opt, const char *text, ...)
+tab_text (struct tab_table *table, int c, int r, unsigned opt,
+ const char *text)
{
- struct tab_joined_cell *j;
+ do_tab_text (table, c, r, opt, pool_strdup (table->container, text));
+}
- assert (table != NULL && text != NULL);
+/* Sets cell (C,R) in TABLE, with options OPT, to have text value
+ FORMAT, which is formatted as if passed to printf. */
+void
+tab_text_format (struct tab_table *table, int c, int r, unsigned opt,
+ const char *format, ...)
+{
+ va_list args;
+
+ va_start (args, format);
+ do_tab_text (table, c, r, opt,
+ pool_vasprintf (table->container, format, args));
+ va_end (args);
+}
+
+static void
+do_tab_joint_text (struct tab_table *table, int x1, int y1, int x2, int y2,
+ unsigned opt, char *text)
+{
+ struct tab_joined_cell *j;
assert (x1 + table->col_ofs >= 0);
assert (y1 + table->row_ofs >= 0);
j->y1 = y1 + table->row_ofs;
j->x2 = ++x2 + table->col_ofs;
j->y2 = ++y2 + table->row_ofs;
-
- {
- va_list args;
-
- va_start (args, text);
- j->contents = text_format (table, opt, text, args);
- va_end (args);
- }
+ j->contents = ss_cstr (text);
opt |= TAB_JOIN;
}
}
+/* Joins cells (X1,X2)-(Y1,Y2) inclusive in TABLE, and sets them with
+ options OPT to have text value TEXT. */
+void
+tab_joint_text (struct tab_table *table, int x1, int y1, int x2, int y2,
+ unsigned opt, const char *text)
+{
+ do_tab_joint_text (table, x1, y1, x2, y2, opt,
+ pool_strdup (table->container, text));
+}
+
+/* Joins cells (X1,X2)-(Y1,Y2) inclusive in TABLE, and sets them
+ with options OPT to have text value FORMAT, which is formatted
+ as if passed to printf. */
+void
+tab_joint_text_format (struct tab_table *table, int x1, int y1, int x2, int y2,
+ unsigned opt, const char *format, ...)
+{
+ va_list args;
+
+ va_start (args, format);
+ do_tab_joint_text (table, x1, y1, x2, y2, opt,
+ pool_vasprintf (table->container, format, args));
+ va_end (args);
+}
+
/* Sets cell (C,R) in TABLE, with options OPT, to contents STRING. */
void
tab_raw (struct tab_table *table, int c, int r, unsigned opt,
r->h[0] = tab_natural_height (r, 0);
}
-/* Outputs text BUF as a table with a single cell having cell options
+static void
+do_tab_output_text (struct tab_table *t, int options, char *text)
+{
+ do_tab_text (t, 0, 0, options, text);
+ tab_flags (t, SOMF_NO_TITLE | SOMF_NO_SPACING);
+ tab_dim (t, options & TAT_NOWRAP ? nowrap_dim : wrap_dim, NULL, NULL);
+ tab_submit (t);
+}
+
+/* Outputs TEXT as a table with a single cell having cell options
OPTIONS, which is a combination of the TAB_* and TAT_*
- constants. */
+ constants. */
void
-tab_output_text (int options, const char *buf, ...)
+tab_output_text (int options, const char *text)
{
- struct tab_table *t = tab_create (1, 1, 0);
- char *tmp_buf = NULL;
-
- if (options & TAT_PRINTF)
- {
- va_list args;
+ struct tab_table *table = tab_create (1, 1, 0);
+ do_tab_output_text (table, options, pool_strdup (table->container, text));
+}
- va_start (args, buf);
- buf = tmp_buf = xvasprintf (buf, args);
- va_end (args);
- }
+/* Outputs FORMAT as a table with a single cell having cell
+ options OPTIONS, which is a combination of the TAB_* and TAT_*
+ constants. FORMAT is formatted as if it was passed through
+ printf. */
+void
+tab_output_text_format (int options, const char *format, ...)
+{
+ struct tab_table *table;
+ va_list args;
- 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, NULL, NULL);
- tab_submit (t);
+ table = tab_create (1, 1, 0);
- free (tmp_buf);
+ va_start (args, format);
+ do_tab_output_text (table, options,
+ pool_vasprintf (table->container, format, args));
+ va_end (args);
}
/* Set table flags to FLAGS. */
enum
{
TAT_NONE = 0, /* No options. */
- TAT_PRINTF = 0x0100, /* Format the text string with sprintf. */
TAT_TITLE = 0x0200 | TAB_EMPH, /* Title attributes. */
TAT_NOWRAP = 0x0800 /* No text wrap (tab_output_text() only). */
};
void tab_double (struct tab_table *, int c, int r, unsigned char opt,
double v, const struct fmt_spec *);
-void tab_text (struct tab_table *, int c, int r, unsigned opt,
- const char *, ...)
+void tab_text (struct tab_table *, int c, int r, unsigned opt, const char *);
+void tab_text_format (struct tab_table *, int c, int r, unsigned opt,
+ const char *, ...)
PRINTF_FORMAT (5, 6);
+
void tab_joint_text (struct tab_table *, int x1, int y1, int x2, int y2,
- unsigned opt, const char *, ...)
+ unsigned opt, const char *);
+void tab_joint_text_format (struct tab_table *, int x1, int y1, int x2, int y2,
+ unsigned opt, const char *, ...)
PRINTF_FORMAT (7, 8);
/* Cell low-level access. */
#define tab_col(TABLE) ((TABLE)->col_ofs)
/* Simple output. */
-void tab_output_text (int options, const char *string, ...)
+void tab_output_text (int options, const char *string);
+void tab_output_text_format (int options, const char *, ...)
PRINTF_FORMAT (2, 3);
#endif /* tab_h */