[Getdata-commits] SF.net SVN: getdata:[867] trunk/getdata
Scientific Database Format
Brought to you by:
ketiltrout
|
From: <ket...@us...> - 2013-12-07 01:48:40
|
Revision: 867
http://sourceforge.net/p/getdata/code/867
Author: ketiltrout
Date: 2013-12-07 01:48:34 +0000 (Sat, 07 Dec 2013)
Log Message:
-----------
Test suite additions, with resultant bug fixes. This includes a fairly
substantial rewrite of the guts of gd_move and gd_rename (including the deletion
of gd_move_alias), and also of the sample index encoding stuff (sie.c).
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/entry.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/t/big_test.t
trunk/getdata/bindings/php/getdata.c
trunk/getdata/bindings/php/test/big_test.php
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/doc/list.tests
trunk/getdata/man/Makefile.am
trunk/getdata/man/gd_alter_entry.3
trunk/getdata/man/gd_entry.3
trunk/getdata/man/gd_free_entry_strings.3
trunk/getdata/man/gd_move.3
trunk/getdata/man/gd_rename.3
trunk/getdata/src/add.c
trunk/getdata/src/ascii.c
trunk/getdata/src/common.c
trunk/getdata/src/constant.c
trunk/getdata/src/del.c
trunk/getdata/src/encoding.c
trunk/getdata/src/entry.c
trunk/getdata/src/errors.c
trunk/getdata/src/field_list.c
trunk/getdata/src/flimits.c
trunk/getdata/src/flush.c
trunk/getdata/src/fpos.c
trunk/getdata/src/getdata.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/gzip.c
trunk/getdata/src/index.c
trunk/getdata/src/internal.h
trunk/getdata/src/legacy.c
trunk/getdata/src/mod.c
trunk/getdata/src/move.c
trunk/getdata/src/name.c
trunk/getdata/src/native.c
trunk/getdata/src/open.c
trunk/getdata/src/parse.c
trunk/getdata/src/putdata.c
trunk/getdata/src/sie.c
trunk/getdata/test/Makefile.am
trunk/getdata/test/alter_const.c
trunk/getdata/test/alter_const_c2r.c
trunk/getdata/test/alter_linterp.c
trunk/getdata/test/del_const_deref.c
trunk/getdata/test/entry_raw_scalar_code.c
trunk/getdata/test/entry_raw_scalar_type.c
trunk/getdata/test/get_linterp.c
trunk/getdata/test/index_index.c
trunk/getdata/test/move_alias.c
trunk/getdata/test/move_data_enc_ar.c
trunk/getdata/test/move_data_enc_ra.c
trunk/getdata/test/move_data_endian.c
trunk/getdata/test/move_data_foffs.c
trunk/getdata/test/move_data_nop.c
trunk/getdata/test/move_subdir.c
trunk/getdata/test/name_affix.c
trunk/getdata/test/name_alias.c
trunk/getdata/test/name_name.c
trunk/getdata/test/name_updb.c
trunk/getdata/test/name_updb_const.c
trunk/getdata/test/sie_get_big.c
trunk/getdata/test/sie_put_big.c
trunk/getdata/test/test.h
Added Paths:
-----------
trunk/getdata/test/add_dot.c
trunk/getdata/test/alter_clincom.c
trunk/getdata/test/alter_const_r2c.c
trunk/getdata/test/alter_const_r2r.c
trunk/getdata/test/alter_cpolynom_null.c
trunk/getdata/test/alter_crecip89_null.c
trunk/getdata/test/alter_entry_lincom.c
trunk/getdata/test/alter_entry_recode_recalc.c
trunk/getdata/test/alter_entry_scalar1.c
trunk/getdata/test/alter_entry_scalar3c.c
trunk/getdata/test/alter_index.c
trunk/getdata/test/alter_spec_polynom.c
trunk/getdata/test/ascii_get_complex.c
trunk/getdata/test/ascii_sync.c
trunk/getdata/test/bof_bit.c
trunk/getdata/test/bof_index.c
trunk/getdata/test/bof_phase_neg.c
trunk/getdata/test/cvlist_array0.c
trunk/getdata/test/cvlist_array_free.c
trunk/getdata/test/cvlist_array_meta0.c
trunk/getdata/test/cvlist_array_meta_free.c
trunk/getdata/test/cvlist_meta0.c
trunk/getdata/test/del_alias.c
trunk/getdata/test/del_data_enoent.c
trunk/getdata/test/del_data_open.c
trunk/getdata/test/del_ref.c
trunk/getdata/test/desync_path.c
trunk/getdata/test/encode_alter_all.c
trunk/getdata/test/encode_alter_open.c
trunk/getdata/test/encode_recode.c
trunk/getdata/test/encode_recode_open.c
trunk/getdata/test/endian_alter_all.c
trunk/getdata/test/eof_bit.c
trunk/getdata/test/eof_phase_neg.c
trunk/getdata/test/flist0.c
trunk/getdata/test/flist2.c
trunk/getdata/test/flist_meta2.c
trunk/getdata/test/flush_lincom.c
trunk/getdata/test/flush_lincom1.c
trunk/getdata/test/flush_mult.c
trunk/getdata/test/flush_raw_close.c
trunk/getdata/test/flush_string.c
trunk/getdata/test/flush_sync.c
trunk/getdata/test/foffs_alter_all.c
trunk/getdata/test/fragment_affix_alter_code.c
trunk/getdata/test/fragment_affix_alter_nop.c
trunk/getdata/test/get_cpolynom1.c
trunk/getdata/test/get_cpolynom_int.c
trunk/getdata/test/get_dim.c
trunk/getdata/test/get_divide_ccin.c
trunk/getdata/test/get_divide_crin.c
trunk/getdata/test/get_divide_crinr.c
trunk/getdata/test/get_divide_rcin.c
trunk/getdata/test/get_divide_s.c
trunk/getdata/test/get_index_complex.c
trunk/getdata/test/get_lincom2s.c
trunk/getdata/test/get_lincom3s.c
trunk/getdata/test/get_lincom_mdt.c
trunk/getdata/test/get_linterp1.c
trunk/getdata/test/get_linterp_abs.c
trunk/getdata/test/get_linterp_complex.c
trunk/getdata/test/get_linterp_empty.c
trunk/getdata/test/get_mplex_complex.c
trunk/getdata/test/get_mplex_s.c
trunk/getdata/test/get_mplex_saved.c
trunk/getdata/test/get_multiply_ccin.c
trunk/getdata/test/get_multiply_crin.c
trunk/getdata/test/get_multiply_crinr.c
trunk/getdata/test/get_multiply_rcin.c
trunk/getdata/test/get_multiply_s.c
trunk/getdata/test/get_neg.c
trunk/getdata/test/get_polynom_cmpin.c
trunk/getdata/test/get_window_complex.c
trunk/getdata/test/get_window_s.c
trunk/getdata/test/get_zero_complex.c
trunk/getdata/test/get_zero_float.c
trunk/getdata/test/gzip_del.c
trunk/getdata/test/gzip_put_back.c
trunk/getdata/test/gzip_sync.c
trunk/getdata/test/index_s.c
trunk/getdata/test/index_subset.c
trunk/getdata/test/legacy_error.c
trunk/getdata/test/legacy_estring.c
trunk/getdata/test/legacy_format.c
trunk/getdata/test/move_affix_meta.c
trunk/getdata/test/move_affix_updb.c
trunk/getdata/test/move_data_foffs_neg.c
trunk/getdata/test/name_dangle.c
trunk/getdata/test/name_dot.c
trunk/getdata/test/name_meta.c
trunk/getdata/test/name_updb_affix.c
trunk/getdata/test/native_bit.c
trunk/getdata/test/native_const.c
trunk/getdata/test/native_index.c
trunk/getdata/test/native_lincom.c
trunk/getdata/test/native_lincom_cmpin.c
trunk/getdata/test/native_lincom_cmpscal.c
trunk/getdata/test/native_linterp.c
trunk/getdata/test/native_linterp_cmp.c
trunk/getdata/test/native_mult.c
trunk/getdata/test/native_mult1.c
trunk/getdata/test/native_mult2.c
trunk/getdata/test/native_phase.c
trunk/getdata/test/native_polynom.c
trunk/getdata/test/native_polynom_cmpin.c
trunk/getdata/test/native_polynom_cmpscal.c
trunk/getdata/test/native_raw.c
trunk/getdata/test/native_recip.c
trunk/getdata/test/native_recip_cmpin.c
trunk/getdata/test/native_recip_cmpscal.c
trunk/getdata/test/native_sbit.c
trunk/getdata/test/native_string.c
trunk/getdata/test/open_cb_rescan_alloc.c
trunk/getdata/test/open_invalid.c
trunk/getdata/test/open_sym_as.c
trunk/getdata/test/open_sym_d.c
trunk/getdata/test/open_sym_l.c
trunk/getdata/test/parse_hex.c
trunk/getdata/test/parse_include_affix_bad.c
trunk/getdata/test/parse_literal_cmpbad.c
trunk/getdata/test/parse_literal_fltcmp.c
trunk/getdata/test/parse_literal_fltcmp0.c
trunk/getdata/test/parse_literal_intcmp.c
trunk/getdata/test/parse_literal_intcmp0.c
trunk/getdata/test/parse_literal_uintcmp.c
trunk/getdata/test/parse_literal_uintcmp0.c
trunk/getdata/test/parse_meta_frag.c
trunk/getdata/test/parse_octal_zero.c
trunk/getdata/test/parse_raw_char_bad.c
trunk/getdata/test/parse_utf8.c
trunk/getdata/test/parse_utf8_invalid.c
trunk/getdata/test/parse_utf8_zero.c
trunk/getdata/test/protect_alter_all.c
trunk/getdata/test/put_carray_client.c
trunk/getdata/test/put_clincom1.c
trunk/getdata/test/put_cpolynom.c
trunk/getdata/test/put_crecip.c
trunk/getdata/test/put_mplex_complex.c
trunk/getdata/test/repr_bad.c
trunk/getdata/test/seek_index.c
trunk/getdata/test/seek_lincom.c
trunk/getdata/test/seek_mult.c
trunk/getdata/test/seek_phase.c
trunk/getdata/test/sie_put_append.c
trunk/getdata/test/sie_put_append2.c
trunk/getdata/test/sie_put_back.c
trunk/getdata/test/sie_put_pad.c
trunk/getdata/test/sie_put_pad0.c
trunk/getdata/test/sie_put_trunc.c
trunk/getdata/test/sie_put_trunc2.c
trunk/getdata/test/sie_sync.c
trunk/getdata/test/svlist0.c
trunk/getdata/test/svlist2.c
trunk/getdata/test/svlist_meta0.c
trunk/getdata/test/unclude_open.c
Removed Paths:
-------------
trunk/getdata/test/encode_move.c
Property Changed:
----------------
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/ChangeLog 2013-12-07 01:48:34 UTC (rev 867)
@@ -1,4 +1,181 @@
-2013-11-15 D. V. Wiebe <ge...@ke...> svn:867
+2013-12-06 D. V. Wiebe <ge...@ke...> svn:867
+ * test/add_dot.c test/alter_clincom.c test/alter_const_r2c.c test/sie_sync.c
+ test/alter_const_r2r.c test/alter_cpolynom_null.c test/alter_crecip89_null.c
+ test/alter_entry_lincom.c test/alter_entry_recode_recalc.c test/get_divide_s.c
+ test/alter_entry_scalar1.c test/alter_entry_scalar3c.c test/alter_index.c
+ test/alter_spec_polynom.c test/ascii_get_complex.c test/ascii_sync.c
+ test/bof_bit.c test/bof_index.c test/bof_phase_neg.c test/cvlist_array0.c
+ test/cvlist_array_free.c test/cvlist_array_meta0.c test/native_polynom_cmpin.c
+ test/cvlist_array_meta_free.c test/cvlist_meta0.c test/del_alias.c
+ test/del_data_enoent.c test/del_data_open.c test/del_ref.c test/desync_path.c
+ test/encode_alter_all.c test/encode_alter_open.c test/svlist_meta0.c
+ test/encode_recode_open.c test/endian_alter_all.c test/eof_bit.c test/flist2.c
+ test/eof_phase_neg.c test/flist0.c test/flist_meta2.c test/flush_lincom.c
+ test/flush_lincom1.c test/flush_mult.c test/sie_put_back.c test/put_cpolynom.c
+ test/flush_raw_close.c test/flush_string.c test/flush_sync.c test/svlist2.c
+ test/foffs_alter_all.c test/fragment_affix_alter_code.c test/native_recip.c
+ test/fragment_affix_alter_nop.c test/get_cpolynom1.c test/get_cpolynom_int.c
+ test/get_dim.c test/get_divide_ccin.c test/get_divide_crin.c test/native_raw.c
+ test/get_divide_crinr.c test/get_divide_rcin.c test/get_index_complex.c
+ test/get_lincom2s.c test/get_lincom3s.c test/get_lincom_mdt.c test/parse_hex.c
+ test/get_linterp1.c test/get_linterp_abs.c test/get_linterp_complex.c
+ test/get_linterp_empty.c test/get_mplex_complex.c test/get_mplex_s.c
+ test/get_mplex_saved.c test/get_multiply_ccin.c test/get_multiply_crin.c
+ test/get_multiply_crinr.c test/get_multiply_rcin.c test/get_multiply_s.c
+ test/get_neg.c test/get_polynom_cmpin.c test/get_window_complex.c
+ test/get_window_s.c test/get_zero_complex.c test/get_zero_float.c
+ test/gzip_del.c test/gzip_put_back.c test/gzip_sync.c test/index_s.c
+ test/index_subset.c test/legacy_error.c test/legacy_estring.c test/seek_mult.c
+ test/legacy_format.c test/move_affix_meta.c test/move_affix_updb.c
+ test/move_data_foffs_neg.c test/name_dangle.c test/name_dot.c test/name_meta.c
+ test/name_updb_affix.c test/native_bit.c test/native_const.c test/repr_bad.c
+ test/native_index.c test/native_lincom.c test/native_lincom_cmpin.c
+ test/native_lincom_cmpscal.c test/native_linterp.c test/native_linterp_cmp.c
+ test/native_mult.c test/native_mult1.c test/native_mult2.c test/native_phase.c
+ test/native_polynom.c test/native_polynom_cmpscal.c test/native_recip_cmpin.c
+ test/native_recip_cmpscal.c test/native_sbit.c test/native_string.c
+ test/open_cb_rescan_alloc.c test/open_invalid.c test/open_sym_as.c
+ test/open_sym_d.c test/open_sym_l.c test/parse_include_affix_bad.c
+ test/parse_literal_cmpbad.c test/parse_literal_fltcmp.c test/parse_meta_frag.c
+ test/parse_literal_fltcmp0.c test/parse_literal_intcmp.c test/sie_put_append.c
+ test/parse_literal_intcmp0.c test/parse_literal_uintcmp.c test/sie_put_trunc.c
+ test/parse_literal_uintcmp0.c test/parse_octal_zero.c test/protect_alter_all.c
+ test/parse_raw_char_bad.c test/parse_utf8.c test/parse_utf8_invalid.c
+ test/parse_utf8_zero.c test/put_carray_client.c test/put_clincom1.c
+ test/put_crecip.c test/put_mplex_complex.c test/svlist0.c test/seek_index.c
+ test/seek_lincom.c test/seek_phase.c test/sie_put_append2.c test/sie_put_pad.c
+ test/sie_put_trunc2.c test/sie_put_pad0.c test/unclude_open.c: Added.
+
+ * test/encode_recode.c: Renamed.
+
+ * src/add.c (_GD_Add): Set the right suberror (GD_E_ENTRY_POLYORD) for
+ poly_ord out of range.
+
+ * src/add.c (gd_add_alias) src/field_list.c (_GD_EntryList): Remove
+ duplicate check for invalid dirfile.
+
+ * src/ascii.c (_GD_ScanFormat): Append a newline.
+
+ * src/ascii.c (_GD_AsciiRead): Use ferror instead of feof to check for stdio
+ errors.
+
+ * src/common.c (_GD_ReadLinterpFile): Zero the LUT pointer on error.
+ * src/mod.c (_GD_Change): reset the LUT length to force table re-read.
+ Also, release the LUT directory.
+
+ * src/common.c (_GD_CanonicalPath): Set errno to ELOOP late.
+
+ * src/constant.c (_GD_PutCarraySlice): Added.
+ * src/constant.c (gd_put_carray_slice gd_put_carray): Call
+ _GD_PutCarraySlice.
+
+ * src/del.c (_GD_Delete): Always close an open raw file, even when
+ deleting it.
+
+ * src/encoding.c (_GD_RecodeFragment): Use _GD_FiniRawIO to close raw files.
+ Clear the internal cache of raw filenames.
+
+ * src/entry.c (_GD_GetScalar): Return non-zero on error. Always call
+ _GD_DoField.
+ * src/entry.c (gd_entry): Return uncalculable entries rather than failing.
+
+ * src/flimits.c (_GD_GetBOF): Also zero *ds if we're before sample zero.
+
+ * src/flush.c (_GD_Flush): Validate input fields before trying to flush
+ them. Don't flush the second lincom field if it's not used.
+
+ * src/flush.c (_GD_StringEscapeise): Remove duplicate check for ".
+
+ * src/fpos.c (_GD_Seek): Fix sign on PHASE shift.
+
+ * src/fpos.c (gd_seek64): Pass index_pos=-1 to _GD_GetFilePos.
+
+ * src/getdata.c (_GD_CPolynomData _GD_CMultiplyData _GD_CDivideData):
+ Delete unused code: type is guaranteed to be complex in these calls.
+ * src/getdata.c (_GD_CDivideData): Fix computation of complex division.
+
+ * src/getdata.c (_GD_DoLinterp): Delete check for uninitialised LUT: the
+ native type check done in DoField has already initialised the LUT.
+
+ * src/index.c (_GD_GetIndex): Fix extrapolations performed when required to
+ search for the EOF.
+ * src/index.c (gd_framenum_subset64): Fix conversion of field_end from
+ frames to samples.
+
+ * src/legacy.c (GetFormat): Allocate Format.mplexEntries.
+
+ * src/mod.c (_GD_Change): Ensure a RAW entry is calculated before trying to
+ modify the data file.
+
+ * src/mod.c (gd_alter_spec gd_malter_spec): Set move flags for POLYNOM
+ entries to ensure co-efficients are updated.
+
+ * src/getdata.h.in: Added struct gd_rename_data_. Added GD_REN_DANGLE,
+ GD_REN_FORCE.
+ * src/move.c (_GD_Move) src/name.c (_GD_Rename): Call _GD_PrepareRename and
+ _GD_PerformRename to handle metadata updates resulting from name changes.
+ * src/move.c (gd_move): Replace move_data with flags argument, which accepts
+ the GD_REN_* flags.
+ * src/name.c (_GD_MatchCode _GD_MakeNewCode _GD_SetNewCode _GD_UpdateInputs
+ _GD_CleanUpRename _GD_PerformRename _GD_PrepareRename): Added.
+ * src/name.c (_GD_InvalidateConst _GD_InvalidateVect): Deleted. (Combined into
+ _GD_UpdateInputs).
+ * src/name.c (_GD_UpdateScalar _GD_UpdateInField): Call _GD_MatchCode
+ _GD_MakeNewCode _GD_SetNewCode for common code. Return non-zero on failure.
+ Update gd_rename_data_ struct in-place.
+ * src/name.c (_GD_MungeCode): If err_ok is 2, dont' worry at all about
+ errors.
+ * src/name.c (_GD_CheckCodeAffixes): Add set_error argument. Remember
+ success or failure separately from the DIRFILE error.
+
+ * src/move.c (gd_move_alias): Deleted.
+ * src/move.c (gd_move): Don't delalias the provided field code.
+ * bindings/cxx/dirfile.cpp (Dirfile::MoveAlias) bindings/f77/fgetdata.c
+ (GDMOVA) bindings/f77/getdata.f90.in (fgd_move_alias)
+ bindings/perl/simple_funcs.xsin (move_alias) bindings/php/getdata.c
+ (gd_move_alias) bindings/python/pydirfile.c (gdpy_dirfile_movealias):
+ Deleted.
+ * bindings/idl/getdata.c (gdidl_move gdidl_rename): Remove keyword ALIAS;
+ add keywords DANGLE, FORCE, UPDATEDB.
+ * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+ bindings/perl/t/big_test.t bindings/php/test/big_test.php
+ bindings/python/test/big_test.py: Delete test 224.
+
+ * src/native.c (_GD_NativeType): Don't always return GD_FLOAT64 for LINCOMs.
+
+ * src/errors.c: Added GD_E_OPEN_IO.
+ * src/open.c (_GD_Open): Throw GD_E_OPEN instead of GD_E_RAW_IO if resolving
+ the supplied path fails.
+
+ * src/parse.c (_GD_SetScalar): Allow literals in semicolon (complex) form in
+ all cases but require a zero imaginary part for non-complex data.
+
+ * src/parse.c (_GD_Tokenise): Fix parsing of \x and \u. Don't unnecessarily
+ overwrite earlier errors with GD_E_FORMAT_UNTERM.
+
+ * src/putdata.c (_GD_MplexOutData): Fix computation of complex data.
+
+ * src/sie.c: Added l, have_l and bof to struct gd_siedata. Also, f->d[0]
+ is no longer endianness corrected (ie. f->d is now simply the raw record),
+ which means we use f->s in most places where we used f->d[0] previously.
+
+ * src/sie.c (_GD_Advance): remember the previous record in f->l. Also set
+ f->bof.
+
+ * src/sie.c (_GD_SampIndSeek): check stdio calls for failure. Correctly
+ format a padding record when write seeking past the EOF.
+
+ * src/sie.c (_GD_SampIndWrite): Correctly deal with appending data,
+ including backing up a record when necessary to check whether we need to
+ combine the start of the new data with that record. Compose p with the
+ output endianness.
+
+ * bindings/idl/getdata.c (gdidl_rename): Fix handling of UPDATEDB.
+
+ * bindings/php/getdata.c (gd_rewrite_fragment): Initalise zi.
+
+2013-11-15 D. V. Wiebe <ge...@ke...> svn:866
* test/add_add.c test/close_close.c test/del_del.c test/flush_flush.c
test/include_include.c test/index_index.c test/move_move.c test/name_name.c
test/nfields_nfields.c test/nframes_nframes.c test/open_open.c
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/NEWS 2013-12-07 01:48:34 UTC (rev 867)
@@ -2,8 +2,26 @@
Library Changes:
- * The gd_free_entry_strings() function now NULLs pointers after freeing them.
+ * Literals in format metadata may now have complex form (i.e. include a
+ semicolon) when the parameter is purely real. However, a non-zero imaginary
+ part is still an error.
+ * BUG FIX: The parsing of the \x and \u escape sequences are now correct.
+
+ * BUG FIX: Computation of LINCOMs with complex valued input fields now
+ correctly happens in the complex plane. As a side effect, gd_native_type()
+ now also correctly reports such LINCOM fields to be complex valued.
+
+ * BUG FIX: If performing a metadata update due to renaming fields (perhaps
+ by passing GD_REN_UPDB to gd_rename()) results in an invalid field code
+ due to affix restrictions, the update now fails (but see GD_REN_FORCE).
+ Previously the invalid field code would be stored, leading to errors when
+ flushing the modified metadata to disk.
+
+ * BUG FIX: When performing a metadata update due to a renamed field, the field
+ codes containing subfields of the renamed field are now also updated,
+ including field codes specifying meta subfield which do not exist.
+
* BUG FIX: The gd_[m]add() functions now ignore zero-length scalar strings.
Previously they would store these invalid field codes, causing problems
later.
@@ -26,6 +44,88 @@
* BUG FIX: gd_alter_entry() no longer corrupts the DIRFILE when modifying
named scalars of MPLEX fields.
+ * BUG FIX: reading a LINTERP table with fewer than two lines no longer results
+ in a segfault on close/discard.
+
+ * BUG FIX: DIVIDE fields with complex valued divisors are now properly
+ computed.
+
+ * BUG FIX: Writing complex MPLEX fields no longer corrupts the stored data.
+
+ * BUG FIX: Several fixes have been made to the sample index encoding (SIE)
+ engine, which should now produce properly encoded data when performing
+ random writes.
+
+ API Changes:
+
+ * gd_free_entry_strings() now NULLs pointers after freeing them.
+
+ * gd_entry() now returns entry metadata when they contain scalar field codes
+ which do not exist. Previously, it would fail with the error
+ GD_E_BAD_SCALAR and return nothing.
+
+ * Two new rename flags have been added:
+ - GD_REN_DANGLE which indicates the library shouldn't update ALIASes whose
+ target has been renamed (turning them into dangling aliases)
+ - GD_REN_FORCE which causes the library to skip updating field codes which
+ would be invalid due to affixes instead of failing.
+
+ * gd_rename() now by default updates the target of ALIASes pointing to a
+ renamed field to point to the new field instead of leaving them dangle.
+ (But see GD_REN_DANGLE).
+
+ * The move_data argument of gd_move() has been replaced with a flags argument
+ which accepts the GD_REN_* flags, which have the same meaning as they do
+ with gd_rename().
+
+ * gd_move_alias() has been deleted: its function is now performed by
+ gd_move(). If gd_move() is passed the field code of an alias, the alias is
+ now moved, instead of moving the field the alias points to.
+
+ * BUG FIX: If the dirfile path provided cannot be resolved (due to, for
+ instance, a symbolic link pointing to a non-existent path), gd_open() and
+ friends now return GD_E_OPEN, as documented, instead of GD_E_RAW_IO.
+
+ * BUG FIX: gd_bof() now returns the correct number (i.e.: zero) when reporting
+ the beginning of field of derived fields shifted to before the start of the
+ dirfile. Previously, this function incorrectly returned values ranging from
+ zero to one less than the samples-per-frame of the requested field.
+
+ * BUG FIX: gd_flush(), gd_sync(), gd_raw_close() no longer segfault when
+ operating on a LINCOM with only one input field.
+
+ * BUG FIX: gd_seek() now works correctly on PHASE fields; previously, the
+ sign of the PHASE shift was flipped.
+
+ * BUG FIX: gd_seek() now correctly positions the virtual I/O pointer of the
+ INDEX field.
+
+ * BUG FIX: gd_framenum_subset() now returns the correct value when passed a
+ field_end which is beyond the end of field, and then is required to
+ extrapolate outside of the specified frame range.
+
+ * BUG FIX: gd_add_polynom() and similar now produce the correct error string
+ when encountering a poly_ord out of range.
+
+ * BUG FIX: gd_alter_raw() and similar no longer fail when asked to re-encode
+ the data file of a RAW field which has not been previously accessed.
+
+ * BUG FIX: A previously-read LINTERP table is now always deleted when changing
+ table paths with gd_alter_linterp() or similar. Previously these obsolete,
+ cached LUTs would sometimes linger, causing incorrect LINTERP computation.
+
+ * BUG FIX: gd_[m]alter_spec() no longer ignore co-efficients specified for
+ POLYNOM entries.
+
+ * BUG FIX: gd_alter_encoding() now deletes the internal cache of RAW filenames
+ of the affected fragment; previously, these old, cached filenames could lead
+ to I/O errors when reading and writing the re-encoded RAW data files.
+
+ Legacy API Changes:
+
+ * BUG FIX: Calling GetFormat on a Dirfile with MPLEX or WINDOW fields no
+ longer results in a segmentation fault.
+
Bindings Changes:
* PHP bindings have been added.
@@ -53,14 +153,17 @@
* PERL: alter_entry() now only updates defined elements in the passed entry
hash.
+ * C++ BUG FIX: Fixed segfault in RawEntry destructor. Reported by S. J.
+ Benton.
+
* F77 and F95 BUG FIX: Named scalar indices are now indexed from one instead
of zero, like all other array indices are in the Fortran GetData bindings.
* F95 BUG FIX: fgd_add and fgd_alter_entry no longer ignore named scalar
parameters provided in supplied entry structures.
- * C++ BUG FIX: Fixed segfault in RawEntry destructor. Reported by S. J.
- Benton.
+ * IDL BUG FIX: the /UPDATEDB flag to gd_rename now operates as expected.
+ Previously it would act like /MOVE_DATA.
|==============================================================================|
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2013-12-07 01:48:34 UTC (rev 867)
@@ -496,11 +496,6 @@
return gd_madd_alias(D, parent, name, target);
}
-int Dirfile::MoveAlias(const char* field_code, int new_fragment) const
-{
- return gd_move_alias(D, field_code, new_fragment);
-}
-
int Dirfile::NAliases(const char* field_code) const
{
return gd_naliases(D, field_code);
Modified: trunk/getdata/bindings/cxx/entry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/entry.cpp 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/cxx/entry.cpp 2013-12-07 01:48:34 UTC (rev 867)
@@ -76,12 +76,12 @@
return 1;
}
-int Entry::Move(int new_fragment, int move_data)
+int Entry::Move(int new_fragment, unsigned flags)
{
int ret = -1;
if (D != NULL)
- ret = gd_move(D->D, E.field, new_fragment, move_data);
+ ret = gd_move(D->D, E.field, new_fragment, flags);
if (!ret)
E.fragment_index = new_fragment;
@@ -89,13 +89,13 @@
return ret;
}
-int Entry::Rename(const char* new_name, int move_data)
+int Entry::Rename(const char* new_name, unsigned flags)
{
char* ptr;
int ret = -1;
if (D != NULL)
- ret = gd_rename(D->D, E.field, new_name, move_data);
+ ret = gd_rename(D->D, E.field, new_name, flags);
if (ret) {
if (E.field == NULL) {
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2013-12-07 01:48:34 UTC (rev 867)
@@ -205,8 +205,6 @@
const char **MStrings(const char *parent) const;
- int MoveAlias(const char* field_code, int new_fragment) const;
-
const char **MVectorList(const char *parent) const;
int NAliases(const char* field_code) const;
Modified: trunk/getdata/bindings/cxx/getdata/entry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/entry.h 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/cxx/getdata/entry.h 2013-12-07 01:48:34 UTC (rev 867)
@@ -89,9 +89,9 @@
int FragmentIndex() const { return E.fragment_index; };
- int Move(int new_fragment, int move_data = 0);
+ int Move(int new_fragment, unsigned flags = 0);
- int Rename(const char* new_name, int move_data = 0);
+ int Rename(const char* new_name, unsigned flags = 0);
/* Specific data */
virtual const char *Input(int index = 0) const {
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2013-12-07 01:48:34 UTC (rev 867)
@@ -1573,19 +1573,11 @@
d->IncludeAffix("format1", 0, "A", "Z", GD_CREAT | GD_EXCL);
CHECK_OK(223);
- // 224: gd_move_alias check
- d->MoveAlias("new20", 1);
- CHECK_OK2(224, 1);
-
- n = d->FragmentIndex("Anew20Z");
- CHECK_OK2(224, 2);
- CHECK_INT(224, n, 1);
-
// 225: gd_delete_alias check
- d->DeleteAlias("Anew20Z", 0);
+ d->DeleteAlias("new20", 0);
CHECK_OK2(225, 1);
- n = d->FragmentIndex("Anew20Z");
+ n = d->FragmentIndex("new20");
CHECK_ERROR2(225, 2, GD_E_BAD_CODE);
CHECK_INT(225, n, -1);
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/f77/fgetdata.c 2013-12-07 01:48:34 UTC (rev 867)
@@ -2910,15 +2910,15 @@
/* gd_move wrapper */
void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code,
const int32_t *field_code_l, const int32_t *new_fragment,
- const int32_t *move_data)
+ const int32_t *flags)
{
char *fc;
dtrace("%i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
- *new_fragment, *move_data);
+ *new_fragment, *flags);
gd_move(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
- *field_code_l), *new_fragment, *move_data);
+ *field_code_l), *new_fragment, *flags);
free(fc);
dreturnvoid();
@@ -2927,15 +2927,15 @@
/* gd_rename wrapper */
void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code,
const int32_t *field_code_l, const char *new_name,
- const int32_t *new_name_l, const int32_t *move_data)
+ const int32_t *new_name_l, const int32_t *flags)
{
char *fc, *nn;
dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
- new_name, *new_name_l, *move_data);
+ new_name, *new_name_l, *flags);
gd_rename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
- *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *move_data);
+ *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *flags);
free(nn);
free(fc);
@@ -3787,21 +3787,6 @@
dreturnvoid();
}
-/* gd_move_alias wrapper */
-void F77_FUNC(gdmova, GDMOVA) (const int32_t *dirfile, const char *field_code,
- const int32_t *field_code_l, const int32_t *new_fragment)
-{
- char *fc;
-
- dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *new_fragment);
-
- gd_move_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
- *field_code_l), *new_fragment);
-
- free(fc);
- dreturnvoid();
-}
-
/* gd_include_affix wrapper */
void F77_FUNC(gdinca, GDINCA) (const int32_t *dirfile, const char *file,
const int32_t *file_l, const int32_t *fragment_index, const char *prefix,
Modified: trunk/getdata/bindings/f77/getdata.f.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f.in 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/f77/getdata.f.in 2013-12-07 01:48:34 UTC (rev 867)
@@ -337,8 +337,6 @@
EXTERNAL GDMFNX
C Correpsonding to gd_malter_spec(3)
EXTERNAL GDMLSP
-C Correpsonding to gd_move_alias(3)
- EXTERNAL GDMOVA
C Correpsonding to gd_move(3)
EXTERNAL GDMOVE
C Corresponding to gd_mstrings(3) (sort of)
Modified: trunk/getdata/bindings/f77/getdata.f90.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f90.in 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/f77/getdata.f90.in 2013-12-07 01:48:34 UTC (rev 867)
@@ -1624,12 +1624,12 @@
LEN_TRIM(field_code))
end function
-subroutine fgd_move (dirfile, field_code, new_fragment, move_data)
- integer, intent(in) :: dirfile, new_fragment, move_data
+subroutine fgd_move (dirfile, field_code, new_fragment, flags)
+ integer, intent(in) :: dirfile, new_fragment, flags
character (len=*), intent(in) :: field_code
call gdmove (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment, &
- move_data)
+ flags)
end subroutine
! calculate in_fields string lengths
@@ -1966,12 +1966,12 @@
LEN_TRIM(parent), recode)
end subroutine
-subroutine fgd_rename (dirfile, field_code, new_name, move_data)
- integer, intent(in) :: dirfile, move_data
+subroutine fgd_rename (dirfile, field_code, new_name, flags)
+ integer, intent(in) :: dirfile, flags
character (len=*), intent(in) :: field_code, new_name
call gdrenm(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(new_name), &
- LEN_TRIM(new_name), move_data)
+ LEN_TRIM(new_name), flags)
end subroutine
subroutine fgd_delete (dirfile, field_code, flags)
@@ -2865,13 +2865,6 @@
LEN_TRIM(field_code), TRIM(targ), LEN_TRIM(targ))
end subroutine
-subroutine fgd_move_alias (dirfile, field_code, new_fragment)
- integer, intent(in) :: dirfile, new_fragment
- character (len=*), intent(in) :: field_code
-
- call gdmova (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment)
-end subroutine
-
subroutine fgd_include_affix (dirfile, fragmentname, fragment_index, prefix, &
suffix, flags)
integer, intent(in) :: dirfile, fragment_index, flags
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/f77/test/big_test.f 2013-12-07 01:48:34 UTC (rev 867)
@@ -1990,19 +1990,11 @@
CALL GDINCA(d, 'format1', 7, 0, 'A', 1, 'Z', 1, GD_CR + GD_EX)
CALL CHKEOK(ne, 223, d)
-C 224: GDMOVA check
- CALL GDMOVA(d, 'new20', 5, 1)
- CALL CHKOK2(ne, 224, 1, d)
-
- CALL GDFRGI(n, d, 'Anew20Z', 7)
- CALL CHKOK2(ne, 224, 2, d)
- CALL CHKINT(ne, 224, n, 1)
-
C 225: GDDELA check
- CALL GDDELA(d, 'Anew20Z', 7, 0)
+ CALL GDDELA(d, 'new20', 7, 0)
CALL CHKOK2(ne, 225, 1, d)
- CALL GDFRGI(n, d, 'Anew20Z', 7)
+ CALL GDFRGI(n, d, 'new20', 7)
CALL CHKER2(ne, 225, 2, d, GD_EBC)
CALL CHKINT(ne, 225, n, -1)
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2013-12-07 01:48:34 UTC (rev 867)
@@ -2405,19 +2405,11 @@
call fgd_include_affix(d, 'format1', 0, 'A', 'Z', GD_CREAT + GD_EXCL)
call check_ok(ne, 223, d)
-! 224: GDMOVA check
- call fgd_move_alias(d, 'new20', 1)
- call check_ok2(ne, 224, 1, d)
-
- n = fgd_fragment_index(d, 'Anew20Z')
- call check_ok2(ne, 224, 2, d)
- call check_int(ne, 224, n, 1)
-
! 225: fgd_delete_alias check
- call fgd_delete_alias(d, 'Anew20Z', 0)
+ call fgd_delete_alias(d, 'new20', 0)
call check_ok2(ne, 225, 1, d)
- n = fgd_fragment_index(d, 'Anew20Z')
+ n = fgd_fragment_index(d, 'new20')
call check_err2(ne, 225, 2, d, GD_E_BAD_CODE)
call check_int(ne, 225, n, -1)
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/idl/getdata.c 2013-12-07 01:48:34 UTC (rev 867)
@@ -3355,19 +3355,20 @@
typedef struct {
IDL_KW_RESULT_FIRST_FIELD;
GDIDL_KW_RESULT_ERROR;
- int move_data;
- int alias;
+ int dangle, force, move_data, updatedb;
} KW_RESULT;
KW_RESULT kw;
- kw.move_data = kw.alias = 0;
+ kw.dangle = kw.force = kw.move_data = kw.updatedb = 0;
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
- { "ALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(alias) },
+ { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) },
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
+ { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) },
{ "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+ { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) },
{ NULL }
};
@@ -3376,10 +3377,11 @@
DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
const char* field_code = IDL_VarGetString(argv[1]);
- if (kw.alias)
- gd_move_alias(D, field_code, IDL_LongScalar(argv[2]));
- else
- gd_move(D, field_code, IDL_LongScalar(argv[2]), kw.move_data);
+ gd_move(D, field_code, IDL_LongScalar(argv[2]),
+ (kw.dangle ? GD_REN_DANGLE : 0) |
+ (kw.force ? GD_REN_FORCE : 0) |
+ (kw.move_data ? GD_REN_DATA : 0) |
+ (kw.updatedb ? GD_REN_UPDB : 0));
GDIDL_SET_ERROR(D);
@@ -3550,17 +3552,18 @@
typedef struct {
IDL_KW_RESULT_FIRST_FIELD;
GDIDL_KW_RESULT_ERROR;
- int updatedb;
- int move_data;
+ int dangle, force, move_data, updatedb;
} KW_RESULT;
KW_RESULT kw;
- kw.move_data = kw.updatedb = 0;
+ kw.dangle = kw.force = kw.move_data = kw.updatedb = 0;
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
+ { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) },
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
+ { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) },
{ "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
{ "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) },
{ NULL }
@@ -3572,8 +3575,11 @@
const char* field_code = IDL_VarGetString(argv[1]);
const char* new_code = IDL_VarGetString(argv[2]);
- gd_rename(D, field_code, new_code, (kw.move_data ? GD_REN_DATA : 0) |
- (kw.move_data ? GD_REN_UPDB : 0));
+ gd_rename(D, field_code, new_code,
+ (kw.dangle ? GD_REN_DANGLE : 0) |
+ (kw.force ? GD_REN_FORCE : 0) |
+ (kw.move_data ? GD_REN_DATA : 0) |
+ (kw.updatedb ? GD_REN_UPDB : 0));
GDIDL_SET_ERROR(D);
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2013-12-07 01:48:34 UTC (rev 867)
@@ -1259,19 +1259,11 @@
gd_include, d, 'format1', prefix='A', suffix='Z', /CREAT, /EXCL
nume += check_ok(223, d)
-; 224: GDMOVA check
-gd_move, d, 'new20', 1, /ALIAS
-nume += check_ok2(224, 1, d)
-
-n = gd_fragment_index(d, 'Anew20Z')
-nume += check_ok2(224, 2, d)
-nume += check_simple(224, n, 1)
-
; 225: gd_delete_alias check
-gd_delete, d, 'Anew20Z', /ALIAS
+gd_delete, d, 'new20', /ALIAS
nume += check_ok2(225, 1, d)
-n = gd_fragment_index(d, 'Anew20Z')
+n = gd_fragment_index(d, 'new20')
nume += check_error2(225, 2, d, !GD.E_BAD_CODE)
nume += check_simple(225, n, -1)
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/make_parameters.c 2013-12-07 01:48:34 UTC (rev 867)
@@ -166,6 +166,8 @@
CONSTANT(DEL_FORCE, "GDD_FO", 5),
CONSTANT(REN_DATA, "GDR_DT", 5),
CONSTANT(REN_UPDB, "GDR_UP", 5),
+ CONSTANT(REN_DANGLE, "GDR_DL", 5),
+ CONSTANT(REN_FORCE, "GDR_FO", 5),
CONSTANT(PROTECT_NONE, "GDPR_N", 6),
CONSTANT(PROTECT_FORMAT, "GDPR_F", 6),
Modified: trunk/getdata/bindings/perl/simple_funcs.xsin
===================================================================
--- trunk/getdata/bindings/perl/simple_funcs.xsin 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/perl/simple_funcs.xsin 2013-12-07 01:48:34 UTC (rev 867)
@@ -123,7 +123,6 @@
int hidden(DIRFILE *dirfile, const char *field_code)
int unhide(DIRFILE *dirfile, const char *field_code)
int sync(DIRFILE *dirfile, const char *field_code)
-int move_alias(DIRFILE *dirfile, const char *field_code, int new_fragment)
int delete_alias(DIRFILE *dirfile, const char *field_code, unsigned int flags=0)
const char *alias_target(DIRFILE *dirfile, const char *field_code)
int add_alias(DIRFILE *dirfile, const char *field_code, const char *target,
Modified: trunk/getdata/bindings/perl/t/big_test.t
===================================================================
--- trunk/getdata/bindings/perl/t/big_test.t 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/perl/t/big_test.t 2013-12-07 01:48:34 UTC (rev 867)
@@ -22,7 +22,7 @@
use GetData;
use Math::Complex;
use strict;
-use Test::More tests => 1521;
+use Test::More tests => 1518;
my $ne = 0;
my ($s, @a, %h);
@@ -1601,19 +1601,11 @@
$s = $_->include('format1', 0, $GetData::CREAT | $GetData::EXCL, 'A', 'Z');
CheckOK(223);
-# 224: GDMOVA check
-$s = $_->move_alias('new20', 1);
-CheckOK2(224, 1);
-
-$s = $_->fragment_index('Anew20Z');
-CheckOK2(224, 2);
-CheckNum(224, $s, 1);
-
# 225: gd_delete_alias check
-$s = $_->delete_alias('Anew20Z', 0);
+$s = $_->delete_alias('new20', 0);
CheckOK2(225, 1);
-$_->fragment_index('Anew20Z');
+$_->fragment_index('new20');
CheckError2(225, 2, $GetData::E_BAD_CODE);
# 226: gd_fragment_affixes check
Modified: trunk/getdata/bindings/php/getdata.c
===================================================================
--- trunk/getdata/bindings/php/getdata.c 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/php/getdata.c 2013-12-07 01:48:34 UTC (rev 867)
@@ -3900,32 +3900,17 @@
char *field_code;
int field_code_len;
long new_fragment;
- zend_bool move_data = 0;
+ long flags = 0;
DIRFILE *D;
dtracephp();
- GDPHP_PARSED("sl|b", &field_code, &field_code_len, &new_fragment, &move_data);
+ GDPHP_PARSED("sl|l", &field_code, &field_code_len, &new_fragment, &flags);
- GDPHP_RETURN_BOOL(gd_move(D, field_code, new_fragment, move_data));
+ GDPHP_RETURN_BOOL(gd_move(D, field_code, new_fragment, flags));
}
-PHP_FUNCTION(gd_move_alias)
-{
- char *field_code;
- int field_code_len;
- long new_fragment;
-
- DIRFILE *D;
-
- dtracephp();
-
- GDPHP_PARSED("sl", &field_code, &field_code_len, &new_fragment);
-
- GDPHP_RETURN_BOOL(gd_move_alias(D, field_code, new_fragment));
-}
-
PHP_FUNCTION(gd_mplex_lookback)
{
long lookback;
@@ -4482,7 +4467,7 @@
PHP_FUNCTION(gd_rewrite_fragment)
{
- zval *zi;
+ zval *zi = NULL;
long i;
@@ -4803,7 +4788,6 @@
PHP_FE(gd_mfield_list, NULL)
PHP_FE(gd_mfield_list_by_type, NULL)
PHP_FE(gd_move, NULL)
- PHP_FE(gd_move_alias, NULL)
PHP_FE(gd_mplex_lookback, NULL)
PHP_FE(gd_mstrings, NULL)
PHP_FE(gd_mvector_list, NULL)
Modified: trunk/getdata/bindings/php/test/big_test.php
===================================================================
--- trunk/getdata/bindings/php/test/big_test.php 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/php/test/big_test.php 2013-12-07 01:48:34 UTC (rev 867)
@@ -1357,21 +1357,12 @@
check_ok2(223, 0, $D);
check_var2(223, 1, $v, 1);
-# 224: move alias
-$v = gd_move_alias($D, 'new20', 1);
-check_ok2(224, 0, $D);
-check_var2(224, 1, $v, TRUE);
-
-$v = gd_fragment_index($D, 'Anew20Z');
-check_ok2(224, 2, $D);
-check_var2(224, 3, $v, 1);
-
# 225: delete alias
-$v = gd_delete_alias($D, 'Anew20Z');
+$v = gd_delete_alias($D, 'new20');
check_ok2(225, 0, $D);
check_var2(225, 1, $v, TRUE);
-$v = gd_fragment_index($D, 'Anew20Z');
+$v = gd_fragment_index($D, 'new20');
check_error2(225, 2, $D, GD_E_BAD_CODE);
check_var2(225, 3, $v, FALSE);
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/python/pydirfile.c 2013-12-07 01:48:34 UTC (rev 867)
@@ -2157,20 +2157,20 @@
static PyObject *gdpy_dirfile_move(struct gdpy_dirfile_t *self, PyObject *args,
PyObject *keys)
{
- char *keywords[] = { "field_code", "new_fragment", "move_data", NULL };
+ char *keywords[] = { "field_code", "new_fragment", "flags", NULL };
const char *field_code;
int new_fragment;
- int move_data = 0;
+ unsigned flags = 0;
dtrace("%p, %p, %p", self, args, keys);
- if (!PyArg_ParseTupleAndKeywords(args, keys, "si|i:pygetdata.dirfile.move",
- keywords, &field_code, &new_fragment, &move_data)) {
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "si|I:pygetdata.dirfile.move",
+ keywords, &field_code, &new_fragment, &flags)) {
dreturn ("%p", NULL);
return NULL;
}
- gd_move(self->D, field_code, new_fragment, move_data);
+ gd_move(self->D, field_code, new_fragment, flags);
PYGD_CHECK_ERROR(self->D, NULL);
@@ -2429,32 +2429,6 @@
return pyobj;
}
-static PyObject *gdpy_dirfile_movealias(struct gdpy_dirfile_t *self,
- PyObject *args, PyObject *keys)
-{
- char *keywords[] = { "field_code", "new_fragment", NULL };
- const char *field_code;
- int new_fragment;
-
- dtrace("%p, %p, %p", self, args, keys);
-
- if (!PyArg_ParseTupleAndKeywords(args, keys,
- "si:pygetdata.dirfile.move_alias", keywords, &field_code,
- &new_fragment))
- {
- dreturn ("%p", NULL);
- return NULL;
- }
-
- gd_move_alias(self->D, field_code, new_fragment);
-
- PYGD_CHECK_ERROR(self->D, NULL);
-
- Py_INCREF(Py_None);
- dreturn("%p", Py_None);
- return Py_None;
-}
-
static PyObject *gdpy_dirfile_deletealias(struct gdpy_dirfile_t *self,
void *args, void *keys)
{
@@ -3081,7 +3055,6 @@
METH_VARARGS | METH_KEYWORDS,
"linterp_tablename(field_code)\n\n"
"Return the pathname of the look-up table (LUT) on disk used by the\n"
- /* ------- handy ruler ---------------------------------------------| */
"LINTERP field specified by 'field_code'. See\n"
"gd_linterp_tablename(3)."
},
@@ -3273,12 +3246,12 @@
"Flush all pending metadata changes to disk. See gd_metaflush(3)."
},
{"move", (PyCFunction)gdpy_dirfile_move, METH_VARARGS | METH_KEYWORDS,
- "move(field_code, new_fragment [, move_data])\n\n"
+ "move(field_code, new_fragment [, flags])\n\n"
"Move the specification of the field given by 'field_code' to the\n"
- "format file fragment indexed by 'new_fragment'. If 'move_data' is\n"
- "given and is non-zero, and 'field_code' specifies a RAW field, the\n"
- "associated file on disk will also be moved, if necessary. See\n"
- "gd_move(3)."
+ /* ------- handy ruler ---------------------------------------------| */
+ "format file fragment indexed by 'new_fragment'. If 'flags' is given\n"
+ "and is non-zero, it should be a bitwise or'd collection of the\n"
+ "pygetdat.REN_* symbols. See gd_move(3)."
},
{"put_carray", (PyCFunction)gdpy_dirfile_putcarray,
METH_VARARGS | METH_KEYWORDS,
@@ -3394,12 +3367,6 @@
"field. If field_code is valid, this will be at least one. See\n"
"gd_naliases(3)."
},
- {"move_alias", (PyCFunction)gdpy_dirfile_movealias,
- METH_VARARGS | METH_KEYWORDS,
- "move_alias(field_code, new_fragment)\n\n"
- "This moves the alias specified by 'field_code' to the fragment\n"
- "indexed by 'new_fragment'. See gd_move_alias(3)."
- },
{"delete_alias", (PyCFunction)gdpy_dirfile_deletealias,
METH_VARARGS | METH_KEYWORDS,
"delete_alias(field_code[, flags])\n\n"
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/bindings/python/test/big_test.py 2013-12-07 01:48:34 UTC (rev 867)
@@ -1794,26 +1794,14 @@
except:
CheckOK(223)
-# 224: gd_move_alias check
-try:
- d.move_alias('new20', 1)
-except:
- CheckOK2(224, 1)
-
-try:
- n = d.fragment_index('Anew20Z')
-except:
- CheckOK2(224, 2)
-CheckSimple(224, n, 1)
-
# 225: gd_delete_alias check
try:
- d.delete_alias('Anew20Z', 0)
+ d.delete_alias('new20', 0)
except:
CheckOK2(225, 1)
try:
- n = d.fragment_index('Anew20Z')
+ n = d.fragment_index('new20')
except:
CheckException2(255, 2, pygetdata.BadCodeError)
Modified: trunk/getdata/doc/list.tests
===================================================================
--- trunk/getdata/doc/list.tests 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/doc/list.tests 2013-12-07 01:48:34 UTC (rev 867)
@@ -222,7 +222,7 @@
221 F9CIpPmh gd_naliases
222 F9CIpPmh gd_aliases
223 F9CIpPmh gd_include_affix
-224 F9CIpPmh gd_move_alias
+224 ........ (unused)
225 F9CIpPmh gd_delete_alias
226 F9CIpPmh gd_fragment_affixes
227 F9CIpPmh gd_alter_affixes
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/Makefile.am 2013-12-07 01:48:34 UTC (rev 867)
@@ -86,7 +86,6 @@
gd_put_carray_slice.3:gd_put_carray.3 \
gd_put_carray_slice.3:gd_put_constant.3 \
gd_delete.3:gd_delete_alias.3 \
- gd_move.3:gd_move_alias.3 \
gd_hide.3:gd_unhide.3 \
gd_add_alias.3:gd_madd_alias.3 \
gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \
Modified: trunk/getdata/man/gd_alter_entry.3
===================================================================
--- trunk/getdata/man/gd_alter_entry.3 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/gd_alter_entry.3 2013-12-07 01:48:34 UTC (rev 867)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_alter_entry 3 "1 October 2013" "Version 0.9.0" "GETDATA"
+.TH gd_alter_entry 3 "27 November 2013" "Version 0.9.0" "GETDATA"
.SH NAME
gd_alter_entry \(em modify the metadata of a dirfile field
.SH SYNOPSIS
@@ -146,10 +146,10 @@
.IR entry -> scalar_ind
element should also be set.
.IP \(bu 4
-a pointer the empty string (""). In this case, no change is made to the field
-code for the corresponding field parameter: if one already existed, it is kept,
-otherwise the corresponding literal numerical parameter is used. If the value
-of the corresponding numerical
+a pointer to the empty string (""). In this case, no change is made to the
+field code for the corresponding field parameter: if one already existed, it is
+kept, otherwise the corresponding literal numerical parameter is used. If the
+value of the corresponding numerical
.I entry
member is the special value listed above indicating no change, no change is
made to the field parameter at all.
Modified: trunk/getdata/man/gd_entry.3
===================================================================
--- trunk/getdata/man/gd_entry.3 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/gd_entry.3 2013-12-07 01:48:34 UTC (rev 867)
@@ -61,6 +61,9 @@
.BR gd_free_entry_strings (3)
function is provided as a convenience to do this.
+If the entry's metadata contains scalar field codes which cannot be dereferenced,
+the associated numerical field parameter will be initialised to zero.
+
The returned
.I entry
structure, including strings and their pointers may be freely modified by the
@@ -90,9 +93,6 @@
The representation suffix specified in
.I field_code
was not recognised.
-.TP
-.B GD_E_BAD_SCALAR
-A scalar parameter used in the definition of the field was invalid.
.PP
The dirfile error may be retrieved by calling
.BR gd_error (3).
Modified: trunk/getdata/man/gd_free_entry_strings.3
===================================================================
--- trunk/getdata/man/gd_free_entry_strings.3 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/gd_free_entry_strings.3 2013-12-07 01:48:34 UTC (rev 867)
@@ -1,6 +1,6 @@
.\" gd_free_entry_strings.3. The gd_free_entry_strings man page.
.\"
-.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2013 D. V. Wiebe
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_free_entry_strings 3 "16 June 2010" "Version 0.7.0" "GETDATA"
+.TH gd_free_entry_strings 3 "7 December 2013" "Version 0.9.0" "GETDATA"
.SH NAME
gd_free_entry_strings \(em free strings in a GetData gd_entry_t object
.SH SYNOPSIS
@@ -31,7 +31,7 @@
.I entry
which were previously allocated by a call to
.BR gd_entry (3).
-If
+After freeing a string, the associated pointer is set to NULL. If
.I entry
is NULL, this function does nothing.
@@ -52,9 +52,9 @@
See
.BR gd_entry (3)
-for a complete description of the gd_entry_t data type.
+for a description of the gd_entry_t data type.
.SH RETURN VALUE
-A call to
+The function
.BR gd_free_entry_strings ()
always returns its input,
.IR entry .
Modified: trunk/getdata/man/gd_move.3
===================================================================
--- trunk/getdata/man/gd_move.3 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/gd_move.3 2013-12-07 01:48:34 UTC (rev 867)
@@ -1,6 +1,6 @@
.\" gd_move.3. The gd_move man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
@@ -13,25 +13,22 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_move 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_move 3 "7 Decmeber 2013" "Version 0.9.0" "GETDATA"
.SH NAME
-gd_move, gd_move_alias \(em move a dirfile entry between format specification fragments
+gd_move \(em move a dirfile entry between format specification fragments
.SH SYNOPSIS
.B #include <getdata.h>
.HP
.nh
.ad l
.BI "int gd_move(DIRFILE *" dirfile ", const char"
-.BI * field_code ", int " new_fragment ", int " move_data );
-.HP
-.BI "int gd_move_alias(DIRFILE *" dirfile ", const char"
-.BI * alias_name ", int " new_fragment );
+.BI * field_code ", int " new_fragment ", unsigned int " flags );
.hy
.ad n
.SH DESCRIPTION
The
.BR gd_move ()
-function transfers the field specified by
+function transfers the field or alias specified by
.IR field_code ,
which should not have a representation suffix, defined in the dirfile
specified by
@@ -42,23 +39,26 @@
.IR new_fragment ,
this function does nothing.
+If the new fragment has different affixes, the field will be renamed as part of
+the move. See
+.BR gd_rename (3)
+for details on field renaming.
+
The
-.BR gd_move_alias ()
-function behaves similarly, but moves the alias named
-.I alias_name
-to the new fragment. (Passing
-.I alias_name
-to
-.BR gd_move ()
-as
+.I flags
+parameter should be zero or more of the following flags, bitwise or'd together:
+.TP
+.B GD_REN_DANGLE
+By default, if the move results in a change of name for the field due to
+differing fragment affixes,
+.B ALIAS
+entries pointing to this field will be updated with the field's new name.
+Specifying this flag prohibits this behaviour, turning these aliases into
+dangling aliases. If moving the field doesn't rename it, this flag is ignored.
+.TP
+.B GD_REN_DATA
+If
.I field_code
-will result in the field ultimately pointed to be the alias being moved, and
-not the alias itself.)
-
-If the flag
-.I move_data
-is one, and
-.I field_code
specifies a
.B RAW
field, the binary file associated with the field will be translated to account
@@ -70,15 +70,25 @@
.I field_code
specifies a field of type other than
.BR RAW ,
-the
-.I move_data
-flag is ignored.
+this flag is ignored.
If the binary file is translated, and the frame offset of the destination
fragment is larger than that of the source fragment, this will result in
permanent deletion of data from the database. If the new frame offset is
smaller than the old frame offset, the binary file will be padded at the front
with zeroes.
+.TP
+.B GD_REN_FORCE
+Skip updating entries which would be invalid (see
+.BR gd_rename (3)
+for details). By default, an invalid field causes the move to fail. If moving
+the field doesn't rename it, this flag is ignored.
+.TP
+.B GD_REN_UPDB
+If moving the field renames it, update entries which use this field as an input
+to account for the new name (see
+.BR gd_rename (3)).
+If moving the field doesn't rename it, this flag is ignored.
.SH RETURN VALUE
On success,
@@ -95,7 +105,9 @@
.B GD_E_BAD_CODE
The field specified by
.I field_code
-was not found.
+was not found, or else the move resulted in the field being renamed and
+the resultant metadata update tried to change a field code into something
+prohibited by a fragment's affixes.
.TP
.B GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
Modified: trunk/getdata/man/gd_rename.3
===================================================================
--- trunk/getdata/man/gd_rename.3 2013-11-15 22:39:46 UTC (rev 866)
+++ trunk/getdata/man/gd_rename.3 2013-12-07 01:48:34 UTC (rev 867)
@@ -1,6 +1,6 @@
.\" gd_rename.3. The gd_rename man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_rename 3 "27 June 2012" "Version 0.8.0" "GETDATA"
+.TH gd_rename 3 "7 December 2013" "Version 0.9.0" "GETDATA"
.SH NAME
gd_rename \(em change the name of a dirfile field or alias
.SH SYNOPSIS
@@ -43,10 +43,29 @@
.I new_name
should only contain the new name (without slash).
+If
+.I old_code
+specifies a top-level field with meta subfields, the subfields will be renamed,
+too. By default, this function also updates
+.B ALIAS
+entries whose target contains
+.I old_code
+to point to the new field. Similarly, specifying the
+.B GD_REN_UPDB
+flag will cause this function to modify any field entry containing
+.IR old_code .
+As a result, this function may cause more than one metadata fragment to be
+modified.
+
The
.I flags
parameter should be zero or more of the following flags, bitwise or'd together:
.TP
+.B GD_REN_DANGLE
+Don't update
+.B ALIAS
+entries, instead turning them into dangling aliases.
+.TP
.B GD_REN_DATA
if
.I old_code
@@ -59,6 +78,16 @@
.BR RAW ,
this flag is ignored.
.TP
+.B GD_REN_FORCE
+When updating field metadata (either the target of an alias, or else when
+specified along with
+.BR GD_REN_UPDB ),
+skip updating field codes which would be invalid (due to
+.B /INCLUDE
+affixes). Without this flag, such invalid field codes causes this function to
+fail with the error
+.BR GD_E_BAD_CODE .
+.TP
.B GD_REN_UPDB
Rename the field in any other field specifications which use this field as an
input (either as a vector input field to a derived field, or else as a scalar
@@ -80,7 +109,8 @@
.B GD_E_BAD_CODE
The field specified by
.I old_code
-was not found.
+was not found. Or else the resultant metadata update tried to change a
+field code into something prohibited by a fragment's affixes.
.TP
.B GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
@@ -94,9 +124,10 @@
The new name specified is already in use by another entry.
.TP
.B GD_E_PROTECTED
-The metadata of the format specification fragment containing the entry was
-protected from change, or the binary data of the fragments was protected from
-change and a binary file move was requested.
+The metadata of the format specification fragment containing the renamed entry,
+or another entry affected by this change, was protected from change, or the
+binary data of the fragment was protected from change and a binary file move
+was requested.
.TP
.B GD_E_RAW_IO
An I/O error occurred while attempting to rename the binary file.
Modified: trunk/getdata/src/add.c
===================================================================
--- trun...
[truncated message content] |