pspp
9 months agoconverters maps work
Ben Pfaff [Wed, 2 Aug 2023 05:21:13 +0000 (22:21 -0700)]
converters maps work

9 months agowork
Ben Pfaff [Wed, 2 Aug 2023 01:20:25 +0000 (18:20 -0700)]
work

9 months agosack is fully implemented
Ben Pfaff [Tue, 1 Aug 2023 17:07:06 +0000 (10:07 -0700)]
sack is fully implemented

9 months agosack works
Ben Pfaff [Tue, 1 Aug 2023 05:05:29 +0000 (22:05 -0700)]
sack works

9 months agowork
Ben Pfaff [Mon, 31 Jul 2023 18:06:57 +0000 (11:06 -0700)]
work

9 months agowork
Ben Pfaff [Mon, 31 Jul 2023 17:53:58 +0000 (10:53 -0700)]
work

9 months agowork
Ben Pfaff [Mon, 31 Jul 2023 16:50:46 +0000 (09:50 -0700)]
work

9 months agoAdd file names and line numbers to error messages.
Ben Pfaff [Sun, 30 Jul 2023 15:27:30 +0000 (08:27 -0700)]
Add file names and line numbers to error messages.

9 months agoseparate sack integration test binary
Ben Pfaff [Sun, 30 Jul 2023 14:43:33 +0000 (07:43 -0700)]
separate sack integration test binary

9 months agofinish sack library
Ben Pfaff [Sat, 29 Jul 2023 23:26:22 +0000 (16:26 -0700)]
finish sack library

10 months agosack making progress!
Ben Pfaff [Sat, 29 Jul 2023 19:21:20 +0000 (12:21 -0700)]
sack making progress!

10 months agowork on testing
Ben Pfaff [Sat, 29 Jul 2023 16:17:48 +0000 (09:17 -0700)]
work on testing

10 months agoparse zlib header and trailer
Ben Pfaff [Sat, 29 Jul 2023 04:37:35 +0000 (21:37 -0700)]
parse zlib header and trailer

10 months agoput common state into struct
Ben Pfaff [Sat, 29 Jul 2023 04:28:36 +0000 (21:28 -0700)]
put common state into struct

10 months agoactually use the new state machine
Ben Pfaff [Sat, 29 Jul 2023 03:47:37 +0000 (20:47 -0700)]
actually use the new state machine

10 months agozlib-compressed data compiles
Ben Pfaff [Sat, 29 Jul 2023 03:12:48 +0000 (20:12 -0700)]
zlib-compressed data compiles

10 months agowork (zlib works?)
Ben Pfaff [Fri, 28 Jul 2023 20:19:45 +0000 (13:19 -0700)]
work (zlib works?)

10 months agowork
Ben Pfaff [Fri, 28 Jul 2023 13:38:56 +0000 (06:38 -0700)]
work

10 months agowork
Ben Pfaff [Thu, 27 Jul 2023 16:08:45 +0000 (09:08 -0700)]
work

10 months agowork
Ben Pfaff [Wed, 26 Jul 2023 06:07:57 +0000 (23:07 -0700)]
work

10 months agowork
Ben Pfaff [Wed, 26 Jul 2023 03:38:21 +0000 (20:38 -0700)]
work

10 months agowork
Ben Pfaff [Tue, 25 Jul 2023 05:58:30 +0000 (22:58 -0700)]
work

10 months agowork
Ben Pfaff [Tue, 25 Jul 2023 02:48:39 +0000 (19:48 -0700)]
work

10 months agowork
Ben Pfaff [Tue, 25 Jul 2023 00:34:56 +0000 (17:34 -0700)]
work

10 months agowork on rust
Ben Pfaff [Mon, 24 Jul 2023 16:02:56 +0000 (09:02 -0700)]
work on rust

10 months agomore library work
Ben Pfaff [Sun, 23 Jul 2023 23:00:04 +0000 (16:00 -0700)]
more library work

10 months agomore work on library
Ben Pfaff [Sun, 23 Jul 2023 22:25:27 +0000 (15:25 -0700)]
more work on library

10 months agoWork on system file library.
Ben Pfaff [Sun, 23 Jul 2023 21:19:26 +0000 (14:19 -0700)]
Work on system file library.

10 months agofeature complete
Ben Pfaff [Sun, 23 Jul 2023 18:12:35 +0000 (11:12 -0700)]
feature complete

10 months agoI think it's complete.
Ben Pfaff [Sun, 23 Jul 2023 05:48:28 +0000 (22:48 -0700)]
I think it's complete.

