projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
READ negative tests
[pspp]
/
src
/
language
/
data-io
/
print.c
diff --git
a/src/language/data-io/print.c
b/src/language/data-io/print.c
index 4545a222df0c5f01ae350446d423ac3eafee0bc7..c0fc3d84f115bfbeebcb761ad880ab2ab16b1f33 100644
(file)
--- a/
src/language/data-io/print.c
+++ b/
src/language/data-io/print.c
@@
-40,9
+40,10
@@
#include "libpspp/misc.h"
#include "libpspp/pool.h"
#include "libpspp/u8-line.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
#include "libpspp/u8-line.h"
+#include "output/driver.h"
#include "output/pivot-table.h"
#include "output/pivot-table.h"
-#include "output/tab.h"
-#include "output/
tex
t-item.h"
+#include "output/tab
le
.h"
+#include "output/
outpu
t-item.h"
#include "gl/xalloc.h"
#include "gl/xalloc.h"
@@
-174,7
+175,7
@@
internal_cmd_print (struct lexer *lexer, struct dataset *ds,
{
lex_match (lexer, T_EQUALS);
lex_match (lexer, T_LPAREN);
{
lex_match (lexer, T_EQUALS);
lex_match (lexer, T_LPAREN);
- if (!lex_force_int
(lexer
))
+ if (!lex_force_int
_range (lexer, "RECORDS", 0, INT_MAX
))
goto error;
trns->record_cnt = lex_integer (lexer);
lex_get (lexer);
goto error;
trns->record_cnt = lex_integer (lexer);
lex_get (lexer);
@@
-450,7
+451,7
@@
dump_table (struct print_trns *trns)
pivot_value_new_integer (spec->record));
int last_column = spec->first_column + spec->format.w - 1;
pivot_table_put2 (table, 1, row, pivot_value_new_user_text_nocopy (
pivot_value_new_integer (spec->record));
int last_column = spec->first_column + spec->format.w - 1;
pivot_table_put2 (table, 1, row, pivot_value_new_user_text_nocopy (
- xasprintf ("%
3d-%3
d",
+ xasprintf ("%
d-%
d",
spec->first_column, last_column)));
char fmt_string[FMT_STRING_LEN_MAX + 1];
spec->first_column, last_column)));
char fmt_string[FMT_STRING_LEN_MAX + 1];
@@
-504,7
+505,7
@@
print_text_trns_proc (void *trns_, struct ccase **c,
char *s;
s = data_out (input, var_get_encoding (spec->var),
char *s;
s = data_out (input, var_get_encoding (spec->var),
- &spec->format);
+ &spec->format
, settings_get_fmt_settings ()
);
len = strlen (s);
width = u8_width (CHAR_CAST (const uint8_t *, s), len, UTF8);
x1 = x0 + width;
len = strlen (s);
width = u8_width (CHAR_CAST (const uint8_t *, s), len, UTF8);
x1 = x0 + width;
@@
-555,14
+556,14
@@
print_text_flush_records (struct print_trns *trns, struct u8_line *line,
{
*eject = false;
if (trns->writer == NULL)
{
*eject = false;
if (trns->writer == NULL)
-
text_item_submit (text_item_create (TEXT_ITEM_EJECT_PAGE, ""
));
+
output_item_submit (page_break_item_create (
));
else
leader = '1';
}
*u8_line_reserve (line, 0, 1, 1) = leader;
if (trns->writer == NULL)
else
leader = '1';
}
*u8_line_reserve (line, 0, 1, 1) = leader;
if (trns->writer == NULL)
-
tab_output_text (TAB_FIX
, ds_cstr (&line->s) + 1);
+
output_log ("%s"
, ds_cstr (&line->s) + 1);
else
{
size_t len = ds_length (&line->s);
else
{
size_t len = ds_length (&line->s);
@@
-574,14
+575,7
@@
print_text_flush_records (struct print_trns *trns, struct u8_line *line,
len--;
}
len--;
}
- if (is_encoding_utf8 (trns->encoding))
- dfm_put_record (trns->writer, s, len);
- else
- {
- char *recoded = recode_string (trns->encoding, UTF8, s, len);
- dfm_put_record (trns->writer, recoded, strlen (recoded));
- free (recoded);
- }
+ dfm_put_record_utf8 (trns->writer, s, len);
}
}
}
}
}
}
@@
-616,7
+610,8
@@
print_binary_trns_proc (void *trns_, struct ccase **c,
const union value *input = case_data (*c, spec->var);
if (!spec->sysmis_as_spaces || input->f != SYSMIS)
data_out_recode (input, var_get_encoding (spec->var),
const union value *input = case_data (*c, spec->var);
if (!spec->sysmis_as_spaces || input->f != SYSMIS)
data_out_recode (input, var_get_encoding (spec->var),
- &spec->format, &line, trns->encoding);
+ &spec->format, settings_get_fmt_settings (),
+ &line, trns->encoding);
else
ds_put_byte_multiple (&line, encoded_space, spec->format.w);
if (spec->add_space)
else
ds_put_byte_multiple (&line, encoded_space, spec->format.w);
if (spec->add_space)