Use the 32x32 icon set for the toolbar.
[pspp] / src / ui / terminal / terminal-reader.c
index f3ea80b808a4c66d29690a764b64360a2d58f9d0..2d72acf39cddbe654555e3525edc582a3f9b00b3 100644 (file)
@@ -20,6 +20,8 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdbool.h>
+#include <stdio.h>
+
 
 #if HAVE_READLINE
 #include <readline/readline.h>
@@ -40,6 +42,9 @@ static int rl_end;
 
 
 #include "ui/terminal/terminal-reader.h"
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/types.h>
 
 #include <assert.h>
 #include <errno.h>
@@ -102,6 +107,14 @@ terminal_reader_cast (struct lex_reader *r)
   return UP_CAST (r, struct terminal_reader, reader);
 }
 
+/* 
+   Older libreadline versions do not provide rl_outstream.
+   However, it is almost always going to be the same as stdout.
+ */
+#if HAVE_RL_OUTSTREAM
+# define rl_outstream stdout
+#endif
+
 static size_t
 terminal_reader_read (struct lex_reader *r_, char *buf, size_t n,
                       enum prompt_style prompt_style)
@@ -172,7 +185,7 @@ terminal_reader_create (void)
   r = xzalloc (sizeof *r);
   r->reader.class = &terminal_reader_class;
   r->reader.syntax = LEX_SYNTAX_INTERACTIVE;
-  r->reader.error = LEX_ERROR_INTERACTIVE;
+  r->reader.error = LEX_ERROR_TERMINAL;
   r->reader.file_name = NULL;
   r->s = ss_empty ();
   r->offset = 0;