10 months agowork
Ben Pfaff [Sat, 22 Jul 2023 20:09:36 +0000 (13:09 -0700)]
work

13 months agorust
Ben Pfaff [Sun, 16 Apr 2023 23:38:50 +0000 (16:38 -0700)]
rust

14 months agowork on rust version of pspp-dump-sav
Ben Pfaff [Sun, 19 Mar 2023 00:50:19 +0000 (17:50 -0700)]
work on rust version of pspp-dump-sav

14 months agoMATRIX: Check format specifier on PRINT command.
Ben Pfaff [Sat, 18 Mar 2023 21:41:40 +0000 (14:41 -0700)]
MATRIX: Check format specifier on PRINT command.

Thanks to Youngseok Choi for reporting the bug.

14 months agolexer: Avoid reentering the lexer upon error in special cases.
Ben Pfaff [Sat, 18 Mar 2023 21:09:38 +0000 (14:09 -0700)]
lexer: Avoid reentering the lexer upon error in special cases.

Thanks to Youngseok Choi for reporting the bug.

14 months agolexer: Simplify lex_get_error().
Ben Pfaff [Sat, 18 Mar 2023 21:25:08 +0000 (14:25 -0700)]
lexer: Simplify lex_get_error().

14 months agolexer: Get rid of useless code in lex_get_error().
Ben Pfaff [Sat, 18 Mar 2023 20:55:40 +0000 (13:55 -0700)]
lexer: Get rid of useless code in lex_get_error().

This function ellipsized the syntax and then didn't do anything with the
result.

14 months agodata-out: Make binary output buffer big enough for a null terminator.
Ben Pfaff [Sat, 18 Mar 2023 19:34:39 +0000 (12:34 -0700)]
data-out: Make binary output buffer big enough for a null terminator.

The max width for binary output is 16, for P or PK format, plus there
needs to be room for a null terminator, for a total width of 17 bytes.
The buffer here was undersized at only 16 bytes.  This commit fixes the
problem.

Thanks to Youngseok Choi for reporting the bug.

14 months agoMATRIX: Fix multiplication of empty matrices.
Ben Pfaff [Sat, 18 Mar 2023 19:22:42 +0000 (12:22 -0700)]
MATRIX: Fix multiplication of empty matrices.

This crashed due to an assertion failure in blas before.
Thanks to Youngseok Choi for reporting the bug.

14 months agodoc: Improve documentation for GET DATA/TYPE=PSQL.
Ben Pfaff [Sat, 18 Mar 2023 19:10:07 +0000 (12:10 -0700)]
doc: Improve documentation for GET DATA/TYPE=PSQL.

Reported by Kent Nassen.

14 months agoEnsure that interactive output appears without a one-command delay.
Ben Pfaff [Sat, 18 Mar 2023 18:43:16 +0000 (11:43 -0700)]
Ensure that interactive output appears without a one-command delay.

When pspp was run in the text-based mode interactively, output for a given
command only appeared after the next command was read.  This fixes the
problem and adds a test.

Thanks to the anonymous reporter.

Bug #63910.

14 months agoFix typo in manual.
Ben Pfaff [Wed, 8 Mar 2023 01:30:09 +0000 (17:30 -0800)]
Fix typo in manual.

Reported by knassen@chartermi.net.

14 months agoCLOSE FILE HANDLE: Fix bugs and add test.
Ben Pfaff [Tue, 7 Mar 2023 20:37:39 +0000 (12:37 -0800)]
CLOSE FILE HANDLE: Fix bugs and add test.

In addition to the particular bug that was reported, there was a memory
leak.  This commit fixes both.

Reported by knassen@chartermi.net.

14 months agoSHOW: Implement SHOW ENVIRONMENT.
Ben Pfaff [Tue, 7 Mar 2023 05:16:37 +0000 (21:16 -0800)]
SHOW: Implement SHOW ENVIRONMENT.

Requested by knassen@chartermi.net.

14 months agoDATA LIST: Fix crash with a bare / at the end of the command.
Ben Pfaff [Tue, 7 Mar 2023 01:00:13 +0000 (17:00 -0800)]
DATA LIST: Fix crash with a bare / at the end of the command.

Embarrassingly, this was in an example from the manual.

Reported by knassen@chartermi.net.

14 months agocase-map: Make creating a case_map destroy the stage.
Ben Pfaff [Sun, 5 Mar 2023 19:14:45 +0000 (11:14 -0800)]
case-map: Make creating a case_map destroy the stage.

