X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fascii.c;h=f0be586dbd9277b69cee4af01471d2906c57c3ef;hb=7972d570c028fabe0d281f2aafbb9e4a8f797239;hp=7b888d06ec5e02886359742e9c039b976a30dce1;hpb=29917c4f5908454803e663d2ad78bca4bc35e805;p=pspp diff --git a/src/output/ascii.c b/src/output/ascii.c index 7b888d06ec..f0be586dbd 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -28,11 +28,8 @@ #include #ifdef HAVE_TERMIOS_H -# include -#endif - -#ifdef GWINSZ_IN_SYS_IOCTL # include +# include #endif #include "data/file-name.h" @@ -584,11 +581,9 @@ ascii_output_table_item_unref (struct ascii_driver *a, } static void -ascii_submit (struct output_driver *driver, - const struct output_item *item) +ascii_submit (struct output_driver *driver, const struct output_item *item) { struct ascii_driver *a = ascii_driver_cast (driver); - if (a->error) return; @@ -620,9 +615,8 @@ ascii_submit (struct output_driver *driver, case OUTPUT_ITEM_CHART: if (a->chart_file_name != NULL) { - char *file_name = xr_draw_png_chart (item->chart, a->chart_file_name, - ++a->chart_cnt, &a->fg, - &a->bg); + char *file_name = xr_draw_png_chart ( + item->chart, a->chart_file_name, ++a->chart_cnt, &a->fg, &a->bg); if (file_name != NULL) { struct output_item *text_item = text_item_create_nocopy ( @@ -647,13 +641,13 @@ ascii_submit (struct output_driver *driver, ascii_output_table_item_unref ( a, text_item_to_table_item ( message_item_to_text_item ( - output_item_ref (item)))); + output_item_ref (item)))); + break; + + case OUTPUT_ITEM_GROUP: break; - case OUTPUT_ITEM_GROUP_OPEN: - case OUTPUT_ITEM_GROUP_CLOSE: case OUTPUT_ITEM_PAGE_BREAK: - case OUTPUT_ITEM_PAGE_SETUP: break; } } @@ -665,10 +659,10 @@ const struct output_driver_factory list_driver_factory = static const struct output_driver_class ascii_driver_class = { - "text", - ascii_destroy, - ascii_submit, - ascii_flush, + .name = "text", + .destroy = ascii_destroy, + .submit = ascii_submit, + .flush = ascii_flush, }; static char *ascii_reserve (struct ascii_driver *, int y, int x0, int x1, @@ -1039,8 +1033,8 @@ ascii_test_write (struct output_driver *driver, .underline = underline, }; const struct pivot_value value = { - .type = PIVOT_VALUE_TEXT, .text = { + .type = PIVOT_VALUE_TEXT, .local = CONST_CAST (char *, s), .c = CONST_CAST (char *, s), .id = CONST_CAST (char *, s),