#include "language/expressions/public.h"
#include "language/lexer/lexer.h"
#include "libpspp/message.h"
-#include "output/output-item.h"
+#include "output/driver.h"
#include "gl/xalloc.h"
while (n--)
if (trns->writer == NULL)
- output_item_submit (text_item_create (TEXT_ITEM_LOG, "", NULL));
+ output_log ("%s", "");
else
dfm_put_record (trns->writer, " ", 1); /* XXX */
#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"
*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);
if (!lex_force_string (lexer))
return CMD_FAILURE;
- output_submit (text_item_create (TEXT_ITEM_LOG, lex_tokcstr (lexer),
- _("Echo")));
+ output_log ("%s", lex_tokcstr (lexer));
lex_get (lexer);
return CMD_SUCCESS;
#include "libpspp/str.h"
#include "libpspp/string-array.h"
#include "libpspp/temp-file.h"
-#include "output/output-item.h"
+#include "output/driver.h"
#include "gl/error.h"
#include "gl/intprops.h"
if (end > output && end[-1] == '\n')
end[-1] = '\0';
- output_item_submit (text_item_create_nocopy (TEXT_ITEM_LOG, output,
- xstrdup (_("Host Output"))));
+ output_log ("%s", output);
}
free (locale_output);
#include <ctype.h>
#include <errno.h>
#include <limits.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "gl/error.h"
#include "gl/xalloc.h"
#include "gl/xmemdup0.h"
+#include "gl/xvasprintf.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
page_title, NULL));
}
+void PRINTF_FORMAT (1, 2)
+output_log (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ char *s = xvasprintf (format, args);
+ va_end (args);
+
+ output_submit (text_item_create_nocopy (TEXT_ITEM_LOG, s, NULL));
+}
+
void
output_set_title (const char *title)
{
#include <stdbool.h>
#include <stddef.h>
+#include "libpspp/compiler.h"
struct output_item;
struct string_set;
void output_submit (struct output_item *);
void output_flush (void);
+void output_log (const char *, ...) PRINTF_FORMAT (1, 2);
+
void output_set_title (const char *);
void output_set_subtitle (const char *);
void output_set_filename (const char *);