This fit the usage model in every case in practice.

14 months agodataset: Replace 'compactor' by a translating casewriter.
Ben Pfaff [Sun, 5 Mar 2023 19:08:00 +0000 (11:08 -0800)]
dataset: Replace 'compactor' by a translating casewriter.

14 months agocase-map: Identity map is only when there are no changes at all.
Ben Pfaff [Sun, 5 Mar 2023 19:07:38 +0000 (11:07 -0800)]
case-map: Identity map is only when there are no changes at all.

case_map_stage_get_case_map() called a mapping an identity map when no
data was reordered, which left the possibility that data was removed from
the end would be called an identity map.  This seems like a bad idea, so
this commit tightens the criteria.

This is a bigger than necessary change that also avoids per-variable
malloc()s that weren't really needed.

This might be a bug fix.  I haven't identified a particular bug that
it fixes.

14 months agocase-map: Optimize case_map_create_output_translator() for no-op case.
Ben Pfaff [Sun, 5 Mar 2023 19:04:29 +0000 (11:04 -0800)]
case-map: Optimize case_map_create_output_translator() for no-op case.

14 months agodictionary: Get rid of case indexes.
Ben Pfaff [Sun, 5 Mar 2023 06:26:03 +0000 (22:26 -0800)]
dictionary: Get rid of case indexes.

Dictionary index (the index into the variables in the dictionary)
and case index (the index into struct ccase for a variable from
the dictionary) have always been independent, but they are
*usually* the same.  It is much cleaner to have an invariant
that they are *always* the same.  This commit makes that the case.

14 months agodictionary: Short-circuit no-op case in dict_reorder_var().
Ben Pfaff [Sun, 5 Mar 2023 17:23:53 +0000 (09:23 -0800)]
dictionary: Short-circuit no-op case in dict_reorder_var().

14 months agodictionary: Always compact immediately upon deletion of a variable.
Ben Pfaff [Sun, 5 Mar 2023 03:06:12 +0000 (19:06 -0800)]
dictionary: Always compact immediately upon deletion of a variable.

With this change, the dictionary has a new invariant that the case_indexes
are always a permutation of [0,N) where N is the number of variables in
the dictionary.  Most commonly, the case_indexes are the same as the
dict_indexes, but reordering the dictionary can permute them.

14 months agopc+-file-reader: Drop unneeded struct member.
Ben Pfaff [Sat, 4 Mar 2023 16:31:29 +0000 (08:31 -0800)]
pc+-file-reader: Drop unneeded struct member.

14 months agodictionary: Get rid of "internal var" concept.
Ben Pfaff [Sat, 4 Mar 2023 02:45:00 +0000 (18:45 -0800)]
dictionary: Get rid of "internal var" concept.

It's nasty and doesn't conform to the usual invariants.

14 months agocase-map: Simplify case_map_stage_get_case_map().
Ben Pfaff [Sat, 4 Mar 2023 01:56:15 +0000 (17:56 -0800)]
case-map: Simplify case_map_stage_get_case_map().

A caseproto can't contain -1s anymore, so don't look for them.

14 months agocase-map: Remove buggy and unused case_map_clone().
Ben Pfaff [Sat, 4 Mar 2023 01:55:12 +0000 (17:55 -0800)]
case-map: Remove buggy and unused case_map_clone().

The xmemdup() in the implementation copied 'old->proto' to 'new->map',
which can't possibly work.  We could fix it but it wasn't used anyway.

14 months agodictionary: Get rid of next_value_idx.
Ben Pfaff [Sat, 4 Mar 2023 01:31:36 +0000 (17:31 -0800)]
dictionary: Get rid of next_value_idx.

At this point, it was always the number of variables in the dictionary.

14 months agocaseproto: Disallow -1 elements in caseprotos.
Ben Pfaff [Sat, 4 Mar 2023 00:49:33 +0000 (16:49 -0800)]
caseproto: Disallow -1 elements in caseprotos.

This is a stronger invariant that should make PSPP code easier to
understand.

It required updating dict_get_proto() to avoid intermediate stages in
which a -1 appeared as a width.

14 months agocaseproto: Allocate base struct and widths separately.
Ben Pfaff [Sat, 4 Mar 2023 00:43:52 +0000 (16:43 -0800)]
caseproto: Allocate base struct and widths separately.

This will allow constructing a caseproto from a passed-in array
without copying it.

14 months agodataset: Before deleting variables, make sure new values are added.
Ben Pfaff [Sat, 4 Mar 2023 00:43:59 +0000 (16:43 -0800)]
dataset: Before deleting variables, make sure new values are added.

This fixes a crash reported privately by knassen(at)chartermi.net.

14 months agocaseinit: Introduce new caseinit_translate_casereader_to_init_vars().
Ben Pfaff [Thu, 2 Mar 2023 22:25:30 +0000 (14:25 -0800)]
caseinit: Introduce new caseinit_translate_casereader_to_init_vars().

14 months agoMakefiles: Make a couple of targets build more quietly.
Ben Pfaff [Sun, 5 Mar 2023 17:24:30 +0000 (09:24 -0800)]
Makefiles: Make a couple of targets build more quietly.

14 months agocaseproto: Fix calculation in caseproto_reserve().
Ben Pfaff [Sat, 4 Mar 2023 00:32:24 +0000 (16:32 -0800)]
caseproto: Fix calculation in caseproto_reserve().

This reserved way too much in a lot of cases.

14 months agoDO REPEAT: Order PRINT output correctly.
Ben Pfaff [Thu, 2 Mar 2023 22:16:25 +0000 (14:16 -0800)]
DO REPEAT: Order PRINT output correctly.

This was printed in reverse order, although the commands were executed in
the correct order.

15 months agoUpdate README.
Ben Pfaff [Mon, 27 Feb 2023 18:00:48 +0000 (10:00 -0800)]
Update README.

The PSPP output subsystem is now pretty good and I don't think that it's
necessary to include it as future work anymore.

I haven't heard anything about OpenBSD in a while, so I don't think it's
necessary to list its tests as an explicit caveat.

These days I tend to prefer hearing bug reports via email.

15 months agoAdd support for variable sets in the system file format.
Ben Pfaff [Sun, 26 Feb 2023 01:48:46 +0000 (17:48 -0800)]
Add support for variable sets in the system file format.

Variable sets are primarily a GUI feature, but this commit doesn't
implement them in the GUI.

15 months agodictionary: Avoid name shadowing in dict_clone().
Ben Pfaff [Mon, 27 Feb 2023 04:26:44 +0000 (20:26 -0800)]
dictionary: Avoid name shadowing in dict_clone().

In this case, it wasn't a bug, but it was confusing.

15 months agoAvoid another possible null pointer dereference
John Darrington [Sun, 26 Feb 2023 10:21:24 +0000 (11:21 +0100)]
Avoid another possible null pointer dereference

* modified:   tests/output/tex-strings.c

15 months agoAvoid possible null pointer dereference
John Darrington [Sun, 26 Feb 2023 09:59:50 +0000 (10:59 +0100)]
Avoid possible null pointer dereference

* modified:   src/ui/gui/psppire-encoding-selector.c

15 months agotreewide: Use struct fmt_spec by value instead of pointer in most cases.
Ben Pfaff [Sun, 26 Feb 2023 00:51:00 +0000 (16:51 -0800)]
treewide: Use struct fmt_spec by value instead of pointer in most cases.

struct fmt_spec is a small struct, only 4 bytes in size.  It doesn't make
sense to pass it by pointer in most cases.  This commit makes that change
treewide.

15 months agopivot-table: Force width of weight formats to 40.
Ben Pfaff [Sat, 25 Feb 2023 03:01:15 +0000 (19:01 -0800)]
pivot-table: Force width of weight formats to 40.

It was too confusing when output tables contained **** because of weight
variables with narrow widths.

Recently reported by Andreas Hammer.  I've also noticed the same thing
myself.

15 months agodictionary: Make dict_get_weight_format() return by value, not pointer.
Ben Pfaff [Sat, 25 Feb 2023 02:46:48 +0000 (18:46 -0800)]
dictionary: Make dict_get_weight_format() return by value, not pointer.

This seems like a better interface.

15 months agoDISPLAY MACROS: New command.
Ben Pfaff [Tue, 21 Feb 2023 19:05:16 +0000 (11:05 -0800)]
DISPLAY MACROS: New command.

15 months agoDELETE VARIABLES: Fix bugs related to details of case compaction.
Ben Pfaff [Mon, 20 Feb 2023 22:56:34 +0000 (14:56 -0800)]
DELETE VARIABLES: Fix bugs related to details of case compaction.

We have to change AUTORECODE and RANK so that they don't add a
transformation, since transformations prevent DELETE VARIABLES.

Thanks to Frans Houweling for reporting the problem.

15 months agocase-map: New function case_map_clone().
Ben Pfaff [Tue, 21 Feb 2023 04:00:23 +0000 (20:00 -0800)]
case-map: New function case_map_clone().

This will acquire its first user in an upcoming commit.

15 months agocase-map: Use stateless translator in case_map_create_input_translator().
Ben Pfaff [Mon, 20 Feb 2023 23:50:28 +0000 (15:50 -0800)]
case-map: Use stateless translator in case_map_create_input_translator().

Case mapping isn't stateful, so this could be more efficient in some cases.

15 months agocasereader-translator: Add a class for casereader translators.
Ben Pfaff [Mon, 20 Feb 2023 23:47:52 +0000 (15:47 -0800)]
casereader-translator: Add a class for casereader translators.

This will make it easier to pass these around from one function to another.

15 months agodoc: Avoid using stdout in Makefile rule to generate .spv files.
Ben Pfaff [Tue, 21 Feb 2023 01:48:54 +0000 (17:48 -0800)]
doc: Avoid using stdout in Makefile rule to generate .spv files.

When pspp writes anything to stdout, also writing the .spv file to stdout
causes confusing corruption.  This avoids the problem.

15 months agozip-reader: Report corrupted Zip archives.
Ben Pfaff [Mon, 20 Feb 2023 20:01:16 +0000 (12:01 -0800)]
zip-reader: Report corrupted Zip archives.

15 months agotests: Fix ODR violations rather than ignoring them.
Ben Pfaff [Mon, 20 Feb 2023 20:00:42 +0000 (12:00 -0800)]
tests: Fix ODR violations rather than ignoring them.

15 months agoconfigure: Work around Gnulib warning with GCC 12.x.
Ben Pfaff [Mon, 20 Feb 2023 19:59:21 +0000 (11:59 -0800)]
configure: Work around Gnulib warning with GCC 12.x.

This keeps getting in my way.  I assume that either Gnulib or GCC will
eventually get fixed, so work around it for now.

15 months agoFix understanding of how long string variable missing values work.
Ben Pfaff [Mon, 20 Feb 2023 18:44:38 +0000 (10:44 -0800)]
Fix understanding of how long string variable missing values work.

Thanks to Andreas Hammer for reporting this bug at
https://lists.gnu.org/archive/html/pspp-users/2023-02/msg00000.html.

The data file that triggered this bug is ESS10SC.sav, available from
https://ess-search.nsd.no/en/study/172ac431-2a06-41df-9dab-c1fd8f3877e7

15 months agodictionary: Fix misuse of DC_* treewide.
Ben Pfaff [Mon, 20 Feb 2023 17:48:50 +0000 (09:48 -0800)]
dictionary: Fix misuse of DC_* treewide.

The DC_* constants are bit values, but some code was using them as shift
offsets.  This fixes the problem.

15 months agoCTABLES: Always show computed categories even if they'd be zeros.
Ben Pfaff [Sat, 18 Feb 2023 00:12:21 +0000 (16:12 -0800)]
CTABLES: Always show computed categories even if they'd be zeros.

With CATEGORIES EXCLUDE=YES, empty computed categories weren't shown.  This
seems counterintuitive, so this commit fixes it.

Thanks to Frans Houweling for reporting this bug.

15 months agoCTABLES: Don't force the look to include empty rows and columns.
Ben Pfaff [Fri, 17 Feb 2023 17:46:45 +0000 (09:46 -0800)]
CTABLES: Don't force the look to include empty rows and columns.

Frans Houweling said that it looked wrong, and I don't have a strong reason
to do it.

15 months agopivot-table: Honor blank variable labels.
Ben Pfaff [Fri, 17 Feb 2023 16:39:35 +0000 (08:39 -0800)]
pivot-table: Honor blank variable labels.

pivot_value_new_variable() ignored empty-string variable labels.  This
honors them.

Requested by Frans Houweling.

15 months agooutput: Link cairo and libxml2 against liboutput.
Ben Pfaff [Fri, 17 Feb 2023 00:22:27 +0000 (16:22 -0800)]
output: Link cairo and libxml2 against liboutput.

This is almost meaningless to me but the bug reporter said it fixed
something.

Bug #63606.
Thanks to Michael Orlitzky for reporting the bug.

15 months agoAGGREGATE: Fix crash with temporary transformations.
Ben Pfaff [Fri, 17 Feb 2023 00:17:42 +0000 (16:17 -0800)]
AGGREGATE: Fix crash with temporary transformations.

