pspp
13 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.

14 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.

14 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.

14 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.

14 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

14 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

14 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.

14 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.

14 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.

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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

14 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

14 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.

14 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.

14 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.

14 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.

15 months agooutput: Refactor driver options to avoid so much copying.
Ben Pfaff [Wed, 8 Feb 2023 19:21:10 +0000 (11:21 -0800)]
output: Refactor driver options to avoid so much copying.

15 months agooutput: Modernize how drivers are initialized.
Ben Pfaff [Mon, 6 Feb 2023 16:17:45 +0000 (08:17 -0800)]
output: Modernize how drivers are initialized.

15 months agoascii: Improve look of dashed line ends.
Ben Pfaff [Sat, 28 Jan 2023 18:16:25 +0000 (10:16 -0800)]
ascii: Improve look of dashed line ends.

Until now, partial ends of horizontal dashed lines were rendered as
U+2574 BOX DRAWINGS LIGHT LEFT and U+2576 BOX DRAWINGS LIGHT RIGHT,
which are solid lines.  This looks funny at the end of a dashed line,
especially in some fonts.  This commit changes these ends to
U+254C BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL, which does extend all the
way across the character cell but looks much better.

15 months agopivot-output: When there's no dimension border, use the category border.
Ben Pfaff [Sat, 28 Jan 2023 18:02:37 +0000 (10:02 -0800)]
pivot-output: When there's no dimension border, use the category border.

This is compatible behavior.

15 months agopivot-table: Add more tests for category and dimension borders.
Ben Pfaff [Sat, 28 Jan 2023 17:46:32 +0000 (09:46 -0800)]
pivot-table: Add more tests for category and dimension borders.

15 months agooutput: Add debugging code to rendering and table code.
Ben Pfaff [Sun, 22 Jan 2023 20:39:11 +0000 (12:39 -0800)]
output: Add debugging code to rendering and table code.

15 months agotable: Make debug code unconditional.
Ben Pfaff [Sun, 22 Jan 2023 18:41:03 +0000 (10:41 -0800)]
table: Make debug code unconditional.

The debugging code in table_vline() and table_hline() was in practice
always enabled, but because of the way it was written each of the tests
was being re-tested in an assertion.  It seems better to just enable it
all the time and avoid duplication.

15 months agorender: Fix typo in comment.
Ben Pfaff [Sun, 22 Jan 2023 18:12:11 +0000 (10:12 -0800)]
render: Fix typo in comment.

15 months agopivot-table: Fix buffer overflow in corner case in pivot_table_dump().
Ben Pfaff [Fri, 27 Jan 2023 19:43:00 +0000 (11:43 -0800)]
pivot-table: Fix buffer overflow in corner case in pivot_table_dump().

Dumping a table with a layer dimension that has no leaves read from an
invalid pointer.  This fixes the problem.  This functionality isn't used
in PSPP, only by "pspp-output dump".

15 months agopivot-table: Fix buffer overflow in pivot_table_dump() in corner case.
Ben Pfaff [Fri, 27 Jan 2023 02:35:38 +0000 (18:35 -0800)]
pivot-table: Fix buffer overflow in pivot_table_dump() in corner case.

This occurred when categories were more deeply nested into groups than
there were leaf categories.  This functionality isn't used in PSPP, only
by "pspp-output dump".

15 months agotable: Fix use of uninitialized data.
Ben Pfaff [Mon, 16 Jan 2023 17:54:30 +0000 (09:54 -0800)]
table: Fix use of uninitialized data.

Fixes: 62a04ffbf5aa ("output: Combine color and stroke into table_border_style.")
15 months agoCTABLES: Avoid uninitialized variable warning in some GCC versions.
Ben Pfaff [Mon, 16 Jan 2023 16:50:07 +0000 (08:50 -0800)]
CTABLES: Avoid uninitialized variable warning in some GCC versions.

