Ben Pfaff [Sun, 3 Feb 2008 06:45:03 +0000 (06:45 +0000)]
In system files, allow missing values to be specified on long string
variables, but warn about them because PSPP does not yet support them.
Ignore extension records 20 and 21, which PSPP does not yet support.
Ben Pfaff [Sat, 8 Dec 2007 06:17:00 +0000 (06:17 +0000)]
Patch #6302.
(data_parser_make_active_file): Fix case count
argument to casereader_create_sequential, which fixes data reading
in the GUI.
Provided by John Darrington.
John Darrington [Sat, 8 Dec 2007 06:10:03 +0000 (06:10 +0000)]
Create a "pspp-stock-select" stock icon, and use it in selector actions.
It probably won't ever get displayed, but avoids GtkCritical errors in
older gtk libraries.
Ben Pfaff [Sat, 8 Dec 2007 06:09:03 +0000 (06:09 +0000)]
Patch #6302.
* casegrouper.c (casegrouper_get_next_group): Cause a casegrouper
made from an empty casereader produce a casegrouper with no
groups, instead of one with one group that has no cases.
* casereader.c (casereader_is_empty): New function.
Ben Pfaff [Wed, 5 Dec 2007 06:04:59 +0000 (06:04 +0000)]
* src/language/data-io/data-reader.c (struct dfm_reader): New
`file_size' member to support dfm_get_percent_read.
(dfm_open_reader): Initialize file_size.
(dfm_get_percent_read): New function.
Ben Pfaff [Sun, 25 Nov 2007 19:11:39 +0000 (19:11 +0000)]
* bugs/compression.sh: Don't fail on big-endian system. Partial
fix for bug #21590.
* bugs/sysfile-info.sh: Disregard "Integer Format" and "Real
Format" lines in SYSFILE INFO output, to permit big-endian systems
to pass also. Partial fix for bug #21590.
* float-format.c (assemble_number): Only store 32 bits for Z short
format. Partial fix for bug #21590.
Ben Pfaff [Sun, 11 Nov 2007 05:51:38 +0000 (05:51 +0000)]
Patch #6262. New developers guide and resulting fixes and cleanups.
* automake.mk (src_data_libdata_a_SOURCES): Add new files.
* dict-class.c: New file.
(dict_class_from_id): Move here.
(dict_class_to_name): Move here.
* dict-class.h: New file.
(enum dict_class): Move here. Change from consecutive integers to
consecutive bits, to make testing for any of multiple values
easier. Add new DC_ALL constant.
* dictionary.c (struct dictionary): Change `case_limit' from
size_t to casenumber.
(dict_get_vars): Make final argument an enum dict_class.
(dict_get_vars_mutable): Ditto.
(dict_get_case_limit): Change return value to casenumber.
(dict_set_case_limit): Change final argument to a casenumber.
(dict_unset_split_var): Add assertion. Rephrase slightly.
(dict_set_label): Use xstrndup to simplify.
* format.c (fmt_step_width): AHEX format also needs 2-byte
stepping.
(fmt_set_style): Simplify assertions.
* missing-values.c (mv_add_num_range): Rename mv_add_range.
Simplify implementation.
(mv_has_value): Simplify implementation.
(mv_pop_value): Remove the first value, not the last, to avoid
having GET followed by SAVE reverse the order of missing values.
(mv_peek_value): Rename mv_get_value. Simplify assertion.
(mv_has_range): Simplify implementation.
(mv_peek_range): Rename mv_get_range.
(can_resize_string): Removed.
(mv_is_resizable): Use value_is_resizable.
(mv_resize): Use value_resize.
* short-names.h (SHORT_NAME_LEN): Move here.
* val-type.h: New file, for definitions related to type and width
of abstract values. Before, these definitions were mixed among
those related to "union value" and those related to variables.
(macro SYSMIS): Move here.
(macro LOWEST): Move here.
(macro HIGHEST): Move here.
(macro MAX_STRING); Move here.
(enum val_type): New enum with values VAL_NUMERIC and VAL_STRING.
Replaces enum var_type that had values VAR_NUMERIC and VAR_STRING.
All references updated.
(val_type_is_valid): New function. Replaces var_type_is_valid.
All references updated.
(val_type_from_width): New function. Replaces
var_type_from_width. All references updated.
* value-labels.c (val_labs_copy): Renamed val_labs_clone. All
references updated.
(val_labs_can_set_width): Use value_is_resizable.
(val_labs_add): Simply return false if the value labels set is too
wide, instead of having undefined behavior.
(val_labs_replace): Ditto.
(val_labs_replace): Ditto.
(val_labs_first): Set iterator to null if iteration is complete.
(val_labs_first_sorted): Ditto.
(val_labs_done): Become a no-op if the iterator is null.
* value.c (value_is_resizable): New function.
(value_resize): New function.
* variable.c (var_get_dict_class): New function.
* variable.h (macro LONG_NAME_LEN): Rename VAR_NAME_LEN. Update
all references.
* not-implemented.texi: Fix @include command so that it works
consistently, by using a file name relative to Makefile.am's
srcdir instead of relative to doc.
Ben Pfaff [Fri, 9 Nov 2007 03:06:28 +0000 (03:06 +0000)]
* automake.mk: Add new file.
* formats/360.sh: New test.
* str.c (ds_read_stream): Change return value semantics to be more
useful. Update all users.
* data-reader.c (struct dfm_reader): New member `block_left'.
(dfm_open_reader): Initialize block_left. For FH_MODE_TEXT, open
the file in text mode.
(read_error): New function.
(partial_record): New function.
(try_to_read_fully): New function.
(enum descriptor_type): New enum.
(read_descriptor_word): New function.
(corrupt_size): New function.
(read_size): New function.
(read_file_record): Implement new modes.
(read_record): Now take care of tracking line numbers here.
(dfm_reader_get_legacy_encoding): New function.
* data-writer.c (dfm_put_record): Implement new modes.
(dfm_writer_get_legacy_encoding): New function.
* file-handle.q: Parse new formats.
(cmd_file_handle): Set up new formats.
* print.c (struct print_trns): New member `encoding'.
(internal_cmd_print): Set encoding.
(print_trns_proc): Recode output data if necessary.
(flush_records): Recode leader byte.
* data-in.c: Make formatted data parsing locale-independent.
(parse_number): Use c_strtod instead of strtod, to avoid
locale-specific behavior.
(parse_Z): Ditto.
Ben Pfaff [Tue, 6 Nov 2007 06:23:25 +0000 (06:23 +0000)]
Patch #6258.
* command.c (report_state_mismatch): Replace code to construct an
error message from bits and pieces by a switch statement that
hard-codes each possible error. Makes i18n easier.
Suggested by Chusslove Illich <caslav.ilic@gmx.net>.
* file-handle-def.c (fh_lock): Add comment that TYPE should be
marked with N_() in the caller. Added these markings to each
caller too. Should make i18n easier.
Suggested by Chusslove Illich <caslav.ilic@gmx.net>.
Ben Pfaff [Tue, 6 Nov 2007 05:49:04 +0000 (05:49 +0000)]
No need for check for off_t or for the size of float or long double
any longer, as we don't use the results anymore. Also, no need to put
#include <locale.h> into config.h any longer, as this was only needed
for --with-included-gettext, which we have not supported for some
time.
Ben Pfaff [Sat, 13 Oct 2007 04:35:25 +0000 (04:35 +0000)]
posix-xprintf-functions.patch from patch #6230.
Add fprintf-posix, printf-posix, printf-safe,
snprintf-posix, sprintf-posix, vasprintf-posxi, vfprintf-posix,
vprintf-posix, vsnprintf-posix, and vsprintf-posix modules, which
allow us to use C99 format specifiers (e.g. 'z') in *printf.
Also, changed many formerly casted arguments in *printf calls to
use one of these format specifiers and drop the cast.
Ben Pfaff [Fri, 12 Oct 2007 04:49:25 +0000 (04:49 +0000)]
magic-elimination.patch from patch #6230.
* float-format.c (float_get_lowest): New function.
* magic.c: Removed.
* magic.h: Removed. Changed all references to NOT_INT,
NOT_DOUBLE, and NOT_LONG to use other constants. Changed
references to second_lowest_value to call float_get_lowest.
Ben Pfaff [Thu, 11 Oct 2007 04:59:33 +0000 (04:59 +0000)]
cleanup-misc.patch from patch #6230.
* acinclude.m4: Improve formatting.
* configure.ac: Ditto. Don't check for headers whose presence is
never tested. Don't use AC_C_CONST (we can assume that "const" is
implemented these days). Don't pass default sizes to
AC_CHECK_SIZEOF, since modern Autoconf doesn't need them. Don't
define FPREP_IEEE754, since it was not tested for. Don't use
AC_FUNC_VPRINTF, since we never tested for it.
* float-format.h (enum float_format): Don't check for
FPREP_IEEE754 macro any longer.
* magic.h: Ditto.
* src/ui/debugger.c: Use debugger if HAVE_FORK is defined, not
HAVE_SYS_TYPES_H. The latter is almost universal, but the former
is only available where it can be implemented.
Ben Pfaff [Tue, 9 Oct 2007 03:50:20 +0000 (03:50 +0000)]
Fix bug #21280. Thanks to John Darrington for review.
* automake.mk: Add new file.
* bugs/overwrite-input-file.sh: New test.
* file-name.c (create_stream): New function.
* por-file-writer.c (pfm_open_writer): Use fh_open to open the
file handle before creating the file, to ensure that we don't
truncate a file that we're reading. Make code easier to read by
using create_stream.