getdata-commits Mailing List for GetData (Page 4)
Scientific Database Format
Brought to you by:
ketiltrout
This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(20) |
Nov
(21) |
Dec
(16) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(1) |
Feb
(1) |
Mar
(56) |
Apr
(20) |
May
(4) |
Jun
(2) |
Jul
(3) |
Aug
(11) |
Sep
(2) |
Oct
(4) |
Nov
(18) |
Dec
(16) |
2012 |
Jan
(8) |
Feb
(12) |
Mar
(30) |
Apr
(13) |
May
(10) |
Jun
(17) |
Jul
(18) |
Aug
(19) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(9) |
2013 |
Jan
(1) |
Feb
(4) |
Mar
(27) |
Apr
(6) |
May
(3) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(15) |
Nov
(4) |
Dec
(9) |
2014 |
Jan
|
Feb
(3) |
Mar
(4) |
Apr
(10) |
May
(15) |
Jun
|
Jul
(14) |
Aug
|
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(9) |
2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ket...@us...> - 2013-12-11 22:35:48
|
Revision: 871 http://sourceforge.net/p/getdata/code/871 Author: ketiltrout Date: 2013-12-11 22:35:43 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Close some memory leaks. Modified Paths: -------------- trunk/getdata/test/alter_clincom.c trunk/getdata/test/entry_raw_scalar_code.c trunk/getdata/test/entry_raw_scalar_type.c trunk/getdata/test/get_linterp_abs.c trunk/getdata/test/open_sym_al.c trunk/getdata/test/open_sym_at.c trunk/getdata/test/open_sym_d.c trunk/getdata/test/open_sym_l.c trunk/getdata/test/tok_escape.c trunk/getdata/test/tok_quote.c Modified: trunk/getdata/test/alter_clincom.c =================================================================== --- trunk/getdata/test/alter_clincom.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/alter_clincom.c 2013-12-11 22:35:43 UTC (rev 871) @@ -80,6 +80,7 @@ CHECKC(E.EN(lincom,cb)[0], b[0]); CHECKC(E.EN(lincom,cb)[1], b[1]); #endif + gd_free_entry_strings(&E); gd_discard(D); Modified: trunk/getdata/test/entry_raw_scalar_code.c =================================================================== --- trunk/getdata/test/entry_raw_scalar_code.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/entry_raw_scalar_code.c 2013-12-11 22:35:43 UTC (rev 871) @@ -48,7 +48,9 @@ n = gd_entry(D, "data", &E); error = gd_error(D); CHECKI(error, 0); + CHECKI(E.flags, 0); CHECKI(n, 0); + gd_free_entry_strings(&E); gd_discard(D); unlink(format); Modified: trunk/getdata/test/entry_raw_scalar_type.c =================================================================== --- trunk/getdata/test/entry_raw_scalar_type.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/entry_raw_scalar_type.c 2013-12-11 22:35:43 UTC (rev 871) @@ -31,7 +31,7 @@ { const char *filedir = "dirfile"; const char *format = "dirfile/format"; - const char *format_data = "const RAW UINT32 8\ndata RAW UINT8 const\n"; + const char *format_data = "const STRING 8\ndata RAW UINT8 const\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; @@ -48,7 +48,9 @@ n = gd_entry(D, "data", &E); error = gd_error(D); CHECKI(error, 0); + CHECKI(E.flags, 0); CHECKI(n, 0); + gd_free_entry_strings(&E); gd_discard(D); unlink(format); Modified: trunk/getdata/test/get_linterp_abs.c =================================================================== --- trunk/getdata/test/get_linterp_abs.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/get_linterp_abs.c 2013-12-11 22:35:43 UTC (rev 871) @@ -95,6 +95,8 @@ CHECKI(n, 1); CHECKU(c, 10); + free(cwd); + return r; #endif } Modified: trunk/getdata/test/open_sym_al.c =================================================================== --- trunk/getdata/test/open_sym_al.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/open_sym_al.c 2013-12-11 22:35:43 UTC (rev 871) @@ -50,6 +50,7 @@ sprintf(targ, "%s/dirfile/", cwd); symlink(targ, filedir); + free(targ); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); Modified: trunk/getdata/test/open_sym_at.c =================================================================== --- trunk/getdata/test/open_sym_at.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/open_sym_at.c 2013-12-11 22:35:43 UTC (rev 871) @@ -50,6 +50,7 @@ sprintf(targ, "%s/dirfile", cwd); symlink(targ, "dirfile/link"); + free(targ); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); Modified: trunk/getdata/test/open_sym_d.c =================================================================== --- trunk/getdata/test/open_sym_d.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/open_sym_d.c 2013-12-11 22:35:43 UTC (rev 871) @@ -18,6 +18,8 @@ * along with GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* this tests whether _GD_CanonicalPath can deal with bad intermediate + * symlinks */ #include "test.h" #include <stdlib.h> @@ -33,7 +35,6 @@ #else const char *link = "dirfile/link"; const char *filedir = "dirfile/link/dirfile"; - char *targ; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; @@ -45,23 +46,20 @@ mkdir("dirfile", 0777); /* make a bad symlink */ - targ = (char*)malloc(cwd_size + 8); - sprintf(targ, "%s/dirfile", cwd); - symlink("non_existent", link); - /* this tests whether _GD_CanonicalPath can deal with bad intermediate - * symlinks */ D = gd_open(filedir, GD_RDONLY); error = gd_error(D); ptr = gd_error_string(D, NULL, 0); + CHECKI(error, GD_E_OPEN); + CHECKEOS(ptr, "dirfile/non_existent/dirfile"); + free(ptr); + gd_discard(D); unlink(link); rmdir("dirfile"); - CHECKI(error, GD_E_OPEN); - CHECKEOS(ptr, "dirfile/non_existent/dirfile"); free(cwd); return r; #endif Modified: trunk/getdata/test/open_sym_l.c =================================================================== --- trunk/getdata/test/open_sym_l.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/open_sym_l.c 2013-12-11 22:35:43 UTC (rev 871) @@ -18,6 +18,7 @@ * along with GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* this tests whether _GD_CanonicalPath can deal with symlink loops */ #include "test.h" #include <stdlib.h> @@ -34,7 +35,6 @@ #else const char *link = "dirfile/link"; const char *filedir = "dirfile/link/dirfile"; - char *targ; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; @@ -46,12 +46,8 @@ mkdir("dirfile", 0777); /* make a bad symlink */ - targ = (char*)malloc(cwd_size + 8); - sprintf(targ, "%s/dirfile", cwd); - symlink("link", link); - /* this tests whether _GD_CanonicalPath can deal with symlink loops */ D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); Modified: trunk/getdata/test/tok_escape.c =================================================================== --- trunk/getdata/test/tok_escape.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/tok_escape.c 2013-12-11 22:35:43 UTC (rev 871) @@ -18,7 +18,6 @@ * along with GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* Parser check */ #include "test.h" #include <stdlib.h> @@ -41,29 +40,35 @@ D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); e1 = gd_error(D); + CHECKI(e1,GD_E_OK); tok1 = gd_strtok(D, spec); e2 = gd_error(D); + CHECKI(e2,GD_E_OK); + CHECKS(tok1,"string"); + free(tok1); + tok2 = gd_strtok(D, NULL); e3 = gd_error(D); + CHECKI(e3,GD_E_OK); + CHECKS(tok2,"STRING"); + free(tok2); + tok3 = gd_strtok(D, NULL); e4 = gd_error(D); + CHECKI(e4,GD_E_OK); + CHECKS(tok3," value"); + free(tok3); + tok4 = gd_strtok(D, NULL); e5 = gd_error(D); + CHECKI(e5,GD_E_OK); + CHECKP(tok4); gd_discard(D); unlink(format); rmdir(filedir); - CHECKI(e1,GD_E_OK); - CHECKI(e2,GD_E_OK); - CHECKI(e3,GD_E_OK); - CHECKI(e4,GD_E_OK); - CHECKI(e5,GD_E_OK); - CHECKS(tok1,"string"); - CHECKS(tok2,"STRING"); - CHECKS(tok3," value"); - CHECKP(tok4); return r; } Modified: trunk/getdata/test/tok_quote.c =================================================================== --- trunk/getdata/test/tok_quote.c 2013-12-11 05:04:11 UTC (rev 870) +++ trunk/getdata/test/tok_quote.c 2013-12-11 22:35:43 UTC (rev 871) @@ -18,7 +18,6 @@ * along with GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* Parser check */ #include "test.h" #include <stdlib.h> @@ -41,29 +40,35 @@ D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); e1 = gd_error(D); + CHECKI(e1,GD_E_OK); tok1 = gd_strtok(D, spec); e2 = gd_error(D); + CHECKI(e2,GD_E_OK); + CHECKS(tok1,"string"); + free(tok1); + tok2 = gd_strtok(D, NULL); e3 = gd_error(D); + CHECKI(e3,GD_E_OK); + CHECKS(tok2,"STRING"); + free(tok2); + tok3 = gd_strtok(D, NULL); e4 = gd_error(D); + CHECKI(e4,GD_E_OK); + CHECKS(tok3,"value"); + free(tok3); + tok4 = gd_strtok(D, NULL); e5 = gd_error(D); + CHECKI(e5,GD_E_OK); + CHECKP(tok4); gd_discard(D); unlink(format); rmdir(filedir); - CHECKI(e1,GD_E_OK); - CHECKI(e2,GD_E_OK); - CHECKI(e3,GD_E_OK); - CHECKI(e4,GD_E_OK); - CHECKI(e5,GD_E_OK); - CHECKS(tok1,"string"); - CHECKS(tok2,"STRING"); - CHECKS(tok3,"value"); - CHECKP(tok4); return r; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-12-11 05:04:14
|
Revision: 870 http://sourceforge.net/p/getdata/code/870 Author: ketiltrout Date: 2013-12-11 05:04:11 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Doc updates. Modified Paths: -------------- trunk/getdata/man/gd_linterp_tablename.3 trunk/getdata/man/gd_raw_filename.3 Modified: trunk/getdata/man/gd_linterp_tablename.3 =================================================================== --- trunk/getdata/man/gd_linterp_tablename.3 2013-12-11 05:03:23 UTC (rev 869) +++ trunk/getdata/man/gd_linterp_tablename.3 2013-12-11 05:04:11 UTC (rev 870) @@ -1,6 +1,6 @@ .\" gd_linterp_tablename.3. The gd_linterp_tablename man page. .\" -.\" Copyright (C) 2012 D. V. Wiebe +.\" Copyright (C) 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_linterp_tablename 3 "1 August 2012" "Version 0.8.1" "GETDATA" +.TH gd_linterp_tablename 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_linterp_tablename \(em retrieve the pathname of a look-up table in a dirfile .SH SYNOPSIS @@ -21,7 +21,7 @@ .HP .nh .ad l -.BI "const char *gd_linterp_tablename(DIRFILE *" dirfile ", const char" +.BI "char *gd_linterp_tablename(DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n @@ -51,9 +51,13 @@ .SH RETURN VALUE On success, .BR gd_linterp_tablename () -returns the full pathname of the LUT associated with the specified field. On -error, NULL is returned and the dirfile error is set to a non-zero error value. -Possible error values are: +returns the full pathname of the LUT associated with the specified field in a +buffer allocated by +.BR malloc (3). +Once no longer needed, the returned pointer should be passed to +.BR free (3) +to deallocate the associated memory. On error, NULL is returned and the dirfile +error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. @@ -88,4 +92,6 @@ .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), -.BR dirfile-format (5) +.BR dirfile-format (5), +.BR free (3), +.BR malloc (3) Modified: trunk/getdata/man/gd_raw_filename.3 =================================================================== --- trunk/getdata/man/gd_raw_filename.3 2013-12-11 05:03:23 UTC (rev 869) +++ trunk/getdata/man/gd_raw_filename.3 2013-12-11 05:04:11 UTC (rev 870) @@ -1,6 +1,6 @@ .\" gd_raw_filename.3. The gd_raw_filename man page. .\" -.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe +.\" Copyright (C) 2008, 2009, 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_raw_filename 3 "16 July 2010" "Version 0.7.0" "GETDATA" +.TH gd_raw_filename 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_raw_filename \(em retrieve the pathname of a binary file in a dirfile .SH SYNOPSIS @@ -21,14 +21,14 @@ .HP .nh .ad l -.BI "const char *gd_raw_filename(DIRFILE *" dirfile ", const char" +.BI "char *gd_raw_filename(DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_raw_filename () -function retrieves the pathname of the file backing the +function reports the pathname of the file backing the .B RAW field specified by .I field_code @@ -42,8 +42,12 @@ On success, .BR gd_raw_filename () returns the full pathname of the binary file associated with the specified -field. On error, NULL is returned and the dirfile error is set to a non-zero -error value. Possible error values are: +field in buffer allocated by +.BR malloc (3). +The returned pointer should be passed to +.BR free (3) +once the caller no longer needs it. On error, NULL is returned and the dirfile +error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. @@ -83,4 +87,6 @@ .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-encoding (5), -.BR dirfile-format (5) +.BR dirfile-format (5), +.BR free (3), +.BR malloc (3) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-12-11 05:03:34
|
Revision: 869 http://sourceforge.net/p/getdata/code/869 Author: ketiltrout Date: 2013-12-11 05:03:23 +0000 (Wed, 11 Dec 2013) Log Message: ----------- More test-suite chainsawing: replace many unnecessary gd_close calls with the less-expensive gd_discard. Also get rid of unnecessary strdups. Modified Paths: -------------- trunk/getdata/test/add_add.c trunk/getdata/test/add_bit.c trunk/getdata/test/add_bit_bitnum.c trunk/getdata/test/add_bit_bitsize.c trunk/getdata/test/add_bit_invalid.c trunk/getdata/test/add_bit_numbits.c trunk/getdata/test/add_carray.c trunk/getdata/test/add_clincom.c trunk/getdata/test/add_code.c trunk/getdata/test/add_const.c trunk/getdata/test/add_cpolynom.c trunk/getdata/test/add_crecip.c trunk/getdata/test/add_crecip89.c trunk/getdata/test/add_divide.c trunk/getdata/test/add_divide_invalid.c trunk/getdata/test/add_duplicate.c trunk/getdata/test/add_format.c trunk/getdata/test/add_invalid.c trunk/getdata/test/add_lincom.c trunk/getdata/test/add_lincom_affix.c trunk/getdata/test/add_lincom_invalid.c trunk/getdata/test/add_lincom_nfields.c trunk/getdata/test/add_linterp.c trunk/getdata/test/add_linterp_invalid.c trunk/getdata/test/add_meta.c trunk/getdata/test/add_meta_alias.c trunk/getdata/test/add_mplex.c trunk/getdata/test/add_multiply.c trunk/getdata/test/add_multiply_invalid.c trunk/getdata/test/add_phase.c trunk/getdata/test/add_phase_invalid.c trunk/getdata/test/add_polynom.c trunk/getdata/test/add_polynom_scalar.c trunk/getdata/test/add_protect.c trunk/getdata/test/add_raw.c trunk/getdata/test/add_raw_include.c trunk/getdata/test/add_raw_invalid.c trunk/getdata/test/add_raw_spf.c trunk/getdata/test/add_raw_spf_scalar.c trunk/getdata/test/add_raw_type.c trunk/getdata/test/add_rdonly.c trunk/getdata/test/add_recip.c trunk/getdata/test/add_sbit.c trunk/getdata/test/add_scalar.c trunk/getdata/test/add_scalar_carray.c trunk/getdata/test/add_scalar_carray_bad.c trunk/getdata/test/add_sort.c trunk/getdata/test/add_spec.c trunk/getdata/test/add_spec_affix.c trunk/getdata/test/add_spec_directive.c trunk/getdata/test/add_spec_invalid.c trunk/getdata/test/add_spec_meta.c trunk/getdata/test/add_string.c trunk/getdata/test/add_string_affix.c trunk/getdata/test/add_type.c trunk/getdata/test/add_window.c trunk/getdata/test/add_window_op.c trunk/getdata/test/alias_list.c trunk/getdata/test/alias_list_alias.c trunk/getdata/test/alias_list_missing.c trunk/getdata/test/alias_num.c trunk/getdata/test/alias_num_alias.c trunk/getdata/test/alias_num_missing.c trunk/getdata/test/alias_target.c trunk/getdata/test/alias_target_alias.c trunk/getdata/test/alias_target_missing.c trunk/getdata/test/alter_bit_bitnum.c trunk/getdata/test/alter_bit_numbits.c trunk/getdata/test/alter_carray_len.c trunk/getdata/test/alter_carray_type.c trunk/getdata/test/alter_clincom.c trunk/getdata/test/alter_const.c trunk/getdata/test/alter_const_r2c.c trunk/getdata/test/alter_cpolynom.c trunk/getdata/test/alter_crecip.c trunk/getdata/test/alter_crecip89.c trunk/getdata/test/alter_crecip89_null.c trunk/getdata/test/alter_crecip_zero.c trunk/getdata/test/alter_divide.c trunk/getdata/test/alter_entry.c trunk/getdata/test/alter_entry_affix.c trunk/getdata/test/alter_entry_hidden.c trunk/getdata/test/alter_entry_lincom.c trunk/getdata/test/alter_entry_recode.c trunk/getdata/test/alter_entry_scalar2a.c trunk/getdata/test/alter_entry_scalar2n.c trunk/getdata/test/alter_entry_scalar3.c trunk/getdata/test/alter_entry_scalar4.c trunk/getdata/test/alter_index.c trunk/getdata/test/alter_lincom_23.c trunk/getdata/test/alter_lincom_32.c trunk/getdata/test/alter_lincom_input.c trunk/getdata/test/alter_lincom_offset.c trunk/getdata/test/alter_lincom_slope.c trunk/getdata/test/alter_linterp.c trunk/getdata/test/alter_linterp_move.c trunk/getdata/test/alter_mplex.c trunk/getdata/test/alter_mspec.c trunk/getdata/test/alter_mspec_affix.c trunk/getdata/test/alter_multiply.c trunk/getdata/test/alter_phase.c trunk/getdata/test/alter_polynom_coeff.c trunk/getdata/test/alter_polynom_input.c trunk/getdata/test/alter_polynom_ord.c trunk/getdata/test/alter_raw_spf.c trunk/getdata/test/alter_raw_type.c trunk/getdata/test/alter_recip.c trunk/getdata/test/alter_recip_zero.c trunk/getdata/test/alter_spec.c trunk/getdata/test/alter_spec_affix.c trunk/getdata/test/alter_spec_meta.c trunk/getdata/test/alter_window.c trunk/getdata/test/ascii_add.c trunk/getdata/test/ascii_get.c trunk/getdata/test/ascii_get_get.c trunk/getdata/test/ascii_nframes.c trunk/getdata/test/ascii_put.c trunk/getdata/test/ascii_sync.c trunk/getdata/test/bof.c trunk/getdata/test/bof_lincom.c trunk/getdata/test/bof_phase.c trunk/getdata/test/bof_phase_neg.c trunk/getdata/test/bzip_get.c trunk/getdata/test/bzip_get_get.c trunk/getdata/test/bzip_move_from.c trunk/getdata/test/bzip_nframes.c trunk/getdata/test/bzip_put.c trunk/getdata/test/close_discard.c trunk/getdata/test/convert_complex128_complex64.c trunk/getdata/test/convert_complex128_float64.c trunk/getdata/test/convert_complex128_int64.c trunk/getdata/test/convert_complex128_uint64.c trunk/getdata/test/convert_complex64_complex128.c trunk/getdata/test/convert_complex64_float64.c trunk/getdata/test/convert_complex64_int64.c trunk/getdata/test/convert_complex64_uint64.c trunk/getdata/test/convert_float32_complex128.c trunk/getdata/test/convert_float32_complex64.c trunk/getdata/test/convert_float32_float64.c trunk/getdata/test/convert_float32_int16.c trunk/getdata/test/convert_float32_int32.c trunk/getdata/test/convert_float32_int64.c trunk/getdata/test/convert_float32_int8.c trunk/getdata/test/convert_float32_uint16.c trunk/getdata/test/convert_float32_uint32.c trunk/getdata/test/convert_float32_uint64.c trunk/getdata/test/convert_float32_uint8.c trunk/getdata/test/convert_float64_complex128.c trunk/getdata/test/convert_float64_complex64.c trunk/getdata/test/convert_float64_float32.c trunk/getdata/test/convert_float64_int16.c trunk/getdata/test/convert_float64_int32.c trunk/getdata/test/convert_float64_int64.c trunk/getdata/test/convert_float64_int8.c trunk/getdata/test/convert_float64_uint16.c trunk/getdata/test/convert_float64_uint32.c trunk/getdata/test/convert_float64_uint64.c trunk/getdata/test/convert_float64_uint8.c trunk/getdata/test/convert_int16_complex128.c trunk/getdata/test/convert_int16_complex64.c trunk/getdata/test/convert_int16_float32.c trunk/getdata/test/convert_int16_float64.c trunk/getdata/test/convert_int16_int32.c trunk/getdata/test/convert_int16_int64.c trunk/getdata/test/convert_int16_int8.c trunk/getdata/test/convert_int16_uint16.c trunk/getdata/test/convert_int16_uint32.c trunk/getdata/test/convert_int16_uint64.c trunk/getdata/test/convert_int16_uint8.c trunk/getdata/test/convert_int32_complex128.c trunk/getdata/test/convert_int32_complex64.c trunk/getdata/test/convert_int32_float32.c trunk/getdata/test/convert_int32_float64.c trunk/getdata/test/convert_int32_int16.c trunk/getdata/test/convert_int32_int64.c trunk/getdata/test/convert_int32_int8.c trunk/getdata/test/convert_int32_uint16.c trunk/getdata/test/convert_int32_uint32.c trunk/getdata/test/convert_int32_uint64.c trunk/getdata/test/convert_int32_uint8.c trunk/getdata/test/convert_int64_complex128.c trunk/getdata/test/convert_int64_complex64.c trunk/getdata/test/convert_int64_float32.c trunk/getdata/test/convert_int64_float64.c trunk/getdata/test/convert_int64_int16.c trunk/getdata/test/convert_int64_int32.c trunk/getdata/test/convert_int64_int8.c trunk/getdata/test/convert_int64_uint16.c trunk/getdata/test/convert_int64_uint32.c trunk/getdata/test/convert_int64_uint64.c trunk/getdata/test/convert_int64_uint8.c trunk/getdata/test/convert_int8_complex128.c trunk/getdata/test/convert_int8_complex64.c trunk/getdata/test/convert_int8_float32.c trunk/getdata/test/convert_int8_float64.c trunk/getdata/test/convert_int8_int16.c trunk/getdata/test/convert_int8_int32.c trunk/getdata/test/convert_int8_int64.c trunk/getdata/test/convert_int8_uint16.c trunk/getdata/test/convert_int8_uint32.c trunk/getdata/test/convert_int8_uint64.c trunk/getdata/test/convert_int8_uint8.c trunk/getdata/test/convert_uint16_complex128.c trunk/getdata/test/convert_uint16_complex64.c trunk/getdata/test/convert_uint16_float32.c trunk/getdata/test/convert_uint16_float64.c trunk/getdata/test/convert_uint16_int16.c trunk/getdata/test/convert_uint16_int32.c trunk/getdata/test/convert_uint16_int64.c trunk/getdata/test/convert_uint16_int8.c trunk/getdata/test/convert_uint16_uint32.c trunk/getdata/test/convert_uint16_uint64.c trunk/getdata/test/convert_uint16_uint8.c trunk/getdata/test/convert_uint32_complex128.c trunk/getdata/test/convert_uint32_complex64.c trunk/getdata/test/convert_uint32_float32.c trunk/getdata/test/convert_uint32_float64.c trunk/getdata/test/convert_uint32_int16.c trunk/getdata/test/convert_uint32_int32.c trunk/getdata/test/convert_uint32_int64.c trunk/getdata/test/convert_uint32_int8.c trunk/getdata/test/convert_uint32_uint16.c trunk/getdata/test/convert_uint32_uint64.c trunk/getdata/test/convert_uint32_uint8.c trunk/getdata/test/convert_uint64_complex128.c trunk/getdata/test/convert_uint64_complex64.c trunk/getdata/test/convert_uint64_float32.c trunk/getdata/test/convert_uint64_float64.c trunk/getdata/test/convert_uint64_int16.c trunk/getdata/test/convert_uint64_int32.c trunk/getdata/test/convert_uint64_int64.c trunk/getdata/test/convert_uint64_int8.c trunk/getdata/test/convert_uint64_uint16.c trunk/getdata/test/convert_uint64_uint32.c trunk/getdata/test/convert_uint64_uint8.c trunk/getdata/test/convert_uint8_complex128.c trunk/getdata/test/convert_uint8_complex64.c trunk/getdata/test/convert_uint8_float32.c trunk/getdata/test/convert_uint8_float64.c trunk/getdata/test/convert_uint8_int16.c trunk/getdata/test/convert_uint8_int32.c trunk/getdata/test/convert_uint8_int64.c trunk/getdata/test/convert_uint8_int8.c trunk/getdata/test/convert_uint8_uint16.c trunk/getdata/test/convert_uint8_uint32.c trunk/getdata/test/convert_uint8_uint64.c trunk/getdata/test/creat.c trunk/getdata/test/creat_excl.c trunk/getdata/test/creat_rdonly.c trunk/getdata/test/cvlist.c trunk/getdata/test/cvlist_array.c trunk/getdata/test/cvlist_array0.c trunk/getdata/test/cvlist_array_hidden.c trunk/getdata/test/cvlist_array_meta.c trunk/getdata/test/cvlist_array_meta_free.c trunk/getdata/test/cvlist_array_meta_hidden.c trunk/getdata/test/cvlist_hidden.c trunk/getdata/test/cvlist_invalid.c trunk/getdata/test/cvlist_meta.c trunk/getdata/test/cvlist_meta0.c trunk/getdata/test/cvlist_meta_hidden.c trunk/getdata/test/cvlist_meta_invalid.c trunk/getdata/test/del_alias.c trunk/getdata/test/del_carray.c trunk/getdata/test/del_carray_deref.c trunk/getdata/test/del_const.c trunk/getdata/test/del_const_force.c trunk/getdata/test/del_data.c trunk/getdata/test/del_data_enoent.c trunk/getdata/test/del_data_open.c trunk/getdata/test/del_del.c trunk/getdata/test/del_derived.c trunk/getdata/test/del_derived_after.c trunk/getdata/test/del_derived_force.c trunk/getdata/test/del_meta.c trunk/getdata/test/del_meta_force.c trunk/getdata/test/del_ref.c trunk/getdata/test/desync.c trunk/getdata/test/desync_flush.c trunk/getdata/test/desync_path.c trunk/getdata/test/desync_reopen.c trunk/getdata/test/desync_reopen_inv.c trunk/getdata/test/dfes_bit.c trunk/getdata/test/dfes_divide.c trunk/getdata/test/dfes_lincom.c trunk/getdata/test/dfes_linterp.c trunk/getdata/test/dfes_multiply.c trunk/getdata/test/dfes_phase.c trunk/getdata/test/dfes_raw.c trunk/getdata/test/dfes_recip.c trunk/getdata/test/elist_alias.c trunk/getdata/test/elist_hidden.c trunk/getdata/test/elist_noalias.c trunk/getdata/test/elist_scalar.c trunk/getdata/test/encode_alter.c trunk/getdata/test/encode_alter_open.c trunk/getdata/test/encode_get.c trunk/getdata/test/encode_recode.c trunk/getdata/test/encode_recode_open.c trunk/getdata/test/endian_alter.c trunk/getdata/test/endian_alter_sie.c trunk/getdata/test/endian_get.c trunk/getdata/test/endian_move.c trunk/getdata/test/entry_bad_code.c trunk/getdata/test/entry_bit.c trunk/getdata/test/entry_bit_scalar.c trunk/getdata/test/entry_divide.c trunk/getdata/test/entry_invalid.c trunk/getdata/test/entry_lincom.c trunk/getdata/test/entry_lincom_scalar.c trunk/getdata/test/entry_linterp.c trunk/getdata/test/entry_mplex.c trunk/getdata/test/entry_mplex_scalar.c trunk/getdata/test/entry_multiply.c trunk/getdata/test/entry_phase.c trunk/getdata/test/entry_phase_scalar.c trunk/getdata/test/entry_polynom.c trunk/getdata/test/entry_polynom_scalar.c trunk/getdata/test/entry_raw.c trunk/getdata/test/entry_raw_scalar.c trunk/getdata/test/entry_recip.c trunk/getdata/test/entry_scalar_repr.c trunk/getdata/test/entry_type.c trunk/getdata/test/entry_type_alias.c trunk/getdata/test/entry_window.c trunk/getdata/test/entry_window_scalar.c trunk/getdata/test/eof.c trunk/getdata/test/eof_index.c trunk/getdata/test/eof_lincom.c trunk/getdata/test/eof_phase.c trunk/getdata/test/eof_phase_neg.c trunk/getdata/test/error.c trunk/getdata/test/error_error.c trunk/getdata/test/error_num.c trunk/getdata/test/error_short.c trunk/getdata/test/error_verbose.c trunk/getdata/test/error_verbose_prefix.c trunk/getdata/test/file.c trunk/getdata/test/file_code.c trunk/getdata/test/file_type.c trunk/getdata/test/flist.c trunk/getdata/test/flist0.c trunk/getdata/test/flist2.c trunk/getdata/test/flist_hidden.c trunk/getdata/test/flist_invalid.c trunk/getdata/test/flist_meta.c trunk/getdata/test/flist_meta_hidden.c trunk/getdata/test/flist_meta_invalid.c trunk/getdata/test/flist_type.c trunk/getdata/test/flist_type_hidden.c trunk/getdata/test/flist_type_invalid.c trunk/getdata/test/flist_type_meta.c trunk/getdata/test/flist_type_meta_hidden.c trunk/getdata/test/flist_type_meta_invalid.c trunk/getdata/test/flush_all.c trunk/getdata/test/flush_bad_code.c trunk/getdata/test/flush_flush.c trunk/getdata/test/flush_invalid.c trunk/getdata/test/flush_lincom.c trunk/getdata/test/flush_lincom1.c trunk/getdata/test/flush_meta.c trunk/getdata/test/flush_mult.c trunk/getdata/test/flush_raw_close.c trunk/getdata/test/flush_ref.c trunk/getdata/test/flush_spec.c trunk/getdata/test/flush_string.c trunk/getdata/test/flush_sync.c trunk/getdata/test/foffs_alter.c trunk/getdata/test/foffs_get.c trunk/getdata/test/foffs_move.c trunk/getdata/test/fragment_affix.c trunk/getdata/test/fragment_affix_alter.c trunk/getdata/test/fragment_affix_alter2.c trunk/getdata/test/fragment_affix_alter_nop.c trunk/getdata/test/fragment_affix_dup.c trunk/getdata/test/fragment_index.c trunk/getdata/test/fragment_index_alias.c trunk/getdata/test/fragment_name.c trunk/getdata/test/fragment_name_oor.c trunk/getdata/test/fragment_num.c trunk/getdata/test/fragment_parent.c trunk/getdata/test/get64.c trunk/getdata/test/get_affix.c trunk/getdata/test/get_bad_code.c trunk/getdata/test/get_bit.c trunk/getdata/test/get_carray.c trunk/getdata/test/get_carray_c2r.c trunk/getdata/test/get_carray_len.c trunk/getdata/test/get_carray_slice.c trunk/getdata/test/get_char.c trunk/getdata/test/get_clincom.c trunk/getdata/test/get_complex128.c trunk/getdata/test/get_complex64.c trunk/getdata/test/get_const.c trunk/getdata/test/get_const_complex.c trunk/getdata/test/get_const_repr.c trunk/getdata/test/get_cpolynom.c trunk/getdata/test/get_cpolynom1.c trunk/getdata/test/get_cpolynom_int.c trunk/getdata/test/get_divide.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_endian16.c trunk/getdata/test/get_endian32.c trunk/getdata/test/get_endian64.c trunk/getdata/test/get_endian8.c trunk/getdata/test/get_endian_complex128_arm.c trunk/getdata/test/get_endian_complex128_big.c trunk/getdata/test/get_endian_complex128_little.c trunk/getdata/test/get_endian_complex64_arm.c trunk/getdata/test/get_endian_complex64_big.c trunk/getdata/test/get_endian_complex64_little.c trunk/getdata/test/get_endian_float32_arm.c trunk/getdata/test/get_endian_float32_big.c trunk/getdata/test/get_endian_float32_little.c trunk/getdata/test/get_endian_float64_arm.c trunk/getdata/test/get_endian_float64_big.c trunk/getdata/test/get_endian_float64_little.c trunk/getdata/test/get_ff.c trunk/getdata/test/get_float32.c trunk/getdata/test/get_float64.c trunk/getdata/test/get_foffs.c trunk/getdata/test/get_fs.c trunk/getdata/test/get_here.c trunk/getdata/test/get_here_foffs.c trunk/getdata/test/get_heres.c trunk/getdata/test/get_int16.c trunk/getdata/test/get_int32.c trunk/getdata/test/get_int64.c trunk/getdata/test/get_int8.c trunk/getdata/test/get_invalid.c trunk/getdata/test/get_lincom1.c trunk/getdata/test/get_lincom2.c trunk/getdata/test/get_lincom2s.c trunk/getdata/test/get_lincom3.c trunk/getdata/test/get_lincom3s.c trunk/getdata/test/get_lincom_mdt.c trunk/getdata/test/get_lincom_noin.c trunk/getdata/test/get_lincom_non.c trunk/getdata/test/get_lincom_null.c trunk/getdata/test/get_lincom_spf.c trunk/getdata/test/get_linterp.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_linterp_noin.c trunk/getdata/test/get_linterp_notab.c trunk/getdata/test/get_linterp_sort.c trunk/getdata/test/get_mplex.c trunk/getdata/test/get_mplex_bof.c trunk/getdata/test/get_mplex_complex.c trunk/getdata/test/get_mplex_lb.c trunk/getdata/test/get_mplex_lball.c trunk/getdata/test/get_mplex_nolb.c trunk/getdata/test/get_mplex_s.c trunk/getdata/test/get_mplex_saved.c trunk/getdata/test/get_multiply.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_noin.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_nonexistent.c trunk/getdata/test/get_null.c trunk/getdata/test/get_off64.c trunk/getdata/test/get_phase.c trunk/getdata/test/get_phase_affix.c trunk/getdata/test/get_polynom.c trunk/getdata/test/get_polynom_cmpin.c trunk/getdata/test/get_polynom_noin.c trunk/getdata/test/get_recip.c trunk/getdata/test/get_recip_const.c trunk/getdata/test/get_recurse.c trunk/getdata/test/get_rofs.c trunk/getdata/test/get_sbit.c trunk/getdata/test/get_sf.c trunk/getdata/test/get_ss.c trunk/getdata/test/get_type.c trunk/getdata/test/get_uint16.c trunk/getdata/test/get_uint32.c trunk/getdata/test/get_uint64.c trunk/getdata/test/get_window.c trunk/getdata/test/get_window_clr.c trunk/getdata/test/get_window_complex.c trunk/getdata/test/get_window_ge.c trunk/getdata/test/get_window_gt.c trunk/getdata/test/get_window_le.c trunk/getdata/test/get_window_lt.c trunk/getdata/test/get_window_ne.c trunk/getdata/test/get_window_s.c trunk/getdata/test/get_window_set.c trunk/getdata/test/get_zero.c trunk/getdata/test/global_flags.c trunk/getdata/test/global_name.c trunk/getdata/test/global_ref.c trunk/getdata/test/global_ref_empty.c trunk/getdata/test/global_ref_set.c trunk/getdata/test/gzip_add.c trunk/getdata/test/gzip_del.c trunk/getdata/test/gzip_get.c trunk/getdata/test/gzip_get_get.c trunk/getdata/test/gzip_get_get2.c trunk/getdata/test/gzip_get_put.c trunk/getdata/test/gzip_move_from.c trunk/getdata/test/gzip_move_to.c trunk/getdata/test/gzip_nframes.c trunk/getdata/test/gzip_put.c trunk/getdata/test/gzip_put_back.c trunk/getdata/test/gzip_put_endian.c trunk/getdata/test/gzip_put_get.c trunk/getdata/test/gzip_sync.c trunk/getdata/test/header_complex.c trunk/getdata/test/hide.c trunk/getdata/test/hide_hidden.c trunk/getdata/test/hide_unhide.c trunk/getdata/test/include_accmode.c trunk/getdata/test/include_affix.c trunk/getdata/test/include_auto.c trunk/getdata/test/include_cb.c trunk/getdata/test/include_creat.c trunk/getdata/test/include_ignore.c trunk/getdata/test/include_include.c trunk/getdata/test/include_index.c trunk/getdata/test/include_invalid.c trunk/getdata/test/include_nonexistent.c trunk/getdata/test/include_pc.c trunk/getdata/test/include_ref.c trunk/getdata/test/include_sub.c trunk/getdata/test/include_syntax.c trunk/getdata/test/index_domain.c trunk/getdata/test/index_index.c trunk/getdata/test/index_range.c trunk/getdata/test/index_s.c trunk/getdata/test/index_subset.c trunk/getdata/test/legacy_estring.c trunk/getdata/test/legacy_format.c trunk/getdata/test/lzma_get.c trunk/getdata/test/lzma_nframes.c trunk/getdata/test/madd.c trunk/getdata/test/madd_affix.c trunk/getdata/test/madd_bit.c trunk/getdata/test/madd_bit_invalid.c trunk/getdata/test/madd_carray.c trunk/getdata/test/madd_clincom.c trunk/getdata/test/madd_const.c trunk/getdata/test/madd_cpolynom.c trunk/getdata/test/madd_crecip.c trunk/getdata/test/madd_crecip89.c trunk/getdata/test/madd_divide.c trunk/getdata/test/madd_index.c trunk/getdata/test/madd_lincom.c trunk/getdata/test/madd_lincom_invalid.c trunk/getdata/test/madd_linterp.c trunk/getdata/test/madd_linterp_invalid.c trunk/getdata/test/madd_mplex.c trunk/getdata/test/madd_multiply.c trunk/getdata/test/madd_multiply_invalid.c trunk/getdata/test/madd_phase.c trunk/getdata/test/madd_phase_invalid.c trunk/getdata/test/madd_polynom.c trunk/getdata/test/madd_recip.c trunk/getdata/test/madd_sbit.c trunk/getdata/test/madd_spec.c trunk/getdata/test/madd_spec_directive.c trunk/getdata/test/madd_spec_invalid.c trunk/getdata/test/madd_string.c trunk/getdata/test/madd_window.c trunk/getdata/test/move_affix.c trunk/getdata/test/move_affix_dup.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_foffs_neg.c trunk/getdata/test/move_data_nop.c trunk/getdata/test/move_index.c trunk/getdata/test/move_meta.c trunk/getdata/test/move_move.c trunk/getdata/test/move_protect.c trunk/getdata/test/move_subdir.c trunk/getdata/test/name_affix.c trunk/getdata/test/name_affix_bad.c trunk/getdata/test/name_alias.c trunk/getdata/test/name_dangle.c trunk/getdata/test/name_dup.c trunk/getdata/test/name_move.c trunk/getdata/test/name_move_alias.c trunk/getdata/test/name_name.c trunk/getdata/test/name_updb.c trunk/getdata/test/name_updb_affix.c trunk/getdata/test/name_updb_alias.c trunk/getdata/test/name_updb_const.c trunk/getdata/test/name_updb_const_alias.c trunk/getdata/test/nentries_alias.c trunk/getdata/test/nentries_hidden.c trunk/getdata/test/nentries_noalias.c trunk/getdata/test/nentries_scalar.c trunk/getdata/test/nfields_hidden.c trunk/getdata/test/nfields_invalid.c trunk/getdata/test/nfields_nfields.c trunk/getdata/test/nfields_type.c trunk/getdata/test/nfields_type_hidden.c trunk/getdata/test/nfields_type_invalid.c trunk/getdata/test/nfields_vector.c trunk/getdata/test/nfields_vector_hidden.c trunk/getdata/test/nfields_vector_invalid.c trunk/getdata/test/nframes64.c trunk/getdata/test/nframes_empty.c trunk/getdata/test/nframes_invalid.c trunk/getdata/test/nframes_nframes.c trunk/getdata/test/nframes_off64.c trunk/getdata/test/nframes_spf.c trunk/getdata/test/nmeta.c trunk/getdata/test/nmeta_hidden.c trunk/getdata/test/nmeta_invalid.c trunk/getdata/test/nmeta_parent.c trunk/getdata/test/nmeta_type.c trunk/getdata/test/nmeta_type_hidden.c trunk/getdata/test/nmeta_type_invalid.c trunk/getdata/test/nmeta_type_parent.c trunk/getdata/test/nmeta_vectors.c trunk/getdata/test/nmeta_vectors_hidden.c trunk/getdata/test/nmeta_vectors_invalid.c trunk/getdata/test/nmeta_vectors_parent.c trunk/getdata/test/open_abs.c trunk/getdata/test/open_cb_abort.c trunk/getdata/test/open_cb_cont.c trunk/getdata/test/open_cb_ignore.c trunk/getdata/test/open_cb_invalid.c trunk/getdata/test/open_cb_rescan.c trunk/getdata/test/open_cb_rescan_alloc.c trunk/getdata/test/open_eaccess.c trunk/getdata/test/open_open.c trunk/getdata/test/open_sym_a.c trunk/getdata/test/open_sym_al.c trunk/getdata/test/open_sym_as.c trunk/getdata/test/open_sym_at.c trunk/getdata/test/open_sym_c.c trunk/getdata/test/open_sym_cl.c trunk/getdata/test/open_sym_ct.c trunk/getdata/test/open_sym_d.c trunk/getdata/test/open_sym_l.c trunk/getdata/test/open_sym_p.c trunk/getdata/test/open_sym_pl.c trunk/getdata/test/open_sym_pt.c trunk/getdata/test/parse_badline.c trunk/getdata/test/parse_bit.c trunk/getdata/test/parse_bit4.c trunk/getdata/test/parse_bit_bitnum.c trunk/getdata/test/parse_bit_bitsize.c trunk/getdata/test/parse_bit_ncols.c trunk/getdata/test/parse_bit_numbits.c trunk/getdata/test/parse_bit_scalar.c trunk/getdata/test/parse_carray.c trunk/getdata/test/parse_carray_long.c trunk/getdata/test/parse_const.c trunk/getdata/test/parse_const_complex.c trunk/getdata/test/parse_const_ncols.c trunk/getdata/test/parse_divide.c trunk/getdata/test/parse_double.c trunk/getdata/test/parse_duplicate.c trunk/getdata/test/parse_duplicate_ignore.c trunk/getdata/test/parse_endian_bad.c trunk/getdata/test/parse_endian_big.c trunk/getdata/test/parse_endian_force.c trunk/getdata/test/parse_endian_little.c trunk/getdata/test/parse_endian_slash.c trunk/getdata/test/parse_eol.c trunk/getdata/test/parse_foffs.c trunk/getdata/test/parse_foffs_include.c trunk/getdata/test/parse_foffs_slash.c trunk/getdata/test/parse_hex.c trunk/getdata/test/parse_hidden.c trunk/getdata/test/parse_hidden_field.c trunk/getdata/test/parse_hidden_meta.c trunk/getdata/test/parse_include.c trunk/getdata/test/parse_include_absolute.c trunk/getdata/test/parse_include_absrel.c trunk/getdata/test/parse_include_affix_ref.c trunk/getdata/test/parse_include_dir.c trunk/getdata/test/parse_include_loop.c trunk/getdata/test/parse_include_nonexistent.c trunk/getdata/test/parse_include_prefix.c trunk/getdata/test/parse_include_prefix_dup.c trunk/getdata/test/parse_include_preprefix.c trunk/getdata/test/parse_include_ref.c trunk/getdata/test/parse_include_relabs.c trunk/getdata/test/parse_include_relrel.c trunk/getdata/test/parse_include_slash.c trunk/getdata/test/parse_include_suffix.c trunk/getdata/test/parse_include_sufsuffix.c trunk/getdata/test/parse_index.c trunk/getdata/test/parse_lincom.c trunk/getdata/test/parse_lincom_ncols1.c trunk/getdata/test/parse_lincom_ncols2.c trunk/getdata/test/parse_lincom_nfields.c trunk/getdata/test/parse_lincom_nofields.c trunk/getdata/test/parse_lincom_non.c trunk/getdata/test/parse_lincom_non_ncols.c trunk/getdata/test/parse_lincom_scalar.c trunk/getdata/test/parse_linterp.c trunk/getdata/test/parse_linterp_ncols.c trunk/getdata/test/parse_meta.c trunk/getdata/test/parse_meta_affix.c trunk/getdata/test/parse_meta_alias.c trunk/getdata/test/parse_meta_frag.c trunk/getdata/test/parse_meta_implicit.c trunk/getdata/test/parse_meta_implicit2.c trunk/getdata/test/parse_meta_implicit_affix.c trunk/getdata/test/parse_meta_index.c trunk/getdata/test/parse_meta_index2.c trunk/getdata/test/parse_meta_jump.c trunk/getdata/test/parse_meta_malias.c trunk/getdata/test/parse_meta_meta.c trunk/getdata/test/parse_meta_parent.c trunk/getdata/test/parse_meta_raw.c trunk/getdata/test/parse_mplex.c trunk/getdata/test/parse_mplex_ncols.c trunk/getdata/test/parse_mplex_nomax.c trunk/getdata/test/parse_mplex_scalar.c trunk/getdata/test/parse_multiply.c trunk/getdata/test/parse_multiply_ncols.c trunk/getdata/test/parse_name.c trunk/getdata/test/parse_name_dot.c trunk/getdata/test/parse_name_ext.c trunk/getdata/test/parse_name_pedantic.c trunk/getdata/test/parse_ncols.c trunk/getdata/test/parse_phase.c trunk/getdata/test/parse_phase_ncols.c trunk/getdata/test/parse_phase_scalar.c trunk/getdata/test/parse_polynom.c trunk/getdata/test/parse_polynom_ncols1.c trunk/getdata/test/parse_polynom_ncols2.c trunk/getdata/test/parse_polynom_scalar.c trunk/getdata/test/parse_protect_all.c trunk/getdata/test/parse_protect_bad.c trunk/getdata/test/parse_protect_data.c trunk/getdata/test/parse_protect_format.c trunk/getdata/test/parse_protect_none.c trunk/getdata/test/parse_quote.c trunk/getdata/test/parse_quote_mismatch.c trunk/getdata/test/parse_raw.c trunk/getdata/test/parse_raw_char.c trunk/getdata/test/parse_raw_ncols.c trunk/getdata/test/parse_raw_scalar.c trunk/getdata/test/parse_raw_spf.c trunk/getdata/test/parse_raw_type.c trunk/getdata/test/parse_recip.c trunk/getdata/test/parse_ref.c trunk/getdata/test/parse_ref_nonexistent.c trunk/getdata/test/parse_sbit.c trunk/getdata/test/parse_sort.c trunk/getdata/test/parse_string.c trunk/getdata/test/parse_string_ncols.c trunk/getdata/test/parse_string_null.c trunk/getdata/test/parse_version.c trunk/getdata/test/parse_version_89.c trunk/getdata/test/parse_version_98.c trunk/getdata/test/parse_version_include.c trunk/getdata/test/parse_version_p8.c trunk/getdata/test/parse_version_p9.c trunk/getdata/test/parse_version_permissive.c trunk/getdata/test/parse_version_slash.c trunk/getdata/test/parse_whitespace.c trunk/getdata/test/parse_window.c trunk/getdata/test/parse_window_ncols.c trunk/getdata/test/parse_window_op.c trunk/getdata/test/parse_window_scalar.c trunk/getdata/test/protect_alter.c trunk/getdata/test/protect_get.c trunk/getdata/test/put64.c trunk/getdata/test/put_bad_code.c trunk/getdata/test/put_bit.c trunk/getdata/test/put_bof.c trunk/getdata/test/put_carray.c trunk/getdata/test/put_carray_client.c trunk/getdata/test/put_carray_slice.c trunk/getdata/test/put_char.c trunk/getdata/test/put_clincom1.c trunk/getdata/test/put_complex128.c trunk/getdata/test/put_complex64.c trunk/getdata/test/put_const.c trunk/getdata/test/put_const_protect.c trunk/getdata/test/put_cpolynom.c trunk/getdata/test/put_crecip.c trunk/getdata/test/put_divide.c trunk/getdata/test/put_endian16.c trunk/getdata/test/put_endian32.c trunk/getdata/test/put_endian64.c trunk/getdata/test/put_endian8.c trunk/getdata/test/put_endian_complex128_arm.c trunk/getdata/test/put_endian_complex128_big.c trunk/getdata/test/put_endian_complex128_little.c trunk/getdata/test/put_endian_complex64_arm.c trunk/getdata/test/put_endian_complex64_big.c trunk/getdata/test/put_endian_complex64_little.c trunk/getdata/test/put_endian_float32_arm.c trunk/getdata/test/put_endian_float32_big.c trunk/getdata/test/put_endian_float32_little.c trunk/getdata/test/put_endian_float64_arm.c trunk/getdata/test/put_endian_float64_big.c trunk/getdata/test/put_endian_float64_little.c trunk/getdata/test/put_ff.c trunk/getdata/test/put_float32.c trunk/getdata/test/put_float64.c trunk/getdata/test/put_foffs.c trunk/getdata/test/put_fs.c trunk/getdata/test/put_here.c trunk/getdata/test/put_heres.c trunk/getdata/test/put_int16.c trunk/getdata/test/put_int32.c trunk/getdata/test/put_int64.c trunk/getdata/test/put_int8.c trunk/getdata/test/put_invalid.c trunk/getdata/test/put_lincom1.c trunk/getdata/test/put_lincom2.c trunk/getdata/test/put_lincom_noin.c trunk/getdata/test/put_linterp.c trunk/getdata/test/put_linterp_noin.c trunk/getdata/test/put_linterp_nomono.c trunk/getdata/test/put_linterp_notab.c trunk/getdata/test/put_linterp_reverse.c trunk/getdata/test/put_mplex.c trunk/getdata/test/put_mplex_complex.c trunk/getdata/test/put_multiply.c trunk/getdata/test/put_null.c trunk/getdata/test/put_off64.c trunk/getdata/test/put_phase.c trunk/getdata/test/put_phase_noin.c trunk/getdata/test/put_polynom1.c trunk/getdata/test/put_polynom2.c trunk/getdata/test/put_polynom_noin.c trunk/getdata/test/put_protect.c trunk/getdata/test/put_rdonly.c trunk/getdata/test/put_recip.c trunk/getdata/test/put_recurse.c trunk/getdata/test/put_repr.c trunk/getdata/test/put_rofs.c trunk/getdata/test/put_sbit.c trunk/getdata/test/put_sf.c trunk/getdata/test/put_ss.c trunk/getdata/test/put_string.c trunk/getdata/test/put_string_protect.c trunk/getdata/test/put_type.c trunk/getdata/test/put_uint16.c trunk/getdata/test/put_uint32.c trunk/getdata/test/put_uint64.c trunk/getdata/test/put_window.c trunk/getdata/test/put_zero.c trunk/getdata/test/ref.c trunk/getdata/test/ref_none.c trunk/getdata/test/ref_two.c trunk/getdata/test/repr_a.c trunk/getdata/test/repr_bad.c trunk/getdata/test/repr_float32.c trunk/getdata/test/repr_float64.c trunk/getdata/test/repr_i.c trunk/getdata/test/repr_int16.c trunk/getdata/test/repr_int32.c trunk/getdata/test/repr_int64.c trunk/getdata/test/repr_int8.c trunk/getdata/test/repr_m.c trunk/getdata/test/repr_r.c trunk/getdata/test/repr_real_a.c trunk/getdata/test/repr_real_i.c trunk/getdata/test/repr_real_m.c trunk/getdata/test/repr_real_r.c trunk/getdata/test/repr_uint16.c trunk/getdata/test/repr_uint32.c trunk/getdata/test/repr_uint64.c trunk/getdata/test/repr_uint8.c trunk/getdata/test/seek64.c trunk/getdata/test/seek_cur.c trunk/getdata/test/seek_end.c trunk/getdata/test/seek_foffs.c trunk/getdata/test/seek_neg.c trunk/getdata/test/seek_set.c trunk/getdata/test/sie_get_big.c trunk/getdata/test/sie_get_little.c trunk/getdata/test/sie_move_from.c trunk/getdata/test/sie_move_to.c trunk/getdata/test/sie_nframes_big.c trunk/getdata/test/sie_nframes_little.c trunk/getdata/test/sie_put_append2.c trunk/getdata/test/sie_put_back.c trunk/getdata/test/sie_put_big.c trunk/getdata/test/sie_put_little.c trunk/getdata/test/sie_put_pad.c trunk/getdata/test/sie_put_trunc.c trunk/getdata/test/sie_put_trunc2.c trunk/getdata/test/sie_sync.c trunk/getdata/test/slim_get.c trunk/getdata/test/slim_nframes.c trunk/getdata/test/slim_put.c trunk/getdata/test/spf_alias.c trunk/getdata/test/spf_alias_meta.c trunk/getdata/test/spf_alias_missing.c trunk/getdata/test/spf_divide.c trunk/getdata/test/spf_lincom.c trunk/getdata/test/spf_multiply.c trunk/getdata/test/spf_polynom.c trunk/getdata/test/spf_raw.c trunk/getdata/test/spf_recip.c trunk/getdata/test/spf_recurse.c trunk/getdata/test/svlist.c trunk/getdata/test/svlist2.c trunk/getdata/test/svlist_hidden.c trunk/getdata/test/svlist_invalid.c trunk/getdata/test/svlist_meta.c trunk/getdata/test/svlist_meta_hidden.c trunk/getdata/test/svlist_meta_invalid.c trunk/getdata/test/table.c trunk/getdata/test/table_code.c trunk/getdata/test/table_type.c trunk/getdata/test/tell.c trunk/getdata/test/tell64.c trunk/getdata/test/tell_multidiv.c trunk/getdata/test/tok_arg.c trunk/getdata/test/tok_escape.c trunk/getdata/test/tok_quote.c trunk/getdata/test/trunc.c trunk/getdata/test/trunc_dir.c trunk/getdata/test/trunc_rdonly.c trunk/getdata/test/trunc_truncsub.c trunk/getdata/test/unclude.c trunk/getdata/test/unclude_del.c trunk/getdata/test/unclude_move.c trunk/getdata/test/unclude_open.c trunk/getdata/test/version_0.c trunk/getdata/test/version_0_write.c trunk/getdata/test/version_1.c trunk/getdata/test/version_1_write.c trunk/getdata/test/version_2.c trunk/getdata/test/version_2_write.c trunk/getdata/test/version_3.c trunk/getdata/test/version_3_write.c trunk/getdata/test/version_4.c trunk/getdata/test/version_4_write.c trunk/getdata/test/version_5.c trunk/getdata/test/version_5_strict.c trunk/getdata/test/version_5_write.c trunk/getdata/test/version_6.c trunk/getdata/test/version_6_strict.c trunk/getdata/test/version_6_write.c trunk/getdata/test/version_7.c trunk/getdata/test/version_7_strict.c trunk/getdata/test/version_7_write.c trunk/getdata/test/version_8.c trunk/getdata/test/version_8_strict.c trunk/getdata/test/version_8_write.c trunk/getdata/test/version_9.c trunk/getdata/test/version_9_strict.c trunk/getdata/test/version_9_write.c trunk/getdata/test/vlist.c trunk/getdata/test/vlist_alias.c trunk/getdata/test/vlist_hidden.c trunk/getdata/test/vlist_invalid.c trunk/getdata/test/vlist_meta.c trunk/getdata/test/vlist_meta_hidden.c trunk/getdata/test/vlist_meta_invalid.c trunk/getdata/test/xz_get.c trunk/getdata/test/xz_nframes.c trunk/getdata/test/zzip_data.c trunk/getdata/test/zzip_get.c trunk/getdata/test/zzip_get_get.c trunk/getdata/test/zzip_nframes.c trunk/getdata/test/zzslim_get.c trunk/getdata/test/zzslim_nframes.c Modified: trunk/getdata/test/add_add.c =================================================================== --- trunk/getdata/test/add_add.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_add.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -63,7 +63,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(data); unlink(format); Modified: trunk/getdata/test/add_bit.c =================================================================== --- trunk/getdata/test/add_bit.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_bit.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -56,7 +56,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_bit_bitnum.c =================================================================== --- trunk/getdata/test/add_bit_bitnum.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_bit_bitnum.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -44,7 +44,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_bit_bitsize.c =================================================================== --- trunk/getdata/test/add_bit_bitsize.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_bit_bitsize.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -44,7 +44,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_bit_invalid.c =================================================================== --- trunk/getdata/test/add_bit_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_bit_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -38,7 +38,7 @@ gd_add_bit(D, "new", "input", 1, 1, 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error,GD_E_BAD_DIRFILE); Modified: trunk/getdata/test/add_bit_numbits.c =================================================================== --- trunk/getdata/test/add_bit_numbits.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_bit_numbits.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -44,7 +44,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_carray.c =================================================================== --- trunk/getdata/test/add_carray.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_carray.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2011 D. V. Wiebe +/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -62,7 +62,7 @@ for (n = 0; n < 5; ++n) CHECKIi(n, data[n], 3 + n); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_clincom.c =================================================================== --- trunk/getdata/test/add_clincom.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_clincom.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2009-2011 D. V. Wiebe +/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -77,7 +77,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_code.c =================================================================== --- trunk/getdata/test/add_code.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_code.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -42,7 +42,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_const.c =================================================================== --- trunk/getdata/test/add_const.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_const.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -57,7 +57,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_cpolynom.c =================================================================== --- trunk/getdata/test/add_cpolynom.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_cpolynom.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2009-2011 D. V. Wiebe +/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -70,7 +70,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_crecip.c =================================================================== --- trunk/getdata/test/add_crecip.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_crecip.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2011 D. V. Wiebe +/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -61,7 +61,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_crecip89.c =================================================================== --- trunk/getdata/test/add_crecip89.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_crecip89.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2011 D. V. Wiebe +/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -58,7 +58,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_divide.c =================================================================== --- trunk/getdata/test/add_divide.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_divide.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2011 D. V. Wiebe +/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -55,7 +55,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_divide_invalid.c =================================================================== --- trunk/getdata/test/add_divide_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_divide_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2011 D. V. Wiebe +/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -37,7 +37,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; Modified: trunk/getdata/test/add_duplicate.c =================================================================== --- trunk/getdata/test/add_duplicate.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_duplicate.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -58,7 +58,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_format.c =================================================================== --- trunk/getdata/test/add_format.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_format.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -42,7 +42,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_invalid.c =================================================================== --- trunk/getdata/test/add_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -37,7 +37,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add(D, &E); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); Modified: trunk/getdata/test/add_lincom.c =================================================================== --- trunk/getdata/test/add_lincom.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_lincom.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -65,7 +65,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_lincom_affix.c =================================================================== --- trunk/getdata/test/add_lincom_affix.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_lincom_affix.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 D. V. Wiebe +/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * @@ -72,7 +72,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format1); unlink(format); Modified: trunk/getdata/test/add_lincom_invalid.c =================================================================== --- trunk/getdata/test/add_lincom_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_lincom_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -40,7 +40,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add_lincom(D, "new", 2, in_fields, m, b, 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); Modified: trunk/getdata/test/add_lincom_nfields.c =================================================================== --- trunk/getdata/test/add_lincom_nfields.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_lincom_nfields.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -46,7 +46,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_linterp.c =================================================================== --- trunk/getdata/test/add_linterp.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_linterp.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -54,7 +54,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_linterp_invalid.c =================================================================== --- trunk/getdata/test/add_linterp_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_linterp_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -37,7 +37,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add_linterp(D, "new", "in", "table", 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; Modified: trunk/getdata/test/add_meta.c =================================================================== --- trunk/getdata/test/add_meta.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_meta.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -63,7 +63,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(data); unlink(format); Modified: trunk/getdata/test/add_meta_alias.c =================================================================== --- trunk/getdata/test/add_meta_alias.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_meta_alias.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -65,7 +65,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(data); unlink(format); Modified: trunk/getdata/test/add_mplex.c =================================================================== --- trunk/getdata/test/add_mplex.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_mplex.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 D. V. Wiebe +/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * @@ -47,7 +47,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_multiply.c =================================================================== --- trunk/getdata/test/add_multiply.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_multiply.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -55,7 +55,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_multiply_invalid.c =================================================================== --- trunk/getdata/test/add_multiply_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_multiply_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -37,7 +37,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; Modified: trunk/getdata/test/add_phase.c =================================================================== --- trunk/getdata/test/add_phase.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_phase.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -54,7 +54,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_phase_invalid.c =================================================================== --- trunk/getdata/test/add_phase_invalid.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_phase_invalid.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -37,7 +37,7 @@ D = gd_open(filedir, GD_RDONLY); gd_add_phase(D, "new", "in", 3, 0); error = gd_error(D); - gd_close(D); + gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; Modified: trunk/getdata/test/add_polynom.c =================================================================== --- trunk/getdata/test/add_polynom.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_polynom.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2009-2011 D. V. Wiebe +/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -60,7 +60,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_polynom_scalar.c =================================================================== --- trunk/getdata/test/add_polynom_scalar.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_polynom_scalar.c 2013-12-11 05:03:23 UTC (rev 869) @@ -67,7 +67,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_protect.c =================================================================== --- trunk/getdata/test/add_protect.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_protect.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -57,7 +57,7 @@ /* check */ n = gd_nfields(D); - gd_close(D); + gd_discard(D); unlink(format); rmdir(filedir); Modified: trunk/getdata/test/add_raw.c =================================================================== --- trunk/getdata/test/add_raw.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_raw.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -55,7 +55,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); if (unlink(data)) { perror("unlink"); Modified: trunk/getdata/test/add_raw_include.c =================================================================== --- trunk/getdata/test/add_raw_include.c 2013-12-11 00:16:49 UTC (rev 868) +++ trunk/getdata/test/add_raw_include.c 2013-12-11 05:03:23 UTC (rev 869) @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 D. V. Wiebe +/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * @@ -58,7 +58,7 @@ gd_free_entry_strings(&e); } - gd_close(D); + gd_discard(D); if (unlink(data)) r = 1; Modified: trunk/getdata/test/add_raw_invalid.c =================================================================== --- trunk/getdata/test/add_raw_invalid.... [truncated message content] |
From: <ket...@us...> - 2013-12-11 00:16:58
|
Revision: 868 http://sourceforge.net/p/getdata/code/868 Author: ketiltrout Date: 2013-12-11 00:16:49 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Merge gd_entry_t members 'comp_scal' and 'hidden', plus private member 'calculated' into (public) member 'flags'. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/NEWS trunk/getdata/bindings/cxx/getdata/entry.h trunk/getdata/bindings/cxx/getdata/lincomentry.h trunk/getdata/bindings/cxx/getdata/polynomentry.h trunk/getdata/bindings/cxx/getdata/recipentry.h trunk/getdata/bindings/cxx/lincomentry.cpp trunk/getdata/bindings/cxx/polynomentry.cpp trunk/getdata/bindings/cxx/recipentry.cpp trunk/getdata/bindings/f77/fgetdata.c trunk/getdata/bindings/f77/fgetdata.h 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/GetData.xs trunk/getdata/bindings/php/getdata.c trunk/getdata/bindings/python/pyentry.c trunk/getdata/man/gd_add.3 trunk/getdata/man/gd_alter_entry.3 trunk/getdata/man/gd_entry.3 trunk/getdata/man/gd_hidden.3 trunk/getdata/man/gd_hide.3 trunk/getdata/src/add.c trunk/getdata/src/constant.c trunk/getdata/src/entry.c trunk/getdata/src/field_list.c trunk/getdata/src/flush.c trunk/getdata/src/getdata.c trunk/getdata/src/getdata.h.in trunk/getdata/src/include.c trunk/getdata/src/internal.h trunk/getdata/src/mod.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/spf.c trunk/getdata/test/add_clincom.c trunk/getdata/test/add_cpolynom.c trunk/getdata/test/add_crecip.c trunk/getdata/test/add_crecip89.c trunk/getdata/test/add_lincom.c trunk/getdata/test/add_lincom_affix.c trunk/getdata/test/add_polynom.c trunk/getdata/test/add_polynom_scalar.c trunk/getdata/test/add_recip.c trunk/getdata/test/add_scalar.c trunk/getdata/test/add_scalar_carray.c trunk/getdata/test/add_scalar_carray_bad.c trunk/getdata/test/alter_clincom.c trunk/getdata/test/alter_cpolynom_null.c trunk/getdata/test/alter_crecip89_null.c trunk/getdata/test/alter_entry_hidden.c trunk/getdata/test/alter_entry_lincom.c trunk/getdata/test/alter_polynom_coeff.c trunk/getdata/test/alter_spec_polynom.c trunk/getdata/test/cvlist_array0.c trunk/getdata/test/cvlist_array_meta0.c trunk/getdata/test/cvlist_meta0.c trunk/getdata/test/del_alias.c trunk/getdata/test/del_ref.c trunk/getdata/test/endian_alter_all.c trunk/getdata/test/entry_lincom.c trunk/getdata/test/entry_polynom.c trunk/getdata/test/entry_polynom_scalar.c trunk/getdata/test/entry_recip.c trunk/getdata/test/flush_ref.c trunk/getdata/test/get_linterp1.c trunk/getdata/test/get_mplex_s.c trunk/getdata/test/get_neg.c trunk/getdata/test/get_uint32.c trunk/getdata/test/get_uint64.c trunk/getdata/test/gzip_del.c trunk/getdata/test/gzip_sync.c trunk/getdata/test/header_complex.c trunk/getdata/test/legacy_format.c trunk/getdata/test/madd_cpolynom.c trunk/getdata/test/madd_crecip.c trunk/getdata/test/madd_crecip89.c trunk/getdata/test/madd_lincom.c trunk/getdata/test/madd_polynom.c trunk/getdata/test/madd_recip.c trunk/getdata/test/name_name.c trunk/getdata/test/parse_hex.c trunk/getdata/test/seek_index.c trunk/getdata/test/sie_sync.c trunk/getdata/test/zzslim_get.c Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/ChangeLog 2013-12-11 00:16:49 UTC (rev 868) @@ -1,3 +1,24 @@ +2013-12-10 D. V. Wiebe <ge...@ke...> svn:868 + * src/getdata.h.in src/internal.h: Merge gd_entry_t members 'comp_scal' and + 'hidden', plus private member 'calculated' into (public) member 'flags', and + add GD_EN_CALC, GD_EN_COMPSCAL and GD_EN_HIDDEN flags. + * bindings/make_parameters.c: Add entry flags. + * bindings/cxx/getdata/entry.h (Entry::Flags) bindings/f77/fgetdata.c + (GDENFL): Added. + * bindings/f77/fgetdata.c (GDCSCL): Deleted. + * bindings/f77/getdata.f90.in: Replaced comp_scal with flags in gd_entry + type. + * bindings/idl/getdata.c: Replaced COMP_SCAL with FLAGS member in gd_entry + struct. + + * src/mod.c (_GD_Change): Allow hiddenness modification. + * test/alter_entry_hidden.c: Update test: hiddenness should change. + + * test/cvlist_meta0.c: Check error. + + * bindings/cxx/ getdata/entry.h (Entry::CompScal): Allow non-zero for + RECIP, too. + 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 Modified: trunk/getdata/NEWS =================================================================== --- trunk/getdata/NEWS 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/NEWS 2013-12-11 00:16:49 UTC (rev 868) @@ -60,10 +60,20 @@ * gd_free_entry_strings() now NULLs pointers after freeing them. + * The comp_scal member of the gd_entry_t object has been replaced with a flags + member, containing a flag (GD_EN_COMPSCAL) with the meaning of the former + comp_scal member. There are also flags for hiddenness (GD_EN_HIDDEN) and + whether the scalar entries have been computed (GD_EN_CALC). + * 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. + which do not exist. In this case the GD_EN_CALC flag in the object will + not be set. Previously, on such entries, this function would fail with the + error GD_E_BAD_SCALAR and return nothing. + * gd_[m]add() and gd_alter_entry() can now be used to set or change the + hiddenness of a field by setting or clearing the GD_EN_HIDDEN bit in the + supplied gd_entry_t object. + * 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) @@ -156,6 +166,10 @@ * C++ BUG FIX: Fixed segfault in RawEntry destructor. Reported by S. J. Benton. + * C++ BUG FIX: Entry::ComplexScalars() now returns non-zero for RECIP + entries when appropriate, instead of always returning zero. (The + RecipEntry::ComplexScalars() method always returned the correct value.) + * 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. Modified: trunk/getdata/bindings/cxx/getdata/entry.h =================================================================== --- trunk/getdata/bindings/cxx/getdata/entry.h 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/getdata/entry.h 2013-12-11 00:16:49 UTC (rev 868) @@ -100,10 +100,17 @@ }; virtual int ComplexScalars() const { - return (E.field_type == GD_LINCOM_ENTRY || - E.field_type == GD_POLYNOM_ENTRY) ? E.comp_scal : 0; + if (E.field_type == GD_LINCOM_ENTRY || + E.field_type == GD_POLYNOM_ENTRY || + E.field_type == GD_RECIP_ENTRY) + if (E.flags & GD_EN_COMPSCAL) + return 1; + + return 0; } + unsigned int Flags() const { return E.flags; }; + virtual const char *Scalar(int index = 0) const; virtual int ScalarIndex(int index = 0) const; Modified: trunk/getdata/bindings/cxx/getdata/lincomentry.h =================================================================== --- trunk/getdata/bindings/cxx/getdata/lincomentry.h 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/getdata/lincomentry.h 2013-12-11 00:16:49 UTC (rev 868) @@ -46,7 +46,9 @@ E.in_fields[index] : NULL; }; - virtual int ComplexScalars() const { return E.comp_scal; } + virtual int ComplexScalars() const { + return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; + } virtual int NFields() const { return E.u.lincom.n_fields; }; Modified: trunk/getdata/bindings/cxx/getdata/polynomentry.h =================================================================== --- trunk/getdata/bindings/cxx/getdata/polynomentry.h 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/getdata/polynomentry.h 2013-12-11 00:16:49 UTC (rev 868) @@ -42,7 +42,9 @@ virtual const char *Input() const { return E.in_fields[0]; }; - virtual int ComplexScalars() const { return E.comp_scal; } + virtual int ComplexScalars() const { + return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; + } virtual int PolyOrd() const { return E.u.polynom.poly_ord; }; Modified: trunk/getdata/bindings/cxx/getdata/recipentry.h =================================================================== --- trunk/getdata/bindings/cxx/getdata/recipentry.h 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/getdata/recipentry.h 2013-12-11 00:16:49 UTC (rev 868) @@ -46,7 +46,9 @@ virtual int ScalarIndex() const { return E.scalar_ind[0]; }; - virtual int ComplexScalars() const { return E.comp_scal; } + virtual int ComplexScalars() const { + return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; + } virtual double Dividend() const { return E.u.recip.dividend; }; Modified: trunk/getdata/bindings/cxx/lincomentry.cpp =================================================================== --- trunk/getdata/bindings/cxx/lincomentry.cpp 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/lincomentry.cpp 2013-12-11 00:16:49 UTC (rev 868) @@ -32,7 +32,7 @@ E.field_type = GD_LINCOM_ENTRY; E.u.lincom.n_fields = n_fields; E.fragment_index = fragment_index; - E.comp_scal = 0; + E.flags = 0; for (i = 0; i < n_fields; ++i) { E.in_fields[i] = strdup(in_fields[i]); E.u.lincom.m[i] = m[i]; @@ -50,7 +50,7 @@ E.field_type = GD_LINCOM_ENTRY; E.u.lincom.n_fields = n_fields; E.fragment_index = fragment_index; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; for (i = 0; i < n_fields; ++i) { E.in_fields[i] = strdup(in_fields[i]); E.u.lincom.cm[i][0] = cm[i].real(); @@ -121,7 +121,7 @@ E.u.lincom.m[index] = E.u.lincom.cm[index][0] = scale.real(); E.u.lincom.cm[index][1] = scale.imag(); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); @@ -171,7 +171,7 @@ E.u.lincom.b[index] = E.u.lincom.cb[index][0] = offset.real(); E.u.lincom.cb[index][1] = offset.imag(); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); Modified: trunk/getdata/bindings/cxx/polynomentry.cpp =================================================================== --- trunk/getdata/bindings/cxx/polynomentry.cpp 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/polynomentry.cpp 2013-12-11 00:16:49 UTC (rev 868) @@ -31,7 +31,7 @@ E.field_type = GD_POLYNOM_ENTRY; E.u.polynom.poly_ord = poly_ord; E.fragment_index = fragment_index; - E.comp_scal = 0; + E.flags = 0; E.in_fields[0] = strdup(in_field); for (i = 0; i <= poly_ord; ++i) E.u.polynom.a[i] = a[i]; @@ -47,7 +47,7 @@ E.field_type = GD_POLYNOM_ENTRY; E.u.polynom.poly_ord = poly_ord; E.fragment_index = fragment_index; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; E.in_fields[0] = strdup(in_field); for (i = 0; i <= poly_ord; ++i) { E.u.polynom.ca[i][0] = ca[i].real(); @@ -113,7 +113,7 @@ E.u.polynom.a[index] = E.u.polynom.ca[index][0] = coeff.real(); E.u.polynom.ca[index][1] = coeff.imag(); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); Modified: trunk/getdata/bindings/cxx/recipentry.cpp =================================================================== --- trunk/getdata/bindings/cxx/recipentry.cpp 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/cxx/recipentry.cpp 2013-12-11 00:16:49 UTC (rev 868) @@ -31,7 +31,7 @@ E.scalar[0] = 0; E.u.recip.cdividend[0] = E.u.recip.dividend = dividend; E.u.recip.cdividend[1] = 0; - E.comp_scal = 0; + E.flags = 0; E.fragment_index = fragment_index; } @@ -44,7 +44,7 @@ E.scalar[0] = 0; E.u.recip.cdividend[0] = E.u.recip.dividend = dividend.real(); E.u.recip.cdividend[1] = dividend.imag(); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; E.fragment_index = fragment_index; } @@ -97,7 +97,7 @@ { E.u.recip.dividend = E.u.recip.cdividend[0] = dividend.real(); E.u.recip.cdividend[1] = dividend.imag(); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); Modified: trunk/getdata/bindings/f77/fgetdata.c =================================================================== --- trunk/getdata/bindings/f77/fgetdata.c 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/fgetdata.c 2013-12-11 00:16:49 UTC (rev 868) @@ -2979,30 +2979,27 @@ dreturn("%i", *type); } -/* returns the value of the comp_scal member */ -void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, const int32_t *dirfile, +/* returns the entry flags */ +void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; gd_entry_t E; DIRFILE *D; - dtrace("%p, %i, %p, %i", comp_scal, *dirfile, field_code, *field_code_l); + dtrace("%p, %i, %p, %i", flags, *dirfile, field_code, *field_code_l); D = _GDF_GetDirfile(*dirfile); - *comp_scal = 0; + if (gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E) == 0) { + *flags = E.flags; - gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E); - - if (!gd_error(D) && (E.field_type == GD_LINCOM_ENTRY || - E.field_type == GD_POLYNOM_ENTRY || E.field_type == GD_RECIP_ENTRY)) - *comp_scal = E.comp_scal; - - gd_free_entry_strings(&E); + gd_free_entry_strings(&E); + } else + *flags = -1; free(fc); - dreturn("%i", *comp_scal); + dreturn("%i", *flags); } /* gd_validate wrapper */ @@ -4075,7 +4072,6 @@ E.fragment_index = *fragment_index; n = E.EN(lincom,n_fields) = *n_fields; _GDF_CString(&E.field, field_code, *field_code_l); - E.comp_scal = 0; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); @@ -4155,7 +4151,7 @@ E.fragment_index = *fragment_index; n = E.EN(lincom,n_fields) = *n_fields; _GDF_CString(&E.field, field_code, *field_code_l); - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); @@ -4231,7 +4227,6 @@ _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; n = E.EN(polynom,poly_ord) = *poly_ord; - E.comp_scal = 0; if (n > 5) n = 5; @@ -4311,7 +4306,7 @@ _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; n = E.EN(polynom,poly_ord) = *poly_ord; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (n > 5) n = 5; @@ -4585,7 +4580,6 @@ E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); n = E.EN(polynom,poly_ord) = *poly_ord; - E.comp_scal = 0; if (n > 5) n = 5; @@ -4664,7 +4658,7 @@ E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); n = E.EN(polynom,poly_ord) = *poly_ord; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; if (n > 5) n = 5; @@ -4936,7 +4930,6 @@ memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; n = E.EN(lincom,n_fields) = *n_fields; - E.comp_scal = 0; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); @@ -5015,7 +5008,7 @@ memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; n = E.EN(lincom,n_fields) = *n_fields; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); @@ -5106,7 +5099,7 @@ memset(&E, 0, sizeof(E)); E.field_type = GD_RECIP_ENTRY; - E.comp_scal = 1; + E.flags = GD_EN_COMPSCAL; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); gd_li2cs_(E.EN(recip,cdividend), dividend[0], dividend[1]); _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l); Modified: trunk/getdata/bindings/f77/fgetdata.h =================================================================== --- trunk/getdata/bindings/f77/fgetdata.h 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/fgetdata.h 2013-12-11 00:16:49 UTC (rev 868) @@ -470,7 +470,7 @@ const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5)); -void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, const int32_t *dirfile, +void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile, Modified: trunk/getdata/bindings/f77/getdata.f.in =================================================================== --- trunk/getdata/bindings/f77/getdata.f.in 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/getdata.f.in 2013-12-11 00:16:49 UTC (rev 868) @@ -153,8 +153,6 @@ EXTERNAL GDCONS C Corresponding to gd_copen(3) EXTERNAL GDCOPN -C Check whether an entry contains complex scalars - EXTERNAL GDCSCL C Correpsonding to gd_delete_alias(3) EXTERNAL GDDELA C Correpsonding to gd_delete(3) @@ -165,6 +163,8 @@ EXTERNAL GDDSYN C Corresponding to gd_error_count(3) EXTERNAL GDECNT +C Returns entry flags + EXTERNAL GDENFL C Corresponding to gd_entry_list(3) (sort of) EXTERNAL GDENTN C Returns the maximum entry name length Modified: trunk/getdata/bindings/f77/getdata.f90.in =================================================================== --- trunk/getdata/bindings/f77/getdata.f90.in 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/getdata.f90.in 2013-12-11 00:16:49 UTC (rev 868) @@ -29,7 +29,7 @@ type gd_entry integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift - integer :: fragment_index, comp_scal, poly_ord, array_len, windop, ithreshold + integer :: fragment_index, flags, poly_ord, array_len, windop, ithreshold integer :: count_val, period character (len=GD_FIELD_LEN), dimension(3) :: field character (len=GD_FIELD_LEN), dimension(6) :: scalar @@ -801,6 +801,9 @@ ! get field type from f77 library call gdenty(fgd_entry, dirfile, TRIM(field_code), LEN_TRIM(field_code)) + ! flags + call gdenfl(ent%flags, dirfile, TRIM(field_code), LEN_TRIM(field_code)) + if (fgd_entry .EQ. GD_RAW_ENTRY) then ! raw call gdgerw(ent%spf, ent%data_type, ent%fragment_index, dirfile, & @@ -809,8 +812,7 @@ TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_LINCOM_ENTRY) then ! lincom - call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code)) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecl(ent%n_fields, ent%field(1), len1, ent%cm(1), ent%cb(1), & ent%field(2), len2, ent%cm(2), ent%cb(2), ent%field(3), len3, ent%cm(3), & ent%cb(3), ent%fragment_index, dirfile, TRIM(field_code), & @@ -866,8 +868,7 @@ TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_POLYNOM_ENTRY) then ! polynom - call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code)) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecp(ent%poly_ord, ent%field(1), len1, ent%ca(1), ent%ca(2), & ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) @@ -883,8 +884,7 @@ end do else if (fgd_entry .EQ. GD_RECIP_ENTRY) then ! recip - call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code)) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecr(ent%field(1), len1, ent%cdividend, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) else @@ -965,7 +965,7 @@ ent%data_type, ent%spf, TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), & ent%scalar_ind(1), ent%fragment_index) else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then - if (ent%comp_scal .EQ. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdaslc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%m(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & @@ -1021,7 +1021,7 @@ TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then - if (ent%comp_scal .EQ. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdaspn(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & @@ -1045,7 +1045,7 @@ LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), ent%fragment_index) end if else if (ent%field_type .EQ. GD_RECIP_ENTRY) then - if (ent%comp_scal .EQ. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdasrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%dividend, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & @@ -1247,7 +1247,7 @@ character (len=1) :: nil = "" if (ent%field_type .EQ. GD_LINCOM_ENTRY) then - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%cm(1), ent%cb(1), TRIM(ent%field(2)), & @@ -1281,7 +1281,7 @@ LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2))) else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%ca(1), ent%ca(2), ent%ca(3), ent%ca(4), & @@ -1293,7 +1293,7 @@ ent%a(5), ent%a(6)) end if else if (ent%field_type .EQ. GD_RECIP_ENTRY) then - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & ent%cdividend) @@ -1694,7 +1694,7 @@ call fgd__set_scalar_len(scalar_len, remove_scalars, lincom_mask(n), ent) call fgd__set_field_len(field_len, n, ent) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscl(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), field_len(1), & ent%cm(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & @@ -1763,7 +1763,7 @@ call fgd__set_scalar_len(scalar_len, remove_scalars, polynom_mask(n), ent) call fgd__set_field_len(field_len, 1, ent) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscp(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), field_len(1), & ent%ca(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & @@ -1786,7 +1786,7 @@ call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent) call fgd__set_field_len(field_len, 1, ent) - if (ent%comp_scal .NE. 0) then + if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscr(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), ent%cdividend, TRIM(ent%scalar(1)), & scalar_len(1), ent%scalar_ind(1)) Modified: trunk/getdata/bindings/f77/test/big_test.f =================================================================== --- trunk/getdata/bindings/f77/test/big_test.f 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/test/big_test.f 2013-12-11 00:16:49 UTC (rev 868) @@ -1403,10 +1403,10 @@ CALL CHKEOK(ne, 129, d) CALL CHKINT(ne, 129, n, GD_I8) -C 130: GDCSCL check - CALL GDCSCL(n, d, 'polynom', 7) +C 130: GDENFL check + CALL GDENFL(n, d, 'polynom', 7) CALL CHKEOK(ne, 130, d) - CALL CHKINT(ne, 130, n, 1) + CALL CHKINT(ne, 130, n, GDE_CS + GDE_CA) C 131: GDVLDT check CALL GDVLDT(n, d, 'new7', 4) @@ -2181,9 +2181,9 @@ +'in3', 3, 1.4d0, '', -1, -1, 0d0, 'carray', 6, 5, 0) CALL CHKOK2(ne, 243, 1, d) - CALL GDCSCL(n, d, 'new243', 6) + CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 243, 2, d) - CALL CHKIN2(ne, 243, 3, n, 0) + CALL CHKIN2(ne, 243, 3, n, GDE_CA) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), @@ -2246,9 +2246,9 @@ +0d0, '', -1, -1, 0d0, '', -1, -1, 0) CALL CHKOK2(ne, 244, 1, d) - CALL GDCSCL(n, d, 'new244', 6) + CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 244, 2, d) - CALL CHKIN2(ne, 244, 3, n, 0) + CALL CHKIN2(ne, 244, 3, n, GDE_CA) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), @@ -2336,9 +2336,9 @@ CALL GDASRC(d, 'new251', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0) CALL CHKOK2(ne, 251, 1, d) - CALL GDCSCL(n, d, 'new251', 6) + CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 251, 2, d) - CALL CHKIN2(ne, 251, 3, n, 0) + CALL CHKIN2(ne, 251, 3, n, GDE_CA) l = flen CALL GDGERC(fn, l, dp, n, d, 'new251', 6) @@ -2415,9 +2415,9 @@ +'carray', 6, 5, 0) CALL CHKOK2(ne, 255, 1, d) - CALL GDCSCL(n, d, 'new255', 6) + CALL GDENFL(n, d, 'new255', 6) CALL CHKOK2(ne, 255, 2, d) - CALL CHKIN2(ne, 255, 3, n, 1) + CALL CHKIN2(ne, 255, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), @@ -2481,9 +2481,9 @@ +dcmplx(0, 0), '', -1, -1, 0) CALL CHKOK2(ne, 256, 1, d) - CALL GDCSCL(n, d, 'new256', 6) + CALL GDENFL(n, d, 'new256', 6) CALL CHKOK2(ne, 256, 2, d) - CALL CHKIN2(ne, 256, 3, n, 1) + CALL CHKIN2(ne, 256, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), @@ -2528,9 +2528,9 @@ CALL GDASCR(d, 'new257', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0) CALL CHKOK2(ne, 257, 1, d) - CALL GDCSCL(n, d, 'new257', 6) + CALL GDENFL(n, d, 'new257', 6) CALL CHKOK2(ne, 257, 2, d) - CALL CHKIN2(ne, 257, 3, n, 0) + CALL CHKIN2(ne, 257, 3, n, GDE_CA) l = flen CALL GDGECR(fn, l, dc, n, d, 'new257', 6) @@ -2578,9 +2578,9 @@ +'', -1, 0d0, 'const', 5, -1, 0d0, 'const', 5, -1) CALL CHKOK2(ne, 259, 1, d) - CALL GDCSCL(n, d, 'new243', 6) + CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 259, 2, d) - CALL CHKIN2(ne, 259, 3, n, 0) + CALL CHKIN2(ne, 259, 3, n, GDE_CA) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), @@ -2644,9 +2644,9 @@ +'', -1, dcmplx(0, 0), '', 0, -1, dcmplx(0, 0), '', 0, -1) CALL CHKOK2(ne, 260, 1, d) - CALL GDCSCL(n, d, 'new243', 6) + CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 260, 2, d) - CALL CHKIN2(ne, 260, 3, n, 1) + CALL CHKIN2(ne, 260, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), @@ -2709,9 +2709,9 @@ +0d0, '', -1, 0, 0d0, '', -1, 0) CALL CHKOK2(ne, 261, 1, d) - CALL GDCSCL(n, d, 'new244', 6) + CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 261, 2, d) - CALL CHKIN2(ne, 261, 3, n, 0) + CALL CHKIN2(ne, 261, 3, n, GDE_CA) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), @@ -2759,9 +2759,9 @@ +dcmplx(0d0, 0d0), '', -1, 0, dcmplx(0d0, 0d0), '', -1, 0) CALL CHKOK2(ne, 262, 1, d) - CALL GDCSCL(n, d, 'new244', 6) + CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 262, 2, d) - CALL CHKIN2(ne, 262, 3, n, 0) + CALL CHKIN2(ne, 262, 3, n, GDE_CA) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), @@ -2874,9 +2874,9 @@ CALL GDLSRC(d, 'new251', 6, 'in5', 3, 0d0, 'carray', 6, 2) CALL CHKOK2(ne, 266, 1, d) - CALL GDCSCL(n, d, 'new251', 6) + CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 266, 2, d) - CALL CHKIN2(ne, 266, 3, n, 0) + CALL CHKIN2(ne, 266, 3, n, GDE_CA) l = flen CALL GDGERC(fn, l, dp, n, d, 'new251', 6) @@ -2897,9 +2897,9 @@ +-1) CALL CHKOK2(ne, 267, 1, d) - CALL GDCSCL(n, d, 'new251', 6) + CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 267, 2, d) - CALL CHKIN2(ne, 267, 3, n, 1) + CALL CHKIN2(ne, 267, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECR(fn, l, dc, n, d, 'new251', 6) Modified: trunk/getdata/bindings/f77/test/big_test95.f90 =================================================================== --- trunk/getdata/bindings/f77/test/big_test95.f90 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/f77/test/big_test95.f90 2013-12-11 00:16:49 UTC (rev 868) @@ -589,7 +589,7 @@ call check_str2(ne, 42, 4, ent%field(1), 'data') call check_str2(ne, 42, 5 , ent%field(2), 'INDEX') call check_str2(ne, 42, 6, ent%field(3), 'linterp') - call check_int2(ne, 42, 7, ent%comp_scal, 1) + call check_int2(ne, 42, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 42, 8, ent%scalar(1), '') call check_str2(ne, 42, 9, ent%scalar(2), '') call check_str2(ne, 42, 10, ent%scalar(3), 'const') @@ -709,7 +709,7 @@ call check_int2(ne, 54, 5, ent%fragment_index, 0) call check_str2(ne, 54, 6, ent%field(1), 'in1') call check_str2(ne, 54, 7, ent%field(2), 'in2') - call check_int2(ne, 54, 8, ent%comp_scal, 0) + call check_int2(ne, 54, 8, ent%flags, GD_EN_CALC) q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /) do i=1,2 @@ -733,7 +733,7 @@ call check_int2(ne, 55, 5, ent%fragment_index, 0) call check_str2(ne, 55, 6, ent%field(1), 'in1') call check_str2(ne, 55, 7, ent%field(2), 'in2') - call check_int2(ne, 55, 8, ent%comp_scal, 1) + call check_int2(ne, 55, 8, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) @@ -755,7 +755,7 @@ call check_int2(ne, 56, 2, ent%poly_ord, 3) call check_int2(ne, 56, 3, ent%fragment_index, 0) call check_str2(ne, 56, 4, ent%field(1), 'in1') - call check_int2(ne, 56, 5, ent%comp_scal, 0) + call check_int2(ne, 56, 5, ent%flags, GD_EN_CALC) q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /) DO i=1,4 @@ -777,7 +777,7 @@ call check_int2(ne, 57, 2, ent%poly_ord, 3) call check_int2(ne, 57, 3, ent%fragment_index, 0) call check_str2(ne, 57, 4, ent%field(1), 'in1') - call check_int2(ne, 57, 5, ent%comp_scal, 1) + call check_int2(ne, 57, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(3.1, 7.0) cq(2) = dcmplx(4.2, 8.0) @@ -927,7 +927,7 @@ call check_int2(ne, 71, 5, ent%fragment_index, 0) call check_str2(ne, 71, 6, ent%field(1), 'in1') call check_str2(ne, 71, 7, ent%field(2), 'in2') - call check_int2(ne, 71, 8, ent%comp_scal, 0) + call check_int2(ne, 71, 8, ent%flags, GD_EN_CALC) q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /) DO i=1,2 @@ -951,7 +951,7 @@ call check_int2(ne, 72, 3, ent%fragment_index, 0) call check_str2(ne, 72, 4, ent%field(1), 'in1') call check_str2(ne, 72, 5, ent%field(2), 'in2') - call check_int2(ne, 72, 6, ent%comp_scal, 1) + call check_int2(ne, 72, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) @@ -1255,7 +1255,7 @@ call check_str2(ne, 100, 6, ent%field(1), 'in4') call check_str2(ne, 100, 7, ent%field(2), 'in5') call check_str2(ne, 100, 8, ent%field(3), 'in6') - call check_int2(ne, 100, 5, ent%comp_scal, 0) + call check_int2(ne, 100, 5, ent%flags, GD_EN_CALC) q = (/ 9.9d-1, 7.8d0, 1.1d1, 2.2d-2, 1.96d0, 0d0 /) DO i=1,3 @@ -1279,7 +1279,7 @@ call check_int2(ne, 101, 3, ent%fragment_index, 0) call check_str2(ne, 101, 4, ent%field(1), 'in4') call check_str2(ne, 101, 5, ent%field(2), 'in3') - call check_int2(ne, 101, 6, ent%comp_scal, 1) + call check_int2(ne, 101, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(0.1, 0.2) cq(2) = dcmplx(0.3, 0.4) @@ -1321,7 +1321,7 @@ call check_int2(ne, 103, 2, ent%poly_ord, 3) call check_int2(ne, 103, 3, ent%fragment_index, 0) call check_str2(ne, 103, 4, ent%field(1), 'in1') - call check_int2(ne, 103, 5, ent%comp_scal, 1) + call check_int2(ne, 103, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 5.0) cq(2) = dcmplx(1.2, 4.0) @@ -1562,7 +1562,7 @@ ! 135: fgd_add raw ent%data_type = GD_FLOAT32 ent%fragment_index = 0 - ent%spf = 0; + ent%spf = 0 ent%field_type = GD_RAW_ENTRY ent%scalar(1) = 'carray' ent%scalar_ind(1) = 2 @@ -1626,7 +1626,7 @@ call check_ok(ne, 145, d) call check_int2(ne, 145, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 145, 2, ent%fragment_index, 0) - call check_int2(ne, 145, 3, ent%comp_scal, 1) + call check_int2(ne, 145, 3, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 145, 4, ent%field(1), 'div') call check_cpx2(ne, 145, 5, ent%cdividend, dcmplx(6.5d0, 4.3d0)) @@ -1650,7 +1650,7 @@ call check_int2(ne, 147, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 147, 2, ent%fragment_index, 0) call check_str2(ne, 147, 3, ent%field(1), 'in1') - call check_int2(ne, 147, 4, ent%comp_scal, 0) + call check_int2(ne, 147, 4, ent%flags, GD_EN_CALC) call check_dbl2(ne, 147, 5, ent%dividend, 31.9d0) ! 148: fgd_add_recip check @@ -1662,7 +1662,7 @@ call check_int2(ne, 148, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 148, 2, ent%fragment_index, 0) call check_str2(ne, 148, 3, ent%field(1), 'in1') - call check_int2(ne, 148, 4, ent%comp_scal, 1) + call check_int2(ne, 148, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 148, 5, ent%cdividend, dcmplx(31.9d0, 38.2d0)) ! 149: fgd_madd_divide check @@ -1685,7 +1685,7 @@ call check_int2(ne, 150, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 150, 2, ent%fragment_index, 0) call check_str2(ne, 150, 3, ent%field(1), 'in0') - call check_int2(ne, 150, 4, ent%comp_scal, 0) + call check_int2(ne, 150, 4, ent%flags, GD_EN_CALC) call check_dbl2(ne, 150, 5, ent%dividend, 95.5d0) ! 151: fgd_madd_recip check @@ -1697,7 +1697,7 @@ call check_int2(ne, 151, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 151, 2, ent%fragment_index, 0) call check_str2(ne, 151, 3, ent%field(1), 'in3') - call check_int2(ne, 151, 4, ent%comp_scal, 1) + call check_int2(ne, 151, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 151, 5, ent%cdividend, dcmplx(8.47d0, 6.22d0)) ! 152: fgd_alter_divide check @@ -2562,7 +2562,7 @@ ent%field_type = GD_LINCOM_ENTRY ent%fragment_index = 0 ent%n_fields = 3 - ent%comp_scal = 0 + ent%flags = 0 ent%field(1) = 'in1' ent%field(2) = 'in2' ent%field(3) = 'in3' @@ -2589,7 +2589,7 @@ call check_str2(ne, 243, 6, ent%field(1), 'in1') call check_str2(ne, 243, 7, ent%field(2), 'in2') call check_str2(ne, 243, 8, ent%field(3), 'in3') - call check_int2(ne, 243, 9, ent%comp_scal, 0) + call check_int2(ne, 243, 9, ent%flags, GD_EN_CALC) call check_str2(ne, 243, 10, ent%scalar(1), '') call check_str2(ne, 243, 11, ent%scalar(2), 'const') call check_str2(ne, 243, 12, ent%scalar(3), '') @@ -2611,7 +2611,7 @@ ent%field_type = GD_POLYNOM_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' - ent%comp_scal = 0 + ent%flags = 0 ent%a(1) = 33d0 ent%a(2) = 44d0 ent%a(3) = 66d0 @@ -2630,7 +2630,7 @@ call check_int2(ne, 244, 4, ent%poly_ord, 3) call check_int2(ne, 244, 5, ent%fragment_index, 0) call check_str2(ne, 244, 6, ent%field(1), 'in1') - call check_int2(ne, 244, 7, ent%comp_scal, 0) + call check_int2(ne, 244, 7, ent%flags, GD_EN_CALC) call check_dbl2(ne, 244, 8, ent%a(1), 33d0) call check_dbl2(ne, 244, 9, ent%a(2), 44d0) call check_dbl2(ne, 244, 10, ent%a(3), 66d0) @@ -2686,7 +2686,7 @@ ent%field_type = GD_RECIP_ENTRY ent%fragment_index = 0 ent%scalar(1) = 'carray' - ent%comp_scal = 0 + ent%flags = 0 ent%scalar_ind = 4 call fgd_add(d, 'new251', ent) call check_ok2(ne, 251, 1, d) @@ -2695,7 +2695,7 @@ call check_ok2(ne, 251, 2, d) call check_int2(ne, 251, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 251, 4, ent%fragment_index, 0) - call check_int2(ne, 251, 5, ent%comp_scal, 0) + call check_int2(ne, 251, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 251, 6, ent%field(1), 'in1') call check_dbl2(ne, 251, 7, ent%dividend, 180d0) call check_str2(ne, 251, 8, ent%scalar(1), 'carray') @@ -2751,7 +2751,7 @@ ent%field_type = GD_LINCOM_ENTRY ent%fragment_index = 0 ent%n_fields = 3 - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%field(1) = 'in1' ent%field(2) = 'in2' ent%field(3) = 'in3' @@ -2778,7 +2778,7 @@ call check_str2(ne, 255, 6, ent%field(1), 'in1') call check_str2(ne, 255, 7, ent%field(2), 'in2') call check_str2(ne, 255, 8, ent%field(3), 'in3') - call check_int2(ne, 255, 9, ent%comp_scal, 1) + call check_int2(ne, 255, 9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 255, 10, ent%scalar(1), '') call check_str2(ne, 255, 11, ent%scalar(2), 'const') call check_str2(ne, 255, 12, ent%scalar(3), '') @@ -2799,7 +2799,7 @@ ent%field_type = GD_POLYNOM_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%ca(1) = dcmplx(22d0, 33d0) ent%ca(2) = dcmplx(44d0, 55d0) ent%ca(3) = dcmplx(66d0, 77d0) @@ -2818,7 +2818,7 @@ call check_int2(ne, 256, 4, ent%poly_ord, 3) call check_int2(ne, 256, 5, ent%fragment_index, 0) call check_str2(ne, 256, 6, ent%field(1), 'in1') - call check_int2(ne, 256, 7, ent%comp_scal, 1) + call check_int2(ne, 256, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 256, 8, ent%ca(1), dcmplx(22d0, 33d0)) call check_cpx2(ne, 256, 9, ent%ca(2), dcmplx(44d0, 55d0)) call check_cpx2(ne, 256, 10, ent%ca(3), dcmplx(66d0, 77d0)) @@ -2834,7 +2834,7 @@ ent%field_type = GD_RECIP_ENTRY ent%fragment_index = 0 ent%scalar(1) = 'carray' - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%scalar_ind = 4 call fgd_add(d, 'new257', ent) call check_ok2(ne, 257, 1, d) @@ -2843,7 +2843,7 @@ call check_ok2(ne, 257, 2, d) call check_int2(ne, 257, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 257, 4, ent%fragment_index, 0) - call check_int2(ne, 257, 5, ent%comp_scal, 0) + call check_int2(ne, 257, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 257, 6, ent%field(1), 'in1') call check_dbl2(ne, 257, 7, ent%dividend, 180d0) call check_str2(ne, 257, 8, ent%scalar(1), 'carray') @@ -2872,8 +2872,8 @@ ! 259: fgd_alter_entry lincom ent%field_type = GD_LINCOM_ENTRY ent%field(2) = 'in4' - ent%comp_scal = 0; - ent%m(1) = 2.2d0; + ent%flags = 0 + ent%m(1) = 2.2d0 ent%scalar(2) = '' ent%scalar(3) = 'const' ent%scalar(4) = 'carray' @@ -2891,7 +2891,7 @@ call check_str2(ne, 259, 6, ent%field(1), 'in1') call check_str2(ne, 259, 7, ent%field(2), 'in4') call check_str2(ne, 259, 8, ent%field(3), 'in3') - call check_int2(ne, 259, 9, ent%comp_scal, 0) + call check_int2(ne, 259, 9, ent%flags, GD_EN_CALC) call check_str2(ne, 259, 10, ent%scalar(1), '') call check_str2(ne, 259, 11, ent%scalar(2), 'const') call check_str2(ne, 259, 12, ent%scalar(3), 'const') @@ -2914,7 +2914,7 @@ ent%field(2) = 'in4' ent%field(3) = 'in3' ent%field_type = GD_LINCOM_ENTRY - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%cm(1) = dcmplx(9d0, 8d0) ent%scalar(2) = '' ent%scalar(3) = '' @@ -2932,7 +2932,7 @@ call check_str2(ne, 260, 6, ent%field(1), 'in1') call check_str2(ne, 260, 7, ent%field(2), 'in4') call check_str2(ne, 260, 8, ent%field(3), 'in3') - call check_int2(ne, 260, 9, ent%comp_scal, 1) + call check_int2(ne, 260, 9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 260, 10, ent%scalar(1), '') call check_str2(ne, 260, 11, ent%scalar(2), 'const') call check_str2(ne, 260, 12, ent%scalar(3), 'const') @@ -2953,7 +2953,7 @@ ! 261: fgd_alter_entry POLYNOM ent%field(1) = 'in3' ent%field_type = GD_POLYNOM_ENTRY - ent%comp_scal = 0 + ent%flags = 0 ent%a(1) = 2d0 ent%a(2) = 6d0 ent%scalar(1) = '' @@ -2969,7 +2969,7 @@ call check_int2(ne, 261, 4, ent%poly_ord, 3) call check_int2(ne, 261, 5, ent%fragment_index, 0) call check_str2(ne, 261, 6, ent%field(1), 'in3') - call check_int2(ne, 261, 7, ent%comp_scal, 0) + call check_int2(ne, 261, 7, ent%flags, GD_EN_CALC) call check_dbl2(ne, 261, 8, ent%a(1), 2d0) call check_dbl2(ne, 261, 9, ent%a(2), 6d0) call check_dbl2(ne, 261, 10, ent%a(3), 15d0) @@ -2982,7 +2982,7 @@ ! 262: fgd_alter_entry CPOLYNOM ent%field_type = GD_POLYNOM_ENTRY - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%ca(3) = dcmplx(26d0, 2d0) ent%scalar(1) = 'const' ent%scalar(2) = 'const' @@ -2997,7 +2997,7 @@ call check_int2(ne, 262, 4, ent%poly_ord, 3) call check_int2(ne, 262, 5, ent%fragment_index, 0) call check_str2(ne, 262, 6, ent%field(1), 'in3') - call check_int2(ne, 262, 7, ent%comp_scal, 1) + call check_int2(ne, 262, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 262, 8, ent%ca(1), dcmplx(93d0, 0)) call check_cpx2(ne, 262, 9, ent%ca(2), dcmplx(93d0, 0)) call check_cpx2(ne, 262, 10, ent%ca(3), dcmplx(26d0, 2d0)) @@ -3061,7 +3061,7 @@ ! 266: fgd_alter_entry RECIP ent%field_type = GD_RECIP_ENTRY - ent%comp_scal = 0 + ent%flags = 0 ent%field(1) = 'in5' ent%scalar(1) = 'carray' ent%scalar_ind(1) = 2 @@ -3072,7 +3072,7 @@ call check_ok2(ne, 266, 2, d) call check_int2(ne, 266, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 266, 4, ent%fragment_index, 0) - call check_int2(ne, 266, 5, ent%comp_scal, 0) + call check_int2(ne, 266, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 266, 6, ent%field(1), 'in5') call check_dbl2(ne, 266, 7, ent%dividend, 12d0) call check_str2(ne, 266, 8, ent%scalar(1), 'carray') @@ -3081,7 +3081,7 @@ ! 267: fgd_alter_entry CRECIP ent%field_type = GD_RECIP_ENTRY ent%field(1) = 'in4' - ent%comp_scal = 1 + ent%flags = GD_EN_COMPSCAL ent%cdividend = dcmplx(12d0, 14d0) call fgd_alter_entry(d, 'new251', ent, 15, 0) call check_ok2(ne, 267, 1, d) @@ -3090,7 +3090,7 @@ call check_ok2(ne, 267, 2, d) call check_int2(ne, 267, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 267, 4, ent%fragment_index, 0) - call check_int2(ne, 267, 5, ent%comp_scal, 1) + call check_int2(ne, 267, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 267, 6, ent%field(1), 'in4') call check_cpx2(ne, 267, 7, ent%cdividend, dcmplx(12d0, 14d0)) call check_str2(ne, 267, 8, ent%scalar(1), '') Modified: trunk/getdata/bindings/idl/getdata.c =================================================================== --- trunk/getdata/bindings/idl/getdata.c 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/idl/getdata.c 2013-12-11 00:16:49 UTC (rev 868) @@ -446,6 +446,9 @@ "IN_FIELDS", IDL_MSG_LONGJMP, NULL)), E->in_fields[0]); } + *(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, + "FLAGS", IDL_MSG_LONGJMP, NULL)) = E->flags; + switch (E->field_type) { case GD_RAW_ENTRY: @@ -461,8 +464,6 @@ case GD_LINCOM_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "N_FIELDS", IDL_MSG_LONGJMP, NULL)) = E->n_fields; - *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, - "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal; for (i = 0; i < E->n_fields; ++i) { IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", @@ -519,8 +520,6 @@ "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]); break; case GD_RECIP_ENTRY: - *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, - "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, @@ -542,8 +541,6 @@ break; case GD_POLYNOM_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, - "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal; - *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "POLY_ORD", IDL_MSG_LONGJMP, NULL)) = E->poly_ord; for (i = 0; i <= E->poly_ord; ++i) { @@ -960,7 +957,7 @@ if (E->n_fields > 0) min = max = E->n_fields; - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; mask = gdidl_get_entry_scalars(E, 9 * tmask, v); @@ -1010,7 +1007,7 @@ break; case GD_RECIP_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; mask = gdidl_get_entry_scalars(E, 0x1, v); @@ -1043,7 +1040,7 @@ tmask = (1 << max) - 1; mask = gdidl_get_entry_scalars(E, tmask, v); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; if ((mask & tmask) != tmask) E->poly_ord = gdidl_get_entry_cmparr(E->ca, v, 'A', min, max, mask, @@ -5947,6 +5944,7 @@ static IDL_STRUCT_TAG_DEF gdidl_entry[] = { { "FIELD", 0, (void*)IDL_TYP_STRING }, { "FIELD_TYPE", 0, (void*)IDL_TYP_INT }, + { "FLAGS", 0, (void*)IDL_TYP_UINT }, { "FRAGMENT", 0, (void*)IDL_TYP_INT }, { "IN_FIELDS", lincom_dims, (void*)IDL_TYP_STRING }, @@ -5956,7 +5954,6 @@ { "B", lincom_dims, (void*)IDL_TYP_DOUBLE }, /* LINCOM */ { "CB", lincom_dims, (void*)IDL_TYP_DCOMPLEX }, /* LINCOM */ { "BITNUM", 0, (void*)IDL_TYP_INT }, /* (S)BIT */ - { "COMP_SCAL", 0, (void*)IDL_TYP_INT }, /* LINCOM / POLYNOM */ { "COUNT_VAL", 0, (void*)IDL_TYP_INT }, /* MPLEX */ { "DATA_TYPE", 0, (void*)IDL_TYP_INT }, /* RAW / CONST / CARRAY */ { "DIVIDEND", 0, (void*)IDL_TYP_DOUBLE }, /* RECIP */ Modified: trunk/getdata/bindings/idl/test/big_test.pro =================================================================== --- trunk/getdata/bindings/idl/test/big_test.pro 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/idl/test/big_test.pro 2013-12-11 00:16:49 UTC (rev 868) @@ -187,7 +187,7 @@ nume += check_simple2(42, 3, n.fragment, 0) nume += check_simple2(42, 4, n.n_fields, 3) nume += check_simple2(42, 5, n.in_fields, [ "data", "INDEX", "linterp" ]) -nume += check_simple2(42, 6, n.comp_scal, 1) +nume += check_simple2(42, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(42, 7, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $ DCOMPLEX(5.5D,0) ]) nume += check_simple2(42, 8, n.cb, [ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), $ @@ -202,7 +202,7 @@ nume += check_simple2(44, 3, n.fragment, 0) nume += check_simple2(44, 4, n.poly_ord, 5) nume += check_simple2(44, 5, n.in_fields, [ "data" ]) -nume += check_simple2(44, 6, n.comp_scal, 1) +nume += check_simple2(44, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(44, 7, n.ca, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), DCOMPLEX(5.5D,0), DCOMPLEX(5.5D,0) ]) nume += check_simple2(44, 8, n.scalar, [ "", "", "", "", "const", "const" ]) @@ -297,7 +297,7 @@ nume += check_simple2(55, 3, n.fragment, 0) nume += check_simple2(55, 4, n.n_fields, 2) nume += check_simple2(55, 5, n.in_fields, [ "in1", "in2" ]) -nume += check_simple2(55, 6, n.comp_scal, 1) +nume += check_simple2(55, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(55, 7, n.cm, [ DCOMPLEX(1.1,1.2), DCOMPLEX(1.4,1.5) ]) nume += check_simple2(55, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ]) @@ -313,7 +313,7 @@ nume += check_simple2(57, 3, n.fragment, 0) nume += check_simple2(57, 4, n.poly_ord, 3) nume += check_simple2(57, 5, n.in_fields, [ "in1" ]) -nume += check_simple2(57, 6, n.comp_scal, 1) +nume += check_simple2(57, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(57, 7, n.ca, [ DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $ DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) ]) @@ -445,7 +445,7 @@ nume += check_simple2(71, 3, n.fragment, 0) nume += check_simple2(71, 4, n.n_fields, 2) nume += check_simple2(71, 5, n.in_fields, [ "in1", "in2" ]) -nume += check_simple2(71, 6, n.comp_scal, 0) +nume += check_simple2(71, 6, n.flags, !GD.EN_CALC) nume += check_simple2(71, 7, n.m, [ 9.9D, 7.7D ]) nume += check_simple2(71, 8, n.b, [ 8.8D, 6.6D ]) @@ -461,7 +461,7 @@ nume += check_simple2(73, 3, n.fragment, 0) nume += check_simple2(73, 4, n.poly_ord, 3) nume += check_simple2(73, 5, n.in_fields, [ "in1" ]) -nume += check_simple2(73, 6, n.comp_scal, 0) +nume += check_simple2(73, 6, n.flags, !GD.EN_CALC) nume += check_simple2(73, 7, n.a, [ 3.3D, 4.4D, 5.5D, 6.6D ]) ; 75: gd_madd_linterp @@ -658,7 +658,7 @@ nume += check_simple2(101, 3, n.fragment, 0) nume += check_simple2(101, 4, n.n_fields, 2) nume += check_simple2(101, 5, n.in_fields, [ "in3", "in4" ]) -nume += check_simple2(101, 6, n.comp_scal, 1) +nume += check_simple2(101, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(101, 7, n.cm, [ DCOMPLEX(2.3,4.5), DCOMPLEX(6.7,8.9) ]) nume += check_simple2(101, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ]) @@ -674,7 +674,7 @@ nume += check_simple2(103, 3, n.fragment, 0) nume += check_simple2(103, 4, n.poly_ord, 4) nume += check_simple2(103, 5, n.in_fields, [ "in1" ]) -nume += check_simple2(103, 6, n.comp_scal, 1) +nume += check_simple2(103, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(103, 7, n.ca, [ DCOMPLEX(1.2,3.4), DCOMPLEX(5.6,7.8), $ DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ]) @@ -959,7 +959,7 @@ nume += check_simple2(145, 2, n.field, "recip") nume += check_simple2(145, 3, n.fragment, 0) nume += check_simple2(145, 4, n.in_fields, [ "div" ]) -nume += check_simple2(145, 5, n.comp_scal, 1) +nume += check_simple2(145, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(145, 6, n.cdividend, DCOMPLEX(6.5D,4.3D)) ; 146: gd_add_divide @@ -983,7 +983,7 @@ nume += check_simple2(148, 2, n.field, "new16") nume += check_simple2(148, 3, n.fragment, 0) nume += check_simple2(148, 4, n.in_fields, [ "in2" ]) -nume += check_simple2(148, 5, n.comp_scal, 1) +nume += check_simple2(148, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4)) ; 152: gd_alter_divide @@ -1006,7 +1006,7 @@ nume += check_simple2(153, 1, n.field_type, !GD.RECIP_ENTRY) nume += check_simple2(153, 2, n.field, "new16") nume += check_simple2(153, 3, n.fragment, 0) -nume += check_simple2(153, 5, n.comp_scal, 0) +nume += check_simple2(153, 5, n.flags, !GD.EN_CALC) nume += check_simple2(153, 4, n.in_fields, [ "in2" ]) nume += check_simple2(153, 6, n.dividend, 1.01) @@ -1393,7 +1393,7 @@ nume += check_simple2(243, 5, n.fragment, 0) nume += check_simple2(243, 6, n.n_fields, 3) nume += check_simple2(243, 7, n.in_fields, [ "in1", "in2", "in3" ]) -nume += check_simple2(243, 8, n.comp_scal, 0) +nume += check_simple2(243, 8, n.flags, !GD.EN_CALC) nume += check_simple2(243, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $ DCOMPLEX(1.4D,0) ]) nume += check_simple2(243, 10, n.m, [ 1.1D, 86D, 1.4D ]) @@ -1418,7 +1418,7 @@ nume += check_simple2(244, 5, n.fragment, 0) nume += check_simple2(244, 6, n.poly_ord, 3) nume += check_simple2(244, 7, n.in_fields, [ "in2" ]) -nume += check_simple2(244, 8, n.comp_scal, 1) +nume += check_simple2(244, 8, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(244, 9, n.ca, [ DCOMPLEX(33D, 0), DCOMPLEX(44D, 55D), $ DCOMPLEX(66D, 0) ]) nume += check_simple2(244, 10, n.a, [ 33D, 44D, 66D ]) @@ -1526,7 +1526,7 @@ nume += check_simple2(145, 4, n.field, "Bnew251") nume += check_simple2(145, 5, n.fragment, 1) nume += check_simple2(145, 6, n.in_fields, [ "Bin1" ]) -nume += check_simple2(145, 7, n.comp_scal, 1) +nume += check_simple2(145, 7, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(145, 8, n.cdividend, DCOMPLEX(33.3, 44.4)) nume += check_simple2(145, 9, n.dividend, 33.3) @@ -1590,7 +1590,7 @@ nume += check_simple2(259, 5, n.fragment, 0) nume += check_simple2(259, 6, n.n_fields, 3) nume += check_simple2(259, 7, n.in_fields, [ "in1", "in2", "in3" ]) -nume += check_simple2(259, 8, n.comp_scal, 0) +nume += check_simple2(259, 8, n.flags, !GD.EN_CALC) nume += check_simple2(259, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $ DCOMPLEX(86D,0) ]) nume += check_simple2(259, 10, n.m, [ 1.1D, 86D, 86D ]) Modified: trunk/getdata/bindings/make_parameters.c =================================================================== --- trunk/getdata/bindings/make_parameters.c 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/make_parameters.c 2013-12-11 00:16:49 UTC (rev 868) @@ -45,6 +45,7 @@ * 12: window operations * 13: desynced flags (not in IDL) * 14: entry_list constants (not in IDL) + * 15: entry flags * 98: miscellaneous constants not in IDL * 99: miscellaneous constants */ @@ -232,6 +233,10 @@ CONSTANT(ENTRIES_HIDDEN, "GDEN_H", 14), CONSTANT(ENTRIES_NOALIAS, "GDEN_N", 14), + CONSTANT(EN_CALC, "GDE_CA", 15), + CONSTANT(EN_HIDDEN, "GDE_HI", 15), + CONSTANT(EN_COMPSCAL, "GDE_CS", 15), + CONSTANT(ALL_FRAGMENTS, "GD_ALL", 99), CONSTANT(DEFAULT_LOOKBACK, "GDLB_D", 99), CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", 99), @@ -358,6 +363,13 @@ parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); + printf("\\\n%c Entry object flags\\\n", c); + + for (j = 0; constant_list[j].lname != NULL; ++j) + if (constant_list[j].type == 15) + parameter(constant_list[j].lname, constant_list[j].fname, + constant_list[j].value, i); + printf("\\\n%c Miscellaneous parameters\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) Modified: trunk/getdata/bindings/perl/GetData.xs =================================================================== --- trunk/getdata/bindings/perl/GetData.xs 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/perl/GetData.xs 2013-12-11 00:16:49 UTC (rev 868) @@ -445,7 +445,7 @@ if (E->EN(lincom,n_fields) != 0) min = max = E->EN(lincom,n_fields); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; mask = gdp_fetch_scalars(E, (HV*)sv, ((1 << max) - 1) * 9, pkg, func); @@ -497,7 +497,7 @@ mask = gdp_fetch_scalars(E, (HV*)sv, (1 << (max + 1)) - 1, pkg, func); tmask = (1 << max) - 1; - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; if ((mask & tmask) != tmask) E->EN(polynom,poly_ord) = gdp_fetch_cmp_list(E->EN(polynom,ca), (HV*)sv, partial, 'a', min, max, mask, pkg, func) - 1; @@ -508,7 +508,7 @@ gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; if (!(mask & 1)) GDP_EHASH_FETCH_CMP(partial, "dividend", EN(recip,cdividend)); break; Modified: trunk/getdata/bindings/php/getdata.c =================================================================== --- trunk/getdata/bindings/php/getdata.c 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/php/getdata.c 2013-12-11 00:16:49 UTC (rev 868) @@ -1320,7 +1320,7 @@ mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, lincom_mask[max], ctx); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; if ((mask & tmask) != tmask) @@ -1382,7 +1382,7 @@ mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, (1 << max) - 1, ctx); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; if ((mask & tmask) != tmask) E->EN(polynom,poly_ord) = @@ -1400,7 +1400,7 @@ case GD_RECIP_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; if (!(mask & 1)) gdphp_entry_complex((double*)gd_csp_(E->EN(recip,cdividend)), a, "dividend", sizeof("dividend"), partial, ctx); Modified: trunk/getdata/bindings/python/pyentry.c =================================================================== --- trunk/getdata/bindings/python/pyentry.c 2013-12-07 01:48:34 UTC (rev 867) +++ trunk/getdata/bindings/python/pyentry.c 2013-12-11 00:16:49 UTC (rev 868) @@ -254,9 +254,9 @@ obj = PyTuple_GetItem(parm2, i); if (PyComplex_Check(obj)) { - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(lincom,cm)[i]), obj); - } else if (E->comp_scal) + } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i], &E->EN(lincom,cm)[i]); else { @@ -272,9 +272,9 @@ obj = PyTuple_GetItem(parm3, i); if (PyComplex_Check(obj)) { - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(lincom,cb)[i]), obj); - } else if (E->comp_scal) + } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,cb)[i]); else { @@ -349,9 +349,9 @@ obj = PyTuple_GetItem(tuple, 1); if (PyComplex_Check(obj)) { - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(recip,cdividend)), obj); - } else if (E->comp_scal) + } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0], &E->EN(recip,cdividend)); else { @@ -399,10 +399,10 @@ for (i = 0; i <= count; ++i) { obj = PyTuple_GetItem(parm2, i); if (PyComplex_Check(obj)) { - E->comp_scal = 1; + E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(polynom,ca)[i]), obj); E->scalar[i] = NULL; - } else if (E->comp_scal) + } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i], &E->EN(polynom,ca)[i]); else { @@ -972,7 +972,7 @@ if (t != -1) { sprintf(buffer, "%s%i", (t & GD_COMPLEX) ? "COMPLEX" : - (t & GD_IEEE754) ? "FLOAT" : (t & GD... [truncated message content] |
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] |
From: <ket...@us...> - 2013-11-15 22:39:49
|
Revision: 866 http://sourceforge.net/p/getdata/code/866 Author: ketiltrout Date: 2013-11-15 22:39:46 +0000 (Fri, 15 Nov 2013) Log Message: ----------- Rename some tests. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/test/Makefile.am Added Paths: ----------- trunk/getdata/test/add_add.c trunk/getdata/test/close_close.c trunk/getdata/test/del_del.c trunk/getdata/test/flush_flush.c trunk/getdata/test/include_include.c trunk/getdata/test/index_index.c trunk/getdata/test/move_move.c trunk/getdata/test/name_name.c trunk/getdata/test/nfields_nfields.c trunk/getdata/test/nframes_nframes.c trunk/getdata/test/open_open.c trunk/getdata/test/spf_raw.c Removed Paths: ------------- trunk/getdata/test/add.c trunk/getdata/test/close.c trunk/getdata/test/del.c trunk/getdata/test/flush.c trunk/getdata/test/include.c trunk/getdata/test/index.c trunk/getdata/test/move.c trunk/getdata/test/name.c trunk/getdata/test/nfields.c trunk/getdata/test/nframes.c trunk/getdata/test/open.c trunk/getdata/test/spf.c Property Changed: ---------------- trunk/getdata/test/ Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/ChangeLog 2013-11-15 22:39:46 UTC (rev 866) @@ -1,3 +1,9 @@ +2013-11-15 D. V. Wiebe <ge...@ke...> svn:867 + * 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 + test/spf_raw.c: Renamed. + 2013-11-13 D. V. Wiebe <ge...@ke...> svn:863 * bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename. Patch from S. J. Benton. Index: trunk/getdata/test =================================================================== --- trunk/getdata/test 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test 2013-11-15 22:39:46 UTC (rev 866) Property changes on: trunk/getdata/test ___________________________________________________________________ Modified: svn:ignore ## -7,7 +7,7 ## *.exe .deps .libs -add +add_add add_affix add_alias add_alias_affix ## -138,8 +138,8 ## bzip_move_from bzip_nframes bzip_put -close close_bad +close_close close_discard close_null convert_complex128_complex64 ## -273,13 +273,13 ## cvlist_meta cvlist_meta_hidden cvlist_meta_invalid -del del_carray del_carray_deref del_const del_const_deref del_const_force del_data +del_del del_derived del_derived_after del_derived_force ## -360,9 +360,9 ## flist_type_meta flist_type_meta_hidden flist_type_meta_invalid -flush flush_all flush_bad_code +flush_flush flush_invalid flush_meta flush_ref ## -491,13 +491,13 ## hide hide_hidden hide_unhide -include include_accmode include_affix include_auto include_cb include_creat include_ignore +include_include include_index include_invalid include_nonexistent ## -505,8 +505,8 ## include_ref include_sub include_syntax -index index_domain +index_index index_range legacy_get legacy_get_put ## -549,7 +549,6 ## madd_spec_resolv madd_string madd_window -move move_affix move_affix_dup move_alias ## -560,15 +559,16 ## move_data_nop move_index move_meta +move_move move_protect move_subdir -name name_affix name_affix_bad name_alias name_dup name_move name_move_alias +name_name name_updb name_updb_alias name_updb_const ## -577,19 +577,19 ## nentries_hidden nentries_noalias nentries_scalar -nfields nfields_hidden nfields_invalid +nfields_nfields nfields_type nfields_type_hidden nfields_type_invalid nfields_vector nfields_vector_hidden nfields_vector_invalid -nframes nframes64 nframes_empty nframes_invalid +nframes_nframes nframes_off64 nframes_spf nmeta ## -605,7 +605,6 ## nmeta_vectors_hidden nmeta_vectors_invalid nmeta_vectors_parent -open open_abs open_cb_abort open_cb_cont ## -615,6 +614,7 ## open_eaccess open_nonexistent open_notdirfile +open_open open_sym_a open_sym_al open_sym_at ## -867,7 +867,6 ## slim_get slim_nframes slim_put -spf spf_alias spf_alias_meta spf_alias_missing ## -875,6 +874,7 ## spf_lincom spf_multiply spf_polynom +spf_raw spf_recip spf_recurse svlist Modified: trunk/getdata/test/Makefile.am =================================================================== --- trunk/getdata/test/Makefile.am 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/Makefile.am 2013-11-15 22:39:46 UTC (rev 866) @@ -25,20 +25,20 @@ EXTRA_DIST=test.h -ADD_TESTS=add add_affix add_alias add_alias_affix add_alias_meta add_bit \ +ADD_TESTS=add_add add_affix add_alias add_alias_affix add_alias_meta add_bit \ add_bit_bitnum add_bit_bitsize add_bit_invalid add_bit_numbits \ - add_bit_scalars add_carray add_clincom add_code add_const add_cpolynom \ - add_crecip add_crecip89 add_divide add_divide_invalid add_duplicate \ - add_format add_invalid add_lincom add_lincom_affix add_lincom_invalid \ - add_lincom_nfields add_linterp add_linterp_invalid add_meta \ - add_meta_alias add_mplex add_mplex_scalars add_multiply \ - add_multiply_invalid add_phase add_phase_invalid add_polynom \ - add_polynom_scalar add_protect add_raw add_raw_include add_raw_invalid \ - add_raw_spf add_raw_spf_scalar add_raw_type add_rdonly add_recip \ - add_resolv add_sbit add_scalar add_scalar_carray add_scalar_carray_bad \ - add_sort add_spec add_spec_directive add_spec_invalid add_spec_meta \ - add_spec_resolv add_string add_string_affix add_type add_window \ - add_window_op + add_bit_scalars add_carray add_clincom add_code add_const \ + add_cpolynom add_crecip add_crecip89 add_divide add_divide_invalid \ + add_duplicate add_format add_invalid add_lincom add_lincom_affix \ + add_lincom_invalid add_lincom_nfields add_linterp \ + add_linterp_invalid add_meta add_meta_alias add_mplex \ + add_mplex_scalars add_multiply add_multiply_invalid add_phase \ + add_phase_invalid add_polynom add_polynom_scalar add_protect add_raw \ + add_raw_include add_raw_invalid add_raw_spf add_raw_spf_scalar \ + add_raw_type add_rdonly add_recip add_resolv add_sbit add_scalar \ + add_scalar_carray add_scalar_carray_bad add_sort add_spec \ + add_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \ + add_string add_string_affix add_type add_window add_window_op ALIAS_TESTS=alias_list alias_list_alias alias_list_missing alias_num \ alias_num_alias alias_num_missing alias_target alias_target_alias \ @@ -69,7 +69,7 @@ cvlist_array_meta_hidden cvlist_hidden cvlist_invalid cvlist_meta \ cvlist_meta_hidden cvlist_meta_invalid -CLOSE_TESTS=close close_bad close_discard close_null +CLOSE_TESTS=close_bad close_close close_discard close_null CONVERT_TESTS=convert_complex128_complex64 convert_complex128_float64 \ convert_complex128_int64 convert_complex128_uint64 \ @@ -122,9 +122,9 @@ CREAT_TESTS=creat creat_excl creat_rdonly -DEL_TESTS=del del_carray del_carray_deref del_const del_const_deref \ +DEL_TESTS=del_carray del_carray_deref del_const del_const_deref \ del_const_force del_data del_derived del_derived_after \ - del_derived_force del_meta del_meta_force + del_derived_force del_del del_meta del_meta_force DFES_TESTS=dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \ dfes_null dfes_phase dfes_raw dfes_recip dfes_zero @@ -156,8 +156,8 @@ flist_meta_invalid flist_type flist_type_hidden flist_type_invalid \ flist_type_meta flist_type_meta_hidden flist_type_meta_invalid -FLUSH_TESTS=flush flush_all flush_bad_code flush_invalid flush_meta flush_ref \ - flush_spec +FLUSH_TESTS=flush_all flush_bad_code flush_flush flush_invalid flush_meta \ + flush_ref flush_spec FOFFS_TESTS=foffs_alter foffs_get foffs_move @@ -167,15 +167,16 @@ GET_TESTS=get64 get_affix get_bad_code get_bit get_carray get_carray_len \ get_carray_c2r get_carray_slice get_char get_clincom get_complex128 \ - get_complex64 get_const get_const_complex get_const_repr get_cpolynom \ - get_divide get_endian8 get_endian16 get_endian32 get_endian64 \ - get_endian_complex128_arm get_endian_complex128_big \ + get_complex64 get_const get_const_complex get_const_repr \ + get_cpolynom get_divide get_endian8 get_endian16 get_endian32 \ + get_endian64 get_endian_complex128_arm get_endian_complex128_big \ get_endian_complex128_little get_endian_complex64_arm \ get_endian_complex64_big get_endian_complex64_little \ - get_endian_float32_arm get_endian_float32_big get_endian_float32_little \ - get_endian_float64_arm get_endian_float64_big get_endian_float64_little \ - get_ff get_float32 get_float64 get_foffs get_fs get_here get_here_foffs \ - get_heres get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 \ + get_endian_float32_arm get_endian_float32_big \ + get_endian_float32_little get_endian_float64_arm \ + get_endian_float64_big get_endian_float64_little get_ff get_float32 \ + get_float64 get_foffs get_fs get_here get_here_foffs get_heres \ + get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 \ get_lincom2 get_lincom3 get_lincom_noin get_lincom_non \ get_lincom_null get_lincom_spf get_linterp get_linterp_noin \ get_linterp_notab get_linterp_sort get_mplex get_mplex_bof \ @@ -197,12 +198,12 @@ HIDE_TESTS=hide hide_hidden hide_unhide -INCLUDE_TESTS=include include_accmode include_affix include_auto include_cb \ - include_creat include_ignore include_index include_invalid \ - include_nonexistent include_pc include_ref include_sub \ - include_syntax +INCLUDE_TESTS=include_accmode include_affix include_auto include_cb \ + include_creat include_ignore include_include include_index \ + include_invalid include_nonexistent include_pc include_ref \ + include_sub include_syntax -INDEX_TESTS=index index_domain index_range +INDEX_TESTS=index_domain index_index index_range if INCLUDE_LEGACY_API LEGACY_TESTS=legacy_get legacy_get_put legacy_get_rofs legacy_nframes \ @@ -219,21 +220,21 @@ madd_polynom madd_recip madd_sbit madd_spec madd_spec_directive \ madd_spec_invalid madd_spec_resolv madd_string madd_window -MOVE_TESTS=move move_affix move_affix_dup move_alias move_data_enc_ar \ +MOVE_TESTS=move_affix move_affix_dup move_alias move_data_enc_ar \ move_data_enc_ra move_data_endian move_data_foffs move_data_nop \ - move_index move_meta move_protect move_subdir + move_index move_meta move_move move_protect move_subdir -NAME_TESTS=name name_affix name_affix_bad name_alias name_dup name_move \ - name_move_alias name_updb name_updb_alias name_updb_const \ +NAME_TESTS=name_affix name_affix_bad name_alias name_dup name_move \ + name_move_alias name_name name_updb name_updb_alias name_updb_const \ name_updb_const_alias NENTRIES_TESTS=nentries_alias nentries_hidden nentries_noalias nentries_scalar -NFIELDS_TESTS=nfields nfields_hidden nfields_invalid nfields_type \ +NFIELDS_TESTS=nfields_hidden nfields_invalid nfields_nfields nfields_type \ nfields_type_hidden nfields_type_invalid nfields_vector \ nfields_vector_hidden nfields_vector_invalid -NFRAMES_TESTS=nframes nframes64 nframes_empty nframes_invalid \ +NFRAMES_TESTS=nframes64 nframes_empty nframes_invalid nframes_nframes \ nframes_off64 nframes_spf NMETA_TESTS=nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \ @@ -241,9 +242,9 @@ nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \ nmeta_vectors_invalid nmeta_vectors_parent -OPEN_TESTS=open open_abs open_cb_abort open_cb_cont open_cb_ignore \ - open_cb_invalid open_cb_rescan open_eaccess open_nonexistent \ - open_notdirfile open_sym_a open_sym_al open_sym_at open_sym_c \ +OPEN_TESTS=open_abs open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \ + open_cb_rescan open_eaccess open_nonexistent open_notdirfile \ + open_open open_sym_a open_sym_al open_sym_at open_sym_c \ open_sym_cl open_sym_ct open_sym_p open_sym_pl open_sym_pt PARSE_TESTS=parse_alias parse_alias_code parse_alias_dup parse_alias_meta \ @@ -324,9 +325,8 @@ SVLIST_TESTS=svlist svlist_hidden svlist_invalid svlist_meta \ svlist_meta_hidden svlist_meta_invalid -SPF_TESTS=spf spf_alias spf_alias_missing spf_alias_meta \ - spf_divide spf_lincom spf_multiply \ - spf_polynom spf_recip spf_recurse +SPF_TESTS=spf_alias spf_alias_missing spf_alias_meta spf_divide spf_lincom \ + spf_multiply spf_polynom spf_raw spf_recip spf_recurse TABLE_TESTS=table table_code table_type Deleted: trunk/getdata/test/add.c =================================================================== --- trunk/getdata/test/add.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/add.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,75 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Add a dirfile field */ -#include "test.h" - -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - int error, r = 0; - DIRFILE *D; - gd_entry_t E, e; - - rmdirfile(); - memset(&E, 0, sizeof(E)); - E.field = "data"; - E.field_type = GD_RAW_ENTRY; - E.EN(raw,spf) = 2; - E.EN(raw,data_type) = GD_UINT8; - E.scalar[0] = NULL; - - D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); - gd_add(D, &E); - error = gd_error(D); - - /* check */ - gd_entry(D, "data", &e); - if (gd_error(D)) - r = 1; - else { - CHECKI(e.field_type, GD_RAW_ENTRY); - CHECKI(e.fragment_index, 0); - CHECKI(e.EN(raw,spf), 2); - CHECKI(e.EN(raw,data_type), GD_UINT8); - CHECKP(e.scalar[0]); - gd_free_entry_strings(&e); - } - - gd_close(D); - - unlink(data); - unlink(format); - rmdir(filedir); - - CHECKI(error, GD_E_OK); - - return r; -} Copied: trunk/getdata/test/add_add.c (from rev 865, trunk/getdata/test/add.c) =================================================================== --- trunk/getdata/test/add_add.c (rev 0) +++ trunk/getdata/test/add_add.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,75 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Add a dirfile field */ +#include "test.h" + +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data = "dirfile/data"; + int error, r = 0; + DIRFILE *D; + gd_entry_t E, e; + + rmdirfile(); + memset(&E, 0, sizeof(E)); + E.field = "data"; + E.field_type = GD_RAW_ENTRY; + E.EN(raw,spf) = 2; + E.EN(raw,data_type) = GD_UINT8; + E.scalar[0] = NULL; + + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add(D, &E); + error = gd_error(D); + + /* check */ + gd_entry(D, "data", &e); + if (gd_error(D)) + r = 1; + else { + CHECKI(e.field_type, GD_RAW_ENTRY); + CHECKI(e.fragment_index, 0); + CHECKI(e.EN(raw,spf), 2); + CHECKI(e.EN(raw,data_type), GD_UINT8); + CHECKP(e.scalar[0]); + gd_free_entry_strings(&e); + } + + gd_close(D); + + unlink(data); + unlink(format); + rmdir(filedir); + + CHECKI(error, GD_E_OK); + + return r; +} Deleted: trunk/getdata/test/close.c =================================================================== --- trunk/getdata/test/close.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/close.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,50 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Closing a dirfile should succeed cleanly */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - int error, r = 0; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); - - D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); - error = gd_close(D); - - unlink(format); - rmdir(filedir); - - CHECKI(error, 0); - - return r; -} Copied: trunk/getdata/test/close_close.c (from rev 865, trunk/getdata/test/close.c) =================================================================== --- trunk/getdata/test/close_close.c (rev 0) +++ trunk/getdata/test/close_close.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,50 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Closing a dirfile should succeed cleanly */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + int error, r = 0; + DIRFILE *D; + + rmdirfile(); + mkdir(filedir, 0777); + close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); + + D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); + error = gd_close(D); + + unlink(format); + rmdir(filedir); + + CHECKI(error, 0); + + return r; +} Deleted: trunk/getdata/test/del.c =================================================================== --- trunk/getdata/test/del.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/del.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,76 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Attempt to delete a field */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdio.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - const char *format_data = "data RAW UINT8 8\n"; - unsigned char c[8]; - unsigned char data_data[256]; - int fd, ret, error1, n, error2, r = 0; - DIRFILE *D; - - memset(c, 0, 8); - rmdirfile(); - mkdir(filedir, 0777); - - for (fd = 0; fd < 256; ++fd) - data_data[fd] = (unsigned char)fd; - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); - write(fd, data_data, 256); - close(fd); - - D = gd_open(filedir, GD_RDWR); - ret = gd_delete(D, "data", 0); - error1 = gd_error(D); - n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); - error2 = gd_error(D); - gd_close(D); - - fd = unlink(data); - unlink(format); - rmdir(filedir); - - CHECKI(fd, 0); - CHECKI(error1, GD_E_OK); - CHECKI(n, 0); - CHECKI(ret, 0); - CHECKI(error2, GD_E_BAD_CODE); - - return r; -} Copied: trunk/getdata/test/del_del.c (from rev 865, trunk/getdata/test/del.c) =================================================================== --- trunk/getdata/test/del_del.c (rev 0) +++ trunk/getdata/test/del_del.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,76 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Attempt to delete a field */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> +#include <stdio.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data = "dirfile/data"; + const char *format_data = "data RAW UINT8 8\n"; + unsigned char c[8]; + unsigned char data_data[256]; + int fd, ret, error1, n, error2, r = 0; + DIRFILE *D; + + memset(c, 0, 8); + rmdirfile(); + mkdir(filedir, 0777); + + for (fd = 0; fd < 256; ++fd) + data_data[fd] = (unsigned char)fd; + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); + write(fd, data_data, 256); + close(fd); + + D = gd_open(filedir, GD_RDWR); + ret = gd_delete(D, "data", 0); + error1 = gd_error(D); + n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); + error2 = gd_error(D); + gd_close(D); + + fd = unlink(data); + unlink(format); + rmdir(filedir); + + CHECKI(fd, 0); + CHECKI(error1, GD_E_OK); + CHECKI(n, 0); + CHECKI(ret, 0); + CHECKI(error2, GD_E_BAD_CODE); + + return r; +} Deleted: trunk/getdata/test/flush.c =================================================================== --- trunk/getdata/test/flush.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/flush.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,88 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Attempt to flush */ -#include "test.h" - -#include <inttypes.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - const char *format_data = "data RAW UINT8 8\n"; - uint8_t c[8], d; - int fd, i, n, error; - struct stat buf; - DIRFILE *D; - - memset(c, 0, 8); - rmdirfile(); - mkdir(filedir, 0777); - - for (i = 0; i < 8; ++i) - c[i] = (uint8_t)(40 + i); - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); - n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); - gd_flush(D, "data"); - error = gd_error(D); - - gd_close(D); - - if (stat(data, &buf)) - return 1; - if (buf.st_size != 40 + 8 * sizeof(uint8_t)) - return 1; - - fd = open(data, O_RDONLY | O_BINARY); - i = 0; - while (read(fd, &d, sizeof(uint8_t))) { - if (i < 40 || i > 48) { - if (d != 0) - return 1; - } else if (d != i) - return 1; - i++; - } - close(fd); - - unlink(data); - unlink(format); - rmdir(filedir); - - if (error) - return 1; - if (n != 8) - return 1; - - return 0; -} Copied: trunk/getdata/test/flush_flush.c (from rev 865, trunk/getdata/test/flush.c) =================================================================== --- trunk/getdata/test/flush_flush.c (rev 0) +++ trunk/getdata/test/flush_flush.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,88 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Attempt to flush */ +#include "test.h" + +#include <inttypes.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data = "dirfile/data"; + const char *format_data = "data RAW UINT8 8\n"; + uint8_t c[8], d; + int fd, i, n, error; + struct stat buf; + DIRFILE *D; + + memset(c, 0, 8); + rmdirfile(); + mkdir(filedir, 0777); + + for (i = 0; i < 8; ++i) + c[i] = (uint8_t)(40 + i); + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); + n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); + gd_flush(D, "data"); + error = gd_error(D); + + gd_close(D); + + if (stat(data, &buf)) + return 1; + if (buf.st_size != 40 + 8 * sizeof(uint8_t)) + return 1; + + fd = open(data, O_RDONLY | O_BINARY); + i = 0; + while (read(fd, &d, sizeof(uint8_t))) { + if (i < 40 || i > 48) { + if (d != 0) + return 1; + } else if (d != i) + return 1; + i++; + } + close(fd); + + unlink(data); + unlink(format); + rmdir(filedir); + + if (error) + return 1; + if (n != 8) + return 1; + + return 0; +} Deleted: trunk/getdata/test/include.c =================================================================== --- trunk/getdata/test/include.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/include.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,67 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Test include */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *format1 = "dirfile/format1"; - const char *format_data = "#\n"; - const char *format1_data = "data RAW UINT8 11\n"; - int fd, error, r = 0; - unsigned int spf; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format1_data, strlen(format1_data)); - close(fd); - - D = gd_open(filedir, GD_RDWR | GD_VERBOSE); - gd_include(D, "format1", 0, 0); - error = gd_error(D); - spf = gd_spf(D, "data"); - gd_close(D); - - unlink(format1); - unlink(format); - rmdir(filedir); - - CHECKI(error, 0); - CHECKU(spf, 11); - - return r; -} Copied: trunk/getdata/test/include_include.c (from rev 865, trunk/getdata/test/include.c) =================================================================== --- trunk/getdata/test/include_include.c (rev 0) +++ trunk/getdata/test/include_include.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,67 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Test include */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *format1 = "dirfile/format1"; + const char *format_data = "#\n"; + const char *format1_data = "data RAW UINT8 11\n"; + int fd, error, r = 0; + unsigned int spf; + DIRFILE *D; + + rmdirfile(); + mkdir(filedir, 0777); + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format1_data, strlen(format1_data)); + close(fd); + + D = gd_open(filedir, GD_RDWR | GD_VERBOSE); + gd_include(D, "format1", 0, 0); + error = gd_error(D); + spf = gd_spf(D, "data"); + gd_close(D); + + unlink(format1); + unlink(format); + rmdir(filedir); + + CHECKI(error, 0); + CHECKU(spf, 11); + + return r; +} Deleted: trunk/getdata/test/index.c =================================================================== --- trunk/getdata/test/index.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/index.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,75 +0,0 @@ -/* Copyright (C) 2009-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Frameindex look-up */ -#include "test.h" - -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <math.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - const char *format_data = "data RAW FLOAT64 1\n"; - double d[1000], f1, f2, f3; - int i, error, r = 0; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - - for (i = 0; i < 1000; ++i) - d[i] = sqrt((i+600) / 500.); - - i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(i, format_data, strlen(format_data)); - close(i); - - i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); - write(i, d, 1000 * sizeof(double)); - close(i); - - D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); - f1 = gd_framenum(D, "data", 1.09); - f2 = gd_framenum(D, "data", 1.49); - f3 = gd_framenum(D, "data", 1.79); - error = gd_error(D); - - gd_close(D); - - unlink(data); - unlink(format); - rmdir(filedir); - - CHECKI(error, 0); - CHECKF(f1, -5.96730894763915); - CHECKF(f2, 510.050010695549); - CHECKF(f3, 1002.04807025292); - - return r; -} Copied: trunk/getdata/test/index_index.c (from rev 865, trunk/getdata/test/index.c) =================================================================== --- trunk/getdata/test/index_index.c (rev 0) +++ trunk/getdata/test/index_index.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,75 @@ +/* Copyright (C) 2009-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Frameindex look-up */ +#include "test.h" + +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <math.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data = "dirfile/data"; + const char *format_data = "data RAW FLOAT64 1\n"; + double d[1000], f1, f2, f3; + int i, error, r = 0; + DIRFILE *D; + + rmdirfile(); + mkdir(filedir, 0777); + + for (i = 0; i < 1000; ++i) + d[i] = sqrt((i+600) / 500.); + + i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(i, format_data, strlen(format_data)); + close(i); + + i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); + write(i, d, 1000 * sizeof(double)); + close(i); + + D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); + f1 = gd_framenum(D, "data", 1.09); + f2 = gd_framenum(D, "data", 1.49); + f3 = gd_framenum(D, "data", 1.79); + error = gd_error(D); + + gd_close(D); + + unlink(data); + unlink(format); + rmdir(filedir); + + CHECKI(error, 0); + CHECKF(f1, -5.96730894763915); + CHECKF(f2, 510.050010695549); + CHECKF(f3, 1002.04807025292); + + return r; +} Deleted: trunk/getdata/test/move.c =================================================================== --- trunk/getdata/test/move.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/move.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,71 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Test move */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <stdio.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *format1 = "dirfile/format1"; - const char *format_data = "INCLUDE format1\ndata RAW UINT8 11"; - const char *format1_data = "#\n"; - int fd, ret, error, ge_ret, r = 0; - gd_entry_t E; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format1_data, strlen(format1_data)); - close(fd); - - D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); - ret = gd_move(D, "data", 1, 0); - error = gd_error(D); - ge_ret = gd_entry(D, "data", &E); - gd_close(D); - - unlink(format1); - unlink(format); - rmdir(filedir); - - CHECKI(ret, 0); - CHECKI(error, GD_E_OK); - CHECKI(ge_ret, 0); - CHECKI(E.fragment_index, 1); - gd_free_entry_strings(&E); - - return r; -} Copied: trunk/getdata/test/move_move.c (from rev 865, trunk/getdata/test/move.c) =================================================================== --- trunk/getdata/test/move_move.c (rev 0) +++ trunk/getdata/test/move_move.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,71 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Test move */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <stdio.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *format1 = "dirfile/format1"; + const char *format_data = "INCLUDE format1\ndata RAW UINT8 11"; + const char *format1_data = "#\n"; + int fd, ret, error, ge_ret, r = 0; + gd_entry_t E; + DIRFILE *D; + + rmdirfile(); + mkdir(filedir, 0777); + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format1_data, strlen(format1_data)); + close(fd); + + D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); + ret = gd_move(D, "data", 1, 0); + error = gd_error(D); + ge_ret = gd_entry(D, "data", &E); + gd_close(D); + + unlink(format1); + unlink(format); + rmdir(filedir); + + CHECKI(ret, 0); + CHECKI(error, GD_E_OK); + CHECKI(ge_ret, 0); + CHECKI(E.fragment_index, 1); + gd_free_entry_strings(&E); + + return r; +} Deleted: trunk/getdata/test/name.c =================================================================== --- trunk/getdata/test/name.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/name.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,133 +0,0 @@ -/* Copyright (C) 2008-2012 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Attempt to rename a field */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdio.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - const char *zata = "dirfile/zata"; - const char *format_data = - "early PHASE data 0\n" - "late PHASE data 0\n" - "/ALIAS bata data\n" - "cata RAW UINT8 8\n" - "data RAW UINT8 8\n" - "eata RAW UINT8 8\n"; - unsigned char data_data[256]; - int fd, ret, e1, e2, e3, e4, unlink_data, unlink_zata, r = 0; - const char **fl; - char *field_list[6]; - char *s1, *s2, *s3; - DIRFILE *D; - gd_entry_t E; - - rmdirfile(); - mkdir(filedir, 0777); - - for (fd = 0; fd < 256; ++fd) - data_data[fd] = (unsigned char)fd; - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); - write(fd, data_data, 256); - close(fd); - - D = gd_open(filedir, GD_RDWR); - gd_validate(D, "early"); - ret = gd_rename(D, "data", "zata", 0); - e1 = gd_error(D); - gd_spf(D, "early"); - e2 = gd_error(D); - gd_spf(D, "late"); - e3 = gd_error(D); - fl = gd_field_list(D); - - field_list[0] = strdup(fl[0]); - field_list[1] = strdup(fl[1]); - field_list[2] = strdup(fl[2]); - field_list[3] = strdup(fl[3]); - field_list[4] = strdup(fl[4]); - field_list[5] = strdup(fl[5]); - - gd_entry(D, "early", &E); - s1 = E.in_fields[0]; - E.in_fields[0] = NULL; - gd_free_entry_strings(&E); - - gd_entry(D, "late", &E); - s2 = E.in_fields[0]; - E.in_fields[0] = NULL; - gd_free_entry_strings(&E); - - gd_entry(D, "bata", &E); - e4 = gd_error(D); - s3 = strdup(gd_alias_target(D, "bata")); - - gd_close(D); - - unlink_data = unlink(data); - unlink_zata = unlink(zata); - unlink(format); - rmdir(filedir); - - CHECKI(e1,0); - CHECKI(e2,GD_E_BAD_CODE); - CHECKI(e3,GD_E_BAD_CODE); - CHECKI(e4,GD_E_BAD_CODE); - CHECKI(ret,0); - CHECKS(field_list[0], "INDEX"); - CHECKS(field_list[1], "cata"); - CHECKS(field_list[2], "early"); - CHECKS(field_list[3], "eata"); - CHECKS(field_list[4], "late"); - CHECKS(field_list[5], "zata"); - CHECKI(unlink_data, 0); - CHECKI(unlink_zata, -1); - CHECKS(s1, "data"); - CHECKS(s2, "data"); - CHECKS(s3, "data"); - - free(s1); - free(s2); - free(s3); - free(field_list[0]); - free(field_list[1]); - free(field_list[2]); - free(field_list[3]); - free(field_list[4]); - free(field_list[5]); - - return r; -} Copied: trunk/getdata/test/name_name.c (from rev 865, trunk/getdata/test/name.c) =================================================================== --- trunk/getdata/test/name_name.c (rev 0) +++ trunk/getdata/test/name_name.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,133 @@ +/* Copyright (C) 2008-2012 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Attempt to rename a field */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> +#include <stdio.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data = "dirfile/data"; + const char *zata = "dirfile/zata"; + const char *format_data = + "early PHASE data 0\n" + "late PHASE data 0\n" + "/ALIAS bata data\n" + "cata RAW UINT8 8\n" + "data RAW UINT8 8\n" + "eata RAW UINT8 8\n"; + unsigned char data_data[256]; + int fd, ret, e1, e2, e3, e4, unlink_data, unlink_zata, r = 0; + const char **fl; + char *field_list[6]; + char *s1, *s2, *s3; + DIRFILE *D; + gd_entry_t E; + + rmdirfile(); + mkdir(filedir, 0777); + + for (fd = 0; fd < 256; ++fd) + data_data[fd] = (unsigned char)fd; + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); + write(fd, data_data, 256); + close(fd); + + D = gd_open(filedir, GD_RDWR); + gd_validate(D, "early"); + ret = gd_rename(D, "data", "zata", 0); + e1 = gd_error(D); + gd_spf(D, "early"); + e2 = gd_error(D); + gd_spf(D, "late"); + e3 = gd_error(D); + fl = gd_field_list(D); + + field_list[0] = strdup(fl[0]); + field_list[1] = strdup(fl[1]); + field_list[2] = strdup(fl[2]); + field_list[3] = strdup(fl[3]); + field_list[4] = strdup(fl[4]); + field_list[5] = strdup(fl[5]); + + gd_entry(D, "early", &E); + s1 = E.in_fields[0]; + E.in_fields[0] = NULL; + gd_free_entry_strings(&E); + + gd_entry(D, "late", &E); + s2 = E.in_fields[0]; + E.in_fields[0] = NULL; + gd_free_entry_strings(&E); + + gd_entry(D, "bata", &E); + e4 = gd_error(D); + s3 = strdup(gd_alias_target(D, "bata")); + + gd_close(D); + + unlink_data = unlink(data); + unlink_zata = unlink(zata); + unlink(format); + rmdir(filedir); + + CHECKI(e1,0); + CHECKI(e2,GD_E_BAD_CODE); + CHECKI(e3,GD_E_BAD_CODE); + CHECKI(e4,GD_E_BAD_CODE); + CHECKI(ret,0); + CHECKS(field_list[0], "INDEX"); + CHECKS(field_list[1], "cata"); + CHECKS(field_list[2], "early"); + CHECKS(field_list[3], "eata"); + CHECKS(field_list[4], "late"); + CHECKS(field_list[5], "zata"); + CHECKI(unlink_data, 0); + CHECKI(unlink_zata, -1); + CHECKS(s1, "data"); + CHECKS(s2, "data"); + CHECKS(s3, "data"); + + free(s1); + free(s2); + free(s3); + free(field_list[0]); + free(field_list[1]); + free(field_list[2]); + free(field_list[3]); + free(field_list[4]); + free(field_list[5]); + + return r; +} Deleted: trunk/getdata/test/nfields.c =================================================================== --- trunk/getdata/test/nfields.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/nfields.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,72 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Retreiving the number of fields of a field should succeed cleanly */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *format_data = - "raw1 RAW UINT8 1\n" - "META raw1 linterp1 LINTERP raw2 table\n" - "META raw1 linterp2 LINTERP raw3 table\n" - "META raw1 linterp3 LINTERP raw4 table\n" - "META raw1 const CONST UINT8 1\n" - "META raw1 string STRING value\n" - "META raw1 string2 STRING value\n" - "raw2 RAW UINT8 1\n" - "raw3 RAW UINT8 1\n" - "raw4 RAW UINT8 1\n" - "const CONST UINT8 1\n" - "string STRING value\n" - "string2 STRING value\n"; - int fd, error, r = 0; - unsigned int nfields; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); - nfields = gd_nfields(D); - error = gd_error(D); - gd_close(D); - - unlink(format); - rmdir(filedir); - - CHECKI(error, 0); - CHECKI(nfields, 8); - - return r; -} Copied: trunk/getdata/test/nfields_nfields.c (from rev 865, trunk/getdata/test/nfields.c) =================================================================== --- trunk/getdata/test/nfields_nfields.c (rev 0) +++ trunk/getdata/test/nfields_nfields.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,72 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +/* Retreiving the number of fields of a field should succeed cleanly */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *format_data = + "raw1 RAW UINT8 1\n" + "META raw1 linterp1 LINTERP raw2 table\n" + "META raw1 linterp2 LINTERP raw3 table\n" + "META raw1 linterp3 LINTERP raw4 table\n" + "META raw1 const CONST UINT8 1\n" + "META raw1 string STRING value\n" + "META raw1 string2 STRING value\n" + "raw2 RAW UINT8 1\n" + "raw3 RAW UINT8 1\n" + "raw4 RAW UINT8 1\n" + "const CONST UINT8 1\n" + "string STRING value\n" + "string2 STRING value\n"; + int fd, error, r = 0; + unsigned int nfields; + DIRFILE *D; + + rmdirfile(); + mkdir(filedir, 0777); + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + + D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); + nfields = gd_nfields(D); + error = gd_error(D); + gd_close(D); + + unlink(format); + rmdir(filedir); + + CHECKI(error, 0); + CHECKI(nfields, 8); + + return r; +} Deleted: trunk/getdata/test/nframes.c =================================================================== --- trunk/getdata/test/nframes.c 2013-11-15 22:01:40 UTC (rev 865) +++ trunk/getdata/test/nframes.c 2013-11-15 22:39:46 UTC (rev 866) @@ -1,66 +0,0 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe - * - *************************************************************************** - * - * This file is part of the GetData project. - * - * GetData is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * GetData is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GetData; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -/* Retreiving the number of frames should succeed cleanly */ -#include "test.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> - -int main(void) -{ - const char *filedir = "dirfile"; - const char *format = "dirfile/format"; - const char *data = "dirfile/data"; - const char *format_data = "data RAW UINT16 1\n"; - int fd, error, r = 0; - const size_t len = strlen(data); - off_t n; - DIRFILE *D; - - rmdirfile(); - mkdir(filedir, 0777); - - fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); - write(fd, format_data, strlen(format_data)); - close(fd); - - fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); - write(fd, data, len); - close(fd); - - D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); - n = gd_nframes(D); - error = gd_error(D); - gd_close(D); - - unlink(data); - unlink(format); - rmdir(filedir); - - CHECKI(error, 0); - CHECKI(n, (off_t)len / 2); - - return r; -} Copied: trunk/getdata/test/nframes_nframes.c (from rev 865, trunk/getdata/test/nframes.c) =================================================================== --- trunk/getdata/test/nframes_nframes.c (rev 0) +++ trunk/getdata/test/nframes_nframes.c 2013-11-15 22:39:46 UTC (rev 866) @@ -0,0 +1,66 @@ +/* Copyright (C) 2008-2011 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be... [truncated message content] |
From: <ket...@us...> - 2013-11-15 22:01:44
|
Revision: 865 http://sourceforge.net/p/getdata/code/865 Author: ketiltrout Date: 2013-11-15 22:01:40 +0000 (Fri, 15 Nov 2013) Log Message: ----------- typo Modified Paths: -------------- trunk/getdata/NEWS Modified: trunk/getdata/NEWS =================================================================== --- trunk/getdata/NEWS 2013-11-13 21:56:54 UTC (rev 864) +++ trunk/getdata/NEWS 2013-11-15 22:01:40 UTC (rev 865) @@ -4,8 +4,9 @@ * The gd_free_entry_strings() function now NULLs pointers after freeing them. - * The gd_[m]add() functions now ignore zero-length scalar strings. Previously - they would store these invalid field codes, causing problems later. + * BUG FIX: The gd_[m]add() functions now ignore zero-length scalar strings. + Previously they would store these invalid field codes, causing problems + later. * BUG FIX: Returning complex-valued CARRAYs as purely real now works. Previously only the first element requested would be returned, the remaining @@ -58,7 +59,7 @@ * 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 distructor. Reported by S. J. + * C++ BUG FIX: Fixed segfault in RawEntry destructor. Reported by S. J. Benton. |==============================================================================| This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-11-13 21:56:56
|
Revision: 864 http://sourceforge.net/p/getdata/code/864 Author: ketiltrout Date: 2013-11-13 21:56:54 +0000 (Wed, 13 Nov 2013) Log Message: ----------- Branch getdata-0.8.5 Added Paths: ----------- branches/getdata-0.8/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-11-13 21:40:29
|
Revision: 863 http://sourceforge.net/p/getdata/code/863 Author: ketiltrout Date: 2013-11-13 21:40:26 +0000 (Wed, 13 Nov 2013) Log Message: ----------- Fix segfault in RawEntry destructor. Patch from S. J. Benton. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/NEWS trunk/getdata/bindings/cxx/rawentry.cpp Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-10-26 02:36:47 UTC (rev 862) +++ trunk/getdata/ChangeLog 2013-11-13 21:40:26 UTC (rev 863) @@ -1,3 +1,7 @@ +2013-11-13 D. V. Wiebe <ge...@ke...> svn:863 + * bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename. + Patch from S. J. Benton. + 2013-10-26 D. V. Wiebe <ge...@ke...> svn:862 * src/getdata.h.in: Add GD_GETDATA_VERSION and GD_GETDATA_INT_VERSION * configure.ac cmake/CMakeLists.txt: Calculate GD_GETDATA_VERSION and Modified: trunk/getdata/NEWS =================================================================== --- trunk/getdata/NEWS 2013-10-26 02:36:47 UTC (rev 862) +++ trunk/getdata/NEWS 2013-11-13 21:40:26 UTC (rev 863) @@ -58,6 +58,9 @@ * 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 distructor. Reported by S. J. + Benton. + |==============================================================================| New in verison 0.8.5: Modified: trunk/getdata/bindings/cxx/rawentry.cpp =================================================================== --- trunk/getdata/bindings/cxx/rawentry.cpp 2013-10-26 02:36:47 UTC (rev 862) +++ trunk/getdata/bindings/cxx/rawentry.cpp 2013-11-13 21:40:26 UTC (rev 863) @@ -30,6 +30,7 @@ E.u.raw.spf = spf; E.u.raw.data_type = (gd_type_t)data_type; E.fragment_index = fragment_index; + filename = NULL; } RawEntry::~RawEntry() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-26 02:36:50
|
Revision: 862 http://sourceforge.net/p/getdata/code/862 Author: ketiltrout Date: 2013-10-26 02:36:47 +0000 (Sat, 26 Oct 2013) Log Message: ----------- Add version information to public header. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/cmake/CMakeLists.txt trunk/getdata/configure.ac trunk/getdata/src/getdata.h.in trunk/getdata/src/internal.h Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-10-25 22:23:34 UTC (rev 861) +++ trunk/getdata/ChangeLog 2013-10-26 02:36:47 UTC (rev 862) @@ -1,3 +1,8 @@ +2013-10-26 D. V. Wiebe <ge...@ke...> svn:862 + * src/getdata.h.in: Add GD_GETDATA_VERSION and GD_GETDATA_INT_VERSION + * configure.ac cmake/CMakeLists.txt: Calculate GD_GETDATA_VERSION and + GD_GETDATA_INT_VERSION. + 2013-10-19 D. V. Wiebe <ge...@ke...> svn:854 * src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek) src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c Modified: trunk/getdata/cmake/CMakeLists.txt =================================================================== --- trunk/getdata/cmake/CMakeLists.txt 2013-10-25 22:23:34 UTC (rev 861) +++ trunk/getdata/cmake/CMakeLists.txt 2013-10-26 02:36:47 UTC (rev 862) @@ -26,7 +26,7 @@ #TODO add configure add_definitions( -DPACKAGE_NAME=\"GetData\" - -DPACKAGE_VERSION=\"0.8.x\" + -DPACKAGE_VERSION=\"0.9.x\" -DPACKAGE_BUGREPORT=\"get...@li...\" -DUNALIGNED_ACCESS_OK ) @@ -34,6 +34,10 @@ # kst2 doesn't need the legacy API set(DEFINE_GD_LEGACY_API "/* #undef GD_LEGACY_API */") +# Version macros +set(DEFINE_GD_GETDATA_VERSION "#define GD_GETDATA_VERSION \"0.9.x\"") +set(DEFINE_GD_GETDATA_INT_VERSION "#define GD_GETDATA_INT_VERSION 900") + if(MSVC) ## Substitutions needed to build getdata.h # build in ANSI C mode Modified: trunk/getdata/configure.ac =================================================================== --- trunk/getdata/configure.ac 2013-10-25 22:23:34 UTC (rev 861) +++ trunk/getdata/configure.ac 2013-10-26 02:36:47 UTC (rev 862) @@ -362,6 +362,15 @@ GD_MSYS_SHELL +dnl verion info +AC_SUBST([DEFINE_GD_GETDATA_VERSION], ["#define GD_GETDATA_VERSION \"]dnl" +getdata_version[\""]) +[DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} ]dnl +ifelse(`getdata_major', `0',dnl" +[%i%02i getdata_minor getdata_revision`"],dnl` +[%i%02i%02i getdata_major getdata_minor getdata_revision`"])dnl` +AC_SUBST([DEFINE_GD_GETDATA_INT_VERSION]) + echo echo "*** Checking host environment" echo Modified: trunk/getdata/src/getdata.h.in =================================================================== --- trunk/getdata/src/getdata.h.in 2013-10-25 22:23:34 UTC (rev 861) +++ trunk/getdata/src/getdata.h.in 2013-10-26 02:36:47 UTC (rev 862) @@ -1155,6 +1155,12 @@ # endif #endif +/* Library version information */ +@DEFINE_GD_GETDATA_VERSION@ + +/* This is (major * 10000) + (minor * 100) + revision */ +@DEFINE_GD_GETDATA_INT_VERSION@ + /* function aliases */ #ifdef GD_FUNCTION_ALIASES # warning "Using deprecated function aliases." Modified: trunk/getdata/src/internal.h =================================================================== --- trunk/getdata/src/internal.h 2013-10-25 22:23:34 UTC (rev 861) +++ trunk/getdata/src/internal.h 2013-10-26 02:36:47 UTC (rev 862) @@ -388,6 +388,7 @@ __FUNCTION__, ##__VA_ARGS__) #define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v) #else +#define gd_colclear() #define dtracevoid() #define dtrace(...) #define dprintf(...) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-25 22:23:37
|
Revision: 861 http://sourceforge.net/p/getdata/code/861 Author: ketiltrout Date: 2013-10-25 22:23:34 +0000 (Fri, 25 Oct 2013) Log Message: ----------- Prevent false negatives in GD_PHP_CONFIG. Modified Paths: -------------- trunk/getdata/m4/php.m4 Modified: trunk/getdata/m4/php.m4 =================================================================== --- trunk/getdata/m4/php.m4 2013-10-24 02:06:29 UTC (rev 860) +++ trunk/getdata/m4/php.m4 2013-10-25 22:23:34 UTC (rev 861) @@ -25,11 +25,13 @@ AC_DEFUN([GD_PHP_CONFIG], [ $1=`${PHP_CONFIG} --$2` +ifelse(`x$3', `x',,[ if test "x${$1}" = "x"; then $1="$3"; have_php="no"; fi ]) +]) dnl GD_PHP dnl --------------------------------------------------------------- @@ -91,17 +93,17 @@ AC_SUBST([phpdir]) AC_MSG_CHECKING([PHP CPPFLAGS]) - GD_PHP_CONFIG([PHP_CPPFLAGS], [includes], []) + GD_PHP_CONFIG([PHP_CPPFLAGS], [includes]) AC_MSG_RESULT([$PHP_CPPFLAGS]) AC_SUBST([PHP_CPPFLAGS]) AC_MSG_CHECKING([PHP LDFLAGS]) - GD_PHP_CONFIG([PHP_LDFLAGS], [ldflags], []) + GD_PHP_CONFIG([PHP_LDFLAGS], [ldflags]) AC_MSG_RESULT([$PHP_LDFLAGS]) AC_SUBST([PHP_ldflags]) AC_MSG_CHECKING([PHP LIBS]) - GD_PHP_CONFIG([PHP_LIBS], [libs], []) + GD_PHP_CONFIG([PHP_LIBS], [libs]) AC_MSG_RESULT([$PHP_LIBS]) AC_SUBST([PHP_libs]) fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-24 02:06:36
|
Revision: 860 http://sourceforge.net/p/getdata/code/860 Author: ketiltrout Date: 2013-10-24 02:06:29 +0000 (Thu, 24 Oct 2013) Log Message: ----------- doc. Modified Paths: -------------- trunk/getdata/doc/README.php Modified: trunk/getdata/doc/README.php =================================================================== --- trunk/getdata/doc/README.php 2013-10-24 02:03:53 UTC (rev 859) +++ trunk/getdata/doc/README.php 2013-10-24 02:06:29 UTC (rev 860) @@ -4,7 +4,9 @@ The PHP bindings for GetData provide PHP5 bindings to the C GetData Library. The bindings are provided in a PHP extension (called "getdata") which also defines all the GetData constants (GD_RDONLY, GD_E_OK, &c.). The bindings -are built using phpize(1) and the standard PHP extension build system. +are configured using php-config(1), which should provide all necessary +configuration. The install path can be changed by passing --with-php-dir to +./configure. In PHP, the C API's DIRFILE object is represented by a Dirfile resource, allocated by gd_open(). The DIRFILE associated with a Dirfile resource is This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-24 02:03:57
|
Revision: 859 http://sourceforge.net/p/getdata/code/859 Author: ketiltrout Date: 2013-10-24 02:03:53 +0000 (Thu, 24 Oct 2013) Log Message: ----------- svn:ignore Property Changed: ---------------- trunk/getdata/bindings/php/ Index: trunk/getdata/bindings/php =================================================================== --- trunk/getdata/bindings/php 2013-10-24 01:09:50 UTC (rev 858) +++ trunk/getdata/bindings/php 2013-10-24 02:03:53 UTC (rev 859) Property changes on: trunk/getdata/bindings/php ___________________________________________________________________ Modified: svn:ignore ## -1,3 +1,4 ## Makefile Makefile.in .deps +constants.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-24 01:09:55
|
Revision: 858 http://sourceforge.net/p/getdata/code/858 Author: ketiltrout Date: 2013-10-24 01:09:50 +0000 (Thu, 24 Oct 2013) Log Message: ----------- Disable static. Modified Paths: -------------- trunk/getdata/bindings/php/Makefile.am Modified: trunk/getdata/bindings/php/Makefile.am =================================================================== --- trunk/getdata/bindings/php/Makefile.am 2013-10-24 00:48:01 UTC (rev 857) +++ trunk/getdata/bindings/php/Makefile.am 2013-10-24 01:09:50 UTC (rev 858) @@ -21,7 +21,7 @@ php_LTLIBRARIES = getdata.la AM_CFLAGS = ${WALL} ${WEXTRA} AM_CPPFLAGS = ${CPPFLAGS} ${PHP_CPPFLAGS} -getdata_la_LDFLAGS = -module -avoid-version ${PHP_LDFLAGS} +getdata_la_LDFLAGS = -module -avoid-version -shared ${PHP_LDFLAGS} getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la getdata_la_SOURCES = getdata.c php_getdata.h nodist_getdata_la_SOURCES = constants.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-24 00:48:05
|
Revision: 857 http://sourceforge.net/p/getdata/code/857 Author: ketiltrout Date: 2013-10-24 00:48:01 +0000 (Thu, 24 Oct 2013) Log Message: ----------- Throw out phpize and do things ourselves: not worth the effort. Modified Paths: -------------- trunk/getdata/bindings/php/Makefile.am trunk/getdata/bindings/php/test/Makefile.am trunk/getdata/configure.ac trunk/getdata/m4/php.m4 Added Paths: ----------- trunk/getdata/bindings/php/getdata.c trunk/getdata/bindings/php/php_getdata.h Removed Paths: ------------- trunk/getdata/bindings/php/getdata/ Property Changed: ---------------- trunk/getdata/bindings/php/ Index: trunk/getdata/bindings/php =================================================================== --- trunk/getdata/bindings/php 2013-10-24 00:37:28 UTC (rev 856) +++ trunk/getdata/bindings/php 2013-10-24 00:48:01 UTC (rev 857) Property changes on: trunk/getdata/bindings/php ___________________________________________________________________ Modified: svn:ignore ## -1,2 +1,3 ## Makefile Makefile.in +.deps Modified: trunk/getdata/bindings/php/Makefile.am =================================================================== --- trunk/getdata/bindings/php/Makefile.am 2013-10-24 00:37:28 UTC (rev 856) +++ trunk/getdata/bindings/php/Makefile.am 2013-10-24 00:48:01 UTC (rev 857) @@ -18,32 +18,23 @@ # along with GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -all-local: getdata/Makefile - cd getdata && ${MAKE} +php_LTLIBRARIES = getdata.la +AM_CFLAGS = ${WALL} ${WEXTRA} +AM_CPPFLAGS = ${CPPFLAGS} ${PHP_CPPFLAGS} +getdata_la_LDFLAGS = -module -avoid-version ${PHP_LDFLAGS} +getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la +getdata_la_SOURCES = getdata.c php_getdata.h +nodist_getdata_la_SOURCES = constants.c -BUILT_SOURCES=getdata/constants.c +BUILT_SOURCES=constants.c -getdata/constants.c: ../make_parameters ../../src/getdata.h +constants.c: ../make_parameters ../../src/getdata.h ../make_parameters h > $@ ../make_parameters: ../make_parameters.c ../../src/gd_config.h cd .. && ${MAKE} make_parameters -getdata/modules: getdata/Makefile - -getdata/Makefile: getdata/configure - cd getdata && \ - ./configure --enable-getdata && \ - ${SED} -e "s/make test/make check/" < Makefile > Makefile.temp && \ - mv -f Makefile.temp Makefile - -getdata/configure: getdata/config.m4 - cd getdata && ${PHPIZE} - clean-local: -if MAKE_PHPBINDINGS - cd getdata && ${PHPIZE} --clean -endif - rm -rf *~ getdata/*~ ${BUILT_SOURCES} getdata/Makefile.temp + rm -rf *~ ${BUILT_SOURCES} SUBDIRS=. test Copied: trunk/getdata/bindings/php/getdata.c (from rev 854, trunk/getdata/bindings/php/getdata/getdata.c) =================================================================== --- trunk/getdata/bindings/php/getdata.c (rev 0) +++ trunk/getdata/bindings/php/getdata.c 2013-10-24 00:48:01 UTC (rev 857) @@ -0,0 +1,4865 @@ +/* Copyright (C) 2013 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "php_getdata.h" +#include "php_ini.h" + +/* corresponding type of the PHP integer */ +#if SIZEOF_LONG == 4 +#define GDPHP_LONG GD_INT32 +typedef int32_t gdphp_long_t; +#elif SIZEOF_LONG == 8 +#define GDPHP_LONG GD_INT64 +typedef int64_t gdphp_long_t; +#endif + +/* PHP globals */ +ZEND_DECLARE_MODULE_GLOBALS(getdata) + +ZEND_BEGIN_MODULE_GLOBALS(getdata) + zend_bool degrade_complex; + zend_bool unpack; +ZEND_END_MODULE_GLOBALS(getdata) + +#ifdef ZTS +# define GDPHP_G(v) TSRMG(getdata_globals_id, zend_getdata_globals *, v) +# define dtracetsrm(fmt, ...) dtrace(fmt ", %p", __VA_ARGS__, tsrm_ls) +#else +# define GDPHP_G(v) (getdata_globals.v) +# define dtracetsrm dtrace +#endif + +/* PHP INI entries */ +PHP_INI_BEGIN() + STD_PHP_INI_ENTRY("getdata.degrade_complex", "true", PHP_INI_ALL, + OnUpdateBool, degrade_complex, zend_getdata_globals, getdata_globals) + STD_PHP_INI_ENTRY("getdata.unpack", "false", PHP_INI_ALL, OnUpdateBool, + unpack, zend_getdata_globals, getdata_globals) +PHP_INI_END() + +/* Common idioms */ +#define GDPHP_FETCH_DIRFILE(r, z) do { \ + r = (gdphp_dirfile*)zend_fetch_resource(&(z) TSRMLS_CC, -1, "Dirfile", NULL, \ + 2, le_gdphp_dirfile, le_gdphp_dirfile_persist); \ + if (!r) { GDPHP_RETURN_F; } \ +} while(0) + +#define GDPHP_RETURN_T do { dreturn("%s", "TRUE"); RETURN_TRUE; } while(0) +#define GDPHP_RETURN_F do { dreturn("%s", "FALSE"); RETURN_FALSE; } while(0) +#define GDPHP_CHECK_ERROR(D) do { if (gd_error(D)) GDPHP_RETURN_F; } while(0) +#define GDPHP_RETURN_ERROR(D) do { \ + if (gd_error(D)) GDPHP_RETURN_F; \ + else GDPHP_RETURN_T; \ +} while(0) +#define GDPHP_RETURN_BOOL(e) do { \ + if (e) GDPHP_RETURN_F; else GDPHP_RETURN_T; } while (0) + +#define GDPHP_PARSE(...) do { \ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, __VA_ARGS__) \ + != SUCCESS) { \ + GDPHP_RETURN_F; \ + } \ +} while(0) + +#define GDPHP_PARSED(vars, ...) do { \ + zval *gdphp_dirfile_zval; \ + gdphp_dirfile *gdphp_dirfile_rsrc; \ + GDPHP_PARSE("r" vars, &gdphp_dirfile_zval, __VA_ARGS__); \ + GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \ + D = gdphp_dirfile_rsrc->D; \ +} while(0) + +#define GDPHP_PARSED_ONLY() do { \ + zval *gdphp_dirfile_zval; \ + gdphp_dirfile *gdphp_dirfile_rsrc; \ + GDPHP_PARSE("r", &gdphp_dirfile_zval); \ + GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \ + D = gdphp_dirfile_rsrc->D; \ +} while(0) + +#define dtracephp() dtrace("%i, %p, %p, %p, %i", ht, return_value, \ + return_value_ptr, this_ptr, return_value_used) + +struct gdphp_din { + void *data; + gd_type_t type; + int free_din; + size_t ns; +}; + +/* error reporting */ +struct gdphp_context_t { + int p; + const char *k; + int i; +}; + +#define dtracectx(fmt, ...) dtrace(fmt " {%i,%s,%i}", __VA_ARGS__, ctx->p, \ + ctx->k ? ctx->k : "-", ctx->i) +#define GDPHP_CONTEXT(v) struct gdphp_context_t v = { 0, NULL, -1 }; +#define GDPHP_CONTEXTp(v,p) struct gdphp_context_t v = { p, NULL, -1 }; +#define GDPHP_DIE_BUFFER_LEN 1000 +#define GDPHP_DIE(x,fmt) do { \ + char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \ + zend_error(E_ERROR,fmt " in %s", gdphp_context(gdphp_die_buffer,x)); \ +} while (0) +#define GDPHP_DIE2(x,fmt,...) do { \ + char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \ + zend_error(E_ERROR,fmt " in %s", __VA_ARGS__, \ + gdphp_context(gdphp_die_buffer,x)); \ +} while (0) + +/* report the context (for error messages) */ +static char *gdphp_context(char *buffer, const struct gdphp_context_t *ctx) +{ + dtrace("%p, %p", buffer, ctx); + + if (ctx->k) { + if (ctx->i >= 0) + snprintf(buffer, GDPHP_DIE_BUFFER_LEN, + "element %i of '%s' of parameter %i", ctx->i, ctx->k, ctx->p + 1); + else + snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element '%s' of parameter %i", + ctx->k, ctx->p + 1); + } else if (ctx->i >= 0) + snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element %i of parameter %i", ctx->i, + ctx->p + 1); + else + snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "parameter %i", ctx->p + 1); + + dreturn("\"%s\"", buffer); + return buffer; +} + +/* the dirfile resource */ +typedef struct _gdphp_dirfile { + DIRFILE *D; + char *callback; + int callback_len; + zval **callback_data; + char *key; + int key_len; +} gdphp_dirfile; + +int le_gdphp_dirfile; +int le_gdphp_dirfile_persist; + +static void gdphp_dirfile_dtor(zend_rsrc_list_entry *z TSRMLS_DC) +{ + dtracetsrm("%p", z); + + gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr); + + gd_discard(r->D); + + if (r->callback) + efree(r->callback); + if (r->callback_data && *(r->callback_data)) + Z_DELREF_PP(r->callback_data); + efree(r->key); + efree(r); + + dreturnvoid(); +} + +static void gdphp_dirfile_pdtor(zend_rsrc_list_entry *z TSRMLS_DC) +{ + dtracetsrm("%p", z); + + gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr); + + gd_discard(r->D); + + if (r->callback) + pefree(r->callback, 1); + if (r->callback_data) + Z_DELREF_PP(r->callback_data); + pefree(r->key, 1); + pefree(r, 1); + + dreturnvoid(); +} + +/* callback wrapper */ +static int gdphp_callback(gd_parser_data_t *pdata, void *extra) +{ + int sem = GD_SYNTAX_ABORT; + int new_line = 0; + char *ptr; + gdphp_dirfile *r = (gdphp_dirfile*)extra; + zval *response; + zval *function_name; + zval *zpdata; + zval **params[2] = { &zpdata, r->callback_data }; + + dtrace("%p, %p", pdata, r->callback_data); + + if (r->callback == NULL) { /* nothing to do */ + dreturn("%i", GD_SYNTAX_ABORT); + return GD_SYNTAX_ABORT; + } + + TSRMLS_FETCH(); + + /* make a zval for the function name */ + ALLOC_INIT_ZVAL(function_name); + ZVAL_STRINGL(function_name, r->callback, r->callback_len, 1); + + /* make a hashtable for the parser data */ + ALLOC_INIT_ZVAL(zpdata); + array_init(zpdata); + add_assoc_long(zpdata, "suberror", pdata->suberror); + add_assoc_long(zpdata, "linenum", pdata->linenum); + add_assoc_string(zpdata, "line", pdata->line, 1); + add_assoc_string(zpdata, "filename", (char*)pdata->filename, 1); + + /* call the callback */ + if (call_user_function_ex(CG(function_table), NULL, function_name, &response, + 2, params, 0, NULL TSRMLS_CC) != SUCCESS) + { + zend_error(E_ERROR, "Unable to execute GetData callback"); + } + + zval_ptr_dtor(&function_name); + + /* interpret the response */ + switch (Z_TYPE_P(response)) { + case IS_DOUBLE: /* I suppose */ + sem = (int)Z_DVAL_P(response); + break; + case IS_LONG: + sem = (int)Z_LVAL_P(response); + break; + case IS_STRING: /* this means rescan */ + ptr = strdup(Z_STRVAL_P(response)); + if (ptr == NULL) + zend_error(E_ERROR, "Out of memory"); + pdata->line = ptr; + sem = GD_SYNTAX_RESCAN; + new_line = 1; + break; + default: + zend_error(E_ERROR, "Bad response from GetData callback"); + } + + /* copy the line out of the zpdata hash, if necessary and possible */ + if (sem == GD_SYNTAX_RESCAN && new_line == 0) { + zval *line; + if (zend_hash_find(Z_ARRVAL_P(zpdata), "line", sizeof("line"), + (void**)&line) == SUCCESS) + { + if (Z_TYPE_P(line) == IS_STRING) { + ptr = strdup(Z_STRVAL_P(response)); + if (ptr == NULL) + zend_error(E_ERROR, "Out of memory"); + pdata->line = ptr; + } + } + } + + zval_ptr_dtor(&zpdata); + + dreturn("%i", sem); + return sem; +} + +/* create a dirfile resource */ +static gdphp_dirfile *gdphp_open(const char *dirfilename, int len, long flags, + const char *callback, int callback_len, zval **callback_data, int persist) +{ + gdphp_dirfile *r; + DIRFILE *D; + + dtrace("\"%s\", %i, 0x%lX, \"%s\", %i, %p, %i", dirfilename, len, flags, + callback, callback_len, callback_data, persist); + + /* create the resource */ + r = pemalloc(sizeof(gdphp_dirfile), persist); + memset(r, 0, sizeof(gdphp_dirfile)); + + r->callback_len = callback_len; + if (callback) + r->callback = pestrdup(callback, persist); + + r->key_len = len; + if (len > 0) { + r->key = pemalloc(len, persist); + memcpy(r->key, dirfilename, len); + } + + if (callback_data) { + Z_ADDREF_PP(callback_data); + r->callback_data = callback_data; + } + + /* open */ + if (callback) + D = gd_cbopen(dirfilename, (unsigned)flags, gdphp_callback, r); + else + D = gd_open(dirfilename, (unsigned)flags); + + /* record the dirfile */ + r->D = D; + + dreturn("%p", r); + return r; +} + +/* convert a complex pair to a 2-element array */ +static zval *gdphp_from_complex(zval *z, double r, double i) +{ + dtrace("%p, %g, %g", z, r, i); + + TSRMLS_FETCH(); + + if (z == NULL) + ALLOC_INIT_ZVAL(z); + + if (i == 0 && GDPHP_G(degrade_complex)) { + ZVAL_DOUBLE(z, r); + } else { + array_init(z); + add_index_double(z, 0, r); + add_index_double(z, 1, i); + } + + dreturn("%p", z); + return z; +} + +/* add a complex scalar to a hash */ +static void gdphp_add_assoc_complex(zval *z, const char *key, double r, + double i) +{ + dtrace("%p, \"%s\", %g, %g", z, key, r, i); + + add_assoc_zval(z, key, gdphp_from_complex(NULL, r, i)); + + dreturnvoid(); +} + +/* add an array of complex data to a hash */ +static void gdphp_add_assoc_cmparray(zval *z, const char *key, double *l, + int n) +{ + zval *a; + int i; + + dtrace("%p, \"%s\", %p, %i", z, key, l, n); + + ALLOC_INIT_ZVAL(a); + array_init(a); + + for (i = 0; i < n; ++i) + add_index_zval(a, i, gdphp_from_complex(NULL, l[i * 2], l[i * 2 + 1])); + + add_assoc_zval(z, key, a); + + dreturnvoid(); +} + +/* add an array of strings to a hash */ +static void gdphp_add_assoc_string_arr(zval *z, const char *key, char **l, + int n) +{ + zval *a; + int i; + + dtrace("%p, \"%s\", %p, %i", z, key, l, n); + + ALLOC_INIT_ZVAL(a); + array_init(a); + + for (i = 0; i < n; ++i) + add_index_string(a, i, l[i], 1); + + add_assoc_zval(z, key, a); + + dreturnvoid(); +} + +/* add scalars to a entry hash */ +static void gdphp_add_assoc_scalars(zval *z, gd_entry_t *E, unsigned mask) +{ + int i; + + zval *scalar; + zval *lm; + + dtrace("%p, %p, 0x%X", z, E, mask); + + ALLOC_INIT_ZVAL(scalar); + array_init(scalar); + + for (i = 0; i <= GD_MAX_POLYORD; ++i) + if (mask & (1 << i)) + if (E->scalar[i]) { + ALLOC_INIT_ZVAL(lm); + array_init(lm); + add_index_string(lm, 0, E->scalar[i], 1); + add_index_long(lm, 1, E->scalar_ind[i]); + add_index_zval(scalar, i, lm); + } + + add_assoc_zval(z, "scalar", scalar); + + dreturnvoid(); +} + +/* convert from a gd_entry_t to a hash */ +static void gdphp_from_entry(zval *z, gd_entry_t *E) +{ + dtrace("%p, %p", z, E); + + array_init(z); + + add_assoc_string(z, "field", E->field, 1); + add_assoc_long(z, "field_type", E->field_type); + add_assoc_long(z, "fragment_index", E->fragment_index); + switch (E->field_type) { + case GD_BIT_ENTRY: + case GD_SBIT_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); + add_assoc_long(z, "bitnum", E->EN(bit,bitnum)); + add_assoc_long(z, "numbits", E->EN(bit,numbits)); + gdphp_add_assoc_scalars(z, E, 0x3); + break; + case GD_CARRAY_ENTRY: + add_assoc_long(z, "array_len", E->EN(scalar,array_len)); + /* fallthrough */ + case GD_CONST_ENTRY: + add_assoc_long(z, "const_type", E->EN(scalar,const_type)); + break; + case GD_LINCOM_ENTRY: + add_assoc_long(z, "n_fields", E->EN(lincom,n_fields)); + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, + E->EN(lincom,n_fields)); + gdphp_add_assoc_cmparray(z, "m", (double*)E->EN(lincom,cm), + E->EN(lincom,n_fields)); + gdphp_add_assoc_cmparray(z, "b", (double*)E->EN(lincom,cb), + E->EN(lincom,n_fields)); + gdphp_add_assoc_scalars(z, E, ((1 << E->EN(lincom,n_fields)) - 1) * 9); + break; + case GD_LINTERP_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); + add_assoc_string(z, "table", E->EN(linterp,table), 1); + break; + case GD_MULTIPLY_ENTRY: + case GD_DIVIDE_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); + break; + case GD_PHASE_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); + add_assoc_long(z, "shift", E->EN(phase,shift)); + gdphp_add_assoc_scalars(z, E, 0x1); + break; + case GD_POLYNOM_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); + add_assoc_long(z, "poly_ord", E->EN(polynom,poly_ord)); + gdphp_add_assoc_cmparray(z, "a", (double*)E->EN(polynom,ca), + E->EN(polynom,poly_ord) + 1); + gdphp_add_assoc_scalars(z, E, (1 << (E->EN(polynom,poly_ord) + 1)) - 1); + break; + case GD_RECIP_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); + gdphp_add_assoc_complex(z, "dividend", creal(E->EN(recip,cdividend)), + cimag(E->EN(recip,cdividend))); + gdphp_add_assoc_scalars(z, E, 0x1); + break; + case GD_RAW_ENTRY: + add_assoc_long(z, "spf", E->EN(raw,spf)); + add_assoc_long(z, "data_type", E->EN(raw,data_type)); + gdphp_add_assoc_scalars(z, E, 0x1); + break; + case GD_WINDOW_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); + add_assoc_long(z, "windop", E->EN(window,windop)); + switch (E->EN(window,windop)) { + case GD_WINDOP_EQ: + case GD_WINDOP_NE: + add_assoc_long(z, "threshold", E->EN(window,threshold.u)); + break; + case GD_WINDOP_SET: + case GD_WINDOP_CLR: + add_assoc_long(z, "threshold", E->EN(window,threshold.i)); + break; + default: + add_assoc_double(z, "threshold", E->EN(window,threshold.r)); + break; + } + gdphp_add_assoc_scalars(z, E, 0x1); + break; + case GD_MPLEX_ENTRY: + gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); + add_assoc_long(z, "count_val", E->EN(mplex,count_val)); + add_assoc_long(z, "period", E->EN(mplex,period)); + gdphp_add_assoc_scalars(z, E, 0x3); + break; + case GD_INDEX_ENTRY: + case GD_STRING_ENTRY: + case GD_NO_ENTRY: + case GD_ALIAS_ENTRY: + break; + } + + dreturnvoid(); +} + +/* interpret a long as a gd_type_t symbol */ +static gd_type_t gdphp_type_from_long(zval *z, struct gdphp_context_t *ctx) +{ + gd_type_t t = GD_UNKNOWN; + dtracectx("%p", z); + + if (Z_TYPE_P(z) != IS_LONG) + GDPHP_DIE(ctx, "Bad type code"); + + switch (Z_LVAL_P(z)) { + case GD_NULL: + case GD_UINT8: + case GD_INT8: + case GD_UINT16: + case GD_INT16: + case GD_UINT32: + case GD_INT32: + case GD_UINT64: + case GD_INT64: + case GD_FLOAT32: + case GD_FLOAT64: + case GD_COMPLEX64: + case GD_COMPLEX128: + t = Z_LVAL_P(z); + } + + dreturn("0x%X", t); + return t; +} + +static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain, + struct gdphp_context_t *ctx); + +/* convert an array to a complex number -- z is known to be an array; returns + * zero on success, non-zero (or doesn't return) on error */ +static int gdphp_to_complex(double *r, double *i, zval *z, int complain, + struct gdphp_context_t *ctx) +{ + int n, converted = 0; + + dtracectx("%p, %p, %p, %i", r, i, z, complain); + + HashTable *a = Z_ARRVAL_P(z); + + n = zend_hash_num_elements(a); + + if (n == 2) { + zval **d; + + if (zend_hash_index_find(a, 0, (void**)&d) == SUCCESS) + if (gdphp_to_datum(r, GD_FLOAT64, *d, 0, ctx) == 0) + converted++; + + if (zend_hash_index_find(a, 1, (void**)&d) == SUCCESS) + if (gdphp_to_datum(i, GD_FLOAT64, *d, 0, ctx) == 0) + converted++; + } + + if (converted < 2) { + if (complain) + GDPHP_DIE(ctx, "Bad numeric data"); + dreturn("%i", 1); + return 1; + } + + dreturn("%i (%g, %g)", 0, *r, *i); + return 0; +} + +/* return a GD type based on a PHP type */ +static gd_type_t gdphp_get_type(zval *z, struct gdphp_context_t *ctx) +{ + gd_type_t t = GD_UNKNOWN; + double r, i; + + dtracectx("%p", z); + + switch (Z_TYPE_P(z)) { + case IS_NULL: + t = GD_NULL; + break; + case IS_LONG: + case IS_BOOL: + t = GD_INT64; + break; + case IS_DOUBLE: + t = GD_FLOAT64; + break; + case IS_ARRAY: /* check for complex by tring to convert */ + if (gdphp_to_complex(&r, &i, z, 0, ctx) == 0) + t = GD_COMPLEX128; + } + + dreturn("0x%X", t); + return t; +} + +#define CCONVERT_ZVAL(t) \ + do { \ + switch (Z_TYPE_P(src)) { \ + double r, i; \ + case IS_NULL: ((t*)dst)[0] = ((t*)dst)[1] = 0; break; \ + case IS_LONG: case IS_BOOL: ((t*)dst)[0] = Z_LVAL_P(src); \ + ((t*)dst)[1] = 0; break; \ + case IS_DOUBLE: ((t*)dst)[0] = Z_DVAL_P(src); \ + ((t*)dst)[1] = 0; break; \ + case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \ + ((t*)dst)[0] = r; ((t*)dst)[1] = i; break; \ + default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \ + } \ + } while (0) + +#define CONVERT_ZVAL(t) \ + do { \ + switch (Z_TYPE_P(src)) { \ + double r, i; \ + case IS_LONG: case IS_BOOL: *((t*)dst) = Z_LVAL_P(src); break; \ + case IS_DOUBLE: *((t*)dst) = Z_DVAL_P(src); break; \ + case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \ + *((t*)dst) = r; break; \ + default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \ + } \ + } while (0) + +/* convert a zval to a C numeric type */ +static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain, + struct gdphp_context_t *ctx) +{ + int r = 0; + dtracectx("%p, 0x%X, %p, %i", dst, type, src, complain); + + switch (type) { + case GD_NULL: case GD_UNKNOWN: break; + case GD_UINT8: CONVERT_ZVAL( uint8_t); break; + case GD_INT8: CONVERT_ZVAL( int8_t); break; + case GD_UINT16: CONVERT_ZVAL(uint16_t); break; + case GD_INT16: CONVERT_ZVAL( int16_t); break; + case GD_UINT32: CONVERT_ZVAL(uint32_t); break; + case GD_INT32: CONVERT_ZVAL( int32_t); break; + case GD_UINT64: CONVERT_ZVAL(uint64_t); break; + case GD_INT64: CONVERT_ZVAL( int64_t); break; + case GD_FLOAT32: CONVERT_ZVAL( float); break; + case GD_FLOAT64: CONVERT_ZVAL( double); break; + case GD_COMPLEX64: CCONVERT_ZVAL( float); break; + case GD_COMPLEX128: CCONVERT_ZVAL( double); break; + } + + dreturn("%i", r); + return r; +} + +static gd_type_t gdphp_to_datum_and_type(void *datum, zval *z, + struct gdphp_context_t *ctx) +{ + gd_type_t t = GD_UNKNOWN; + + dtracectx("%p, %p", datum, z); + + switch (Z_TYPE_P(z)) { + case IS_LONG: + t = GDPHP_LONG; + *((gdphp_long_t*)datum) = Z_LVAL_P(z); + break; + case IS_DOUBLE: + t = GD_FLOAT64; + *((double*)datum) = Z_DVAL_P(z); + break; + case IS_ARRAY: + /* check if it is a complex array */ + if (gdphp_to_complex(datum, ((double*)datum) + 1, z, 0, ctx) == 0) { + t = GD_COMPLEX128; + break; + } + /* FALLTHROUGH */ + default: + GDPHP_DIE(ctx, "expected numeric scalar"); + } + + dreturn("0x%X", t); + return t; +} + +gd_static_inline_ char *gdphp_check_null_string(char *v) +{ + dtrace("\"%s\"", v); + if (v == NULL || v[0] == 0) { + dreturn("%p", NULL); + return NULL; + } + + dreturn("\"%s\"", v); + return v; +} + +static void gdphp_to_threshold(gd_triplet_t *t, gd_windop_t windop, zval *z, + struct gdphp_context_t *ctx) +{ + dtracectx("%p, %i, %p", t, windop, z); + + switch (windop) { + case GD_WINDOP_EQ: + case GD_WINDOP_NE: + gdphp_to_datum(&t->i, GD_INT64, z, 1, ctx); + break; + case GD_WINDOP_SET: + case GD_WINDOP_CLR: + gdphp_to_datum(&t->u, GD_UINT64, z, 1, ctx); + break; + default: + gdphp_to_datum(&t->r, GD_FLOAT64, z, 1, ctx); + break; + } + + dreturnvoid(); +} + +/* doesn't return on error */ +static void gdphp_validate_type(gd_type_t t, struct gdphp_context_t *ctx) { + dtracectx("0x%X", t); + + if (GD_SIZE(t) == 0) + GDPHP_DIE(ctx, "bad data type"); + + dreturnvoid(); +} + +/* convert a PHP array ot an array of complex data; returns length */ +static int gdphp_convert_cmparray(double *out, zval *z, int min, int max, + unsigned mask, struct gdphp_context_t *ctx) +{ + HashTable *a = Z_ARRVAL_P(z); + HashPosition i; + zval **d = NULL; + int n = -1; + unsigned key_len; + char *key; + long index; + + int *have; + + dtracectx("%p, %p, %i, %i, 0x%X", out, z, min, max, mask); + + /* remember which elements we've seen */ + have = emalloc(sizeof(int) * max); + memset(have, 0, sizeof(int) * max); + + for (index = 0; index < max; ++index) + if (mask & (1 << index)) + have[index] = 1; + + /* populate the C array */ + for (zend_hash_internal_pointer_reset_ex(a, &i); + zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; + zend_hash_move_forward_ex(a, &i)) + { + /* check key */ + if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) + == HASH_KEY_IS_STRING) + { + GDPHP_DIE(ctx, "cannot use associative array"); + } else if (index < 0 || index >= max) + GDPHP_DIE2(ctx, "bad array index (%li)", index); + + if (!have[index]) { + gdphp_to_datum(out + index * 2, GD_COMPLEX128, *d, 1, ctx); + have[index] = 1; + } + } + + /* check for holes and calculate n */ + for (index = max - 1; index >= 0; --index) { + if (have[index] == 0 && n != -1) + GDPHP_DIE(ctx, "uninitialised data in numeric array"); + else if (have[index] && n == -1) + n = index + 1; + } + + if (n < min || n > max) + GDPHP_DIE(ctx, "bad array count"); + + efree(have); + + dreturn("%i", n); + return n; +} + +/* convert a PHP array to an array of strings; returns the number of elements */ +static int gdphp_convert_sarray(char **out, zval *z, int min, int max, + struct gdphp_context_t *ctx) +{ + HashTable *a = Z_ARRVAL_P(z); + HashPosition i; + zval **d = NULL; + int n = -1; + unsigned key_len; + char *key; + long index; + + dtracectx("%p, %p, %i, %i", out, z, min, max); + + /* santitise */ + memset(out, 0, sizeof(char*) * max); + + /* populate the C array */ + for (zend_hash_internal_pointer_reset_ex(a, &i); + zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; + zend_hash_move_forward_ex(a, &i)) + { + /* check key */ + if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) + == HASH_KEY_IS_STRING) + { + GDPHP_DIE(ctx, "cannot use associative array"); + } else if (index < 0 || index >= max) + GDPHP_DIE2(ctx, "bad array index (%li)", index); + + if (Z_TYPE_PP(d) != IS_STRING) + GDPHP_DIE(ctx, "string array required"); + + out[index] = Z_STRVAL_PP(d); + } + + /* check for holes and calculate n */ + for (index = max - 1; index >= 0; --index) { + if (out[index] == NULL && n != -1) + GDPHP_DIE(ctx, "uninitialised data in string array"); + else if (out[index] && n == -1) + n = index + 1; + } + + if (n < min || n > max) + GDPHP_DIE(ctx, "bad string array count"); + + dreturn("%i", n); + return n; +} + +/* convert an array to data */ +static void gdphp_convert_array(struct gdphp_din *din, zval *zdata, + struct gdphp_context_t *ctx) +{ + HashTable *a = Z_ARRVAL_P(zdata); + HashPosition i; + zval **d = NULL; + char *key; + unsigned key_len; + long index; + + dtracectx("%p, %p", din, zdata); + + din->ns = 0; + + /* pass 1: validate data and determine ns */ + for (zend_hash_internal_pointer_reset_ex(a, &i); + zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; + zend_hash_move_forward_ex(a, &i)) + { + /* make sure this isn't an associative array */ + if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) + == HASH_KEY_IS_STRING) + { + GDPHP_DIE(ctx, "cannot use associative arrays"); + } else if (index < 0) /* does zend_hash_get_current_key_ex return ulong + or a long? */ + GDPHP_DIE(ctx, "bad array index"); + + if ((unsigned long)index + 1 > din->ns) + din->ns = index + 1; + + if (din->type == GD_UNKNOWN) { + din->type = gdphp_get_type(*d, ctx); + if (din->type == GD_UNKNOWN) + GDPHP_DIE(ctx, "bad numeric type"); + else if (din->type == GD_NULL) + din->type = GD_UNKNOWN; + } + } + + if (din->ns == 0 || din->type == GD_UNKNOWN) { + din->type = GD_NULL; + din->ns = 0; + } else { + /* allocate the buffer */ + din->free_din = 1; + din->data = emalloc(din->ns * GD_SIZE(din->type)); + + /* zero */ + if (din->type == GD_FLOAT64 || din->type == GD_COMPLEX128) { + size_t j, ns = din->ns; + + if (din->type == GD_COMPLEX128) + ns *= 2; + + for (j = 0; j < ns; ++j) + ((double*)(din->data))[j] = NAN; + } else if (din->type == GD_FLOAT32 || din->type == GD_COMPLEX64) { + size_t j, ns = din->ns; + + if (din->type == GD_COMPLEX128) + ns *= 2; + + for (j = 0; j < ns; ++j) + ((float*)(din->data))[j] = (float)NAN; + } else + memset(din->data, 0, din->ns * GD_SIZE(din->type)); + + /* pass 2: convert the data */ + for (zend_hash_internal_pointer_reset_ex(a, &i); + zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; + zend_hash_move_forward_ex(a, &i)) + { + zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i); + + gdphp_to_datum(((char*)(din->data)) + index * GD_SIZE(din->type), + din->type, *d, 1, ctx); + } + } + + dreturn("0x%X, %zu", din->type, din->ns); +} + +/* convert input data */ +static struct gdphp_din gdphp_convert_data(zval *zdata1, zval *zdata2, int p1, + int p2) +{ + struct gdphp_din din; + + dtrace("%p, %p, %i, %i", zdata1, zdata2, p1, p2); + + if (zdata2 == NULL) { + GDPHP_CONTEXTp(ctx,p1); + + if (Z_TYPE_P(zdata1) == IS_ARRAY) { + din.type = GD_UNKNOWN; + gdphp_convert_array(&din, zdata1, &ctx); + } else + GDPHP_DIE(&ctx, "bad input data: expected array or type code"); + } else { + /* in the two argument case, the first argument is taken to be a type code + */ + GDPHP_CONTEXTp(ctx,p1); + + din.type = gdphp_type_from_long(zdata1, &ctx); /* doesn't return on error */ + + ctx.p = p2; + + switch (Z_TYPE_P(zdata2)) { + case IS_STRING: /* packed data -- just use it in place */ + din.data = Z_STRVAL_P(zdata2); + din.ns = Z_STRLEN_P(zdata2) / GD_SIZE(din.type); + din.free_din = 0; + break; + case IS_ARRAY: + gdphp_convert_array(&din, zdata2, &ctx); + break; + default: + GDPHP_DIE(&ctx, "bad input data: expected array or string"); + } + } + + dreturn("{%p, 0x%X, %i, %zu}", din.data, din.type, din.free_din, din.ns); + return din; +} + +static long gdphp_convert_long(zval *z, struct gdphp_context_t *ctx) +{ + long l; + + dtracectx("%p", z); + + if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE) + GDPHP_DIE(ctx, "expected number"); + + convert_to_long(z); /* coerce */ + l = Z_LVAL_P(z); + + dreturn("%li", l); + return l; +} + +static double gdphp_convert_double(zval *z, struct gdphp_context_t *ctx) +{ + double d; + + dtracectx("%p", z); + + if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE) + GDPHP_DIE(ctx, "expected number"); + + convert_to_double(z); /* coerce */ + d = Z_DVAL_P(z); + + dreturn("%g", d); + return d; +} + +/* convert PHP string with error checking */ +static char *gdphp_convert_string(zval *z, struct gdphp_context_t *ctx) +{ + char *s; + + dtracectx("%p", z); + + if (Z_TYPE_P(z) != IS_STRING) + GDPHP_DIE(ctx, "expected string"); + + s = Z_STRVAL_P(z); + + dreturn("\"%s\"", s); + return s; +} + +static void gdphp_entry_complex(double *v, HashTable *a, const char *key, + size_t len, int partial, struct gdphp_context_t *ctx) +{ + zval **z; + + dtracectx("%p, %p, \"%s\", %zu, %i", v, a, key, len, partial); + + if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { + ctx->k = key; + gdphp_to_datum(v, GD_COMPLEX128, *z, 1, ctx); + ctx->k = NULL; + } else if (!partial) + GDPHP_DIE2(ctx, "required key '%s' not found", key); + + dreturnvoid(); +} + +static long gdphp_entry_long(HashTable *a, const char *key, size_t len, + int *missing, int partial, struct gdphp_context_t *ctx) +{ + long r = 0; + zval **z; + + dtracectx("%p, \"%s\", %zu, %p, %i", a, key, len, missing, partial); + + if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { + ctx->k = key; + r = gdphp_convert_long(*z, ctx); + ctx->k = NULL; + if (missing != NULL) + *missing = 0; + } else if (missing != NULL) + *missing = 1; + else if (!partial) + GDPHP_DIE2(ctx, "required key '%s' not found", key); + + dreturn("%li", r); + return r; +} + +static double gdphp_entry_double(HashTable *a, const char *key, size_t len, + int partial, struct gdphp_context_t *ctx) +{ + double r = 0; + zval **z; + + dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial); + + if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { + ctx->k = key; + r = gdphp_convert_double(*z, ctx); + ctx->k = NULL; + } else if (!partial) + GDPHP_DIE2(ctx, "required key '%s' not found", key); + + dreturn("%g", r); + return r; +} + +static int gdphp_entry_infields(char **l, HashTable *a, int min, int max, + int partial, struct gdphp_context_t *ctx) +{ + zval **z; + int n = 0; + + dtracectx("%p, %p, %i, %i, %i", l, a, min, max, partial); + + if (zend_hash_find(a, "in_fields", sizeof("in_fields"), (void**)&z) == + SUCCESS) + { + ctx->k = "in_fields"; + if (Z_TYPE_PP(z) == IS_ARRAY) + n = gdphp_convert_sarray(l, *z, min, max, ctx); + else if (Z_TYPE_PP(z) == IS_STRING) { + if (min > 1) + GDPHP_DIE(ctx, "bad string array count"); + n = 1; + l[0] = gdphp_convert_string(*z, ctx); + } else + GDPHP_DIE(ctx, "expected string or string array"); + ctx->k = NULL; + } else if (!partial) + GDPHP_DIE(ctx, "required key 'in_fields' not found"); + + dreturn("%i", n); + return n; +} + +static int gdphp_entry_cmparray(double *l, HashTable *a, char *key, size_t len, + int min, int max, unsigned mask, int partial, struct gdphp_context_t *ctx) +{ + zval **z; + int n = 0; + + dtracectx("%p, %p, \"%s\", %zu, %i, %i, 0x%X", l, a, key, len, min, max, + mask); + + if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { + ctx->k = key; + if (Z_TYPE_PP(z) == IS_ARRAY) + n = gdphp_convert_cmparray(l, *z, min, max, mask, ctx); + else if (Z_TYPE_PP(z) == IS_DOUBLE) { + if (min > 1) + GDPHP_DIE(ctx, "bad array count"); + n = 1; + l[0] = Z_DVAL_PP(z); + } else + GDPHP_DIE(ctx, "expected array or float"); + ctx->k = NULL; + } else if (!partial) + GDPHP_DIE2(ctx, "required key '%s' not found", key); + + dreturn("%i", n); + return n; +} + +/* populate an entry from the scalar array in an entry array; returns a + * bitmask of the elements set */ +static unsigned gdphp_entry_scalars(char** scalar, int *scalar_ind, + HashTable *a, unsigned mask, struct gdphp_context_t *ctx) +{ + unsigned mask_out = 0; + zval **z; + int i; + + dtracectx("%p, %p, %p, 0x%X", scalar, scalar_ind, a, mask); + + /* find 'scalar' in the entry array */ + if (zend_hash_find(a, "scalar", sizeof("scalar"), (void**)&z) != SUCCESS) { + dreturn("%i", 0); + return 0; + } + + ctx->k = "scalar"; + + /* 'scalar' must be an array (or null) */ + if (Z_TYPE_PP(z) == IS_NULL) { + ctx->k = NULL; + dreturn("%i", 0); + return 0; + } else if (Z_TYPE_PP(z) != IS_ARRAY) + GDPHP_DIE(ctx, "expected array"); + + /* loop through the array of scalars */ + a = Z_ARRVAL_PP(z); + for (i = 0; i < 2 * GD_MAX_LINCOM; ++i) { + if (!(mask & (1 << i))) + continue; + + /* get the i'th scalar array element */ + ctx->i = i; + if (zend_hash_index_find(a, i, (void**)&z) == SUCCESS) { + HashTable *sa; + + if (Z_TYPE_PP(z) == IS_NULL) + continue; + if (Z_TYPE_PP(z) != IS_ARRAY) + GDPHP_DIE(ctx, "expected array"); + + sa = Z_ARRVAL_PP(z); + + /* element zero should be the name of a scalar field. */ + if (zend_hash_index_find(sa, 0, (void**)&z) == SUCCESS) { + if (Z_TYPE_PP(z) != IS_STRING) + GDPHP_DIE(ctx, "expected scalar field name"); + scalar[i] = Z_STRVAL_PP(z); + } else + GDPHP_DIE(ctx, "element zero of should be scalar field name"); + + mask_out |= 1 << i; + + /* element one should be the index; if missing zero is assumed */ + if (zend_hash_index_find(sa, 1, (void**)&z) == SUCCESS) { + convert_to_long(*z); /* coerce */ + scalar_ind[i] = Z_LVAL_PP(z); + } else + scalar_ind[i] = 0; + } + } + + ctx->k = NULL; + ctx->i = -1; + dreturn("0x%02X", mask_out); + return mask_out; +} + +static char *gdphp_entry_string(HashTable *a, const char *key, + size_t len, int partial, struct gdphp_context_t *ctx) +{ + char *s = NULL; + zval **z; + + dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial); + + if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { + ctx->k = key; + s = gdphp_convert_string(*z, ctx); + ctx->k = NULL; + } else if (!partial) + GDPHP_DIE2(ctx, "required key '%s' not found", key); + + dreturn("\"%s\"", s); + return s; +} + +/* convert an entry array to a gd_entry_t; z is known to be an array */ +static void gdphp_to_entry(gd_entry_t *E, zval *z, const gd_entry_t *old_E, + int no_fragment, struct gdphp_context_t *ctx) +{ + /* lincom scalar masks */ + const unsigned lincom_mask[4] = { 0x00, 0x09, 0x1B, 0x3F }; + const int partial = (old_E != NULL); + + int n, missing = 0, min = 0, max = 0; + unsigned mask, tmask; + HashTable *a = Z_ARRVAL_P(z); + + dtracectx("%p, %p, %p, %i", E, z, old_E, no_fragment); + + if (old_E) + memcpy(E, old_E, sizeof(gd_entry_t)); + else + memset(E, 0, sizeof(gd_entry_t)); + + if (!partial) + E->field = gdphp_entry_string(a, "field", sizeof("field"), partial, ctx); + + E->field_type = gdphp_entry_long(a, "field_type", sizeof("field_type"), NULL, + partial, ctx); + + if (no_fragment) + E->fragment_index = 0; + else + E->fragment_index = gdphp_entry_long(a, "fragment_index", + sizeof("fragment_index"), NULL, partial, ctx); + + + switch (E->field_type) { + case GD_BIT_ENTRY: + case GD_SBIT_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); + + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx); + + if (!(mask & 1)) + E->EN(bit,bitnum) = gdphp_entry_long(a, "bitnum", sizeof("bitnum"), + NULL, partial, ctx); + + if (!(mask & 2)) { + E->EN(bit,numbits) = gdphp_entry_long(a, "numbits", sizeof("numbits"), + &missing, partial, ctx); + + if (missing && !partial) + E->EN(bit,numbits) = 1; + } + break; + case GD_CARRAY_ENTRY: + E->EN(scalar,array_len) = gdphp_entry_long(a, "array_len", + sizeof("array_len"), NULL, partial, ctx); + /* FALLTHROUGH */ + case GD_CONST_ENTRY: + E->EN(scalar,const_type) = gdphp_entry_long(a, "const_type", + sizeof("const_type"), NULL, partial, ctx); + break; + case GD_LINCOM_ENTRY: + /* honour n_fields, if given */ + n = gdphp_entry_long(a, "n_fields", sizeof("n_fields"), &missing, + partial, ctx); + if (missing) { + min = 1; + max = GD_MAX_LINCOM; + } else if (n < 1 || n > GD_MAX_LINCOM) { + GDPHP_DIE2(ctx, "bad value for 'n_fields' (%i)", n); + } else + min = max = n; + + E->EN(lincom,n_fields) = gdphp_entry_infields((char**)E->in_fields, a, + min, max, partial, ctx); + + if (E->EN(lincom,n_fields) != 0) + min = max = E->EN(lincom,n_fields); + + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, lincom_mask[max], + ctx); + + E->comp_scal = 1; + tmask = (1 << max) - 1; + + if ((mask & tmask) != tmask) + gdphp_entry_cmparray((double*)E->EN(lincom,cm), a, "m", sizeof("m"), + min, max, mask, partial, ctx); + + if (((mask >> GD_MAX_LINCOM) & tmask) != tmask) + gdphp_entry_cmparray((double*)E->EN(lincom,cb), a, "b", sizeof("m"), + min, max, mask >> GD_MAX_LINCOM, partial, ctx); + else + E->EN(lincom,n_fields) = max; + break; + case GD_LINTERP_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); + E->EN(linterp,table) = gdphp_entry_string(a, "table", sizeof("table"), + partial, ctx); + break; + case GD_MPLEX_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx); + + if (!(mask & 1)) + E->EN(mplex,count_val) = gdphp_entry_long(a, "count_val", + sizeof("count_val"), NULL, partial, ctx); + + if (!(mask & 2)) { + E->EN(mplex,period) = gdphp_entry_long(a, "period", sizeof("period"), + &missing, partial, ctx); + + if (missing) + E->EN(mplex,period) = 0; + } + break; + case GD_MULTIPLY_ENTRY: + case GD_DIVIDE_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); + break; + case GD_PHASE_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); + if (!(mask & 1)) + E->EN(phase,shift) = gdphp_entry_long(a, "shift", sizeof("shift"), NULL, + partial, ctx); + break; + case GD_POLYNOM_ENTRY: + /* honour poly_ord, if given */ + n = gdphp_entry_long(a, "poly_ord", sizeof("poly_ord"), &missing, partial, + ctx); + if (missing) { + min = 2; + max = GD_MAX_POLYORD + 1; + } else if (n < 1 || n > GD_MAX_POLYORD) { + GDPHP_DIE2(ctx, "bad value for 'poly_ord' (%i)", n); + } else + min = max = n + 1; + + gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); + + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, (1 << max) - 1, + ctx); + + E->comp_scal = 1; + tmask = (1 << max) - 1; + if ((mask & tmask) != tmask) + E->EN(polynom,poly_ord) = + gdphp_entry_cmparray((double*)E->EN(polynom,ca), a, "a", sizeof("a"), + min, max, mask, partial, ctx) - 1; + else + E->EN(polynom,poly_ord) = max - 1; + break; + case GD_RAW_ENTRY: + E->EN(raw,data_type) = gdphp_entry_long(a, "data_type", + sizeof("data_type"), NULL, partial, ctx); + E->EN(raw,spf) = gdphp_entry_long(a, "spf", sizeof("spf"), NULL, partial, + ctx); + break; + case GD_RECIP_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); + E->comp_scal = 1; + if (!(mask & 1)) + gdphp_entry_complex((double*)gd_csp_(E->EN(recip,cdividend)), a, + "dividend", sizeof("dividend"), partial, ctx); + break; + case GD_STRING_ENTRY: + /* nothing to do */ + break; + case GD_WINDOW_ENTRY: + gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); + mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); + E->EN(window,windop) = gdphp_entry_long(a, "windop", sizeof("windop"), + NULL, partial, ctx); + if (!(mask & 1)) + switch (E->EN(window,windop)) { + case GD_WINDOP_EQ: + case GD_WINDOP_NE: + E->EN(window,threshold.i) = gdphp_entry_long(a, "threshold", + sizeof("threshold"), NULL, partial, ctx); + break; + case GD_WINDOP_SET: + case GD_WINDOP_CLR: + E->EN(window,threshold.u) = gdphp_entry_long(a, "threshold", + sizeof("threshold"), NULL, partial, ctx); + break; + default: + E->EN(window,threshold.r) = gdphp_entry_double(a, "threshold", + sizeof("threshold"), partial, ctx); + break; + } + break; + default: + GDPHP_DIE2(ctx, "bad field type (%i)", E->field_type); + } + + dreturnvoid(); +} + +/* convert a C string list to a array of strings */ +static void gdphp_to_string_array(zval *z, const char **l, int n) +{ + int i; + + dtrace("%p, %p, %i", z, l, n); + + array_init(z); + + for (i = 0; (l[i] && n == 0) || (n > 0 && i < n); ++i) + if (l[i] == NULL) + add_index_null(z, i); + else + add_index_string(z, i, l[i], 1); + + dreturnvoid(); +} + +/* convert a datum to a PHP value */ +static void gdphp_from_datum(zval *z, void *datum, gd_type_t type) +{ + dtrace("%p, %p, 0x%X", z, datum, type); + + switch (type) { + case GD_UINT8: + ZVAL_LONG(z, *((uint8_t*)datum)); + break; + case GD_INT8: + ZVAL_LONG(z, *((int8_t*)datum)); + break; + case GD_UINT16: + ZVAL_LONG(z, *((uint16_t*)datum)); + break; + case GD_INT16: + ZVAL_LONG(z, *((int16_t*)datum)); + break; + case GD_UINT32: + ZVAL_LONG(z, *((uint32_t*)datum)); + break; + case GD_INT32: + ZVAL_LONG(z, *((int32_t*)datum)); + break; + case GD_UINT64: + ZVAL_LONG(z, *((uint64_t*)datum)); + break; + case GD_INT64: + ZVAL_LONG(z, *((int64_t*)datum)); + break; + case GD_FLOAT32: + ZVAL_DOUBLE(z, *((float*)datum)); + break; + case GD_FLOAT64: + ZVAL_DOUBLE(z, *((double*)datum)); + break; + case GD_COMPLEX64: + gdphp_from_complex(z, ((float*)datum)[0], ((float*)datum)[1]); + break; + case GD_COMPLEX128: + gdphp_from_complex(z, ((double*)datum)[0], ((double*)datum)[1]); + break; + default: + ZVAL_NULL(z); + break; + } + + dreturnvoid(); +} + +/* convert a data vector to a PHP array -- <a> must already be initialised as + * an array */ +static void gdphp_data_to_array(zval *a, const void *data, gd_type_t type, + size_t n) +{ + size_t i; + + dtrace("%p, %p, 0x%X, %zu", a, data, type, n); + + switch (type) { + case GD_UINT8: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((uint8_t*)(data))[i]); + break; + case GD_INT8: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((int8_t*)(data))[i]); + break; + case GD_UINT16: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((uint16_t*)(data))[i]); + break; + case GD_INT16: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((int16_t*)(data))[i]); + break; + case GD_UINT32: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((uint32_t*)(data))[i]); + break; + case GD_INT32: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((int32_t*)(data))[i]); + break; + case GD_UINT64: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((uint64_t*)(data))[i]); + break; + case GD_INT64: + for (i = 0; i < n; ++i) + add_index_long(a, i, ((int64_t*)(data))[i]); + break; + case GD_FLOAT32: + for (i = 0; i < n; ++i) + add_index_double(a, i, ((float*)(data))[i]); + break; + case GD_FLOAT64: + for (i = 0; i < n; ++i) + add_index_double(a, i, ((double*)(data))[i]); + break; + case GD_COMPLEX64: + for (i = 0; i < n; ++i) + add_index_zval(a, i, gdphp_from_complex(NULL, ((float*)(data))[i * 2], + ((float*)(data))[i * 2 + 1])); + case GD_COMPLEX128: + for (i = 0; i < n; ++i) + add_index_zval(a, i, gdphp_from_complex(NULL, ((double*)(data))[i * 2], + ((double*)(data))[i * 2 + 1])); + break; + default: + /* fill with nulls */ + for (i = 0; i < n; ++i) + add_index_null(a, i); + break; + } + + dreturnvoid(); +} + +static zval *gdphp_from_data(zval *z, size_t n, gd_type_t data_type, void *data, + int duplicate, int unpack) +{ + dtrace("%p, %zu, 0x%X, %p, %i, %i", z, n, data_type, data, duplicate, unpack); + + if (z == NULL) + ALLOC_INIT_ZVAL(z); + + if (unpack) { + array_init(z); + gdphp_data_to_array(z, data, data_type, n); + if (!duplicate) + efree(data); + } else { /* packed data */ + if (n == 0) { + if (!duplicate) + efree(data); + ZVAL_EMPTY_STRING(z); + } else { + if (!duplicate) + data = erealloc(data, n * GD_SIZE(data_type)); /* trim excess */ + ZVAL_STRINGL(z, data, n * GD_SIZE(data_type), duplicate); + } + } + + dreturn("%p", z); + return z; +} + +/* convert a zval to a long, with null checking - unfortunately PHP + * automatically converts nulls passed as longs into zero */ +static int gdphp_long_from_zval_null(zval *z, long dflt) +{ + long v = dflt; + + dtrace("%p, %li", z, dflt); + + if (z != NULL && Z_TYPE_P(z) != IS_NULL) { + convert_to_long(z); /* coerce */ + v = Z_LVAL_P(z); + } + + dreturn("%li", v); + return v; +} + +/* get the unpack value */ +static zend_bool gdphp_unpack(zval *z) +{ + zend_bool unpack; + + dtrace("%p", z); + + TSRMLS_FETCH(); + + if (z != NULL && Z_TYPE_P(z) != IS_NULL) { + convert_to_boolean(z); /* coerce */ + unpack = Z_BVAL_P(z); + } else + unpack = GDPHP_G(unpack); + + dreturn("%i", unpack); + return unpack; +} + +static void gdphp_init_globals(zend_getdata_globals *g) +{ + dtrace("%p", g); + + g->unpack = 0; + g->degrade_complex = 1; + + dreturnvoid(); +} + +/* module init function */ +PHP_MINIT_FUNCTION(getdata) +{ + dtracetsrm("%i, %i", type, module_number); + + /* initialise globals */ + ZEND_INIT_MODULE_GLOBALS(getdata, gdphp_init_globals, NULL); + + /* Register constants */ + gdphp_register_constants(module_number); + + /* conveniences */ + zend_register_long_constant(ZEND_STRS("GD_INT"), GDPHP_LONG, CONST_CS, + module_number TSRMLS_CC); + zend_register_long_constant(ZEND_STRS("GD_FLOAT"), GD_FLOAT64, CONST_CS, + module_number TSRMLS_CC); + + /* INI entries */ + REGISTER_INI_ENTRIES(); + + /* dirfile resource */ + le_gdphp_dirfile = zend_register_list_destructors_ex(gdphp_dirfile_dtor, NULL, + "Dirfile", module_number); + le_gdphp_dirfile_persist = zend_register_list_destructors_ex(NULL, + gdphp_dirfile_pdtor, "Dirfile", module_number); + + dreturn("%i", 0); + return 0; +} + +PHP_MSHUTDOWN_FUNCTION(getdata) +{ + dtracetsrm("%i, %i", type, module_number); + + UNREGISTER_INI_ENTRIES(); + + dreturn("%i", SUCCESS); + return SUCCESS; +} + +PHP_MINFO_FUNCTION(getdata) +{ + dtracetsrm("%p", zend_module); + + php_info_print_table_start(); + php_info_print_table_header(2, "GetData support", "enabled"); + php_info_print_table_row(2, "Version", PACKAGE_VERSION); + php_info_print_table_end(); + + dreturnvoid(); +} + + +/* BINDINGS */ +PHP_FUNCTION(gd_add) +{ + zval *z; + + gd_entry_t E; + DIRFILE *D; + + GDPHP_CONTEXTp(ctx,2); + + dtracephp(); + + GDPHP_PARSED("a", &z); + + gdphp_to_entry(&E, z, NULL, 0, &ctx); + + /* no need to free entry strings */ + GDPHP_RETURN_BOOL(gd_add(D, &E)); +} + +PHP_FUNCTION(gd_add_alias) +{ + char *field_code, *target; + int field_code_len, target_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ss|l", &field_code, &field_code_len, &target, &target_len, + &index); + + GDPHP_RETURN_BOOL(gd_add_alias(D, field_code, target, index)); +} + +PHP_FUNCTION(gd_add_bit) +{ + char *field_code, *in_field; + int field_code_len, in_field_len; + long bitnum, index = 0; + zval *znumbits = NULL; + + int numbits; + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len, + &bitnum, &znumbits, &index); + + numbits = gdphp_long_from_zval_null(znumbits, 1); + + GDPHP_RETURN_BOOL(gd_add_bit(D, field_code, in_field, bitnum, numbits, + index)); +} + +PHP_FUNCTION(gd_add_carray) +{ + char *field_code; + int field_code_len; + long data_type; + zval *z1, *z2 = NULL, *z3 = NULL; + DIRFILE *D; + + int r; + struct gdphp_din din; + int index = 0; + + dtracephp(); + + GDPHP_PARSED("slz|zz", &field_code, &field_code_len, &data_type, &z1, &z2, + &z3); + + /* allowed types for the last three parameters: + * + * 1: anything: data + * 2: array, anything: data, index + * 3: other, anything: type, data + * 4: other, anything, anything: type, data, index + */ + if (z2 == NULL) /* 1 */ + din = gdphp_convert_data(z1, NULL, 3, 4); + else if (Z_TYPE_P(z1) == IS_ARRAY) { /* 2 */ + din = gdphp_convert_data(z1, NULL, 3, 3); + convert_to_long(z2); /* coerce */ + index = Z_LVAL_P(z2); + } else if (z3 == NULL) /* 3 */ + din = gdphp_convert_data(z1, z2, 3, 4); + else { /* 4 */ + din = gdphp_convert_data(z1, z2, 3, 4); + convert_to_long(z3); /* coerce */ + index = Z_LVAL_P(z3); + } + + r = gd_add_carray(D, field_code, data_type, din.ns, din.type, din.data, + index); + + if (din.free_din) + efree(din.data); + + GDPHP_RETURN_BOOL(r); +} + +PHP_FUNCTION(gd_add_const) +{ + char *field_code; + int field_code_len; + long data_type, index = 0; + zval *z; + + DIRFILE *D; + char data[16]; + GDPHP_CONTEXTp(ctx,3); + + dtracephp(); + + GDPHP_PARSED("slz|l", &field_code, &field_code_len, &data_type, &z, &index); + + /* might as well convert to the storage type now */ + gdphp_to_datum(data, data_type, z, 1, &ctx); + + GDPHP_RETURN_BOOL(gd_add_const(D, field_code, data_type, data_type, data, + index)); +} + +PHP_FUNCTION(gd_add_divide) +{ + char *field_code, *in1, *in2; + int field_code_len, in1_len, in2_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2, + &in2_len, &index); + + GDPHP_RETURN_BOOL(gd_add_divide(D, field_code, in1, in2, index)); +} + +PHP_FUNCTION(gd_add_lincom) +{ + char *field_code; + int field_code_len; + long index = 0; + zval *zin, *zm, *zb; + + char *in[GD_MAX_LINCOM]; + double m[GD_MAX_LINCOM * 2]; + double b[GD_MAX_LINCOM * 2]; + int n; + + DIRFILE *D; + GDPHP_CONTEXT(ctx); + + dtracephp(); + + GDPHP_PARSED("saaa|l", &field_code, &field_code_len, &zin, &zm, &zb, &index); + + /* these don't return on error */ + ctx.p = 2; + n = gdphp_convert_sarray((char**)in, zin, 1, GD_MAX_LINCOM, &ctx); + ctx.p = 3; + gdphp_convert_cmparray(m, zm, n, n, 0, &ctx); + ctx.p = 4; + gdphp_convert_cmparray(b, zb, n, n, 0, &ctx); + + GDPHP_RETURN_BOOL(gd_add_clincom(D, field_code, n, (const char**)in, + (GD_DCOMPLEXP_t)m, (GD_DCOMPLEXP_t)b, index)); +} + +PHP_FUNCTION(gd_add_linterp) +{ + char *field_code, *in_field, *table; + int field_code_len, in_field_len, table_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ssp|l", &field_code, &field_code_len, &in_field, &in_field_len, + &table, &table_len, &index); + + GDPHP_RETURN_BOOL(gd_add_linterp(D, field_code, in_field, table, index)); +} + +PHP_FUNCTION(gd_add_mplex) +{ + char *field_code, *in1, *in2; + int field_code_len, in1_len, in2_len; + long count, period = 0, index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("sssl|ll", &field_code, &field_code_len, &in1, &in1_len, &in2, + &in2_len, &count, &period, &index); + + GDPHP_RETURN_BOOL(gd_add_mplex(D, field_code, in1, in2, count, period, + index)); +} + +PHP_FUNCTION(gd_add_multiply) +{ + char *field_code, *in1, *in2; + int field_code_len, in1_len, in2_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2, + &in2_len, &index); + + GDPHP_RETURN_BOOL(gd_add_multiply(D, field_code, in1, in2, index)); +} + +PHP_FUNCTION(gd_add_phase) +{ + char *field_code, *in_field; + int field_code_len, in_field_len; + long shift, index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ssl|l", &field_code, &field_code_len, &in_field, &in_field_len, + &shift, &index); + + GDPHP_RETURN_BOOL(gd_add_phase(D, field_code, in_field, shift, index)); +} + +PHP_FUNCTION(gd_add_polynom) +{ + char *field_code, *in_field; + int field_code_len, in_field_len; + long index = 0; + zval *za; + + double a[GD_MAX_POLYORD + 1]; + int o; + + DIRFILE *D; + GDPHP_CONTEXTp(ctx,3); + + dtracephp(); + + GDPHP_PARSED("ssa|l", &field_code, &field_code_len, &in_field, &in_field_len, + &za, &index); + + /* doesn't return on error */ + o = gdphp_convert_cmparray(a, za, 2, GD_MAX_POLYORD + 1, 0, &ctx) - 1; + + GDPHP_RETURN_BOOL(gd_add_cpolynom(D, field_code, o, in_field, + (GD_DCOMPLEXP_t)a, index)); +} + +PHP_FUNCTION(gd_add_raw) +{ + char *field_code; + int field_code_len; + long data_type, spf, index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("pll|l", &field_code, &field_code_len, &data_type, &spf, + &index); + + GDPHP_RETURN_BOOL(gd_add_raw(D, field_code, data_type, spf, index)); +} + +PHP_FUNCTION(gd_add_recip) +{ + char *field_code, *in_field; + int field_code_len, in_field_len; + zval *zdividend; + long index = 0; + + double dividend[2]; + DIRFILE *D; + GDPHP_CONTEXTp(ctx,3); + + dtracephp(); + + GDPHP_PARSED("ssz|l", &field_code, &field_code_len, &in_field, &in_field_len, + &zdividend, &index); + + gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx); + + GDPHP_RETURN_BOOL(gd_add_crecip89(D, field_code, in_field, dividend, index)); +} + +PHP_FUNCTION(gd_add_sbit) +{ + char *field_code, *in_field; + int field_code_len, in_field_len; + long bitnum, index = 0; + zval *znumbits = NULL; + + int numbits; + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len, + &bitnum, &znumbits, &index); + + numbits = gdphp_long_from_zval_null(znumbits, 1); + + GDPHP_RETURN_BOOL(gd_add_sbit(D, field_code, in_field, bitnum, numbits, + index)); +} + +PHP_FUNCTION(gd_add_spec) +{ + char *spec; + int spec_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("s|l", &spec, &spec_len, &index); + + GDPHP_RETURN_BOOL(gd_add_spec(D, spec, index)); +} + +PHP_FUNCTION(gd_add_string) +{ + char *field_code, *value; + int field_code_len, value_len; + long index = 0; + + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("ss|l", &field_code, &field_code_len, &value, &value_len, + &index); + + GDPHP_RETURN_BOOL(gd_add_string(D, field_code, value, index)); +} + +PHP_FUNCTION(gd_add_window) +{ + char *field_code, *in1, *in2; + int field_code_len, in1_len, in2_len; + long windop, index = 0; + zval *zthreshold; + + gd_triplet_t threshold; + DIRFILE *D; + GDPHP_CONTEXTp(ctx,5); + + dtracephp(); + + GDPHP_PARSED("ssslz|l", &field_code, &field_code_len, &in1, &in1_len, &in2, + &in2_len, &windop, &zthreshold, &index); + + gdphp_to_threshold(&threshold, windop, zthreshold, &ctx); + + GDPHP_RETURN_BOOL(gd_add_window(D, field_code, in1, in2, windop, threshold, + index)); +} + +PHP_FUNCTION(gd_alias_target) +{ + char *field_code; + int field_code_len; + + DIRFILE *D; + const char *s; + + dtracephp(); + + GDPHP_PARSED("s", &field_code, &field_code_len); + + s = gd_alias_target(D, field_code); + + if (s == NULL) + GDPHP_RETURN_F; + + dreturn("\"%s\"", s); + RETURN_STRING(s, 1); +} + +PHP_FUNCTION(gd_aliases) +{ + char *field_code; + int field_code_len; + + DIRFILE *D; + const char **fl; + + dtracephp(); + + GDPHP_PARSED("s", &field_code, &field_code_len); + + fl = gd_aliases(D, field_code); + + if (fl == NULL) + GDPHP_RETURN_F; + + gdphp_to_string_array(return_value, fl, 0); + + dreturnvoid(); +} + +PHP_FUNCTION(gd_alter_affixes) +{ + zval *zprefix, *zsuffix; + long index; + + char *prefix = NULL, *suffix = NULL; + DIRFILE *D; + + dtracephp(); + + GDPHP_PARSED("lzz", &index, &zprefix, &zsuffix); + + if (Z_TYPE_P(zprefix) != IS_NULL) { + convert_to_string(zprefix); /* coerce */ + prefix = Z_STRVAL_P(zprefix); + } + + if (Z_TYPE_P(zsuffix) != IS_NULL) { + convert_to_string(zsuffix); /* coerce */ + suffix = Z_STRVAL_P(zsuffix); + } + + GDPHP_RETURN_BOOL(gd_alter_affixes(D, index, prefix, suffix)); +} + +PHP_FUNCTION(gd_alter_bit) +{ + char *field_code, *in_field = N... [truncated message content] |
From: <ket...@us...> - 2013-10-24 00:37:32
|
Revision: 856 http://sourceforge.net/p/getdata/code/856 Author: ketiltrout Date: 2013-10-24 00:37:28 +0000 (Thu, 24 Oct 2013) Log Message: ----------- Clean compiler warnings. Modified Paths: -------------- trunk/getdata/bindings/python/pyentry.c Modified: trunk/getdata/bindings/python/pyentry.c =================================================================== --- trunk/getdata/bindings/python/pyentry.c 2013-10-23 00:56:47 UTC (rev 855) +++ trunk/getdata/bindings/python/pyentry.c 2013-10-24 00:37:28 UTC (rev 856) @@ -1066,7 +1066,7 @@ static int gdpy_entry_setspf(struct gdpy_entry_t *self, PyObject *value, void *closure) { - unsigned int spf; + unsigned int spf = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); @@ -1457,7 +1457,7 @@ static int gdpy_entry_setbitnum(struct gdpy_entry_t *self, PyObject *value, void *closure) { - int bitnum; + int bitnum = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); @@ -1511,7 +1511,7 @@ static int gdpy_entry_setnumbits(struct gdpy_entry_t *self, PyObject *value, void *closure) { - int numbits; + int numbits = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); @@ -1633,7 +1633,7 @@ static int gdpy_entry_setshift(struct gdpy_entry_t *self, PyObject *value, void *closure) { - int64_t shift; + int64_t shift = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); @@ -1685,7 +1685,7 @@ static int gdpy_entry_setcountval(struct gdpy_entry_t *self, PyObject *value, void *closure) { - int count_val; + int count_val = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); @@ -1737,7 +1737,7 @@ static int gdpy_entry_setperiod(struct gdpy_entry_t *self, PyObject *value, void *closure) { - int period; + int period = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-23 00:56:55
|
Revision: 855 http://sourceforge.net/p/getdata/code/855 Author: ketiltrout Date: 2013-10-23 00:56:47 +0000 (Wed, 23 Oct 2013) Log Message: ----------- Make distclean work when things aren't configured. Modified Paths: -------------- trunk/getdata/bindings/php/Makefile.am trunk/getdata/bindings/python/Makefile.am Modified: trunk/getdata/bindings/php/Makefile.am =================================================================== --- trunk/getdata/bindings/php/Makefile.am 2013-10-22 20:55:24 UTC (rev 854) +++ trunk/getdata/bindings/php/Makefile.am 2013-10-23 00:56:47 UTC (rev 855) @@ -41,7 +41,9 @@ cd getdata && ${PHPIZE} clean-local: +if MAKE_PHPBINDINGS cd getdata && ${PHPIZE} --clean +endif rm -rf *~ getdata/*~ ${BUILT_SOURCES} getdata/Makefile.temp SUBDIRS=. test Modified: trunk/getdata/bindings/python/Makefile.am =================================================================== --- trunk/getdata/bindings/python/Makefile.am 2013-10-22 20:55:24 UTC (rev 854) +++ trunk/getdata/bindings/python/Makefile.am 2013-10-23 00:56:47 UTC (rev 855) @@ -40,6 +40,8 @@ cd .. && ${MAKE} make_parameters clean-local: +if MAKE_PYBINDINGS if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi +endif rm -rf build pygetdata.so ${BUILT_SOURCES} debug.c *~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-22 20:55:26
|
Revision: 854 http://sourceforge.net/p/getdata/code/854 Author: ketiltrout Date: 2013-10-22 20:55:24 +0000 (Tue, 22 Oct 2013) Log Message: ----------- Merge OOP write and temp file code in the encoding bookkeeping layer. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/src/add.c trunk/getdata/src/encoding.c trunk/getdata/src/fpos.c trunk/getdata/src/getdata.c trunk/getdata/src/mod.c trunk/getdata/src/move.c trunk/getdata/src/parse.c trunk/getdata/src/putdata.c trunk/getdata/test/Makefile.am Added Paths: ----------- trunk/getdata/test/gzip_put_endian.c Property Changed: ---------------- trunk/getdata/test/ Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/ChangeLog 2013-10-22 20:55:24 UTC (rev 854) @@ -1,3 +1,12 @@ +2013-10-19 D. V. Wiebe <ge...@ke...> svn:854 + * src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek) + src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c + (_GD_MogrifyFile) src/parse.c (_GD_ParseFieldSpec) src/putdata.c + (_GD_DoRawOut): Compute the swap argument correctly in _GD_InitRawIO calls. + * src/encoding.c (_GD_InitRawIO): Merge oop_write and temp file creation + code; also, assume that the caller has figured out the swap parameter. + * test/gzip_put_endian.c: Added. + 2013-10-19 D. V. Wiebe <ge...@ke...> svn:852 _GD_MakeTempFile patch from Seth: Modified: trunk/getdata/src/add.c =================================================================== --- trunk/getdata/src/add.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/add.c 2013-10-22 20:55:24 UTC (rev 854) @@ -301,7 +301,8 @@ GD_SIZE(E->EN(raw,data_type))) == 0) _GD_SetError(D, GD_E_BAD_TYPE, entry->EN(raw,data_type), NULL, 0, NULL); else if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, - GD_FILE_WRITE | GD_FILE_TOUCH, 0)) + GD_FILE_WRITE | GD_FILE_TOUCH, + _GD_FileSwapBytes(D, E->fragment_index))) { ; } else if (D->fragment[E->fragment_index].ref_name == NULL) { Modified: trunk/getdata/src/encoding.c =================================================================== --- trunk/getdata/src/encoding.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/encoding.c 2013-10-22 20:55:24 UTC (rev 854) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2012 D. V. Wiebe +/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * @@ -486,7 +486,6 @@ int fragment, const struct encoding_t *enc, unsigned int funcs, unsigned int mode, int swap) { - int temp_fd = -1; const int touch = mode & GD_FILE_TOUCH; int oop_write = 0; @@ -538,59 +537,41 @@ if (fragment == -1) fragment = E->fragment_index; - if (mode & GD_FILE_TEMP) { + if (oop_write || mode & GD_FILE_TEMP) { /* create temporary file in file[1] */ - if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data, + if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data, E->e->u.raw.file + 1, filebase, 1, 0)) { ; /* error already set */ - } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file + 1, swap, - GD_FILE_WRITE | GD_FILE_TEMP)) + dreturn("%i", 1); + return 1; + } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file + 1, + swap, GD_FILE_WRITE | GD_FILE_TEMP)) { _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL); - } - - if (D->error) { dreturn("%i", 1); return 1; } - dreturn("%i", 0); - return 0; - } - if (oop_write) { - /* an out-of-place write requires us to open a temporary file and pass - * in its fd */ - if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data, - E->e->u.raw.file + 1, filebase, 1, 0)) - { - dreturn("%i", 1); - return 1; - } else if ((temp_fd = _GD_MakeTempFile(D, - D->fragment[E->fragment_index].dirfd, E->e->u.raw.file[1].name)) - < 0) - { - dreturn("%i", 1); - return 1; - } else if ((*enc->open)(temp_fd, E->e->u.raw.file + 1, _GD_FileSwapBytes(D, - E->fragment_index), GD_FILE_WRITE)) { - _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL); - dreturn("%i", 1); - return 1; + if (oop_write) { + /* The read file in OOP mode is flagged as RW. */ + mode = GD_FILE_RDWR; + } else { + /* Temp file creation complete */ + dreturn("%i", 0); + return 0; } - /* The read file in OOP mode is flagged as RW. */ - mode = GD_FILE_RDWR; } /* open a regular file, if necessary */ if (E->e->u.raw.file[0].idata < 0) { - if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data, + if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data, E->e->u.raw.file, filebase, 0, 0)) { dreturn("%i", 1); return 1; - } else if ((*enc->open)(D->fragment[E->fragment_index].dirfd, - E->e->u.raw.file, _GD_FileSwapBytes(D, E->fragment_index), mode)) + } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file, swap, + mode)) { /* In oop_write mode, it doesn't matter if the old file doesn't exist */ if (!oop_write || errno != ENOENT) { @@ -603,7 +584,7 @@ } if (touch) - _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP); + _GD_FiniRawIO(D, E, fragment, GD_FINIRAW_KEEP); dreturn("%i", 0); return 0; Modified: trunk/getdata/src/fpos.c =================================================================== --- trunk/getdata/src/fpos.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/fpos.c 2013-10-22 20:55:24 UTC (rev 854) @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2012 D. V. Wiebe +/* Copyright (C) 2011-2013 D. V. Wiebe * *************************************************************************** * @@ -38,8 +38,11 @@ case GD_RAW_ENTRY: /* We must open the file to know its starting offset */ if (E->e->u.raw.file[0].idata < 0) - if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0)) + if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, + _GD_FileSwapBytes(D, E->fragment_index))) + { break; + } pos = E->e->u.raw.file[0].pos + E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset; break; @@ -171,7 +174,8 @@ if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) { dreturn("%i", -1); return -1; - } else if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, GD_FILE_WRITE, 0)) + } else if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, GD_FILE_WRITE, + _GD_FileSwapBytes(D, E->fragment_index))) { dreturn("%i", -1); return -1; @@ -250,8 +254,11 @@ switch (E->field_type) { case GD_RAW_ENTRY: /* open/create the file, if necessary */ - if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, mode, 0)) + if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, mode, + _GD_FileSwapBytes(D, E->fragment_index))) + { break; + } /* The requested offset is before the start of the file, so I guess * pretend we've repositioned it... Modified: trunk/getdata/src/getdata.c =================================================================== --- trunk/getdata/src/getdata.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/getdata.c 2013-10-22 20:55:24 UTC (rev 854) @@ -286,7 +286,7 @@ if (ns > 0) { /** open the file (and cache the fp) if it hasn't been opened yet. */ if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK | GD_EF_READ, - GD_FILE_READ, 0)) + GD_FILE_READ, _GD_FileSwapBytes(D, E->fragment_index))) { free(databuffer); dreturn("%i", 0); Modified: trunk/getdata/src/mod.c =================================================================== --- trunk/getdata/src/mod.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/mod.c 2013-10-22 20:55:24 UTC (rev 854) @@ -323,9 +323,11 @@ enc = gd_ef_ + E->e->u.raw.file[0].subenc; /* open the old file */ - if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0)) + if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, + _GD_FileSwapBytes(D, E->fragment_index))) + { break; - else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type), + } else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type), GD_FILE_READ) == -1) { _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, Modified: trunk/getdata/src/move.c =================================================================== --- trunk/getdata/src/move.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/move.c 2013-10-22 20:55:24 UTC (rev 854) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2011 D. V. Wiebe +/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * @@ -138,7 +138,9 @@ } /* Open the input file, if necessary */ - if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0)) { + if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, + _GD_FileSwapBytes(D, E->fragment_index))) + { free(new_filebase); dreturn("%i", -1); return -1; Modified: trunk/getdata/src/parse.c =================================================================== --- trunk/getdata/src/parse.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/parse.c 2013-10-22 20:55:24 UTC (rev 854) @@ -1545,7 +1545,8 @@ /* If the encoding scheme is unsupported, we can't add the field */ _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL); else - _GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE | GD_FILE_TOUCH, 0); + _GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE | GD_FILE_TOUCH, + _GD_FileSwapBytes(D, E->fragment_index)); } /* Is this the first raw field ever defined? */ Modified: trunk/getdata/src/putdata.c =================================================================== --- trunk/getdata/src/putdata.c 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/src/putdata.c 2013-10-22 20:55:24 UTC (rev 854) @@ -1,6 +1,6 @@ /* Copyright (C) 2003-2005 C. Barth Netterfield * Copyright (C) 2003-2005 Theodore Kisner - * Copyright (C) 2005-2012 D. V. Wiebe + * Copyright (C) 2005-2013 D. V. Wiebe * *************************************************************************** * @@ -93,7 +93,9 @@ } /* write data to file. */ - if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE, 0)) { + if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE, + _GD_FileSwapBytes(D, E->fragment_index))) + { free(databuffer); dreturn("%i", 0); return 0; Index: trunk/getdata/test =================================================================== --- trunk/getdata/test 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/test 2013-10-22 20:55:24 UTC (rev 854) Property changes on: trunk/getdata/test ___________________________________________________________________ Modified: svn:ignore ## -485,6 +485,7 ## gzip_move_to gzip_nframes gzip_put +gzip_put_endian gzip_put_get header_complex hide Modified: trunk/getdata/test/Makefile.am =================================================================== --- trunk/getdata/test/Makefile.am 2013-10-19 03:12:50 UTC (rev 853) +++ trunk/getdata/test/Makefile.am 2013-10-22 20:55:24 UTC (rev 854) @@ -190,7 +190,8 @@ GLOBAL_TESTS=global_flags global_name global_ref global_ref_empty global_ref_set GZIP_TESTS=gzip_add gzip_get gzip_get_get gzip_get_get2 gzip_get_put \ - gzip_move_from gzip_move_to gzip_nframes gzip_put gzip_put_get + gzip_move_from gzip_move_to gzip_nframes gzip_put gzip_put_endian \ + gzip_put_get HEADER_TESTS=header_complex Added: trunk/getdata/test/gzip_put_endian.c =================================================================== --- trunk/getdata/test/gzip_put_endian.c (rev 0) +++ trunk/getdata/test/gzip_put_endian.c 2013-10-22 20:55:24 UTC (rev 854) @@ -0,0 +1,125 @@ +/* Copyright (C) 2013 D. V. Wiebe + * + *************************************************************************** + * + * This file is part of the GetData project. + * + * GetData is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * GetData is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GetData; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "test.h" + +#include <inttypes.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> +#include <stdio.h> + +int main(void) +{ +#ifndef TEST_GZIP + return 77; +#else + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *data_gz = "dirfile/data.gz"; + const char *data = "dirfile/data"; + const char *format_data = "data RAW UINT16 8\n" +#ifdef WORDS_BIGENDIAN + "ENDIAN little\n"; +#else + "ENDIAN big\n"; +#endif + uint16_t c[8]; +#ifdef USE_GZIP + char command[4096]; + uint16_t d; +#endif + struct stat buf; + int fd, i, n, error, stat_data, unlink_data, r = 0; + DIRFILE *D; + + memset(c, 0, 8); + rmdirfile(); + mkdir(filedir, 0777); + + for (i = 0; i < 8; ++i) + c[i] = (uint16_t)(0x102 * i); + + fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); + write(fd, format_data, strlen(format_data)); + close(fd); + +#ifdef USE_GZIP + D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); +#else + D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); +#endif + n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); + error = gd_error(D); + + gd_discard(D); + + stat_data = stat(data_gz, &buf); +#ifdef USE_GZIP + if (stat_data) { + perror("stat"); + } + CHECKI(stat_data, 0); +#else + CHECKI(stat_data, -1); +#endif + +#ifdef USE_GZIP + /* uncompress */ + snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); + if (gd_system(command)) { + r = 1; + } else { + fd = open(data, O_RDONLY | O_BINARY); + if (fd >= 0) { + i = 0; + while (read(fd, &d, sizeof(uint16_t))) { + if (i < 40 || i > 48) { + CHECKIi(i, d, 0); + } else + CHECKIi(i, d, 0x201 * (i - 40)); + i++; + } + CHECKI(i, 48); + close(fd); + } + } +#endif + + unlink_data = unlink(data); + unlink(format); + rmdir(filedir); + +#ifdef USE_GZIP + CHECKI(unlink_data, 0); + CHECKI(error, GD_E_OK); + CHECKI(n, 8); +#else + CHECKI(unlink_data, -1); + CHECKI(error, GD_E_UNSUPPORTED); + CHECKI(n, 0); +#endif + + return r; +#endif +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-19 03:12:54
|
Revision: 853 http://sourceforge.net/p/getdata/code/853 Author: ketiltrout Date: 2013-10-19 03:12:50 +0000 (Sat, 19 Oct 2013) Log Message: ----------- USE_MODULES kludge. Modified Paths: -------------- trunk/getdata/src/internal.h trunk/getdata/test/add_raw_spf_scalar.c Modified: trunk/getdata/src/internal.h =================================================================== --- trunk/getdata/src/internal.h 2013-10-19 02:43:38 UTC (rev 852) +++ trunk/getdata/src/internal.h 2013-10-19 03:12:50 UTC (rev 853) @@ -1162,6 +1162,11 @@ #define gd_MakeFullPathOnly _GD_MakeFullPathOnly #endif char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name); +#ifdef USE_MODULES +#define _GD_MakeTempFile gd_MakeTempFile +#else +#define gd_MakeTempFile _GD_MakeTempFile +#endif int _GD_MakeTempFile(const DIRFILE*, int, char*); void *_GD_Malloc(DIRFILE *D, size_t size); int _GD_MissingFramework(int encoding, unsigned int funcs); Modified: trunk/getdata/test/add_raw_spf_scalar.c =================================================================== --- trunk/getdata/test/add_raw_spf_scalar.c 2013-10-19 02:43:38 UTC (rev 852) +++ trunk/getdata/test/add_raw_spf_scalar.c 2013-10-19 03:12:50 UTC (rev 853) @@ -41,6 +41,7 @@ rmdirfile(); E.field = "data"; E.field_type = GD_RAW_ENTRY; + E.fragment_index = 0; E.EN(raw,spf) = 0; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = "const"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-19 02:43:41
|
Revision: 852 http://sourceforge.net/p/getdata/code/852 Author: ketiltrout Date: 2013-10-19 02:43:38 +0000 (Sat, 19 Oct 2013) Log Message: ----------- Seth's _GD_MakeTempFile patch. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/src/ascii.c trunk/getdata/src/encoding.c trunk/getdata/src/gzip.c trunk/getdata/src/raw.c trunk/getdata/src/sie.c Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/ChangeLog 2013-10-19 02:43:38 UTC (rev 852) @@ -1,3 +1,13 @@ +2013-10-19 D. V. Wiebe <ge...@ke...> svn:852 + + _GD_MakeTempFile patch from Seth: + + * src/encoding.c (_GD_InitRawIO): Let the encoding framework deal with + creating temporary files. + * src/ascii.c (_GD_AsciiOpen) src/gzip.c (_GD_GzipOpen) src/raw.c + (_GD_RawOpen) src/sie.c (_GD_SampIndDoOpen): Call _GD_MakeTempFile when + necessary. + 2013-10-19 D. V. Wiebe <ge...@ke...> svn:850 Merge in getdata-distutils branch: Modified: trunk/getdata/src/ascii.c =================================================================== --- trunk/getdata/src/ascii.c 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/src/ascii.c 2013-10-19 02:43:38 UTC (rev 852) @@ -37,13 +37,14 @@ file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); - if (file->idata < 0) { - dreturn("%i", -1); - return -1; - } } else - file->idata = fd; + file->idata = _GD_MakeTempFile(file->D, fd, file->name); + if (file->idata < 0) { + dreturn("%i", -1); + return -1; + } + file->edata = fdopen(file->idata, (mode & GD_FILE_WRITE) ? "rb+" : "rb"); if (file->edata == NULL) { Modified: trunk/getdata/src/encoding.c =================================================================== --- trunk/getdata/src/encoding.c 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/src/encoding.c 2013-10-19 02:43:38 UTC (rev 852) @@ -544,11 +544,7 @@ E->e->u.raw.file + 1, filebase, 1, 0)) { ; /* error already set */ - } else if ((temp_fd = _GD_MakeTempFile(D, D->fragment[fragment].dirfd, - E->e->u.raw.file[1].name)) < 0) - { - _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL); - } else if ((*enc->open)(temp_fd, E->e->u.raw.file + 1, swap, + } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file + 1, swap, GD_FILE_WRITE | GD_FILE_TEMP)) { _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL); Modified: trunk/getdata/src/gzip.c =================================================================== --- trunk/getdata/src/gzip.c 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/src/gzip.c 2013-10-19 02:43:38 UTC (rev 852) @@ -51,6 +51,8 @@ return 1; } gzmode = "r"; + } else if (mode & GD_FILE_TEMP) { + file->idata = _GD_MakeTempFile(file->D, fd, file->name); } else file->idata = fd; Modified: trunk/getdata/src/raw.c =================================================================== --- trunk/getdata/src/raw.c 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/src/raw.c 2013-10-19 02:43:38 UTC (rev 852) @@ -34,9 +34,11 @@ file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); - } else - file->idata = fd; + } else { + file->idata = _GD_MakeTempFile(file->D, fd, file->name); + } + file->pos = 0; file->mode = mode | GD_FILE_READ; Modified: trunk/getdata/src/sie.c =================================================================== --- trunk/getdata/src/sie.c 2013-10-19 01:34:07 UTC (rev 851) +++ trunk/getdata/src/sie.c 2013-10-19 02:43:38 UTC (rev 852) @@ -40,14 +40,14 @@ if (!(mode & GD_FILE_TEMP)) { fd = gd_OpenAt(file->D, fdin, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); + } else { + fd = _GD_MakeTempFile(file->D, fdin, file->name); + } - if (fd < 0) { - dreturn("%i", -1); - return -1; - } - } else - fd = fdin; - + if (fd < 0) { + dreturn("%i", -1); + return -1; + } stream = fdopen(fd, (mode & GD_FILE_WRITE) ? "rb+" : "rb"); if (stream == NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-19 01:34:12
|
Revision: 851 http://sourceforge.net/p/getdata/code/851 Author: ketiltrout Date: 2013-10-19 01:34:07 +0000 (Sat, 19 Oct 2013) Log Message: ----------- Delete branches/getdata-distutils (merged back into trunk) Modified Paths: -------------- trunk/getdata/ChangeLog Removed Paths: ------------- branches/getdata-distutils/ Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-10-19 01:31:01 UTC (rev 850) +++ trunk/getdata/ChangeLog 2013-10-19 01:34:07 UTC (rev 851) @@ -1,3 +1,12 @@ +2013-10-19 D. V. Wiebe <ge...@ke...> svn:850 + + Merge in getdata-distutils branch: + + * m4/python.m4 bindings/python/test/Makefile.am bindings/python/Makefile.am + configure.ac: Use distutils to build Python bindings rather than rolling our + own. + * bindings/python/setup.py.in: Added. + 2013-10-18 D. V. Wiebe <ge...@ke...> svn:848 * bindings/f77/fgetdata.c (GDASRW GDASLC GDASCL GDASPN GDASCP GDASPH GDASRC This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-19 01:31:08
|
Revision: 850 http://sourceforge.net/p/getdata/code/850 Author: ketiltrout Date: 2013-10-19 01:31:01 +0000 (Sat, 19 Oct 2013) Log Message: ----------- Merge in getdata-distutils branch. Modified Paths: -------------- trunk/getdata/bindings/python/Makefile.am trunk/getdata/bindings/python/test/Makefile.am trunk/getdata/configure.ac trunk/getdata/m4/python.m4 Added Paths: ----------- trunk/getdata/bindings/python/setup.py.in Property Changed: ---------------- trunk/getdata/ trunk/getdata/bindings/python/ Index: trunk/getdata =================================================================== --- trunk/getdata 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata 2013-10-19 01:31:01 UTC (rev 850) Property changes on: trunk/getdata ___________________________________________________________________ Modified: svn:mergeinfo ## -1,4 +1,5 ## /branches/getdata-0.4:217-227 /branches/getdata-0.7:513-566 /branches/getdata-arm:355-413 +/branches/getdata-distutils:778-849 /branches/getdata-osx:400-402 \ No newline at end of property Index: trunk/getdata/bindings/python =================================================================== --- trunk/getdata/bindings/python 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata/bindings/python 2013-10-19 01:31:01 UTC (rev 850) Property changes on: trunk/getdata/bindings/python ___________________________________________________________________ Modified: svn:ignore ## -1,4 +1,6 ## -.deps Makefile.in Makefile +build +debug.c pyconstants.c +setup.py Modified: trunk/getdata/bindings/python/Makefile.am =================================================================== --- trunk/getdata/bindings/python/Makefile.am 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata/bindings/python/Makefile.am 2013-10-19 01:31:01 UTC (rev 850) @@ -20,25 +20,19 @@ # AUTOMAKE_OPTIONS = foreign -if GETDATA_DEBUG -DEBUG_C = ../../src/debug.c -endif - SUBDIRS=test -python_LTLIBRARIES = pygetdata.la -LIBS= +nodist_python_SCRIPTS = pygetdata.so BUILT_SOURCES = pyconstants.c -AM_CFLAGS = ${GD_CC_WALL} -fno-strict-aliasing -AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS) -pygetdata_la_LDFLAGS = -module -avoid-version \ - -export-symbols-regex initpygetdata -pygetdata_la_LIBADD = $(PYTHON_LIBS) ../../src/libgetdata.la -pygetdata_la_SOURCES = pygetdata.c pydirfile.c pyentry.c pyfragment.c \ - ${DEBUG_C} pygetdata.h -nodist_pygetdata_la_SOURCES = pyconstants.c +distutils_path=build/lib.${PYTHON_PLATFORM}-${PYTHON_VERSION} +pygetdata.so: ${distutils_path}/pygetdata.so + cp $< $@ + +${distutils_path}/pygetdata.so: setup.py ${BUILT_SOURCES} + ${PYTHON} setup.py build + pyconstants.c: ../make_parameters ../make_parameters p > $@ @@ -46,5 +40,6 @@ cd .. && ${MAKE} make_parameters clean-local: - rm -rf ${BUILT_SOURCES} *~ + if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi + rm -rf build pygetdata.so ${BUILT_SOURCES} debug.c *~ Copied: trunk/getdata/bindings/python/setup.py.in (from rev 849, branches/getdata-distutils/bindings/python/setup.py.in) =================================================================== --- trunk/getdata/bindings/python/setup.py.in (rev 0) +++ trunk/getdata/bindings/python/setup.py.in 2013-10-19 01:31:01 UTC (rev 850) @@ -0,0 +1,98 @@ +# Copyright (C) 2012 D. V. Wiebe +# +# @configure_input@ +# +########################################################################## +# +# This file is part of the GetData project. +# +# GetData is free software; you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation; either version 2.1 of the License, or (at your +# option) any later version. +# +# GetData is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with GetData; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +from distutils.core import setup +from distutils.extension import Extension +from distutils.command.clean import clean as clean +from os.path import join +from os import unlink +from shutil import copy + +libsrc_dir = '@top_srcdir@/src' +libbuild_dir = '../../src' +srcdir = '@srcdir@' + +#include paths +includes = [ libbuild_dir ] + +try: + import numpy + includes.append(numpy.get_include()) +except ImportError: + pass + +sources = [ 'pydirfile.c', 'pyentry.c', 'pyfragment.c', 'pygetdata.c' ] + +# clean copied source files in out-of-place builds; see below +cmdclass = {} + +class gd_clean(clean): + def run(self): + if '@srcdir@' != '.': + for x in sources: + unlink(x) + clean.run(self) + +# deal with out-of-place (VPATH) builds +if srcdir != '.': + includes.append(srcdir) # to find pygetdata.h + + # if we don't do this, the object files will end up in + # @top_builddir@/bindings/bindings/python, + # instead of + # @builddir@/build/temp.<whatever> + # like they're supposed to. It seems to work, but it's a little crazier + # than we're willing to deal with. + for x in sources: + copy(join(srcdir, x), x) + + # handle clean up + cmdclass['clean'] = gd_clean + +# now add this built source; it always ends up where distutils wants it to be +sources.append('pyconstants.c') + +# add debug sources +if @GETDATA_DEBUG@: + copy(join(libsrc_dir, 'debug.c'), 'debug.c') # see comment above + sources.append('debug.c') + includes.append(libsrc_dir) # to find internal.h + +setup( + name = 'pygetdata', + version = '@VERSION@', + cmdclass = cmdclass, + ext_modules = [ + Extension('pygetdata', + sources = sources, + depends = [ + join(srcdir, 'pygetdata.h'), + join(libbuild_dir, 'gd_config.h'), + join(libbuild_dir, 'getdata.h') + ], + include_dirs = includes, + library_dirs = [ join(libbuild_dir, '.libs') ], + libraries = [ 'getdata' ], + define_macros = [ ('HAVE_CONFIG_H','1') ] + ) + ] + ) Modified: trunk/getdata/bindings/python/test/Makefile.am =================================================================== --- trunk/getdata/bindings/python/test/Makefile.am 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata/bindings/python/test/Makefile.am 2013-10-19 01:31:01 UTC (rev 850) @@ -21,7 +21,7 @@ AUTOMAKE_OPTIONS = foreign if TEST_PYTHON -TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs PYTHONPATH=../.libs/ ${PYTHON} +TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs PYTHONPATH=.. ${PYTHON} pyTESTS=callback.py big_test.py TESTS=$(addprefix ${srcdir}/,$(pyTESTS)) endif Modified: trunk/getdata/configure.ac =================================================================== --- trunk/getdata/configure.ac 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata/configure.ac 2013-10-19 01:31:01 UTC (rev 850) @@ -862,7 +862,6 @@ AC_MSG_CHECKING([NumPy includes]) NUMPY_CPPFLAGS=-I`$PYTHON -c "import numpy; print numpy.get_include()"` AC_MSG_RESULT([$NUMPY_CPPFLAGS]) - AC_SUBST([NUMPY_CPPFLAGS]) saved_cppflags=$CPPFLAGS CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS} ${NUMPY_CPPFLAGS}" @@ -1063,6 +1062,7 @@ AC_CONFIG_FILES([bindings/php/getdata/config.m4]) AC_CONFIG_FILES([bindings/php/test/Makefile]) AC_CONFIG_FILES([bindings/python/Makefile]) +AC_CONFIG_FILES([bindings/python/setup.py]) AC_CONFIG_FILES([bindings/python/test/Makefile]) AC_CONFIG_FILES([doc/Makefile]) AC_CONFIG_FILES([man/Makefile]) Modified: trunk/getdata/m4/python.m4 =================================================================== --- trunk/getdata/m4/python.m4 2013-10-19 01:09:09 UTC (rev 849) +++ trunk/getdata/m4/python.m4 2013-10-19 01:31:01 UTC (rev 850) @@ -96,50 +96,25 @@ AC_MSG_CHECKING([$PYTHON version]) PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[:3]]"` AC_MSG_RESULT([$PYTHON_VERSION]) +AC_SUBST([PYTHON_VERSION]) -dnl calculate python CPPFLAGS and LIBS +dnl calculate python CPPFLAGS +AC_MSG_CHECKING([Python includes]) if test -x $PYTHON-config; then - if test -n "$user_python"; then - python_exec_prefix=`$PYTHON-config --exec-prefix` - PYTHON_LIBS="-L${python_exec_prefix}/lib " - else - PYTHON_LIBS="" - fi PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null` - PYTHON_LIBS="${PYTHON_LIBS}`$PYTHON-config --ldflags 2>/dev/null`" else python_prefix=`$PYTHON -c "import sys; print sys.prefix"` python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` - python_libdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDIR')"` - python_syslibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SYSLIBS')"` - python_shlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SHLIBS')"` - python_modlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('MODLIBS')"` - PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}" - if test -n "$user_python"; then - PYTHON_LIBS="-L${python_libdir} " - else - PYTHON_LIBS="" - fi - PYTHON_LIBS="${PYTHON_LIBS}$python_syslibs $python_shlibs $python_modlibs -lpython${PYTHON_VERSION}" fi -AC_MSG_CHECKING([Python includes]) AC_MSG_RESULT([$PYTHON_CPPFLAGS]) -AC_SUBST([PYTHON_CPPFLAGS]) -AC_MSG_CHECKING([Python libraries]) -AC_MSG_RESULT([$PYTHON_LIBS]) -AC_SUBST([PYTHON_LIBS]) -dnl header check -saved_CPPFLAGS=${CPPFLAGS} -CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}" -AC_CHECK_HEADERS(Python.h,,[have_python="no"]) -CPPFLAGS=${saved_CPPFLAGS} +dnl figure out the platform name +AC_MSG_CHECKING([Python platform name]) +PYTHON_PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"` +AC_MSG_RESULT([$PYTHON_PLATFORM]) +AC_SUBST([PYTHON_PLATFORM]) -fi - -if test "x${have_python}" != "xno"; then - dnl calculate the exec prefix pyexec_prefix=$exec_prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix @@ -155,16 +130,5 @@ AC_SUBST([pythondir]) AC_MSG_RESULT([$pythondir]) -saved_CPPFLAGS=${CPPFLAGS} -CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}" -saved_LIBS=$LIBS -LIBS="$LIBS ${PYTHON_LIBS}" -dnl try to compile a module -AC_MSG_CHECKING([if we can compile a simple Python extension module]) -AC_TRY_LINK_FUNC([Py_Initialize], [ AC_MSG_RESULT([yes]) ], -[ AC_MSG_RESULT([no]); have_python="no" ]) -CPPFLAGS=$saved_CPPFLAGS -LIBS=$saved_LIBS - fi ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-19 01:09:13
|
Revision: 849 http://sourceforge.net/p/getdata/code/849 Author: ketiltrout Date: 2013-10-19 01:09:09 +0000 (Sat, 19 Oct 2013) Log Message: ----------- PHP doc Modified Paths: -------------- trunk/getdata/bindings/php/getdata/getdata.c Added Paths: ----------- trunk/getdata/doc/README.php Modified: trunk/getdata/bindings/php/getdata/getdata.c =================================================================== --- trunk/getdata/bindings/php/getdata/getdata.c 2013-10-18 02:00:00 UTC (rev 848) +++ trunk/getdata/bindings/php/getdata/getdata.c 2013-10-19 01:09:09 UTC (rev 849) @@ -2871,13 +2871,13 @@ PHP_FUNCTION(gd_encoding) { - long i; + long i = 0; DIRFILE *D; dtracephp(); - GDPHP_PARSED("l", &i); + GDPHP_PARSED("|l", &i); i = gd_encoding(D, i); @@ -2890,13 +2890,13 @@ PHP_FUNCTION(gd_endianness) { - long i; + long i = 0; DIRFILE *D; dtracephp(); - GDPHP_PARSED("l", &i); + GDPHP_PARSED("|l", &i); i = gd_endianness(D, i); @@ -3158,13 +3158,13 @@ PHP_FUNCTION(gd_frameoffset) { - long i; + long i = 0; DIRFILE *D; dtracephp(); - GDPHP_PARSED("l", &i); + GDPHP_PARSED("|l", &i); i = gd_frameoffset64(D, i); @@ -3218,7 +3218,7 @@ unpack = gdphp_unpack(zunpack); if (len == -1) { - len = gd_carray_len(D, field_code); + len = gd_carray_len(D, field_code) - start; if (len == 0) /* error */ GDPHP_RETURN_F; } @@ -4485,14 +4485,18 @@ PHP_FUNCTION(gd_rewrite_fragment) { - long i = GD_ALL_FRAGMENTS; + zval *zi; + long i; + DIRFILE *D; dtracephp(); - GDPHP_PARSED("|l", &i); + GDPHP_PARSED("|z", &zi); + i = gdphp_long_from_zval_null(zi, GD_ALL_FRAGMENTS); + GDPHP_RETURN_BOOL(gd_rewrite_fragment(D, i)); } Added: trunk/getdata/doc/README.php =================================================================== --- trunk/getdata/doc/README.php (rev 0) +++ trunk/getdata/doc/README.php 2013-10-19 01:09:09 UTC (rev 849) @@ -0,0 +1,575 @@ +PHP BINDINGS FOR GETDATA +======================== + +The PHP bindings for GetData provide PHP5 bindings to the C GetData Library. +The bindings are provided in a PHP extension (called "getdata") which also +defines all the GetData constants (GD_RDONLY, GD_E_OK, &c.). The bindings +are built using phpize(1) and the standard PHP extension build system. + +In PHP, the C API's DIRFILE object is represented by a Dirfile resource, +allocated by gd_open(). The DIRFILE associated with a Dirfile resource is +automatically discarded and de-allocated (see gd_discard(3)) when the resource +goes out of scope and is reclaimed by GC. Typically this means that a +Dirfile opened with these bindings stays open only while the calling +script runs. However, Dirfile resources can also be made persistent by +calling gd_popen() instead. (See Persistent Database Connections in the PHP +manual for details on persistent resources.) + +A persistent Dirfile resource is not collected by GC when it goes out of scope. +Call gd_discard or gd_close to explicitly delete it. See the discussion of +gd_popen() below for more details on retrieving previously-created persistent +Dirfile resources. + +In general when strings are passed to the extension, only that part of the +string up to the first NUL character will be considered. The exception to this +is gd_popen() (q.v.) + +Data Types +---------- + +In the extension, gd_entry_t structs are represented as associative arrays whose +keys are the same as the gd_entry_t structure members in the C API (see +gd_entry(3)), with the following exceptions: + +* There is no "scalar_ind" key. The value associated with the key "scalar" + is an array of two-element arrays. The first element of the two-element + array is the scalar field code, and the second is the scalar index. + +* Because the extension can determine at run-time the type of a value, there + is no need to distinguish purely real from complex data in the entry + arrays. As a result, complex data will be stored in the values associated + with "m", "b", "a", "dividend" when appropriate. For the same reason, there + is no "comp_scal" key. + +Data can be returned by the extension either packed or unpacked. Packed data +are returned as a string and can be later unpacked using the standard unpack() +function. Unpacked data are returned as an array of the data type requested. +See the INI setting "getdata.unpack" below for ways of indicating whether +packed or unpacked data should be returned. + +Although PHP does not support unsigned integers, if requested, the extension +will return unpacked unsigned data coerced to signed. Be careful with its +interpretation. For convenience, in addition to the standard GD_INT32, +GD_INT64, &c. data type symbols, the extension defines the constants GD_INT +and GD_FLOAT to the native PHP integer and floating point types. + +Similarly, data vectors passed to the extension can be packed or unpacked. +Packed data require a GetData type code indicating the type of the packed data. +If a GetData type code is specified with unpacked data, that type will be used +internally to pass the data to the C API; if no type code is given with unpacked +data, a suitable type will be automatically picked by the extension. Because +packed data can be passed through the extension without intermediate conversion, +it should be preferred when a choice is available. + +Complex data (when not packed) is represented as a two-element array. The +element indexed zero is the real part of the datum; the element indexed one +is the imaginary part. If the "getdata.degrade_complex" INI setting (see below) +is true, complex data whose imaginary part is zero will be simply reported as +a real number, rather than the two-element array. + +INI Setttings +------------- + +The GetData extension defines two optional, boolean INI settings: + +* getdata.unpack: If true, GetData will by default return data as an unpacked + array, rather than a packed string. All functions which return data allow + overriding this setting on a call-by-call basis via their "unpack" argument. + The default is false. + +* getdata.degrade_complex: If true, when returning (unpacked) complex value + data, values which are purely real will be represented simply as a floating + point number. If this is false, these values whill be returned as a + two-element array whose second element (the imarginary part) is zero. The + default is true. + +Both of these settings can be changed on the fly using the standard ini_set() +function. + +Functions +--------- + +Unless otherwise indicated, functions in the extension return false on error, +regardless of their stated return type. Functions which are specified to return +a bool return true on success, except as noted. + +Most functions behave equivalently to their counterparts in the C API. See the +corresponding manual page in the Unix manual for complete details. A complete +list of available functions is given below. Differences from the C API are +pointed out. + +In the prototypes below, "data" can be either a string containing packed data +or else an array containing unpacked data; "number" can be any numeric type +(including a two-element array representing a complex number). + +Optional arguments are given in square brackets with their default values. +The default value for the always-optional $unpack parameter is not given; the +default is the current value of the getdata.unpack INI setting (see above). +Some functions have several ways that they can be called. + +* bool gd_add(resource $dirfile, array $entry) + + For LINCOM and POLYNOM entries, the "n_fields" and "poly_ord" keys of $entry + are optional: the extension will use the other supplied parameters to + deterimine these if not given. If named scalars are used for parameters, + the corresponding literal parameter can be omitted. In most cases, $entry + members which are one-element arrays can be replaced with a scalar. + +* bool gd_add_alias(resource $dirfile, string $field_code, string $target, + [ int $fragment_index = 0 ]) + +* bool gd_add_bit(resource $dirfile, string $field_code, string $in_field, + int $bitnum, [ int $numbits = 1, int $fragment_index = 0 ]) + +* bool gd_add_carray(resource $dirfile, string $field_code, int $const_type, + array $unpacked_data, [ int $fragment_index = 0 ]) + bool gd_add_carray(resource $dirfile, string $field_code, int $const_type, + int $data_type, data $data, [ int $fragment_index = 0 ]) + +* bool gd_add_const(resource $dirfile, string $field_code, int $const_type, + number $value) + +* bool gd_add_divide(resource $dirfile, string $field_code, string $in_field1, + string $in_field2, [ int $fragment_index = 0 ]) + +* bool gd_add_lincom(resource $dirfile, string $field_code, array $in_fields, + array $m, array $b, [ int $fragment_index = 0 ]) + +* bool gd_add_linterp(resource $dirfile, string $field_code, string $in_field, + string $table, [ int $fragment_index = 0 ]) + +* bool gd_add_mplex(resource $dirfile, string $field_code, string $in_field, + string $count_field, int $count, [ int $period = 0, + int $fragment_index = 0 ]) + +* bool gd_add_multiply(resource $dirfile, string $field_code, string $in_field1, + string $in_field2, [ int $fragment_index = 0 ]) + +* bool gd_add_phase(resource $dirfile, string $field_code, string $in_field, + int $shift, [ int $fragment_index = 0 ]) + +* bool gd_add_polynom(resource $dirfile, string $field_code, string $in_field, + array $a, [ int $fragment_index = 0 ]) + +* bool gd_add_raw(resource $dirfile, string $field_code, int $data_type, + int $spf, [ int $fragment_index = 0 ]) + +* bool gd_add_recip(resource $dirfile, string $field_code, string $in_field, + number $dividend, [ int $fragment_index = 0]) + +* bool gd_add_sbit(resource $dirfile, string $field_code, string $in_field, + int $bitnum, [ int $numbits = 1, int $fragment_index = 0 ]) + +* bool gd_add_spec(resource $dirfile, string $spec, [ int $fragment_index = 0 ]) + +* bool gd_add_string(resource $dirfile, string $field_code, string $value, + [ int $fragment_index = 0 ]) + +* bool gd_add_window(resource $dirfile, string $field_code, string $in_field, + string $check_field, int $windop, number $threshold, + [ int $fragment_index = 0 ]) + +* string gd_alias_target(resource $dirfile, string $field_code) + +* array gd_aliases(resource $dirfile, string $field_code) + +* bool gd_alter_affixes(resource $dirfile, int $fragment_index, string $prefix, + string $suffix) + + If $prefix and/or $suffix is null, no change will be made to that affix. To + remove an affix, use the empty string (as in the C API). + +* bool gd_alter_bit(resource $dirfile, string $field_code, + [ string $in_field = null, int $bitnum = null, int $numbits = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_carray(resource $dirfile, string $field_code, + [ int $const_type = null, int $array_len = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_const(resource $dirfile, string $field_code, + [ int $const_type = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_encoding(resource $dirfile, int $encoding, int $fragment_index, + [ bool $recode = false ]) + +* bool gd_alter_endianness(resource $dirfile, int $byte_sex, + int $fragment_index, [ bool $recode = false ]) + +* bool gd_alter_entry(resource $dirfile, string $field_code, array $entry, + [ bool $recode = false ]) + + Elements of $entry which are missing or set to null are left unchanged. + +* bool gd_alter_frameoffset(resource $dirfile, int $offset, int $fragment_index, + [ bool $recode = false ]) + +* bool gd_alter_divide(resource $dirfile, string $field_code, + [ string $in_field1 = null, string $in_field2 = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_lincom(resource $dirfile, string $field_code, + [ int $n_fields = null, array $in_fields = null, array $m = null, + array $b = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_linterp(resource $dirfile, string $field_code, + [ string $in_field, string $table, bool $rename = false ]) + +* bool gd_alter_mplex(resource $dirfile, string $field_code, + [ string $in_field = null, string $count_field = null, int $count = null, + int $period = null ]) + +* bool gd_alter_multiply(resource $dirfile, string $field_code, + [ string $in_field1, string $in_field2 ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_phase(resource $dirfile, string $field_code, + [ string $in_field = null, int $shift = null ]) + +* bool gd_alter_polynom(resource $dirfile, string $field_code, + [ int $poly_ord = null, string $in_field = null, array $a = null ]) + +* bool gd_alter_protection(resource $dirfile, int $protection, + int $fragment_index) + +* bool gd_alter_raw(resource $dirfile, string $field_code, + [ int $data_type = null, int $spf = null, bool $recode = false ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_recip(resource $dirfile, string $field_code, + [ string $in_field = null, number $dividend = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_sbit(resource $dirfile, string $field_code, + [ string $in_field = null, int $bitnum = null, int $numbits = null ]) + + Parameters which are null (or not given) are left unchanged. + +* bool gd_alter_spec(resource $dirfile, string $spec, [ bool $recode = false ]) + +* bool gd_alter_window(resource $dirfile, string $field_code, + [ string $in_field = null, string $check_field = null, + int $windop = null, number $threshold = null ]) + +* int gd_bof(resource $dirfile, string $field_code) + +* int gd_carray_len(resource $dirfile, string $field_code) + +* array gd_carrays(resource $dirfile, int $return_type, [ bool $unpack ]) + + Returns an array of packed strings or unpacked arrays. + +* bool gd_close(resource $dirfile) + + On success, the resource $dirfile is deleted. + +* data gd_constants(resource $dirfile, int $return_type, [ bool $unpack ]) + +* bool gd_delete(resource $dirfile, string $field_code, [ int $flags = 0 ]) + +* bool gd_delete_alias(resource $dirfile, string $field_code, + [ int $flags = 0 ]) + +* bool gd_desync(resource $dirfile, [ int $flags = 0 ]) + + Returns true or false, as appropriate, on success, and null on error. + +* int gd_dirfile_standards(resource $dirfile, + [ int $version = GD_VERSION_CURRENT ]) + +* string gd_dirfilekey(resource $dirfile) + + This function, which has no counterpart in the C API, returns the dirfile + key, which is simply the string passed to gd_open() or gd_popen() when + the dirfile was opened. Unlike most strings returned by the extension, + the string returned may contain embedded NUL characters. See gd_popen() + for a discussion on the use of dirfile keys. If you simply want the + dirfile path, use gd_dirfilename() below. + +* string gd_dirfilename(resource $dirfile) + +* bool gd_discard(resource $dirfile) + + On success, the resource $dirfile is deleted. + +* int gd_encoding(resource $dirfile, [ int $fragment_index = 0 ]) + +* int gd_endianness(resource $dirfile, [ int $fragment_index = 0 ]) + +* array gd_entry(resource $dirfile, string $field_code) + + See above for a description of the returned entry array. + +* array gd_entry_list(resource $dirfile, [ string $parent = null, + int $type = GD_ALL_ENTRIES, flags = 0 ]) + +* int gd_entry_type(resource $dirfile, string $field_code) + +* int gd_eof(resource $dirfile, string $field_code) + +* int gd_error(resorce $dirfile) + +* string gd_error_string(resource $dirfile) + +* array gd_field_list(resource $dirfile) + +* array gd_field_list_by_type(resource $dirfile, int $type) + +* int gd_flags(resource $dirfile, [ int $set = 0, int $reset = 0 ]) + +* bool gd_flush(resource $dirfile, [ string $field_code = null ]) + +* array gd_fragment_affixes(resource $dirfile, int $fragment_index) + +* string gd_fragmentname(resoruce $dirfile, int $fragment_index) + +* int gd_frameoffset(resource $dirfile, [ int $fragment_index = 0 ]) + +* float gd_framenum(resource $dirfile, string $field_code, float $value, + [ int $start = 0, int $stop = 0 ]) + + This actually wraps gd_framenum_subset(3). + +* data gd_get_carray(resource $dirfile, string $field_code, int $return_type, + [ int $start = 0, int $len = null, bool $unpack ]) + + If $len is null (or not given), all values to the end of the CARRAY are + returned. + +* number gd_get_constant(resource $dirfile, string $field_code, int $return_type) + +* string gd_get_string(resource $dirfile, string $field_code) + +* data gd_getdata(resource $dirfile, string $field_code, int $first_frame, + int $first_sample, int $num_frames, int $num_samples, int $return_type, + [ bool $unpack ]) + +* bool gd_hidden(resource $dirfile, string $field_code) + + Returns true or false, as appropriate, on success, and null on error. + +* bool gd_hide(resource $dirfile, string $field_code) + +* int gd_include(resource $dirfile, string $path, int $parent_fragment, + [ int $flags = 0, string $prefix = "", string $suffix = "" ]) + + This actually wraps gd_include_affix(3). + +* resource gd_invalid_dirfile(void) + + This returns a Dirfile resource associated with an invalid dirfile. + There is no corresponding function that returns a persistent resource. + +* string gd_linterp_tablename(resource $dirfile, string $field_code) + +* bool gd_madd(resource $dirfile, string $parent, array $entry) + + For LINCOM and POLYNOM entries, the "n_fields" and "poly_ord" keys of $entry + are optional: the extension will use the other supplied parameters to + deterimine these if not given. If named scalars are used for parameters, + the corresponding literal parameter can be omitted. In most cases, $entry + members which are one-element arrays can be replaced with a scalar. + +* bool gd_madd_alias(resource $dirfile, string $parent, string $field_code, + string $target) + +* bool gd_madd_bit(resource $dirfile, string $parent, string $field_code, + string $in_field, int $bitnum, [ int $numbits = 1 ]) + +* bool gd_madd_carray(resource $dirfile, string $parent, string $field_code, + int $const_type, array $unpacked_data) + bool gd_madd_carray(resource $dirfile, string $parent, string $field_code, + int $const_type, int $data_type, data $data) + +* bool gd_madd_const(resource $dirfile, string $parent, string $field_code, + int $const_type, number $value) + +* bool gd_madd_divide(resource $dirfile, string $parent, string $field_code, + string $in_field1, string $in_field2) + +* bool gd_madd_lincom(resource $dirfile, string $parent, string $field_code, + array $in_fields, array $m, array $b) + +* bool gd_madd_linterp(resource $dirfile, string $parent, string $field_code, + string $in_field, string $table) + +* bool gd_madd_mplex(resource $dirfile, string $parent, string $field_code, + string $in_field, string $count_field, int $count, [ int $period = 0 ]) + +* bool gd_madd_multiply(resource $dirfile, string $parent, string $field_code, + string $in_field1, string $in_field2) + +* bool gd_madd_phase(resource $dirfile, string $parent, string $field_code, + string $in_field, int $shift) + +* bool gd_madd_polynom(resource $dirfile, string $parent, string $field_code, + string $in_field, array $a) + +* bool gd_madd_recip(resource $dirfile, string $parent, string $field_code, + string $in_field, number $dividend) + +* bool gd_madd_sbit(resource $dirfile, string $parent, string $field_code, + string $in_field, int $bitnum, [ int $numbits = 1 ]) + +* bool gd_madd_spec(resource $dirfile, string $spec, string $parent) + +* bool gd_madd_string(resource $dirfile, string $parent, string $field_code, + string $value) + +* bool gd_madd_window(resource $dirfile, string $parent, string $field_code, + string $in_field, string $check_field, int $windop, number $threshold) + +* bool gd_malter_spec(resource $dirfile, string $psec, string $parent, + [ bool $recode = false ]) + +* array gd_mcarrays(resource $dirfile, int $return_type, [ bool $unpack ]) + + Returns an array of packed strings or unpacked arrays. + +* data gd_mconstants(resource $dirfile, int $return_type, [ bool $unpack ]) + +* bool gd_metaflush(resource $dirfile) + +* array gd_mfield_list(resource $dirfile, string $field_code) + +* array gd_mfield_list_by_type(resource $dirfile, string $field_code, int $type) + +* bool gd_move(resource $dirfile, string $field_code, $new_fragment, + [ bool move_data = false ]) + +* bool gd_move_alias(resource $dirfile, string $field_code, $new_fragment) + +* bool gd_mplex_lookback(resource $dirfile, int $lookback) + +* array gd_mstrings(resource $dirfile, string $field_code) + +* array gd_mvector_list(resource $dirfile, string $field_code) + +* int gd_naliases(resource $dirfile, string $field_code) + +* int gd_native_type(resource $dirfile, string $field_code) + +* int gd_nentries(resource $dirfile, [ string $parent = null, + int $type = GD_ALL_ENTRIES, flags = 0 ]) + +* int gd_nfields(resource $dirfile) + +* int gd_nfields_by_type(resource $dirfile, int $type) + +* int gd_nfragments(resource $dirfile) + +* int gd_nframes(resource $dirfile) + +* int gd_nmfields(resource $dirfile, string $field_code) + +* int gd_nmfields_by_type(resource $dirfile, string $field_code, int $type) + +* int gd_nmvectors(resource $dirfile, string $field_code) + +* int gd_nvectors(resource $dirfile) + +* resource gd_open(string $dirfilename, [ int $flags = 0, + callable $callback = null, mixed $callback_data = null ]) + + If specified (and non-null), $callback should be a string giving the + name of a callback function. $callback_data, if given, may be anything; + it will be passed to the callback without inspection. + + The $callback should accept two parameters. The first will be an + associative array of parser data, the second will be the + $callback_data passed to this function. + + This function only returns false in the case when it couldn't create a + Dirfile resource; generally, a failed open will still return a Dirfile + resource. Use gd_error() to check for success. + + To open a Dirfile persistently, see gd_popen(). + +* int gd_parent_fragment(resource $dirfile, int $fragment_index) + +* resource gd_popen(string $dirfilename, [ int $flags = 0, + callable $callback = null, mixed $callback_data = null ]) + + If specified (and non-null), $callback should be a string giving the + name of a callback function. $callback_data, if given, may be anything; + it will be passed to the callback without inspection. + + The $callback should accept two parameters. The first will be an + associative array of parser data, the second will be the + $callback_data passed to this function. + + This function only returns false in the case when it couldn't create a + Dirfile resource; generally, a failed open will still return a Dirfile + resource. Use gd_error() to check for success. + + The returned resource will be persistent (ie. it won't be deleted when + it goes out of scope. If a persistent Dirfile is already open with the + same $dirfilename (including embedded NULs), its resource will be returned + and no new Dirfile will be opened. + +* int gd_protection(resource $dirfile, int $fragment_index) + +* bool gd_put_carray(resource $dirfile, string $field_code, array $unpacked_data) + bool gd_put_carray(resource $dirfile, string $field_code, int $start, + array $unpacked_data) + bool gd_put_carray(resource $dirfile, string $field_code, int $data_type, + string $packed_data) + bool gd_put_carray(resource $dirfile, string $field_code, int $start, + int $data_type, data $data) + +* bool gd_put_constant(resource $dirfile, string $field_code, number $datum) + +* bool gd_put_string(resource $dirfile, string $field_code, string $value) + +* int gd_putdata(resource $dirfile, string $field_code, int $first_frame, + int $first_sample, array $unpacked_data) + int gd_putdata(resource $dirfile, string $field_code, int $first_frame, + int $first_sample, int $data_type, data $data) + +* bool gd_raw_close(resource $dirfile, [ string $field_code = null ]) + +* string gd_raw_filename(resource $dirfile, string $field_code) + +* string gd_reference(resource $dirfile, [ string $field_code = null ]) + +* bool gd_rename(resource $dirfile, string $field_code, string new_name, + [ int flags = 0 ]) + +* bool gd_rewrite_fragment(resource $dirfile, + [ int $fragment_index = GD_ALL_FRAGMENTS ]) + +* int gd_seek(resource $dirfile, string $field_code, int $frame_num, + int $sample_num, [ int $flags = 0 ]) + +* int gd_spf(resource $dirfile, string $field_code) + +* array gd_strings(resource $dirfile) + +* array gd_strtok(resource $dirfile, string $string) + + Unlike the C API function, this function fully tokenises the string and + returns an array of string tokens. + +* bool gd_sync(resource $dirfile, [ string $field_code = null ]) + +* int gd_tell(resource $dirfile, string $field_code) + +* bool gd_unhide(resource $dirfile, string $field_code) + +* bool gd_uninclude(resource $dirfile, int $fragment_index, [ bool $delete = false ]) + +* bool gd_validate(resource $dirfile, string $field_code) + +* array gd_vector_list(resource $dirfile) + +* bool gd_verbose_prefix(resource $dirfile, [ string $prefix = "" ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2013-10-18 02:00:06
|
Revision: 848 http://sourceforge.net/p/getdata/code/848 Author: ketiltrout Date: 2013-10-18 02:00:00 +0000 (Fri, 18 Oct 2013) Log Message: ----------- PHP bindings; better handling of entry objects in Perl, IDL, Fortran; bug fixes. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/NEWS trunk/getdata/bindings/Makefile.am trunk/getdata/bindings/cxx/Makefile.am trunk/getdata/bindings/cxx/test/Makefile.am trunk/getdata/bindings/cxx/test/big_test.cpp trunk/getdata/bindings/f77/Makefile.am trunk/getdata/bindings/f77/fgetdata.c trunk/getdata/bindings/f77/fgetdata.h trunk/getdata/bindings/f77/getdata.f.in trunk/getdata/bindings/f77/getdata.f90.in trunk/getdata/bindings/f77/test/Makefile.am trunk/getdata/bindings/f77/test/big_test.f trunk/getdata/bindings/f77/test/big_test95.f90 trunk/getdata/bindings/idl/Makefile.am trunk/getdata/bindings/idl/getdata.c trunk/getdata/bindings/idl/package/README trunk/getdata/bindings/idl/package/configure.ac trunk/getdata/bindings/idl/test/big_test.pro trunk/getdata/bindings/make_parameters.c trunk/getdata/bindings/matlab/test/big_test.m trunk/getdata/bindings/perl/GetData.xs trunk/getdata/bindings/perl/simple_funcs.pl trunk/getdata/bindings/perl/simple_funcs.xsin trunk/getdata/bindings/perl/t/big_test.t trunk/getdata/bindings/perl/typemap trunk/getdata/bindings/python/Makefile.am trunk/getdata/bindings/python/test/big_test.py trunk/getdata/configure.ac trunk/getdata/doc/list.tests trunk/getdata/m4/compiler.m4 trunk/getdata/m4/version.m4 trunk/getdata/man/gd_add_bit.3 trunk/getdata/man/gd_alter_bit.3 trunk/getdata/man/gd_alter_entry.3 trunk/getdata/man/gd_dirfile_standards.3 trunk/getdata/man/gd_entry.3 trunk/getdata/man/gd_get_carray_slice.3 trunk/getdata/man/gd_madd_bit.3 trunk/getdata/man/gd_naliases.3 trunk/getdata/man/gd_uninclude.3 trunk/getdata/src/Makefile.am trunk/getdata/src/add.c trunk/getdata/src/common.c trunk/getdata/src/entry.c trunk/getdata/src/errors.c trunk/getdata/src/field_list.c trunk/getdata/src/getdata.c trunk/getdata/src/internal.h trunk/getdata/src/mod.c trunk/getdata/test/Makefile.am trunk/getdata/util/Makefile.am Added Paths: ----------- trunk/getdata/bindings/php/ trunk/getdata/bindings/php/Makefile.am trunk/getdata/bindings/php/getdata/ trunk/getdata/bindings/php/getdata/config.m4.in trunk/getdata/bindings/php/getdata/getdata.c trunk/getdata/bindings/php/getdata/php_getdata.h trunk/getdata/bindings/php/test/ trunk/getdata/bindings/php/test/Makefile.am trunk/getdata/bindings/php/test/big_test.php trunk/getdata/bindings/php/test/callback.php trunk/getdata/m4/php.m4 trunk/getdata/test/add_bit_scalars.c trunk/getdata/test/add_mplex_scalars.c trunk/getdata/test/add_polynom_scalar.c trunk/getdata/test/add_raw_spf_scalar.c trunk/getdata/test/get_carray_c2r.c Removed Paths: ------------- trunk/getdata/test/add_mplex_val.c Property Changed: ---------------- trunk/getdata/test/ Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/ChangeLog 2013-10-18 02:00:00 UTC (rev 848) @@ -1,7 +1,63 @@ +2013-10-18 D. V. Wiebe <ge...@ke...> svn:848 + + * bindings/f77/fgetdata.c (GDASRW GDASLC GDASCL GDASPN GDASCP GDASPH GDASRC + GDASCR GDASWD GDASMX GDLSPH GDLSPN GDLSCP GDLSWD _GDF_AddBitSBit GDASBT + GDASSB _GDF_AlterBitSBit GDLSBT GDLSSB GDLSLC GDLSCL GDLSRC GDLSCR GDLSRW): + Added. + * bindings/f77/getdata.f90.in (fgd_add): Call GDAS.. instead of GDAD.. where + possible. + * bindings/f77/getdata.f90.in (fgd_alter_entry): Call GDLS.. instead of + GDAL.. where possible. + * bindings/f77/getdata.f90.in (fgd__set_field_len fgd__set_scalar_len): + Added. + + * 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/matlab/test/big_test.m bindings/perl/t/big_test.t + bindings/python/test/big_test.py: Reorganize, renumber tests. Add tests + 243-269 where appropriate. + + * bindings/idl/getdata.c (gdidl_convert_entry_num gdidl_get_entry_num + gdidl_get_entry_scalars gdidl_get_in_fields gdidl_get_entry_cmparr): Added. + * bindings/idl/getdata.c (gdidl_read_idl_entry): Be less pedantic about + numerical types. + * bindings/idl/getdata.c (gdidl_make_idl_entry: Initialise both complex and + real floating point parameters. + + * bindings/perl/GetData.xs (gdp_fetch_cmp_list gdp_fetch_in_fields + gdp_fetch_scalars gdp_to_entry): Be less pedantic about numerical types and + array sizes. + * bindings/perl/typemap (T_PENTRY): Added. + + * bindings/php m4/php.m4: Added. + * bindings/make_parameters.c (PHP): Added. + + * src/mod.c (_GD_Change): Fix MPLEX scalar modifying. + + * src/add.c (_GD_CopyScalars): Added. + * src/add.c (_GD_Change): Fix scalar copying for GD_POLYNOM_ENTRY. Don't + throw errors for passed members which will be ignored due to scalars (spf, + numbits, bitnum). + * test/add_bit_scalars.c test/add_mplex_scalars.c test/add_raw_spf_scalar.c + * test/add_polynom_scalar.c: Added. + + * src/add.c (_GD_Change): Don't throw an error on mplex.count_val < 0. + * src/errors.c src/internal.h: Remove unused GD_E_ENTRY_CNTVAL. + * test/add_mplex_val.c: Deleted. + + * src/getdata.c (_GD_DoConst): Return len instead of 1. + * src/field_list.c (gd_carrays gd_mcarrays): Update _GD_DoField calls to + deal with the above. + * test/get_carray_c2r.c: Added. + + * src/entry.c (_GD_FreeE): When priv == 0, zero free'd pointers. + + * bindings/perl/t/big_test.t: Added test 181. + 2013-09-05 D. V. Wiebe <ge...@ke...> svn:845 GetData-0.8.5 released. - * src/zzslim.c: + * src/zzslim.c: Fix for rename of gd_raw_file_. 2013-07-17 D. V. Wiebe <ge...@ke...> svn:835 Modified: trunk/getdata/NEWS =================================================================== --- trunk/getdata/NEWS 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/NEWS 2013-10-18 02:00:00 UTC (rev 848) @@ -1,3 +1,65 @@ +New in verison 0.9.0a: + + Library Changes: + + * The gd_free_entry_strings() function now NULLs pointers after freeing them. + + * The gd_[m]add() functions now ignore zero-length scalar strings. Previously + they would store these invalid field codes, causing problems later. + + * BUG FIX: Returning complex-valued CARRAYs as purely real now works. + Previously only the first element requested would be returned, the remaining + output buffer containing uninitialised data. + + * BUG FIX: A scalar field code specified for the last factor in a POLYNOM + entry is no longer ignored by gd_[m]add(). + + * BUG FIX: Entry members spf, bitnum, numbits, and period are now completely + ignored by gd_[m]add() when corresponding named scalars are specified. + Previously, an invalid value in these members would result in the entry + being rejected, even though the rest of GetData ignored the invalid, unsued + value. + + * BUG FIX: gd_[m]add() no longer rejects MPLEX fields with negative count_val. + + * BUG FIX: gd_alter_entry() no longer corrupts the DIRFILE when modifying + named scalars of MPLEX fields. + + Bindings Changes: + + * PHP bindings have been added. + + * F77: Functions to add fields with named scalar parameters have been added + (GDASBT GDASCL GDASCP GDASCR GDASLC GDASMX GDASPH GDASPN GDASRC GDASRW + GDASSB GDASWD), but only for those field types which permit named scalars. + Similarly, functions for altering field metatdata with named scalars are + also present (GDLSBT GDLSCL GDLSCP GDLSCR GDLSLC GDLSMX GDLSPH GDLSPN GDLSRC + GDLSRW GDLSSB GDLSWD). These are provided as an alternative to using GDASCA + after the fact. + + * IDL: The entry structure parser has been rewritten. It no longer requires + members which it doesn't need, and is also a lot more lax about numerical + data types. Notably, it now ignores a supplied COMP_SCAL member. Floating + point parameters can be specified in either the base name (M, B, A, + DIVIDEND) or else the member prefixed with 'C' (CM, CB, CA, CDIVIDEND), + whatever numerical type. The bindings will ingest them appropriately. + Also, N_FIELDS and POLY_ORD, may be omitted, and will be calculated from the + supplied data. A scalar IN_FIELDS is treated like an single element array. + + * PERL: The entry hash parser has been rewritten. It no longer requires keys + which it doesn't need. + + * PERL: alter_entry() now only updates defined elements in the passed entry + hash. + + * 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. + +|==============================================================================| + New in verison 0.8.5: Library Changes: @@ -2,3 +64,3 @@ - * The zzslim encoding framework, which was inadvertantly rendered + * BUG FIX: The zzslim encoding framework, which was inadvertantly rendered non-compilable in 0.8.4, should once again work. Reported by Matthew @@ -51,8 +113,8 @@ Library Changes: - * The count_max member of the gd_entry_t object has been renamed period. The - corresponding dummy argument in various function prototypes has been + * The count_max member of the gd_entry_t object has been renamed to period. + The corresponding dummy argument in various function prototypes has been similarly renamed. * BUG FIX: The library no longer incorrectly rejects negative count_val MPLEX @@ -111,7 +173,7 @@ * BUG FIX: Adding an entry via gd_[m]add() with a negative CARRAY scalar index no longer results in an internal error or worse when the added field is - later read. + later read. Instead, a proper error is returned. * BUG FIX: Changing a CONST field to a real floating point type using gd_alter_const() (or similar) no longer results in the value of the field @@ -660,7 +722,7 @@ * GetData, including its bindings, is now supported under MacOS X, Cygwin, and Win32 using MinGW. In the case of MinGW, this includes linking against the - Microsoft C Runtime, which isn't POSIX compliant. Users should excercise + Microsoft C Runtime, which isn't POSIX compliant. Users should exercise caution when writing to dirfiles in this case. * GetData can now be used on ARM processors. As a side-effect, GetData can @@ -677,7 +739,7 @@ * As a result of the previous change, the Standards compliance of the parser in strict mode has been greatly increased. This affects allowed characters - in field names, and field name lengths. The existance or lack thereof of + in field names, and field name lengths. The existence or lack thereof of the implicit FILEFRAM field (an alias for INDEX) is also affected. * Since Standards Versions 4 and earlier were never codified, we've made some @@ -804,7 +866,7 @@ ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted. * Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE - on I/O error, they now raise the new GD_FLUSH. + on I/O error, they now raise the new GD_E_FLUSH. * All functions now raise GD_E_DIMENSION when encountering a scalar field when expecting a vector. In the past, the error value returned was Modified: trunk/getdata/bindings/Makefile.am =================================================================== --- trunk/getdata/bindings/Makefile.am 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/Makefile.am 2013-10-18 02:00:00 UTC (rev 848) @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 D. V. Wiebe +# Copyright (C) 2008-2010, 2013 D. V. Wiebe # ########################################################################## # @@ -46,13 +46,17 @@ PERL_SUBDIR=perl endif +if MAKE_PHPBINDINGS +PHP_SUBDIR=php +endif + noinst_PROGRAMS=make_parameters make_parameters_SOURCES = make_parameters.c nodist_make_parameters_SOURCES = ../src/getdata.h ../src/gd_config.h SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${MATLAB_SUBDIR} \ - ${PY_SUBDIR} ${PERL_SUBDIR} + ${PY_SUBDIR} ${PERL_SUBDIR} ${PHP_SUBDIR} make_parameters$(EXEEXT): $(make_parameters_SOURCES) \ $(nodist_make_parameters_SOURCES) Modified: trunk/getdata/bindings/cxx/Makefile.am =================================================================== --- trunk/getdata/bindings/cxx/Makefile.am 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/cxx/Makefile.am 2013-10-18 02:00:00 UTC (rev 848) @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 D. V. Wiebe +# Copyright (C) 2008-2013 D. V. Wiebe # ########################################################################## # @@ -21,15 +21,7 @@ AUTOMAKE_OPTIONS = foreign getdata_includedir = ${includedir}/getdata -if CXX_WALL -WALL=-Wall -endif - -if CXX_WEXTRA -WEXTRA=-Wextra -endif - -INCLUDES = ${WALL} $(WEXTRA) -I$(top_srcdir)/src +INCLUDES = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(top_srcdir)/src LIBS= SUBDIRS=test Modified: trunk/getdata/bindings/cxx/test/Makefile.am =================================================================== --- trunk/getdata/bindings/cxx/test/Makefile.am 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/cxx/test/Makefile.am 2013-10-18 02:00:00 UTC (rev 848) @@ -20,15 +20,7 @@ # AUTOMAKE_OPTIONS = foreign -if CXX_WALL -WALL=-Wall -endif - -if CXX_WEXTRA -WEXTRA=-Wextra -endif - -INCLUDES = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src +INCLUDES = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src LDADD=../libgetdata++.la TESTS=big_test Modified: trunk/getdata/bindings/cxx/test/big_test.cpp =================================================================== --- trunk/getdata/bindings/cxx/test/big_test.cpp 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/cxx/test/big_test.cpp 2013-10-18 02:00:00 UTC (rev 848) @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2012 D. V. Wiebe +// Copyright (C) 2009-2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // @@ -145,7 +145,7 @@ "/META data mstr STRING \"This is a string constant.\"\n" "/META data mconst CONST COMPLEX128 3.3;4.4\n" "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n" - "/META data mlut LINTERP DATA ./lut\n" + "/META data mlut LINTERP data ./lut\n" "const CONST FLOAT64 5.5\n" "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n" "linterp LINTERP data ./lut\n" @@ -228,90 +228,90 @@ write(n, data_data, 80); close(n); - // 0: Dirfile::Error check + // 1: Dirfile::Error check d = new Dirfile("x"); - CHECK_ERROR(0, GD_E_OPEN); + CHECK_ERROR(1, GD_E_OPEN); delete d; - // 1: Dirfile::Dirfile check + // 2: Dirfile::Dirfile check d = new Dirfile(filedir, GD_RDWR); - CHECK_OK(1); + CHECK_OK(2); - // 2: Dirfile::GetData check + // 3: Dirfile::GetData check n = d->GetData("data", 5, 0, 1, 0, UInt8, c); - CHECK_OK(2); - CHECK_INT(2,n,8); - CHECK_INT_ARRAY(2,8,c[i],41 + i); + CHECK_OK(3); + CHECK_INT(3,n,8); + CHECK_INT_ARRAY(3,8,c[i],41 + i); - // 3: Dirfile::GetConstant check + // 12: Dirfile::GetConstant check n = d->GetConstant("const", Float64, &dp); - CHECK_OK(3); - CHECK_INT(3,n,0); - CHECK_DOUBLE(3,dp,5.5); + CHECK_OK(12); + CHECK_INT(12,n,0); + CHECK_DOUBLE(12,dp,5.5); - // 6: Dirfile::NFields check + // 23: Dirfile::NFields check n = d->NFields(); - CHECK_OK(6); - CHECK_INT(6,n,nfields); + CHECK_OK(23); + CHECK_INT(23,n,nfields); - // 8: Dirfile::FieldList check + // 25: Dirfile::FieldList check list = d->FieldList(); - CHECK_OK(8); - CHECK_STRING_ARRAY(8,n,list[i],fields[i]); + CHECK_OK(25); + CHECK_STRING_ARRAY(25,n,list[i],fields[i]); - // 9: Dirfile::NFields check + // 26: Dirfile::NFields check n = d->NMFields("data"); - CHECK_OK(9); - CHECK_INT(9,n,4); + CHECK_OK(26); + CHECK_INT(26,n,4); - // 10: Dirfile::MFieldList check + // 27: Dirfile::MFieldList check fields[0] = (char*)"mstr"; fields[1] = (char*)"mconst"; fields[2] = (char*)"mcarray"; fields[3] = (char*)"mlut"; list = d->MFieldList("data"); - CHECK_OK(10); - CHECK_STRING_ARRAY(10,n,list[i],fields[i]); + CHECK_OK(27); + CHECK_STRING_ARRAY(27,n,list[i],fields[i]); - // 11: Dirfile::NFrames check + // 28: Dirfile::NFrames check n = d->NFrames(); - CHECK_OK(11); - CHECK_INT(11,n,10); + CHECK_OK(28); + CHECK_INT(28,n,10); - // 12: Dirfile::SamplesPerFrame check + // 29: Dirfile::SamplesPerFrame check n = d->SamplesPerFrame("data"); - CHECK_OK(12); - CHECK_INT(12,n,8); + CHECK_OK(29); + CHECK_INT(29,n,8); - // 13: Dirfile::PutData check + // 30: Dirfile::PutData check c[0] = 13; c[1] = 14; c[2] = 15; c[3] = 16; n = d->PutData("data", 5, 1, 0, 4, UInt8, c); - CHECK_OK2(13,1); - CHECK_INT2(13,1,n,4); + CHECK_OK2(30,1); + CHECK_INT2(30,1,n,4); n = d->GetData("data", 5, 0, 1, 0, UInt8, c); - CHECK_OK2(13,2); - CHECK_INT2(13,2,n,8); - CHECK_INT_ARRAY(13,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i); + CHECK_OK2(30,2); + CHECK_INT2(30,2,n,8); + CHECK_INT_ARRAY(30,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i); - // 14: Dirfile::ErrorString check + // 38: Dirfile::ErrorString check d->GetData("x", 5, 0, 1, 0, Null, NULL); str = d->ErrorString(); - CHECK_STRING(14,str,"Field not found: x"); + CHECK_STRING(38,str,"Field not found: x"); - // 16: Dirfile::Entry / RawEntry check + // 40: Dirfile::Entry / RawEntry check ent = d->Entry("data"); - CHECK_OK(16); - CHECK_INT2(16,1,ent->Type(),RawEntryType); - CHECK_INT2(16,2,ent->FragmentIndex(),0); - CHECK_INT2(16,3,ent->SamplesPerFrame(),8); - CHECK_INT2(16,4,ent->RawType(),Int8); + CHECK_OK(40); + CHECK_INT2(40,1,ent->Type(),RawEntryType); + CHECK_INT2(40,2,ent->FragmentIndex(),0); + CHECK_INT2(40,3,ent->SamplesPerFrame(),8); + CHECK_INT2(40,4,ent->RawType(),Int8); delete ent; - // 18: Dirfile::Entry / LincomEntry check + // 42: Dirfile::Entry / LincomEntry check cq[0] = 1.1; cq[1] = 2.2; cq[2] = 2.2; @@ -319,113 +319,113 @@ cq[4] = 5.5; cq[5] = 5.5; ent = d->Entry("lincom"); - CHECK_OK(18); - CHECK_INT2(18,1,ent->Type(),LincomEntryType); - CHECK_INT2(18,2,ent->NFields(),3); - CHECK_INT2(18,3,ent->FragmentIndex(),0); - CHECK_STRING2(18,4,ent->Input(0),"data"); - CHECK_STRING2(18,5,ent->Input(1),"INDEX"); - CHECK_STRING2(18,6,ent->Input(2),"linterp"); - CHECK_INT2(18,7,ent->ComplexScalars(),1); - CHECK_COMPLEX_ARRAY(18,3,ent->CScale(i),cq[i * 2]); - CHECK_COMPLEX_ARRAY(18,3,ent->COffset(i),cq[i * 2 + 1]); + CHECK_OK(42); + CHECK_INT2(42,1,ent->Type(),LincomEntryType); + CHECK_INT2(42,2,ent->NFields(),3); + CHECK_INT2(42,3,ent->FragmentIndex(),0); + CHECK_STRING2(42,4,ent->Input(0),"data"); + CHECK_STRING2(42,5,ent->Input(1),"INDEX"); + CHECK_STRING2(42,6,ent->Input(2),"linterp"); + CHECK_INT2(42,7,ent->ComplexScalars(),1); + CHECK_COMPLEX_ARRAY(42,3,ent->CScale(i),cq[i * 2]); + CHECK_COMPLEX_ARRAY(42,3,ent->COffset(i),cq[i * 2 + 1]); delete ent; - // 20: Dirfile::Entry / PolynomEntry check + // 44: Dirfile::Entry / PolynomEntry check ent = d->Entry("polynom"); - CHECK_OK(20); - CHECK_INT2(20,1,ent->Type(),PolynomEntryType); - CHECK_INT2(20,2,ent->PolyOrd(),5); - CHECK_INT2(20,3,ent->FragmentIndex(),0); - CHECK_STRING2(20,4,ent->Input(),"data"); - CHECK_INT2(20,7,ent->ComplexScalars(),1); - CHECK_COMPLEX_ARRAY(20,6,ent->CCoefficient(i),cq[i]); + CHECK_OK(44); + CHECK_INT2(44,1,ent->Type(),PolynomEntryType); + CHECK_INT2(44,2,ent->PolyOrd(),5); + CHECK_INT2(44,3,ent->FragmentIndex(),0); + CHECK_STRING2(44,4,ent->Input(),"data"); + CHECK_INT2(44,7,ent->ComplexScalars(),1); + CHECK_COMPLEX_ARRAY(44,6,ent->CCoefficient(i),cq[i]); delete ent; - // 21: Dirfile::Entry / LinterpEntry check + // 45: Dirfile::Entry / LinterpEntry check ent = d->Entry("linterp"); - CHECK_OK(21); - CHECK_INT2(21,1,ent->Type(),LinterpEntryType); - CHECK_INT2(21,2,ent->FragmentIndex(),0); - CHECK_STRING2(21,3,ent->Input(),"data"); - CHECK_STRING2(21,4,ent->Table(),"./lut"); + CHECK_OK(45); + CHECK_INT2(45,1,ent->Type(),LinterpEntryType); + CHECK_INT2(45,2,ent->FragmentIndex(),0); + CHECK_STRING2(45,3,ent->Input(),"data"); + CHECK_STRING2(45,4,ent->Table(),"./lut"); delete ent; - // 22: Dirfile::Entry / BitEntry check + // 46: Dirfile::Entry / BitEntry check ent = d->Entry("bit"); - CHECK_OK(22); - CHECK_INT2(22,1,ent->Type(),BitEntryType); - CHECK_INT2(22,2,ent->FragmentIndex(),0); - CHECK_STRING2(22,3,ent->Input(),"data"); - CHECK_INT2(22,4,ent->NumBits(),4); - CHECK_INT2(22,5,ent->FirstBit(),3); + CHECK_OK(46); + CHECK_INT2(46,1,ent->Type(),BitEntryType); + CHECK_INT2(46,2,ent->FragmentIndex(),0); + CHECK_STRING2(46,3,ent->Input(),"data"); + CHECK_INT2(46,4,ent->NumBits(),4); + CHECK_INT2(46,5,ent->FirstBit(),3); delete ent; - // 23: Dirfile::Entry / SBitEntry check + // 47: Dirfile::Entry / SBitEntry check ent = d->Entry("sbit"); - CHECK_OK(23); - CHECK_INT2(23,1,ent->Type(),SBitEntryType); - CHECK_INT2(23,2,ent->FragmentIndex(),0); - CHECK_STRING2(23,3,ent->Input(),"data"); - CHECK_INT2(23,4,ent->NumBits(),6); - CHECK_INT2(23,5,ent->FirstBit(),5); + CHECK_OK(47); + CHECK_INT2(47,1,ent->Type(),SBitEntryType); + CHECK_INT2(47,2,ent->FragmentIndex(),0); + CHECK_STRING2(47,3,ent->Input(),"data"); + CHECK_INT2(47,4,ent->NumBits(),6); + CHECK_INT2(47,5,ent->FirstBit(),5); delete ent; - // 24: Dirfile::Entry / MultiplyEntry check + // 48: Dirfile::Entry / MultiplyEntry check ent = d->Entry("mult"); - CHECK_OK(24); - CHECK_INT2(24,1,ent->Type(),MultiplyEntryType); - CHECK_INT2(24,2,ent->FragmentIndex(),0); - CHECK_STRING2(24,3,ent->Input(0),"data"); - CHECK_STRING2(24,4,ent->Input(1),"sbit"); + CHECK_OK(48); + CHECK_INT2(48,1,ent->Type(),MultiplyEntryType); + CHECK_INT2(48,2,ent->FragmentIndex(),0); + CHECK_STRING2(48,3,ent->Input(0),"data"); + CHECK_STRING2(48,4,ent->Input(1),"sbit"); delete ent; - // 25: Dirfile::Entry / PhaseEntry check + // 49: Dirfile::Entry / PhaseEntry check ent = d->Entry("phase"); - CHECK_OK(25); - CHECK_INT2(25,1,ent->Type(),PhaseEntryType); - CHECK_INT2(25,2,ent->FragmentIndex(),0); - CHECK_STRING2(25,3,ent->Input(),"data"); - CHECK_INT2(25,4,ent->Shift(),11); + CHECK_OK(49); + CHECK_INT2(49,1,ent->Type(),PhaseEntryType); + CHECK_INT2(49,2,ent->FragmentIndex(),0); + CHECK_STRING2(49,3,ent->Input(),"data"); + CHECK_INT2(49,4,ent->Shift(),11); delete ent; - // 26: Dirfile::Entry / ConstEntry check + // 50: Dirfile::Entry / ConstEntry check ent = d->Entry("const"); - CHECK_OK(26); - CHECK_INT2(26,1,ent->Type(),ConstEntryType); - CHECK_INT2(26,2,ent->FragmentIndex(),0); - CHECK_INT2(26,3,ent->ConstType(),Float64); + CHECK_OK(50); + CHECK_INT2(50,1,ent->Type(),ConstEntryType); + CHECK_INT2(50,2,ent->FragmentIndex(),0); + CHECK_INT2(50,3,ent->ConstType(),Float64); delete ent; - // 134: Dirfile::Entry / StringEntry check + // 51: Dirfile::Entry / StringEntry check ent = d->Entry("string"); - CHECK_OK(134); - CHECK_INT2(134,1,ent->Type(),StringEntryType); - CHECK_INT2(134,2,ent->FragmentIndex(),0); + CHECK_OK(51); + CHECK_INT2(51,1,ent->Type(),StringEntryType); + CHECK_INT2(51,2,ent->FragmentIndex(),0); delete ent; - // 27: Dirfile::FragmentIndex check + // 52: Dirfile::FragmentIndex check n = d->FragmentIndex("data"); - CHECK_OK(27); - CHECK_INT(27,n,0); + CHECK_OK(52); + CHECK_INT(52,n,0); - // 28: Dirfile::Add / RawEntry check + // 53: Dirfile::Add / RawEntry check rent.SetName("new1"); rent.SetFragmentIndex(0); rent.SetSamplesPerFrame(3); rent.SetType(Float64); d->Add(rent); - CHECK_OK2(28,1); + CHECK_OK2(53,1); ent = d->Entry("new1"); - CHECK_OK2(28,2); - CHECK_INT2(28,1,ent->Type(),RawEntryType); - CHECK_INT2(28,2,ent->FragmentIndex(),0); - CHECK_INT2(28,3,ent->SamplesPerFrame(),3); - CHECK_INT2(28,4,ent->RawType(),Float64); + CHECK_OK2(53,2); + CHECK_INT2(53,1,ent->Type(),RawEntryType); + CHECK_INT2(53,2,ent->FragmentIndex(),0); + CHECK_INT2(53,3,ent->SamplesPerFrame(),3); + CHECK_INT2(53,4,ent->RawType(),Float64); delete ent; - // 29: Dirfile::Add / LincomEntry check + // 54: Dirfile::Add / LincomEntry check q[0] = 9.9; q[1] = 8.8; q[2] = 7.7; @@ -440,21 +440,21 @@ lent.SetScale(q[2], 1); lent.SetOffset(q[3], 1); d->Add(lent); - CHECK_OK2(29,1); + CHECK_OK2(54,1); ent = d->Entry("new2"); - CHECK_OK2(29,2); - CHECK_INT2(29,1,ent->Type(),LincomEntryType); - CHECK_INT2(29,2,ent->NFields(),2); - CHECK_INT2(29,3,ent->FragmentIndex(),0); - CHECK_STRING2(29,4,ent->Input(0),"in1"); - CHECK_STRING2(29,5,ent->Input(1),"in2"); - CHECK_INT2(29,6,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(29,7,2,ent->Scale(i),q[i * 2]); - CHECK_DOUBLE_ARRAY(29,8,2,ent->Offset(i),q[i * 2 + 1]); + CHECK_OK2(54,2); + CHECK_INT2(54,1,ent->Type(),LincomEntryType); + CHECK_INT2(54,2,ent->NFields(),2); + CHECK_INT2(54,3,ent->FragmentIndex(),0); + CHECK_STRING2(54,4,ent->Input(0),"in1"); + CHECK_STRING2(54,5,ent->Input(1),"in2"); + CHECK_INT2(54,6,ent->ComplexScalars(),0); + CHECK_DOUBLE_ARRAY(54,7,2,ent->Scale(i),q[i * 2]); + CHECK_DOUBLE_ARRAY(54,8,2,ent->Offset(i),q[i * 2 + 1]); delete ent; - // 30: Dirfile::Add / LincomEntry check + // 55: Dirfile::Add / LincomEntry check cq[0] = complex<double>(1.1, 1.2); cq[1] = complex<double>(1.3, 1.4); cq[2] = complex<double>(1.4, 1.5); @@ -470,21 +470,21 @@ lent.SetScale(cq[2], 1); lent.SetOffset(cq[3], 1); d->Add(lent); - CHECK_OK2(30,1); + CHECK_OK2(55,1); ent = d->Entry("new3"); - CHECK_OK2(30,2); - CHECK_INT2(30,1,ent->Type(),LincomEntryType); - CHECK_INT2(30,2,ent->NFields(),2); - CHECK_INT2(30,3,ent->FragmentIndex(),0); - CHECK_STRING2(30,4,ent->Input(0),"in1"); - CHECK_STRING2(30,5,ent->Input(1),"in2"); - CHECK_INT2(30,6,ent->ComplexScalars(),1); - CHECK_COMPLEX_ARRAY(30,2,ent->CScale(i),cq[i * 2]); - CHECK_COMPLEX_ARRAY(30,2,ent->COffset(i),cq[i * 2 + 1]); + CHECK_OK2(55,2); + CHECK_INT2(55,1,ent->Type(),LincomEntryType); + CHECK_INT2(55,2,ent->NFields(),2); + CHECK_INT2(55,3,ent->FragmentIndex(),0); + CHECK_STRING2(55,4,ent->Input(0),"in1"); + CHECK_STRING2(55,5,ent->Input(1),"in2"); + CHECK_INT2(55,6,ent->ComplexScalars(),1); + CHECK_COMPLEX_ARRAY(55,2,ent->CScale(i),cq[i * 2]); + CHECK_COMPLEX_ARRAY(55,2,ent->COffset(i),cq[i * 2 + 1]); delete ent; - // 31: Dirfile::Add / PolynomEntry check + // 56: Dirfile::Add / PolynomEntry check q[0] = 3.9; q[1] = 4.8; q[2] = 5.7; @@ -498,19 +498,19 @@ yent.SetCoefficient(q[2], 2); yent.SetCoefficient(q[3], 3); d->Add(yent); - CHECK_OK2(31,1); + CHECK_OK2(56,1); ent = d->Entry("new4"); - CHECK_OK2(31,2); - CHECK_INT2(31,1,ent->Type(),PolynomEntryType); - CHECK_INT2(31,2,ent->PolyOrd(),3); - CHECK_INT2(31,3,ent->FragmentIndex(),0); - CHECK_STRING2(31,4,ent->Input(),"in1"); - CHECK_INT2(31,5,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(31,6,4,ent->Coefficient(i),q[i]); + CHECK_OK2(56,2); + CHECK_INT2(56,1,ent->Type(),PolynomEntryType); + CHECK_INT2(56,2,ent->PolyOrd(),3); + CHECK_INT2(56,3,ent->FragmentIndex(),0); + CHECK_STRING2(56,4,ent->Input(),"in1"); + CHECK_INT2(56,5,ent->ComplexScalars(),0); + CHECK_DOUBLE_ARRAY(56,6,4,ent->Coefficient(i),q[i]); delete ent; - // 32: Dirfile::Add / PolynomEntry check + // 57: Dirfile::Add / PolynomEntry check cq[0] = complex<double>(3.1, 7); cq[1] = complex<double>(4.2, 8); cq[2] = complex<double>(5.2, 9); @@ -525,155 +525,155 @@ yent.SetCoefficient(cq[2], 2); yent.SetCoefficient(cq[3], 3); d->Add(yent); - CHECK_OK2(32,1); + CHECK_OK2(57,1); ent = d->Entry("new5"); - CHECK_OK2(32,2); - CHECK_INT2(32,1,ent->Type(),PolynomEntryType); - CHECK_INT2(32,2,ent->PolyOrd(),3); - CHECK_INT2(32,3,ent->FragmentIndex(),0); - CHECK_STRING2(32,4,ent->Input(),"in2"); - CHECK_INT2(32,7,ent->ComplexScalars(),1); - CHECK_COMPLEX_ARRAY(32,4,ent->CCoefficient(i),cq[i]); + CHECK_OK2(57,2); + CHECK_INT2(57,1,ent->Type(),PolynomEntryType); + CHECK_INT2(57,2,ent->PolyOrd(),3); + CHECK_INT2(57,3,ent->FragmentIndex(),0); + CHECK_STRING2(57,4,ent->Input(),"in2"); + CHECK_INT2(57,7,ent->ComplexScalars(),1); + CHECK_COMPLEX_ARRAY(57,4,ent->CCoefficient(i),cq[i]); delete ent; - // 33: Dirfile::Add / LinterpEntry check + // 58: Dirfile::Add / LinterpEntry check nent.SetName("new6"); nent.SetFragmentIndex(0); nent.SetInput("in"); nent.SetTable("./some/table"); d->Add(nent); - CHECK_OK2(33,1); + CHECK_OK2(58,1); ent = d->Entry("new6"); - CHECK_OK2(33,2); - CHECK_INT2(33,1,ent->Type(),LinterpEntryType); - CHECK_INT2(33,2,ent->FragmentIndex(),0); - CHECK_STRING2(33,3,ent->Input(),"in"); - CHECK_STRING2(33,4,ent->Table(),"./some/table"); + CHECK_OK2(58,2); + CHECK_INT2(58,1,ent->Type(),LinterpEntryType); + CHECK_INT2(58,2,ent->FragmentIndex(),0); + CHECK_STRING2(58,3,ent->Input(),"in"); + CHECK_STRING2(58,4,ent->Table(),"./some/table"); delete ent; - // 34: Dirfile::Add / BitEntry check + // 59: Dirfile::Add / BitEntry check bent.SetName("new7"); bent.SetFragmentIndex(0); bent.SetInput("in1"); bent.SetFirstBit(13); bent.SetNumBits(12); d->Add(bent); - CHECK_OK2(34,1); + CHECK_OK2(59,1); ent = d->Entry("new7"); - CHECK_OK(34); - CHECK_INT2(34,1,ent->Type(),BitEntryType); - CHECK_INT2(34,2,ent->FragmentIndex(),0); - CHECK_STRING2(34,3,ent->Input(),"in1"); - CHECK_INT2(34,4,ent->NumBits(),12); - CHECK_INT2(34,5,ent->FirstBit(),13); + CHECK_OK(59); + CHECK_INT2(59,1,ent->Type(),BitEntryType); + CHECK_INT2(59,2,ent->FragmentIndex(),0); + CHECK_STRING2(59,3,ent->Input(),"in1"); + CHECK_INT2(59,4,ent->NumBits(),12); + CHECK_INT2(59,5,ent->FirstBit(),13); delete ent; - // 35: Dirfile::Add / SBitEntry check + // 60: Dirfile::Add / SBitEntry check sent.SetName("new8"); sent.SetFragmentIndex(0); sent.SetInput("in2"); sent.SetFirstBit(14); sent.SetNumBits(15); d->Add(sent); - CHECK_OK2(35,1); + CHECK_OK2(60,1); ent = d->Entry("new8"); - CHECK_OK(35); - CHECK_INT2(35,1,ent->Type(),SBitEntryType); - CHECK_INT2(35,2,ent->FragmentIndex(),0); - CHECK_STRING2(35,3,ent->Input(),"in2"); - CHECK_INT2(35,4,ent->NumBits(),15); - CHECK_INT2(35,5,ent->FirstBit(),14); + CHECK_OK(60); + CHECK_INT2(60,1,ent->Type(),SBitEntryType); + CHECK_INT2(60,2,ent->FragmentIndex(),0); + CHECK_STRING2(60,3,ent->Input(),"in2"); + CHECK_INT2(60,4,ent->NumBits(),15); + CHECK_INT2(60,5,ent->FirstBit(),14); delete ent; - // 36: Dirfile::Add / MultiplyEntry check + // 61: Dirfile::Add / MultiplyEntry check ment.SetName("new9"); ment.SetFragmentIndex(0); ment.SetInput("in1", 0); ment.SetInput("in2", 1); d->Add(ment); - CHECK_OK2(36,1); + CHECK_OK2(61,1); ent = d->Entry("new9"); - CHECK_OK2(36,2); - CHECK_INT2(36,1,ent->Type(),MultiplyEntryType); - CHECK_INT2(36,2,ent->FragmentIndex(),0); - CHECK_STRING2(36,3,ent->Input(0),"in1"); - CHECK_STRING2(36,4,ent->Input(1),"in2"); + CHECK_OK2(61,2); + CHECK_INT2(61,1,ent->Type(),MultiplyEntryType); + CHECK_INT2(61,2,ent->FragmentIndex(),0); + CHECK_STRING2(61,3,ent->Input(0),"in1"); + CHECK_STRING2(61,4,ent->Input(1),"in2"); delete ent; - // 37: Dirfile::Add / PhaseEntry check + // 62: Dirfile::Add / PhaseEntry check pent.SetName("new10"); pent.SetFragmentIndex(0); pent.SetInput("in1"); pent.SetShift(22); d->Add(pent); - CHECK_OK2(37,1); + CHECK_OK2(62,1); ent = d->Entry("new10"); - CHECK_OK(37); - CHECK_INT2(37,1,ent->Type(),PhaseEntryType); - CHECK_INT2(37,2,ent->FragmentIndex(),0); - CHECK_STRING2(37,3,ent->Input(),"in1"); - CHECK_INT2(37,4,ent->Shift(),22); + CHECK_OK(62); + CHECK_INT2(62,1,ent->Type(),PhaseEntryType); + CHECK_INT2(62,2,ent->FragmentIndex(),0); + CHECK_STRING2(62,3,ent->Input(),"in1"); + CHECK_INT2(62,4,ent->Shift(),22); delete ent; - // 38: Dirfile::Add / ConstEntry check + // 63: Dirfile::Add / ConstEntry check cent.SetName("new11"); cent.SetFragmentIndex(0); cent.SetType(Float64); d->Add(cent); - CHECK_OK2(38,1); + CHECK_OK2(63,1); ent = d->Entry("new11"); - CHECK_OK2(38,2); - CHECK_INT2(38,1,ent->Type(),ConstEntryType); - CHECK_INT2(38,2,ent->FragmentIndex(),0); - CHECK_INT2(38,3,ent->ConstType(),Float64); + CHECK_OK2(63,2); + CHECK_INT2(63,1,ent->Type(),ConstEntryType); + CHECK_INT2(63,2,ent->FragmentIndex(),0); + CHECK_INT2(63,3,ent->ConstType(),Float64); delete ent; - // 39: Fragment check + // 64: Fragment check frag = d->Fragment(0); - CHECK_OK(39); + CHECK_OK(64); sprintf(buf, "dirfile%cformat", GD_DIRSEP); - CHECK_EOSTRING(39,frag->Name(), buf); + CHECK_EOSTRING(64,frag->Name(), buf); delete frag; - // 40: Dirfile::NFragments check + // 65: Dirfile::NFragments check n = d->NFragments(); - CHECK_OK(40); - CHECK_INT(40,n,1); + CHECK_OK(65); + CHECK_INT(65,n,1); - // 41: Dirfile::Include check + // 66: Dirfile::Include check n = d->Include("form2"); - CHECK_OK2(41,1); - CHECK_INT2(41,1,n,1); + CHECK_OK2(66,1); + CHECK_INT2(66,1,n,1); n = d->GetConstant("const2", Int8, &sc); - CHECK_OK2(41,2); - CHECK_INT2(41,2,sc,-19); + CHECK_OK2(66,2); + CHECK_INT2(66,2,sc,-19); - // 42: Dirfile::NFieldsByType check + // 67: Dirfile::NFieldsByType check n = d->NFieldsByType(LincomEntryType); - CHECK_OK(42); - CHECK_INT(42,n,3); + CHECK_OK(67); + CHECK_INT(67,n,3); - // 43: Dirfile::FieldListByType check + // 68: Dirfile::FieldListByType check fields[0] = (char*)"lincom"; fields[1] = (char*)"new2"; fields[2] = (char*)"new3"; list = d->FieldListByType(LincomEntryType); - CHECK_OK(43); - CHECK_STRING_ARRAY(43,n,list[i],fields[i]); + CHECK_OK(68); + CHECK_STRING_ARRAY(68,n,list[i],fields[i]); - // 44: Dirfile::NVectors check + // 69: Dirfile::NVectors check n = d->NVectors(); - CHECK_OK(44); - CHECK_INT(44,n,24); + CHECK_OK(69); + CHECK_INT(69,n,24); - // 45: Dirfile::VectorList check + // 70: Dirfile::VectorList check fields[0] = (char*)"INDEX"; fields[1] = (char*)"alias"; fields[2] = (char*)"bit"; @@ -699,150 +699,120 @@ fields[22] = (char*)"sbit"; fields[23] = (char*)"window"; list = d->VectorList(); - CHECK_OK(45); - CHECK_STRING_ARRAY(45,n,list[i],fields[i]); + CHECK_OK(70); + CHECK_STRING_ARRAY(70,n,list[i],fields[i]); - // 126: Dirfile::MAdd check - q[0] = 9.9; - q[1] = 8.8; - q[2] = 7.7; - q[3] = 6.6; - lent.Dissociate(); - lent.SetName("mnew1"); - lent.SetNFields(2); - lent.SetInput("in1", 0); - lent.SetScale(q[0], 0); - lent.SetOffset(q[1], 0); - lent.SetInput("in2", 1); - lent.SetScale(q[2], 1); - lent.SetOffset(q[3], 1); - d->MAdd(lent, "data"); - CHECK_OK2(126,1); - - ent = d->Entry("data/mnew1"); - CHECK_OK2(126,2); - CHECK_INT2(126,1,ent->Type(),LincomEntryType); - CHECK_INT2(126,2,ent->NFields(),2); - CHECK_INT2(126,3,ent->FragmentIndex(),0); - CHECK_STRING2(126,4,ent->Input(0),"in1"); - CHECK_STRING2(126,5,ent->Input(1),"in2"); - CHECK_INT2(126,6,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(126,7,2,ent->Scale(i),q[i * 2]); - CHECK_DOUBLE_ARRAY(126,8,2,ent->Offset(i),q[i * 2 + 1]); - delete ent; - - // 56: Dirfile::GetString check + // 81: Dirfile::GetString check n = d->GetString("string", GD_MAX_LINE_LENGTH, buf); - CHECK_OK(56); - CHECK_INT(56,n,18); - CHECK_STRING(56,buf,"Zaphod Beeblebrox"); + CHECK_OK(81); + CHECK_INT(81,n,18); + CHECK_STRING(81,buf,"Zaphod Beeblebrox"); - // 57: Dirfile::Add / StringEntry check + // 82: Dirfile::Add / StringEntry check gent.SetName("new12"); gent.SetFragmentIndex(0); d->Add(gent); - CHECK_OK2(57,1); + CHECK_OK2(82,1); ent = d->Entry("new12"); - CHECK_OK2(57,2); - CHECK_INT2(57,1,ent->Type(),StringEntryType); - CHECK_INT2(57,2,ent->FragmentIndex(),0); + CHECK_OK2(82,2); + CHECK_INT2(82,1,ent->Type(),StringEntryType); + CHECK_INT2(82,2,ent->FragmentIndex(),0); delete ent; n = d->GetString("new12", GD_MAX_LINE_LENGTH, buf); - CHECK_OK2(57,3); - CHECK_INT(57,n,1); - CHECK_STRING(57,buf,""); + CHECK_OK2(82,3); + CHECK_INT(82,n,1); + CHECK_STRING(82,buf,""); - // 59: Dirfile::AddSpec check + // 84: Dirfile::AddSpec check d->AddSpec("lorem STRING \"Lorem ipsum\"", 0); - CHECK_OK2(59,1); + CHECK_OK2(84,1); n = d->GetString("lorem", GD_MAX_LINE_LENGTH, buf); - CHECK_OK2(59,2); - CHECK_INT(59,n,12); - CHECK_STRING(59,buf,"Lorem ipsum"); + CHECK_OK2(84,2); + CHECK_INT(84,n,12); + CHECK_STRING(84,buf,"Lorem ipsum"); - // 60: Dirfile::MAddSpec check + // 85: Dirfile::MAddSpec check d->MAddSpec("ipsum STRING \"dolor sit amet.\"", "lorem"); - CHECK_OK2(60,1); + CHECK_OK2(85,1); n = d->GetString("lorem/ipsum", GD_MAX_LINE_LENGTH, buf); - CHECK_OK2(60,2); - CHECK_INT(60,n,16); - CHECK_STRING(60,buf,"dolor sit amet."); + CHECK_OK2(85,2); + CHECK_INT(85,n,16); + CHECK_STRING(85,buf,"dolor sit amet."); - // 61: Dirfile::PutConstant check - sc = 61; + // 86: Dirfile::PutConstant check + sc = 86; n = d->PutConstant("const", Int8, &sc); - CHECK_OK2(61,1); - CHECK_INT2(61,1,n,0); + CHECK_OK2(86,1); + CHECK_INT2(86,1,n,0); n = d->GetConstant("const", Float32, &fl); - CHECK_OK2(61,2); - CHECK_INT2(61,2,n,0); - CHECK_DOUBLE2(61,3,fl,61); + CHECK_OK2(86,2); + CHECK_INT2(86,2,n,0); + CHECK_DOUBLE2(86,3,fl,86); - // 62: Dirfile::PutString check + // 94: Dirfile::PutString check n = d->PutString("string", "Arthur Dent"); - CHECK_OK2(62,1); - CHECK_INT2(62,1,n,12); + CHECK_OK2(94,1); + CHECK_INT2(94,1,n,12); n = d->GetString("string", GD_MAX_LINE_LENGTH, buf); - CHECK_OK2(62,2); - CHECK_INT2(62,2,n,12); - CHECK_STRING(62,buf,"Arthur Dent"); + CHECK_OK2(94,2); + CHECK_INT2(94,2,n,12); + CHECK_STRING(94,buf,"Arthur Dent"); - // 63: Dirfile::NMFieldsByType check - n = d->NMFieldsByType("data", LincomEntryType); - CHECK_OK(63); - CHECK_INT(63,n,1); + // 95: Dirfile::NMFieldsByType check + n = d->NMFieldsByType("data", LinterpEntryType); + CHECK_OK(95); + CHECK_INT(95,n,1); - // 64: Dirfile::MFieldListByType check - fields[0] = (char*)"mnew1"; - list = d->MFieldListByType("data", LincomEntryType); - CHECK_OK(64); - CHECK_STRING_ARRAY(64,n,list[i],fields[i]); + // 96: Dirfile::MFieldListByType check + fields[0] = (char*)"mlut"; + list = d->MFieldListByType("data", LinterpEntryType); + CHECK_OK(96); + CHECK_STRING_ARRAY(96,n,list[i],fields[i]); - // 65: Dirfile::NMVectors check + // 97: Dirfile::NMVectors check n = d->NMVectors("data"); - CHECK_OK(65); - CHECK_INT(65,n,2); + CHECK_OK(97); + CHECK_INT(97,n,1); - // 66: Dirfile::MVectorList check + // 98: Dirfile::MVectorList check fields[0] = (char*)"mlut"; - fields[1] = (char*)"mnew1"; list = d->MVectorList("data"); - CHECK_OK(66); - CHECK_STRING_ARRAY(66,n,list[i],fields[i]); + CHECK_OK(98); + CHECK_STRING_ARRAY(98,n,list[i],fields[i]); - // 67: RawEntry check + // 99: RawEntry check rep = reinterpret_cast<RawEntry*>(d->Entry("new1")); - CHECK_OK2(67,1); + CHECK_OK2(99,1); rep->SetType(Int32,0); - CHECK_OK2(67,2); + CHECK_OK2(99,2); rep->SetSamplesPerFrame(4,0); - CHECK_OK2(67,3); + CHECK_OK2(99,3); ent = d->Entry("new1"); - CHECK_OK2(67,4); - CHECK_INT2(67,1,ent->Type(),RawEntryType); - CHECK_INT2(67,2,ent->FragmentIndex(),0); - CHECK_INT2(67,3,ent->SamplesPerFrame(),4); - CHECK_INT2(67,4,ent->RawType(),Int32); + CHECK_OK2(99,4); + CHECK_INT2(99,1,ent->Type(),RawEntryType); + CHECK_INT2(99,2,ent->FragmentIndex(),0); + CHECK_INT2(99,3,ent->SamplesPerFrame(),4); + CHECK_INT2(99,4,ent->RawType(),Int32); delete ent; - // 68: LincomEntry check + // 100: LincomEntry check lep = reinterpret_cast<LincomEntry*>(d->Entry("new2")); - CHECK_OK2(68,1); + CHECK_OK2(100,1); lep->SetNFields(3); - CHECK_OK2(68,2); + CHECK_OK2(100,2); lep->SetInput("in4",2); - CHECK_OK2(68,3); + CHECK_OK2(100,3); lep->SetScale(1.96,2); - CHECK_OK2(68,4); + CHECK_OK2(100,4); lep->SetOffset(0.22,2); - CHECK_OK2(68,5); + CHECK_OK2(100,5); delete lep; q[0] = 9.9; @@ -852,27 +822,27 @@ q[4] = 1.96; q[5] = 0.22; ent = d->Entry("new2"); - CHECK_OK2(68,6); - CHECK_INT2(68,1,ent->Type(),LincomEntryType); - CHECK_INT2(68,2,ent->NFields(),3); - CHECK_INT2(68,3,ent->FragmentIndex(),0); - CHECK_STRING2(68,4,ent->Input(0),"in1"); - CHECK_STRING2(68,5,ent->Input(1),"in2"); - CHECK_STRING2(68,6,ent->Input(2),"in4"); - CHECK_INT2(68,7,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(68,8,3,ent->Scale(i),q[i * 2]); - CHECK_DOUBLE_ARRAY(68,9,3,ent->Offset(i),q[i * 2 + 1]); + CHECK_OK2(100,6); + CHECK_INT2(100,1,ent->Type(),LincomEntryType); + CHECK_INT2(100,2,ent->NFields(),3); + CHECK_INT2(100,3,ent->FragmentIndex(),0); + CHECK_STRING2(100,4,ent->Input(0),"in1"); + CHECK_STRING2(100,5,ent->Input(1),"in2"); + CHECK_STRING2(100,6,ent->Input(2),"in4"); + CHECK_INT2(100,7,ent->ComplexScalars(),0); + CHECK_DOUBLE_ARRAY(100,8,3,ent->Scale(i),q[i * 2]); + CHECK_DOUBLE_ARRAY(100,9,3,ent->Offset(i),q[i * 2 + 1]); delete ent; - // 70: PolynomEntry check + // 102: PolynomEntry check yep = reinterpret_cast<PolynomEntry*>(d->Entry("new4")); - CHECK_OK2(70,1); + CHECK_OK2(102,1); yep->SetInput("in4"); - CHECK_OK2(70,2); + CHECK_OK2(102,2); yep->SetPolyOrd(4); - CHECK_OK2(70,3); + CHECK_OK2(102,3); yep->SetCoefficient(55.5,4); - CHECK_OK2(70,4); + CHECK_OK2(102,4); delete yep; q[0] = 3.9; @@ -881,276 +851,302 @@ q[3] = 6.6; q[4] = 55.5; ent = d->Entry("new4"); - CHECK_OK2(70,5); - CHECK_INT2(70,1,ent->Type(),PolynomEntryType); - CHECK_INT2(70,2,ent->PolyOrd(),4); - CHECK_INT2(70,3,ent->FragmentIndex(),0); - CHECK_STRING2(70,4,ent->Input(),"in4"); - CHECK_INT2(70,5,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(70,6,5,ent->Coefficient(i),q[i]); + CHECK_OK2(102,5); + CHECK_INT2(102,1,ent->Type(),PolynomEntryType); + CHECK_INT2(102,2,ent->PolyOrd(),4); + CHECK_INT2(102,3,ent->FragmentIndex(),0); + CHECK_STRING2(102,4,ent->Input(),"in4"); + CHECK_INT2(102,5,ent->ComplexScalars(),0); + CHECK_DOUBLE_ARRAY(102,6,5,ent->Coefficient(i),q[i]); delete ent; - // 72: LinterpEntry check + // 104: LinterpEntry check nep = reinterpret_cast<LinterpEntry*>(d->Entry("new6")); - CHECK_OK2(72,1); + CHECK_OK2(104,1); nep->SetInput("in3"); - CHECK_OK2(72,2); + CHECK_OK2(104,2); nep->SetTable("./other/table"); - CHECK_OK2(72,3); + CHECK_OK2(104,3); delete nep; ent = d->Entry("new6"); - CHECK_OK2(72,2); - CHECK_INT2(72,1,ent->Type(),LinterpEntryType); - CHECK_INT2(72,2,ent->FragmentIndex(),0); - CHECK_STRING2(72,3,ent->Input(),"in3"); - CHECK_STRING2(72,4,ent->Table(),"./other/table"); + CHECK_OK2(104,2); + CHECK_INT2(104,1,ent->Type(),LinterpEntryType); + CHECK_INT2(104,2,ent->FragmentIndex(),0); + CHECK_STRING2(104,3,ent->Input(),"in3"); + CHECK_STRING2(104,4,ent->Table(),"./other/table"); delete ent; - // 73: BitEntry check + // 105: BitEntry check bep = reinterpret_cast<BitEntry*>(d->Entry("new7")); - CHECK_OK2(73,1); + CHECK_OK2(105,1); bep->SetInput("in3"); - CHECK_OK2(73,2); + CHECK_OK2(105,2); bep->SetFirstBit(3); - CHECK_OK2(73,3); + CHECK_OK2(105,3); bep->SetNumBits(2); - CHECK_OK2(73,4); + CHECK_OK2(105,4); delete bep; ent = d->Entry("new7"); - CHECK_OK(73); - CHECK_INT2(73,1,ent->Type(),BitEntryType); - CHECK_INT2(73,2,ent->FragmentIndex(),0); - CHECK_STRING2(73,3,ent->Input(),"in3"); - CHECK_INT2(73,4,ent->NumBits(),2); - CHECK_INT2(73,5,ent->FirstBit(),3); + CHECK_OK(105); + CHECK_INT2(105,1,ent->Type(),BitEntryType); + CHECK_INT2(105,2,ent->FragmentIndex(),0); + CHECK_STRING2(105,3,ent->Input(),"in3"); + CHECK_INT2(105,4,ent->NumBits(),2); + CHECK_INT2(105,5,ent->FirstBit(),3); delete ent; - // 74: SBitEntry check + // 106: SBitEntry check sep = reinterpret_cast<SBitEntry*>(d->Entry("new8")); - CHECK_OK2(74,1); + CHECK_OK2(106,1); sep->SetInput("in4"); - CHECK_OK2(74,2); + CHECK_OK2(106,2); sep->SetFirstBit(1); - CHECK_OK2(74,3); + CHECK_OK2(106,3); sep->SetNumBits(22); - CHECK_OK2(74,4); + CHECK_OK2(106,4); delete sep; ent = d->Entry("new8"); - CHECK_OK(74); - CHECK_INT2(74,1,ent->Type(),SBitEntryType); - CHECK_INT2(74,2,ent->FragmentIndex(),0); - CHECK_STRING2(74,3,ent->Input(),"in4"); - CHECK_INT2(74,4,ent->NumBits(),22); - CHECK_INT2(74,5,ent->FirstBit(),1); + CHECK_OK(106); + CHECK_INT2(106,1,ent->Type(),SBitEntryType); + CHECK_INT2(106,2,ent->FragmentIndex(),0); + CHECK_STRING2(106,3,ent->Input(),"in4"); + CHECK_INT2(106,4,ent->NumBits(),22); + CHECK_INT2(106,5,ent->FirstBit(),1); delete ent; - // 75: MultiplyEntry check + // 107: MultiplyEntry check mep = reinterpret_cast<MultiplyEntry*>(d->Entry("new9")); - CHECK_OK2(75,1); + CHECK_OK2(107,1); mep->SetInput("in4",0); - CHECK_OK2(75,2); + CHECK_OK2(107,2); mep->SetInput("in5",1); - CHECK_OK2(75,3); + CHECK_OK2(107,3); delete mep; ent = d->Entry("new9"); - CHECK_OK2(75,2); - CHECK_INT2(75,1,ent->Type(),MultiplyEntryType); - CHECK_INT2(75,2,ent->FragmentIndex(),0); - CHECK_STRING2(75,3,ent->Input(0),"in4"); - CHECK_STRING2(75,4,ent->Input(1),"in5"); + CHECK_OK2(107,2); + CHECK_INT2(107,1,ent->Type(),MultiplyEntryType); + CHECK_INT2(107,2,ent->FragmentIndex(),0); + CHECK_STRING2(107,3,ent->Input(0),"in4"); + CHECK_STRING2(107,4,ent->Input(1),"in5"); delete ent; - // 76: PhsaeEntry check + // 108: PhsaeEntry check pep = reinterpret_cast<PhaseEntry*>(d->Entry("new10")); - CHECK_OK2(76,1); + CHECK_OK2(108,1); pep->SetInput("in2"); - CHECK_OK2(76,2); + CHECK_OK2(108,2); pep->SetShift(8); - CHECK_OK2(76,3); + CHECK_OK2(108,3); delete pep; ent = d->Entry("new10"); - CHECK_OK(76); - CHECK_INT2(76,1,ent->Type(),PhaseEntryType); - CHECK_INT2(76,2,ent->FragmentIndex(),0); - CHECK_STRING2(76,3,ent->Input(),"in2"); - CHECK_INT2(76,4,ent->Shift(),8); + CHECK_OK(108); + CHECK_INT2(108,1,ent->Type(),PhaseEntryType); + CHECK_INT2(108,2,ent->FragmentIndex(),0); + CHECK_STRING2(108,3,ent->Input(),"in2"); + CHECK_INT2(108,4,ent->Shift(),8); delete ent; - // 77: ConstEntry check + // 109: ConstEntry check cep = reinterpret_cast<ConstEntry*>(d->Entry("new11")); - CHECK_OK2(77,1); + CHECK_OK2(109,1); cep->SetType(Float32); - CHECK_OK2(77,2); + CHECK_OK2(109,2); delete cep; ent = d->Entry("new11"); - CHECK_OK2(77,2); - CHECK_INT2(77,1,ent->Type(),ConstEntryType); - CHECK_INT2(77,2,ent->FragmentIndex(),0); - CHECK_INT2(77,3,ent->ConstType(),Float32); + CHECK_OK2(109,2); + CHECK_INT2(109,1,ent->Type(),ConstEntryType); + CHECK_INT2(109,2,ent->FragmentIndex(),0); + CHECK_INT2(109,3,ent->ConstType(),Float32); delete ent; - // 78: Fragment::Encoding check + // 110: Fragment::Encoding check frag = d->Fragment(0); - CHECK_OK(78); - CHECK_INT(78,frag->Encoding(),RawEncoding); + CHECK_OK(110); + CHECK_INT(110,frag->Encoding(),RawEncoding); - // 79: Fragment::Endianness check - CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); + // 111: Fragment::Endianness check + CHECK_INT(111,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); delete frag; - // 80: Dirfile::Name check + // 112: Dirfile::Name check str = d->Name(); - CHECK_OK(80); - CHECK_EOSTRING(80,str,"dirfile"); + CHECK_OK(112); + CHECK_EOSTRING(112,str,"dirfile"); - // 81: Fragment::Parent check + // 113: Fragment::Parent check frag = d->Fragment(1); - CHECK_OK(81); - CHECK_INT(81,frag->Parent(),0); + CHECK_OK(113); + CHECK_INT(113,frag->Parent(),0); - // 82: Fragment::SetProtection check + // 114: Fragment::SetProtection check frag->SetProtection(GD_PROTECT_DATA); - CHECK_OK(82); + CHECK_OK(114); delete frag; - // 83: Fragment::Protection check + // 115: Fragment::Protection check frag = d->Fragment(1); - CHECK_OK(83); - CHECK_INT(83,frag->Protection(),GD_PROTECT_DATA); + CHECK_OK(115); + CHECK_INT(115,frag->Protection(),GD_PROTECT_DATA); - // 84: RawEntry::FileName check + // 116: RawEntry::FileName check str = rep->FileName(); - CHECK_OK(84); + CHECK_OK(116); sprintf(buf, "dirfile%cnew1", GD_DIRSEP); - CHECK_EOSTRING(84,str, buf); + CHECK_EOSTRING(116,str, buf); delete rep; - // 85: Dirfile::Reference check + // 117: Dirfile::Reference check rep = d->Reference("new1"); - CHECK_OK(85); - CHECK_STRING(85,rep->Name(),"new1"); + CHECK_OK(117); + CHECK_STRING(117,rep->Name(),"new1"); delete rep; - // 135: Dirfile::ReferenceFilename check - str = d->ReferenceFilename(); - CHECK_OK(135); - CHECK_EOSTRING(135,str, buf); + // 118: Dirfile::EoF check + n = d->EoF("lincom"); + CHECK_OK(118); + CHECK_INT(118,n,80); - // 87: Fragment::SetEncoding check + // 119: Fragment::SetEncoding check frag->SetEncoding(SlimEncoding,0); - CHECK_OK(87); - CHECK_INT(87,frag->Encoding(),SlimEncoding); + CHECK_OK(119); + CHECK_INT(119,frag->Encoding(),SlimEncoding); - // 88: Fragment::SetEndianness check + // 120: Fragment::SetEndianness check frag->SetEndianness(GD_BIG_ENDIAN,0); - CHECK_OK(88); - CHECK_INT(88,frag->Endianness(),GD_BIG_ENDIAN); + CHECK_OK(120); + CHECK_INT(120,frag->Endianness(),GD_BIG_ENDIAN); delete frag; - // 89: Dirfile::AlterSpec check + // 121: Dirfile::AlterSpec check d->AlterSpec("new10 PHASE in1 3"); - CHECK_OK2(89,1); + CHECK_OK2(121,1); ent = d->Entry("new10"); - CHECK_OK2(89,2); - CHECK_INT2(89,1,ent->Type(),PhaseEntryType); - CHECK_INT2(89,2,ent->FragmentIndex(),0); - CHECK_STRING2(89,3,ent->Input(),"in1"); - CHECK_INT2(89,4,ent->Shift(),3); + CHECK_OK2(121,2); + CHECK_INT2(121,1,ent->Type(),PhaseEntryType); + CHECK_INT2(121,2,ent->FragmentIndex(),0); + CHECK_STRING2(121,3,ent->Input(),"in1"); + CHECK_INT2(121,4,ent->Shift(),3); delete ent; - // 90: Dirfile::Delete check + // 122: Dirfile::Delete check d->Delete("new10", 0); - CHECK_OK2(90,1); + CHECK_OK2(122,1); ent = d->Entry("new10"); - CHECK_ERROR2(90,2,GD_E_BAD_CODE); + CHECK_ERROR2(122,2,GD_E_BAD_CODE); delete ent; - // 91: Dirfile::MAlterSpec check - d->MAlterSpec("mnew1 LINCOM 2 in4 1 2 in5 3 4", "data", 0); - CHECK_OK2(91,1); + // 123: Dirfile::MAlterSpec check + d->MAlterSpec("mlut LINTERP data /new/lut", "data", 0); + CHECK_OK2(123,1); - ent = d->Entry("data/mnew1"); - CHECK_OK2(91,2); - CHECK_INT2(91,1,ent->Type(),LincomEntryType); - CHECK_INT2(91,2,ent->NFields(),2); - CHECK_INT2(91,3,ent->FragmentIndex(),0); - CHECK_STRING2(91,4,ent->Input(0),"in4"); - CHECK_STRING2(91,5,ent->Input(1),"in5"); - CHECK_INT2(91,6,ent->ComplexScalars(),0); - CHECK_DOUBLE_ARRAY(91,7,2,ent->Scale(i),i * 2 + 1); - CHECK_DOUBLE_ARRAY(91,8,2,ent->Offset(i),i * 2 + 2); + ent = d->Entry("data/mlut"); + CHECK_OK2(123,2); + CHECK_INT2(123,3,ent->Type(),LinterpEntryType); + CHECK_INT2(123,4,ent->FragmentIndex(),0); + CHECK_STRING2(123,5,ent->Input(),"data"); + CHECK_STRING2(123,6,ent->Table(),"/new/lut"); delete ent; - // 92: Entry::Move check + // 124: Entry::Move check ent = d->Entry("new9"); - CHECK_OK2(92,1); + CHECK_OK2(124,1); ent->Move(1,0); - CHECK_OK2(92,2); - CHECK_INT(92,ent->FragmentIndex(),1); + CHECK_OK2(124,2); + CHECK_INT(124,ent->FragmentIndex(),1); - // 93: Entry::Rename check + // 125: Entry::Rename check ent->Rename("newer",0); - CHECK_OK2(93,1); + CHECK_OK2(125,1); delete ent; ent = d->Entry("new9"); - CHECK_ERROR2(93,2,GD_E_BAD_CODE); + CHECK_ERROR2(125,2,GD_E_BAD_CODE); delete ent; ent = d->Entry("newer"); - CHECK_OK2(93,3); - CHECK_INT2(93,1,ent->Type(),MultiplyEntryType); - CHECK_INT2(93,2,ent->FragmentIndex(),1); - CHECK_STRING2(93,3,ent->Input(0),"in4"); - CHECK_STRING2(93,4,ent->Input(1),"in5"); + CHECK_OK2(125,3); + CHECK_INT2(125,1,ent->Type(),MultiplyEntryType); + CHECK_INT2(125,2,ent->FragmentIndex(),1); + CHECK_STRING2(125,3,ent->Input(0),"in4"); + CHECK_STRING2(125,4,ent->Input(1),"in5"); delete ent; - // 94: Dirfile::UnInclude check + // 126: Dirfile::UnInclude check d->UnInclude(1,0); - CHECK_OK2(94,1); + CHECK_OK2(126,1); ent = d->Entry("newer"); - CHECK_ERROR2(94,2,GD_E_BAD_CODE); + CHECK_ERROR2(126,2,GD_E_BAD_CODE); delete ent; - // 95: Fragment::FrameOffset check + // 127: Fragment::FrameOffset check frag = d->Fragment(0); - CHECK_OK(95); - CHECK_INT(95,frag->FrameOffset(),0); + CHECK_OK(127); + CHECK_INT(127,frag->FrameOffset(),0); - // 96: Fragment::SetFrameOffset check + // 128: Fragment::SetFrameOffset check frag->SetFrameOffset(33,0); - CHECK_OK(96); - CHECK_INT(96,frag->FrameOffset(),33); + CHECK_OK(128); + CHECK_INT(128,frag->FrameOffset(),33); - // 97: Dirfile::NativeType check + // 129: Dirfile::NativeType check n = d->NativeType("data"); - CHECK_OK(97); - CHECK_INT(97,n,Int8); + CHECK_OK(129); + CHECK_INT(129,n,Int8); - // 99: Dirfile::Validate check + // 131: Dirfile::Validate check n = d->Validate("new7"); - CHECK_ERROR(99,GD_E_BAD_CODE); - CHECK_INT(99,n,-1); + CHECK_ERROR(131,GD_E_BAD_CODE); + CHECK_INT(131,n,-1); - // 101: Dirfile::FrameNum check + // 133: Dirfile::FrameNum check delete d->Reference("data"); dp = d->FrameNum("data", 33.3, 6); - CHECK_OK(101); - CHECK_DOUBLE(101,dp,37.0375); + CHECK_OK(133); + CHECK_DOUBLE(133,dp,37.0375); - // 86: Dirfile::EoF check - n = d->EoF("lincom"); - CHECK_OK(86); - CHECK_INT(86,n,344); + // 136: Dirfile::MAdd check + q[0] = 9.9; + q[1] = 8.8; + q[2] = 7.7; + q[3] = 6.6; + lent.Dissociate(); + lent.SetName("mnew136"); + lent.SetNFields(2); + lent.SetInput("in1", 0); + lent.SetScale(q[0], 0); + lent.SetOffset(q[1], 0); + lent.SetInput("in2", 1); + lent.SetScale(q[2], 1); + lent.SetOffset(q[3], 1); + d->MAdd(lent, "data"); + CHECK_OK2(136,1); + + ent = d->Entry("data/mnew136"); + CHECK_OK2(136,2); + CHECK_INT2(136,1,ent->Type(),LincomEntryType); + CHECK_INT2(136,2,ent->NFields(),2); + CHECK_INT2(136,3,ent->FragmentIndex(),0); + CHECK_STRING2(136,4,ent->Input(0),"in1"); + CHECK_STRING2(136,5,ent->Input(1),"in2"); + CHECK_INT2(136,6,ent->ComplexScalars(),0); + CHECK_DOUBLE_ARRAY(136,7,2,ent->Scale(i),q[i * 2]); + CHECK_DOUBLE_ARRAY(136,8,2,ent->Offset(i),q[i * 2 + 1]); + delete ent; + + // 137: Dirfile::ReferenceFilename check + str = d->ReferenceFilename(); + CHECK_OK(137); + sprintf(buf, "dirfile%cdata", GD_DIRSEP); + CHECK_EOSTRING(137,str, buf); // 142: Dirfile::BoF check n = d->BoF("lincom"); @@ -1370,7 +1366,7 @@ CHECK_INT2(180,4,ent->ArrayLen(),2); delete ent; - // 181 gd_alter_carray + // 181: gd_alter_carray aep = reinterpret_cast<CarrayEntry*>(d->Entry("new17")); CHECK_OK2(181,1); aep->SetType(Float32); @@ -1388,7 +1384,7 @@ delete ent; // 183: gd_constants - p[0] = 61.; + p[0] = 86.; p[1] = 0.; n = d->NFieldsByType(ConstEntryType); qp = reinterpret_cast<const double *>(d->Constants()); Modified: trunk/getdata/bindings/f77/Makefile.am =================================================================== --- trunk/getdata/bindings/f77/Makefile.am 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/f77/Makefile.am 2013-10-18 02:00:00 UTC (rev 848) @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 D. V. Wiebe +# Copyright (C) 2008-2010, 2013 D. V. Wiebe # ########################################################################## # @@ -23,28 +23,12 @@ SED = @SED@ DIFF = @DIFF@ -if FC_WEXTRA -FC_WEXTRA=-Wextra -endif - -if FC_WALL -FC_WALL=-Wall -endif - -if CC_WEXTRA -CC_WEXTRA=-Wextra -endif - -if CC_WALL -CC_WALL=-Wall -endif - if MAKE_F95BINDINGS F95_INC=getdata.mod F95_LIB=libf95getdata.la endif -FCFLAGS += $(FC_WALL) $(FC_WEXTRA) +FCFLAGS += $(GD_FC_WALL) $(GD_FC_WEXTRA) INCLUDES = -I$(top_srcdir)/src EXTRA_DIST=getdata.f.in getdata.f90.in @@ -56,7 +40,7 @@ nodist_include_HEADERS=getdata.f $(F95_INC) lib_LTLIBRARIES=libfgetdata.la $(F95_LIB) -libfgetdata_la_CPPFLAGS = ${CC_WALL} $(CC_WEXTRA) +libfgetdata_la_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) libfgetdata_la_SOURCES = fgetdata.c fgetdata.h libfgetdata_la_LIBADD=../../src/libgetdata.la libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@ Modified: trunk/getdata/bindings/f77/fgetdata.c =================================================================== --- trunk/getdata/bindings/f77/fgetdata.c 2013-09-05 23:32:05 UTC (rev 847) +++ trunk/getdata/bindings/f77/fgetdata.c 2013-10-18 02:00:00 UTC (rev 848) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2012 D. V. Wiebe +/* Copyright (C) 2008-2013 D. V. Wiebe * ************************************************************************* * @@ -25,6 +25,16 @@ #include <stdio.h> #include <string.h> +/* convert scalar_ind from C to FORTRAN */ +#define GDF_SCIND_C2F(out,in) do { \ + (out) = (in); if ((out) >= 0) (out)++; \ +} while (0) + +/* convert scalar ind from FORTRAN to C */ +#define GDF_SCIND_F2C(out,in) do { \ + (out) = (in); if ((out) > 0) (out)--; \ +} while (0) + /* Fortran 77 has no facility to take a pointer to a DIRFILE* object. * Instead, we keep a list of them here. If we ever run out of these, * the caller will be abort()ed. */ @@ -65,7 +75,7 @@ if (l < 0) { *out = NULL; dreturn("%p", NULL); - return *out; + return NULL; } *out = (char*)malloc(l + 1); @@ -1370,24 +1380,17 @@ void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, - const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend), + const int32_t *in_field_l, const double *cdividend, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %g;%g, %i", *dirfile, field_code, *field_code_l, - in_field, *in_field_l, crealp(cdividend), cimagp(cdividend), - *fragment_index); + in_field, *in_field_l, cdividend[0], cdividend[1], *fragment_index); -#ifdef GD_NO_C99_API gd_add_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), cdividend, *fragment_index); -#else - gd_add_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, - *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *cdividend, - *fragment_index); -#endif free(fc); free(in); @@ -3115,7 +3118,7 @@ ok = 0; _GDF_FString(scalar, scalar_l, (ok) ? E.scalar[*index - 1] : ""); - *scalar_index = E.scalar_ind[*index - 1]; + GDF_SCIND_C2F(*scalar_index, E.scalar_ind[*index - 1]); gd_free_entry_strings(&E); @@ -3189,7 +3192,7 @@ free(E.scalar[*index - 1]); _GDF_CString(E.scalar + *index - 1, scalar, *scalar_l); - E.scalar_ind[*index - 1] = *scalar_index; + GDF_SCIND_F2C(E.scalar_ind[*index - 1], *scalar_index); gd_alter_entry(D, fc, &E, *recode); @@ -3478,18 +3481,18 @@ void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, - const int32_t *count_field_l, const int32_t *val, const int32_t *max, + const int32_t *count_field_l, const int32_t *val, const int32_t *period, const int32_t *fragment_index) { char *in, *cf, *fc; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, - *val, *max, *fragment_index); + *val, *period, *fragment_index); gd_add_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), - _GDF_CString(&cf, count_field, *count_field_l), *val, *max, + _GDF_CString(&cf, count_field, *count_field_l), *val, *period, *fragment_index); free(fc); @@ -3504,18 +3507,18 @@ const int32_t *parent_l, const char *field_code, const int32_t ... [truncated message content] |
From: <ket...@us...> - 2013-09-05 23:32:06
|
Revision: 847 http://sourceforge.net/p/getdata/code/847 Author: ketiltrout Date: 2013-09-05 23:32:05 +0000 (Thu, 05 Sep 2013) Log Message: ----------- Tag getdata-0.8.5 Added Paths: ----------- tags/getdata-0.8.5/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |