X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fterminal%2Fmsg-ui.c;h=9cbbf10f7998f0bbd541b3356e23bb136edfa072;hb=df8347af23172430e5b37b1ae0ad67b41245e191;hp=7d5cf72f84ff89fb689136ad820eb68c96477106;hpb=f5574c6264163859a8eb94ab1e33bcc1b61fce5f;p=pspp diff --git a/src/ui/terminal/msg-ui.c b/src/ui/terminal/msg-ui.c index 7d5cf72f84..9cbbf10f79 100644 --- a/src/ui/terminal/msg-ui.c +++ b/src/ui/terminal/msg-ui.c @@ -24,10 +24,14 @@ #include "exit.h" #include "linebreak.h" -#include +#include +#include #include #include +#include #include +#include + #include "gettext.h" #define _(msgid) gettext (msgid) @@ -40,7 +44,7 @@ static const char *error_file; static void handle_msg (const struct msg *); -static FILE *msg_file; +static FILE *msg_file ; void msg_ui_set_error_file (const char *filename) @@ -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,23 +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 (); - fclose (msg_file); + 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.")); @@ -94,7 +100,7 @@ check_msg_count (void) else return; - getl_abort_noninteractive (); + getl_abort_noninteractive (ss); } }