X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fdriver.c;h=0da3e6a0f6549b6fb6f3dd99edf19c7c6ffb884b;hb=f9d59ffdc8ff71ac4093a9b32f4ddb96653f2307;hp=203644584f162eade6f30663c26ffaa81625d58d;hpb=d0b91eae59319ab2756d0d43b9cb15eb9cd3c234;p=pspp-builds.git diff --git a/src/output/driver.c b/src/output/driver.c index 20364458..0da3e6a0 100644 --- a/src/output/driver.c +++ b/src/output/driver.c @@ -50,9 +50,6 @@ static const struct output_driver_factory *factories[]; /* Drivers currently registered with output_driver_register(). */ static struct llx_list drivers = LLX_INITIALIZER (drivers); -static struct output_item *deferred_syntax; -static bool in_command; - void output_close (void) { @@ -72,8 +69,10 @@ output_get_supported_formats (struct string_set *formats) string_set_insert (formats, (*fp)->extension); } -static void -output_submit__ (struct output_item *item) +/* Submits ITEM to the configured output drivers, and transfers ownership to + the output subsystem. */ +void +output_submit (struct output_item *item) { struct llx *llx, *next; @@ -105,53 +104,6 @@ output_submit__ (struct output_item *item) output_item_unref (item); } -static void -flush_deferred_syntax (void) -{ - if (deferred_syntax != NULL) - { - output_submit__ (deferred_syntax); - deferred_syntax = NULL; - } -} - -/* Submits ITEM to the configured output drivers, and transfers ownership to - the output subsystem. */ -void -output_submit (struct output_item *item) -{ - if (is_text_item (item)) - { - struct text_item *text = to_text_item (item); - switch (text_item_get_type (text)) - { - case TEXT_ITEM_SYNTAX: - if (!in_command) - { - flush_deferred_syntax (); - deferred_syntax = item; - return; - } - break; - - case TEXT_ITEM_COMMAND_OPEN: - output_submit__ (item); - flush_deferred_syntax (); - in_command = true; - return; - - case TEXT_ITEM_COMMAND_CLOSE: - in_command = false; - break; - - default: - break; - } - } - - output_submit__ (item); -} - /* Flushes output to screen devices, so that the user can see output that doesn't fill up an entire page. */ void @@ -246,8 +198,10 @@ output_driver_track_current_command (const struct output_item *output_item, extern const struct output_driver_factory txt_driver_factory; extern const struct output_driver_factory list_driver_factory; extern const struct output_driver_factory html_driver_factory; -extern const struct output_driver_factory odt_driver_factory; extern const struct output_driver_factory csv_driver_factory; +#ifdef ODT_SUPPORT +extern const struct output_driver_factory odt_driver_factory; +#endif #ifdef HAVE_CAIRO extern const struct output_driver_factory pdf_driver_factory; extern const struct output_driver_factory ps_driver_factory; @@ -259,8 +213,10 @@ static const struct output_driver_factory *factories[] = &txt_driver_factory, &list_driver_factory, &html_driver_factory, - &odt_driver_factory, &csv_driver_factory, +#ifdef ODT_SUPPORT + &odt_driver_factory, +#endif #ifdef HAVE_CAIRO &pdf_driver_factory, &ps_driver_factory, @@ -323,8 +279,9 @@ output_driver_create (struct string_map *options) device_type = SETTINGS_DEVICE_LISTING; else { + /* TRANSLATORS: Don't translate the words `terminal' or `listing'. */ error (0, 0, _("%s is not a valid device type (the choices are " - "\"terminal\" and \"listing\")"), device_string); + "`terminal' and `listing')"), device_string); device_type = default_device_type (file_name); } @@ -336,7 +293,7 @@ output_driver_create (struct string_map *options) const char *key; STRING_MAP_FOR_EACH_KEY (key, node, options) - error (0, 0, _("%s: unknown option \"%s\""), file_name, key); + error (0, 0, _("%s: unknown option `%s'"), file_name, key); } string_map_clear (options);