X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fprint.c;h=34042aa83022640997faf985d6e6b499bdca946a;hb=2cf38ce51a9f34961d68a75e0b312a591b5c9abf;hp=edbe2fae9948e9d85a697c91ad0baecbf98b7d6a;hpb=d0371553a98cd169353bf6d211e375e5ffc3a3bd;p=pspp-builds.git diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index edbe2fae..34042aa8 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -1,5 +1,5 @@ /* 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 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -288,7 +289,8 @@ parse_string_argument (struct lexer *lexer, struct print_trns *trns, int record, int first_column, last_column; bool range_specified; - if (!parse_column_range (lexer, &first_column, &last_column, &range_specified)) + if (!parse_column_range (lexer, 1, + &first_column, &last_column, &range_specified)) return false; spec->first_column = first_column; @@ -402,7 +404,7 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) 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) { @@ -411,8 +413,9 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) 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: @@ -424,9 +427,9 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) 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++; } @@ -448,7 +451,7 @@ static void flush_records (struct print_trns *, int target_record, /* Performs the transformation inside print_trns T on case C. */ static int -print_trns_proc (void *trns_, struct ccase *c, casenumber case_num UNUSED) +print_trns_proc (void *trns_, struct ccase **c, casenumber case_num UNUSED) { struct print_trns *trns = trns_; bool eject = trns->eject; @@ -465,7 +468,7 @@ print_trns_proc (void *trns_, struct ccase *c, casenumber case_num UNUSED) ds_set_length (&trns->line, spec->first_column, encoded_space); if (spec->type == PRT_VAR) { - const union value *input = case_data (c, spec->var); + const union value *input = case_data (*c, spec->var); char *output = ds_put_uninit (&trns->line, spec->format.w); if (!spec->sysmis_as_spaces || input->f != SYSMIS) data_out_legacy (input, trns->encoding, &spec->format, output);