Fixed bugs which crept in with the variable encapsulation changes.
[pspp] / src / ui / terminal / msg-ui.c
index ddd927c58f1b31f4c746e704d0161a4c21ea66b6..9cbbf10f7998f0bbd541b3356e23bb136edfa072 100644 (file)
 #include "exit.h"
 #include "linebreak.h"
 
-#include <language/line-buffer.h>
+#include <libpspp/msg-locator.h>
+#include <libpspp/getl.h>
 #include <data/settings.h>
 #include <libpspp/message.h>
+#include <libpspp/str.h>
 #include <errno.h>
+#include <stdio.h>
+
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -49,7 +53,7 @@ msg_ui_set_error_file (const char *filename)
 }
 
 void
-msg_ui_init (void
+msg_ui_init (struct source_stream *ss
 {
   msg_file = stdout;
 
@@ -65,25 +69,25 @@ msg_ui_init (void)
          msg_file = stdout;
        }
     }
-  msg_init (handle_msg, get_msg_location);
+  msg_init (ss, handle_msg);
 }
 
 void
 msg_ui_done (void) 
 {
   msg_done ();
+  msg_locator_done ();
   
   if ( msg_file ) /* FIXME: do we really want to close stdout ?? */
     fclose (msg_file);
 }
 
-
 /* Checks whether we've had so many errors that it's time to quit
    processing this syntax file. */
 void
-check_msg_count (void)
+check_msg_count (struct source_stream *ss)
 {
-  if (!getl_is_interactive ()) 
+  if (!getl_is_interactive (ss)) 
     {
       if (get_errorbreak () && error_count)
         msg (MN, _("Terminating execution of syntax file due to error."));
@@ -96,7 +100,7 @@ check_msg_count (void)
       else
         return;
 
-      getl_abort_noninteractive (); 
+      getl_abort_noninteractive (ss); 
     }
 }