15 months agooutput: Combine color and stroke into table_border_style.
Ben Pfaff [Sun, 15 Jan 2023 18:05:03 +0000 (10:05 -0800)]
output: Combine color and stroke into table_border_style.

Rules in tables have a line style (stroke) and a color.  Until now, these
have been mostly maintained separately.  This commit combines them in most
places.

15 months agorender: Get rid of RENDER_LINE_* in favor of similar TABLE_STROKE_*.
Ben Pfaff [Sun, 15 Jan 2023 17:28:08 +0000 (09:28 -0800)]
render: Get rid of RENDER_LINE_* in favor of similar TABLE_STROKE_*.

These had the same values.  They were separated for abstraction reasons
that don't seem to be needed, and eliminating one of them eliminates some
conversions.

16 months agotable: Rename TAB_* to TABLE_CELL_* and reduce from 16 to 8 bits each.
Ben Pfaff [Fri, 23 Dec 2022 21:17:56 +0000 (13:17 -0800)]
table: Rename TAB_* to TABLE_CELL_* and reduce from 16 to 8 bits each.

16 months agotable: Drop support for -1 as style to table_hline(), table_vline().
Ben Pfaff [Fri, 23 Dec 2022 20:49:45 +0000 (12:49 -0800)]
table: Drop support for -1 as style to table_hline(), table_vline().

The callers didn't ever pass a style of -1.

16 months agotable: Remove table_box().
Ben Pfaff [Fri, 23 Dec 2022 20:48:50 +0000 (12:48 -0800)]
table: Remove table_box().

It was only used from table_put() to erase any rules within a joined cell,
but the client code didn't ever put rules in a joined cell, so it was only
used as a no-op.

16 months agoONEWAY: Fix incorrect, duplicate "(J) Family" label.
Ben Pfaff [Thu, 5 Jan 2023 01:38:41 +0000 (17:38 -0800)]
ONEWAY: Fix incorrect, duplicate "(J) Family" label.

ONEWAY output should contain dimensions labeled "(I) Family" and
"(J) Family", but they incorrectly both had the latter label.  This fixes
the problem.

Thanks to Andreas Hammer for reporting the bug.

Fixes: 5cab4cf3322f ("output: Introduce pivot tables.")
17 months agodoc: Make the developers guide just a description of file formats.
Ben Pfaff [Sun, 27 Nov 2022 18:27:48 +0000 (10:27 -0800)]
doc: Make the developers guide just a description of file formats.

The other material in the developers guide was mostly obsolete or very
incomplete.  I don't think it really helped any developers.

There were a few possibly valuable parts.  I added them to the source tree,
which is where I think developers would be inclined to look.

17 months agoMove all command implementations into a single 'commands' directory.
Ben Pfaff [Sun, 27 Nov 2022 18:05:35 +0000 (10:05 -0800)]
Move all command implementations into a single 'commands' directory.

The original division of commands into subdirectories was fairly arbitrary,
and over time it got more confusing, even to me (who made the divisions
to begin with).  I don't see a problem with having them in a single
directory, and it will confuse me less.  This commit moves them all into
one place.

17 months agoRemove unneeded #includes.
Ben Pfaff [Sun, 27 Nov 2022 17:39:27 +0000 (09:39 -0800)]
Remove unneeded #includes.

17 months agoCTABLES: Fix issue with special case for SLABELS POSITION=ROW.
Ben Pfaff [Fri, 25 Nov 2022 23:20:52 +0000 (15:20 -0800)]
CTABLES: Fix issue with special case for SLABELS POSITION=ROW.

With SLABELS POSITION=ROW and stacked variables with different summaries,
values were shown in the wrong rows.  This fixes the problem.

Thanks to Frans Houweling for reporting the bug.

17 months agopivot-table: Fix memory leak in debug print code.
Ben Pfaff [Fri, 25 Nov 2022 20:13:41 +0000 (12:13 -0800)]
pivot-table: Fix memory leak in debug print code.

