X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fdriver-provider.h;h=ffa483b4618db20297b00cde88a40aa47d9b1a12;hb=9d4b6c71c0cd089bb94296fab50a703735b89ccd;hp=df31637379b070cf3c5ddf5b90c4f9948f1f4b91;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp diff --git a/src/output/driver-provider.h b/src/output/driver-provider.h index df31637379..ffa483b461 100644 --- a/src/output/driver-provider.h +++ b/src/output/driver-provider.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2012, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,11 @@ #include "output/driver.h" struct output_item; +struct output_iterator; struct string_map; +struct file_handle; +struct page_setup; +struct driver_options; /* A configured output driver. */ struct output_driver @@ -34,13 +38,12 @@ struct output_driver enum settings_output_devices device_type; /* One of SETTINGS_DEVICE_*. */ }; -void output_driver_init (struct output_driver *, - const struct output_driver_class *, - const char *name, enum settings_output_devices); void output_driver_destroy (struct output_driver *); const char *output_driver_get_name (const struct output_driver *); +char *output_driver_substitute_heading_vars (const char *, int page_number); + /* One kind of output driver. Output driver implementations must not call msg() to report errors. This @@ -61,6 +64,10 @@ struct output_driver_class void (*submit) (struct output_driver *driver, const struct output_item *item); + /* Changes DRIVER's output page setup to PS, if possible. This may be NUL + if the driver doesn't support page setup. */ + void (*setup) (struct output_driver *driver, const struct page_setup *ps); + /* Ensures that any output items passed to the 'submit' function for DRIVER have actually been displayed. @@ -69,17 +76,30 @@ struct output_driver_class it doesn't make sense for DRIVER to be used this way, then this function need not do anything. */ void (*flush) (struct output_driver *driver); + + /* Ordinarily, the core driver code will skip passing hidden output items + to 'submit'. If this member is true, the core driver hands them to the + driver to let it handle them itself. */ + bool handles_show; + + /* Ordinarily, the core driver code will flatten groups of output items + before passing them to 'submit'. If this member is true, the core + driver code leaves them in place for the driver to handle. */ + bool handles_groups; }; -/* Useful for output driver implementation. */ -void output_driver_track_current_command (const struct output_item *, char **); - /* An abstract way for the output subsystem to create an output driver. */ struct output_driver_factory { /* The file extension, without the leading dot, e.g. "pdf". */ const char *extension; + /* The default file name, including extension. + + If this is "-", that implies that by default output will be directed to + stdout. */ + const char *default_file_name; + /* Creates a new output driver of this class. NAME and TYPE should be passed directly to output_driver_init. Returns the new output driver if successful, otherwise a null pointer. @@ -92,10 +112,9 @@ struct output_driver_factory The returned driver should not have been registered (with output_driver_register). The caller will register the driver (if this is desirable). */ - struct output_driver *(*create) (const char *name, + struct output_driver *(*create) (struct file_handle *, enum settings_output_devices type, - struct string_map *options); + struct driver_options *); }; - #endif /* output/driver-provider.h */