X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fmessage.c;h=80ddef88691169f3913ef1b09202a07d47c483c1;hb=0a20082e28caaaf1122510d992e1c6dce755ad0e;hp=24bb8e874ba10d77dd29cf76e168af795cfaee8a;hpb=2d4dd90964061defa92972156ae2a12323708519;p=pspp diff --git a/src/libpspp/message.c b/src/libpspp/message.c index 24bb8e874b..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 @@ -63,9 +62,12 @@ 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 *) ) +msg_init (struct source_stream *ss, void (*handler) (const struct msg *) ) { + s_stream = ss; msg_handler = handler; } @@ -99,7 +101,7 @@ msg_destroy(struct msg *m) void msg_emit (struct msg *m) { - get_msg_location (&m->where); + get_msg_location (s_stream, &m->where); if (!messages_disabled) msg_handler (m); free (m->text);