X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fmessage.c;h=80ddef88691169f3913ef1b09202a07d47c483c1;hb=0a20082e28caaaf1122510d992e1c6dce755ad0e;hp=1a4601fc18981b55bf3ed9f1422b1478d872e8ac;hpb=8e018d25310cb53e5339b46e95f0abe02db83782;p=pspp diff --git a/src/libpspp/message.c b/src/libpspp/message.c index 1a4601fc18..80ddef8869 100644 --- a/src/libpspp/message.c +++ b/src/libpspp/message.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -19,7 +18,8 @@ #include -#include +#include "message.h" +#include "msg-locator.h" #include #include @@ -39,8 +39,6 @@ static char *command_name; /* Message handler as set by msg_init(). */ static void (*msg_handler) (const struct msg *); -static void (*msg_location) (struct msg_locator *); - /* Disables emitting messages if positive. */ static int messages_disabled; @@ -64,12 +62,13 @@ msg (enum msg_class class, const char *format, ...) msg_emit (&m); } +static struct source_stream *s_stream; + void -msg_init ( void (*handler) (const struct msg *), - void (*location) (struct msg_locator *) ) +msg_init (struct source_stream *ss, void (*handler) (const struct msg *) ) { + s_stream = ss; msg_handler = handler; - msg_location = location; } void @@ -102,7 +101,7 @@ msg_destroy(struct msg *m) void msg_emit (struct msg *m) { - msg_location (&m->where); + get_msg_location (s_stream, &m->where); if (!messages_disabled) msg_handler (m); free (m->text);