Thanks to Frans Houweling for reporting this bug at
https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-01/msg00004.html

15 months agodictionary: Fix invariant that no split file vars means SPLIT_NONE.
Ben Pfaff [Thu, 16 Feb 2023 23:59:45 +0000 (15:59 -0800)]
dictionary: Fix invariant that no split file vars means SPLIT_NONE.

Add SHOW SPLIT to enable testing.

Fixes a crash bug reported by Frans Houweling
at https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-01/msg00011.html

15 months agoCROSSTABS: Always cite all the dimensions if there are too many.
Ben Pfaff [Thu, 16 Feb 2023 23:24:05 +0000 (15:24 -0800)]
CROSSTABS: Always cite all the dimensions if there are too many.

Otherwise, 32-bit and 64-bit systems cite different sets of dimensions,
which makes the test output change between i386 and x86-64.

Thanks to Friedrich Beckmann for reporting this bug.
Bug #63797.

15 months agoCROSSTABS: Fix confidence interval display for risk estimate output.
Ben Pfaff [Thu, 16 Feb 2023 23:14:50 +0000 (15:14 -0800)]
CROSSTABS: Fix confidence interval display for risk estimate output.

Bug #63747.

15 months agopivot-table-test: Add paged PDF output too.
Ben Pfaff [Thu, 16 Feb 2023 22:19:34 +0000 (14:19 -0800)]
pivot-table-test: Add paged PDF output too.

15 months agorender: Fix spanned width distribution for cells not at top or left.
Ben Pfaff [Sun, 22 Jan 2023 20:32:59 +0000 (12:32 -0800)]
render: Fix spanned width distribution for cells not at top or left.

This code always used the widths of rules at the left or top side of the
table, even in cases where the spanned cells were not at the top of left
side of the table.  This obviously made the calculations wrong sometimes.

15 months agospv-writer: Use correct namespaces for pageSetup.
Ben Pfaff [Sat, 11 Feb 2023 17:20:46 +0000 (09:20 -0800)]
spv-writer: Use correct namespaces for pageSetup.

This turns out to be important.

15 months agooutput: Correctly define and properly implement column width ranges.
Ben Pfaff [Mon, 6 Feb 2023 16:17:28 +0000 (08:17 -0800)]
output: Correctly define and properly implement column width ranges.

I previously had the idea that SPV files had ranges for both column
widths and row heights, which didn't really make sense, since if
you fix the range of one of those you have to be flexible about the
other.  However, these settings actually control just column widths,
in two sets of columns: the columns for row headings and the columns
for column headings.  This implements those properly.

15 months agospv-driver: Add page_setup to output files and allow user to configure them.
Ben Pfaff [Fri, 10 Feb 2023 18:54:25 +0000 (10:54 -0800)]
spv-driver: Add page_setup to output files and allow user to configure them.

This seems better than what I see happening otherwise, which can be that
the default page_setup that SPSS Viewer picks is a ridiculous one, like a
postcard page size.

15 months agospv: Fix crash reading a page_setup without headings.
Ben Pfaff [Fri, 10 Feb 2023 18:53:06 +0000 (10:53 -0800)]
spv: Fix crash reading a page_setup without headings.

The SPV driver can output such a page_setup.

15 months agocairo: Fix crashes and bugs in 'setup' call.
Ben Pfaff [Fri, 10 Feb 2023 17:25:43 +0000 (09:25 -0800)]
cairo: Fix crashes and bugs in 'setup' call.

Changing the page_setup was not properly supported for PNG and SVG output,
because it assert-failed in xr_set_surface_size().  In addition, for all
kinds of output, it didn't account for margins properly in the page size.
This fixes the problem and unifies page setup between initial driver
creation and update.

This wasn't noticed before because output_set_page_setup() wasn't used
much, but it could be triggered with the pspp-output utility, converting
from an SPV file that contained a page_setup.  It will become more
important because an upcoming commit will cause the SPV driver to output
a page_setup every time.

15 months agooutput: Use page_setup for parsing cairo page setup.
Ben Pfaff [Wed, 8 Feb 2023 22:28:54 +0000 (14:28 -0800)]
output: Use page_setup for parsing cairo page setup.

This will make it easier to add page_setup support to the SPV driver.

15 months agooutput: Add null sentinel automatically to parse_enum() arguments.
Ben Pfaff [Wed, 8 Feb 2023 19:27:05 +0000 (11:27 -0800)]
output: Add null sentinel automatically to parse_enum() arguments.