17 months agoCTABLES: Fix treatment of multiline titles.
Ben Pfaff [Thu, 24 Nov 2022 00:51:19 +0000 (16:51 -0800)]
CTABLES: Fix treatment of multiline titles.

Bug #63032.
Thanks to Frans Houweling for reporting this bug.

17 months agoCTABLES: Make EMPTY independent of other settings on CATEGORIES.
Ben Pfaff [Thu, 24 Nov 2022 00:39:35 +0000 (16:39 -0800)]
CTABLES: Make EMPTY independent of other settings on CATEGORIES.

Frans Houweling reported that the following two commands behave
differently:

   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
      /CATEGORIES VARIABLES=size TOTAL=YES.
   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=size TOTAL=YES
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.

There was a good reason for this, which is that CATEGORIES always changes
all the category attributes of whatever variables are named.  That is,
CATEGORIES VARIABLES=ALL overrides TOTAL even if EMPTY is the only
subcommand given.  I don't know what SPSS does here, but this behavior is
surprising enough that I wanted to change it.  This commit does that;
afterward, both of the above commands behave the same way, which
combines effects of TOTAL=YES and EMPTY=EXCLUDE for size and just
EMPTY=EXCLUDE for the class and datum.

17 months agoexamples: Rename variables for nhtsa example to give them better names.
Ben Pfaff [Wed, 23 Nov 2022 02:47:59 +0000 (18:47 -0800)]
examples: Rename variables for nhtsa example to give them better names.

The existing names were taken from question numbers in the questionnaire
(I guess), which weren't meaningful.  This replaces them by meaningful
names.

Thanks to Frans Houweling <fhouweling@email.it> for providing the new
names!

17 months agospv-driver: Fix memory leak on error path.
Ben Pfaff [Wed, 23 Nov 2022 01:15:22 +0000 (17:15 -0800)]
spv-driver: Fix memory leak on error path.

17 months agospv: ALlow an extra 01 at the end of X3.
Ben Pfaff [Tue, 22 Nov 2022 22:47:45 +0000 (14:47 -0800)]
spv: ALlow an extra 01 at the end of X3.

One sample received in a user report had this present.

17 months agoUPDATE: Improve a test.
Ben Pfaff [Mon, 21 Nov 2022 07:00:19 +0000 (23:00 -0800)]
UPDATE: Improve a test.

17 months agoMEANS: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:25:33 +0000 (22:25 -0800)]
MEANS: Improve error messages and coding style.

17 months agoOUTPUT MODIFY: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:15:11 +0000 (22:15 -0800)]
OUTPUT MODIFY: Improve error messages and coding style.

17 months agoSET: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:49:55 +0000 (16:49 -0800)]
SET: Improve error messages and coding style.

17 months agoINSERT: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:46:30 +0000 (16:46 -0800)]
INSERT: Improve error messages and coding style.

17 months agoROC: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:14:04 +0000 (14:14 -0800)]
ROC: Improve error messages and coding style.

17 months agoRANK: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:03:13 +0000 (14:03 -0800)]
RANK: Improve error messages and coding style.

17 months agoONEWAY: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:54:37 +0000 (13:54 -0800)]
ONEWAY: Improve error messages and coding style.

17 months agoGRAPH: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:29:12 +0000 (13:29 -0800)]
GRAPH: Improve error messages and coding style.

17 months agoLOGISTIC REGRESSION: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 19:28:02 +0000 (11:28 -0800)]
LOGISTIC REGRESSION: Improve error messages and coding style.

17 months agoGLM: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 17:58:01 +0000 (09:58 -0800)]
GLM: Improve error messages and coding style.

17 months agosplit-file: New function output_split_file_values_peek().
Ben Pfaff [Sun, 20 Nov 2022 17:52:31 +0000 (09:52 -0800)]
split-file: New function output_split_file_values_peek().

This helper function encapsulates what most of the callers were doing.