X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fmsglog.c;h=7fe6555f19dc4acc8f0d16ff3812392f5d9fbbd9;hb=78a43b3fd07c601dea27f0568727f515d39a2153;hp=9b606b4f18f1bde7cfdb478eac1bb3985334c7cb;hpb=f4bd801640ccaf1d41f45e0206e01e71d3e18604;p=pspp diff --git a/src/output/msglog.c b/src/output/msglog.c index 9b606b4f18..7fe6555f19 100644 --- a/src/output/msglog.c +++ b/src/output/msglog.c @@ -29,7 +29,7 @@ #include "libpspp/cast.h" #include "libpspp/message.h" #include "output/driver-provider.h" -#include "output/message-item.h" +#include "output/output-item.h" #include "gl/fwriteerror.h" #include "gl/xalloc.h" @@ -98,11 +98,9 @@ msglog_submit (struct output_driver *driver, const struct output_item *item) { struct msglog_driver *ml = msglog_driver_cast (driver); - if (is_message_item (item)) + if (item->type == OUTPUT_ITEM_MESSAGE) { - const struct message_item *message_item = to_message_item (item); - const struct msg *msg = message_item_get_msg (message_item); - char *s = msg_to_string (msg, message_item->command_name); + char *s = msg_to_string (item->message); fprintf (ml->file, "%s\n", s); free (s); } @@ -110,8 +108,7 @@ msglog_submit (struct output_driver *driver, const struct output_item *item) static const struct output_driver_class msglog_class = { - "msglog", - msglog_destroy, - msglog_submit, - NULL + .name = "msglog", + .destroy = msglog_destroy, + .submit = msglog_submit, };