token: Update functional interface and add token_copy(), token_equal().
[pspp] / src / language / data-io / print.c
index 3b5541a3c3e68a62584f2a6ddb8373c2748f8b41..9e4d8a294dfee4c88d58f42f44c946df50ee189f 100644 (file)
@@ -40,6 +40,7 @@
 #include "libpspp/misc.h"
 #include "libpspp/pool.h"
 #include "libpspp/u8-line.h"
+#include "output/driver.h"
 #include "output/pivot-table.h"
 #include "output/table.h"
 #include "output/output-item.h"
@@ -174,7 +175,7 @@ internal_cmd_print (struct lexer *lexer, struct dataset *ds,
        {
          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);
@@ -562,9 +563,7 @@ print_text_flush_records (struct print_trns *trns, struct u8_line *line,
       *u8_line_reserve (line, 0, 1, 1) = leader;
 
       if (trns->writer == NULL)
-        output_item_submit (text_item_create (TEXT_ITEM_LOG,
-                                              ds_cstr (&line->s) + 1,
-                                              NULL));
+        output_log ("%s", ds_cstr (&line->s) + 1);
       else
         {
           size_t len = ds_length (&line->s);